Преглед изворни кода

1、语音卡编辑
2、关注官方渠道

huangmp пре 2 година
родитељ
комит
9989e75362

+ 3 - 1
src/components/yuyin-preview/index.vue

@@ -13,7 +13,8 @@
       :model="dataForm"
       size="small">
       <el-form-item label="昵称">
-        <el-input v-model="dataForm.cardNote.authorName" :disabled="true"></el-input>
+        <el-button size="mini" @click="authorNameEdit = !authorNameEdit">编辑</el-button>
+        <el-input v-model="dataForm.cardNote.authorName" :disabled="authorNameEdit"></el-input>
       </el-form-item>
       <el-form-item label="祝福的话语">
         <el-button size="mini" @click="personalSignEdit = !personalSignEdit">编辑</el-button>
@@ -81,6 +82,7 @@
     name: "YuyinPreview",
     data() {
       return {
+        authorNameEdit: true,
         personalSignEdit: true,
         audioBoxVisible: false,
         visible: false,

+ 1 - 2
src/views/modules/order/order.vue

@@ -279,9 +279,8 @@
               placeholder="产品专区"
               size="small">
               <el-option key="jm" label="集美" value="集美"></el-option>
+              <el-option key="zb" label="周边" value="周边"></el-option>
               <el-option key="sk" label="闪卡" value="闪卡"></el-option>
-              <el-option key="Seventeen" label="Seventeen" value="Seventeen"></el-option>
-              <el-option key="ZEROBASEONE" label="ZEROBASEONE" value="ZEROBASEONE"></el-option>
             </el-select>
           </el-form-item>
           <el-form-item label="客服备注"  :label-width=" lang === 'en' ? '145px' : '85px'">

+ 1 - 0
src/views/modules/order/qrcode-card-note-add-or-update.vue

@@ -80,6 +80,7 @@
     name: "YuyinPreview",
     data() {
       return {
+        authorNameEdit: true,
         personalSignEdit: true,
         audioBoxVisible: false,
         visible: false,

+ 135 - 0
src/views/modules/promotion/officialChannel-add-or-update.vue

@@ -0,0 +1,135 @@
+<template>
+  <el-dialog
+    :title="!dataForm.id ? this.$i18n.t('crud.addTitle') : this.$i18n.t('temp.modify')"
+    :close-on-click-modal="false"
+    top="5vh"
+    width="40%"
+    :visible.sync="visible">
+    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="100px">
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="关注二维码" prop="officialQrCode">
+            <img-upload v-model="dataForm.officialQrCode" :limit="1"></img-upload>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="官方Logo" prop="officialLogo">
+            <img-upload v-model="dataForm.officialLogo" :limit="1"></img-upload>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="渠道Logo" prop="channelLogo">
+            <img-upload v-model="dataForm.channelLogo" :limit="1"></img-upload>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-form-item label="官方名称" prop="officialName">
+        <el-input v-model="dataForm.officialName"></el-input>
+      </el-form-item>
+      <el-form-item label="官方ID" prop="officialNo">
+        <el-input v-model="dataForm.officialNo"></el-input>
+      </el-form-item>
+      <el-form-item label="渠道名称" prop="channelName">
+        <el-input v-model="dataForm.channelName"></el-input>
+      </el-form-item>
+      <el-form-item label="官方介绍" prop="officialDesc">
+        <el-input v-model="dataForm.officialDesc" type="textarea"></el-input>
+      </el-form-item>
+      <el-form-item label="关联店铺" prop="shopId">
+        <el-select v-model="dataForm.shopId" clearable filterable>
+          <el-option v-for="(item, index) in shopList"
+                     :key="index"
+                     :label="item.shopName"
+                     :value="item.shopId">
+          </el-option>
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button class="default-btn" @click="visible = false">{{$t("crud.filter.cancelBtn")}}</el-button>
+      <el-button class="default-btn primary-btn" type="primary" @click="dataFormSubmit()">{{$t("crud.filter.submitBtn")}}</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+  import ImgUpload from '@/components/imgs-upload'
+export default {
+  components: {
+    ImgUpload
+  },
+  data () {
+    return {
+      visible: false,
+      dataForm: {
+        officialNo: null,
+        officialName: null,
+        officialLogo: null,
+        officialQrCode: null,
+        channelName: null,
+        channelLogo: null,
+        shopId: this.$store.state.user.shopId,
+        status:1
+      },
+      dataRule: {
+      },
+      shopList: []
+    }
+  },
+  created() {
+    this.getShopList();
+  },
+  methods: {
+
+    getShopList() {
+      this.$http({
+        url: this.$http.adornUrl('/shop/shopDetail/getShopList'),
+        method: 'get',
+        params: this.$http.adornParams({shopId: this.shopId})
+      }).then(({ data }) => {
+        if (data) {
+          this.shopList = data
+        }
+      })
+    },
+    init (id) {
+      this.dataForm.id = id || 0
+      this.visible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].resetFields()
+        if (this.dataForm.id) {
+          this.$http({
+            url: this.$http.adornUrl('/promotion/officialChannel/info/' + this.dataForm.id),
+            method: 'get',
+            params: this.$http.adornParams()
+          }).then(({data}) => {
+            this.dataForm = data
+          })
+        }
+      })
+    },
+    // 表单提交
+    dataFormSubmit () {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          this.$http({
+            url: this.$http.adornUrl('/promotion/officialChannel'),
+            method: this.dataForm.id ? 'put' : 'post',
+            data: this.$http.adornData(this.dataForm)
+          }).then(({data}) => {
+            this.$message({
+              message: this.$i18n.t('publics.operation'),
+              type: 'success',
+              duration: 500,
+              onClose: () => {
+                this.visible = false
+                this.$emit('refreshDataList')
+              }
+            })
+          })
+        }
+      })
+    }
+  }
+}
+</script>

+ 196 - 0
src/views/modules/promotion/officialChannel.vue

@@ -0,0 +1,196 @@
+<template>
+  <div class="mod-promotion-officialChannel">
+    <!-- 列表相关区域 -->
+    <div class="main-container">
+      <div class="operation-bar">
+        <div class="default-btn primary-btn" @click="addOrUpdateHandle()">{{$t("crud.addTitle")}}</div>
+      </div>
+      <div class="table-con spec-table">
+        <el-table
+          ref="specListTable"
+          :data="dataList"
+          header-cell-class-name="table-header"
+          row-class-name="table-row"
+          style="width: 100%">
+          <el-table-column label="关注二维码" prop="assistImg" align="center">
+            <template slot-scope="scope">
+              <el-image
+                style="width: 100px; height: 100px"
+                :src="resourcesUrl + scope.row.officialQrCode"
+                v-if="scope.row.officialQrCode"
+                fit="fill"
+                @click="previewPic(scope.row.officialQrCode)"
+              />
+            </template>
+          </el-table-column>
+          <!-- 官方名称 -->
+          <el-table-column label="官方名称" prop="assistName" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.officialName}}</span>
+              <br/>
+              <span>{{ scope.row.officialNo}}</span>
+            </template>
+          </el-table-column>
+          <!-- 渠道名称 -->
+          <el-table-column label="渠道名称" prop="assistNum" align="center">
+            <template slot-scope="scope">
+              <el-image
+                style="width: 100px; height: 100px"
+                :src="resourcesUrl + scope.row.channelLogo"
+                v-if="scope.row.channelLogo"
+                fit="fill"
+                @click="previewPic(scope.row.channelLogo)"
+              />
+              <br/>
+              <span>{{ scope.row.channelName}}</span>
+            </template>
+          </el-table-column>
+          <!-- 官方介绍 -->
+          <el-table-column label="官方介绍" prop="assistPower" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.officialDesc}}</span>
+            </template>
+          </el-table-column>
+          <!-- 状态 -->
+          <el-table-column label="状态" prop="unitPower" align="center">
+            <template slot-scope="scope">
+              <el-tag v-if="scope.row.status === 1" type="success">正常</el-tag>
+              <el-tag v-if="scope.row.status === -1" type="danger">下线</el-tag>
+            </template>
+          </el-table-column>
+          <!-- 操作 -->
+          <el-table-column align="center" fixed="right" :label="$t('publics.operating')" width="250px">
+            <template slot-scope="scope">
+              <div class="text-btn-con">
+                <div class="default-btn text-btn" @click="addOrUpdateHandle(scope.row.id)">{{$t("crud.updateBtn")}}</div>
+                <div class="default-btn text-btn" @click.stop="deleteHandle(scope.row.id)">{{$t("text.delBtn")}}</div>
+                </div>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+        <el-pagination
+          v-if="dataList.length"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="page.currentPage"
+          :page-sizes="[10, 20, 50, 100]"
+          :page-size="page.pageSize"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="page.total">
+        </el-pagination>
+      </div>
+    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="refreshChange"></add-or-update>
+    <el-dialog :visible.sync="previewPicDialogVisible" :modal="false" title="图片预览" width="30%" top="3vh">
+      <el-image :src="previewPicUrl" alt=""  style="width: 100%; height: 100%"/>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import AddOrUpdate from './officialChannel-add-or-update'
+export default {
+  data () {
+    return {
+      dataList: [],
+      previewPicDialogVisible: false,
+      previewPicUrl: null,
+      page: {
+        total: 0, // 总页数
+        currentPage: 1, // 当前页数
+        pageSize: 10 // 每页显示多少条
+      },
+      shopId: this.$store.state.user.shopId,
+      assistRecordVisible: false,
+      resourcesUrl: process.env.VUE_APP_RESOURCES_URL,
+      searchForm: {}, // 搜索
+      dataListLoading: false,
+      addOrUpdateVisible: false
+    }
+  },
+  components: {
+    AddOrUpdate,
+  },
+  created () {
+    this.getDataList()
+  },
+  mounted () {
+  },
+  methods: {
+    previewPic(url){
+      this.previewPicUrl = this.resourcesUrl + url
+      this.previewPicDialogVisible = true;
+    },
+    getDataList (page) {
+      this.dataListLoading = true
+      this.$http({
+        url: this.$http.adornUrl('/promotion/officialChannel/page'),
+        method: 'get',
+        params: this.$http.adornParams(
+          Object.assign({
+            current: page == null ? this.page.currentPage : page.currentPage,
+            size: page == null ? this.page.pageSize : page.pageSize,
+            shopId: this.shopId
+          },
+            this.searchForm
+          )
+        )
+      }).then(({data}) => {
+        this.dataList = data.records
+        this.page.total = data.total
+        this.dataListLoading = false
+      })
+    },
+    // 新增 / 修改
+    addOrUpdateHandle (id) {
+      this.addOrUpdateVisible = true
+      this.$nextTick(() => {
+        this.$refs.addOrUpdate.init(id)
+      })
+    },
+    deleteHandle (id) {
+      this.$confirm(this.$i18n.t('admin.isDeleOper') + '?', this.$i18n.t('text.tips'), {
+        confirmButtonText: this.$i18n.t('crud.filter.submitBtn'),
+        cancelButtonText: this.$i18n.t('crud.filter.cancelBtn'),
+        type: 'warning'
+      }).then(() => {
+        this.$http({
+          url: this.$http.adornUrl('/promotion/officialChannel/' + id),
+          method: 'delete',
+          data: this.$http.adornData({})
+        }).then(({ data }) => {
+          this.$message({
+            message: this.$i18n.t('publics.operation'),
+            type: 'success',
+            duration: 200,
+            onClose: () => {
+              this.refreshChange()
+            }
+          })
+        })
+      }).catch(() => { })
+    },
+    // 刷新回调
+    refreshChange () {
+      this.page.currentPage = 1
+      this.getDataList(this.page)
+    },
+    searchChange (params) {
+      this.searchForm = params
+      this.getDataList(this.page)
+    },
+    handleSizeChange (val) {
+      this.page.pageSize = val
+      this.getDataList()
+    },
+    handleCurrentChange (val) {
+      this.page.currentPage = val
+      this.getDataList()
+    }
+  }
+}
+</script>
+<style lang="scss">
+.mod-print-prodAssist {
+}
+</style>