Sfoglia il codice sorgente

系统设置---活动标签添加字段

YY 2 anni fa
parent
commit
df85e027eb

+ 6 - 1
src/views/system/actTags/detail.vue

@@ -10,6 +10,9 @@
             <template #status>
               <el-option v-for="i in statusList" :key="i.model" :label="i.label" :value="i.value"></el-option>
             </template>
+            <template #show_index>
+              <el-option v-for="i in statusList" :key="i.model" :label="i.label" :value="i.value"></el-option>
+            </template>
           </data-form>
         </el-col>
       </el-col>
@@ -41,6 +44,8 @@ export default {
         { label: '编码', model: 'value' },
         { label: '排序', model: 'sort', type: 'number' },
         { label: '状态', model: 'status', type: 'select' },
+        { label: '标签图片', model: 'file', type: 'upload', url: '/files/point/actTags/upload' },
+        { label: '是否在首页展示', model: 'show_index', type: 'select' },
       ],
       // 类型
       typeList: [],
@@ -63,7 +68,7 @@ export default {
           this.$set(this, `form`, res.data);
         }
       } else {
-        this.$set(this, `form`, { status: '0' });
+        this.$set(this, `form`, { status: '0', show_index: '0' });
       }
     },
     // 提交

+ 9 - 0
src/views/system/actTags/index.vue

@@ -60,6 +60,15 @@ export default {
             else return '暂无';
           },
         },
+        {
+          label: '是否在首页显示',
+          model: 'show_index',
+          format: (i) => {
+            let data = that.statusList.find((f) => f.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+        },
       ],
       list: [],
       total: 0,

+ 10 - 3
src/views/system/config/index.vue

@@ -36,14 +36,21 @@ export default {
     async search() {
       const res = await this.fetch();
       if (this.$checkRes(res)) {
-        console.log(res.data);
-        // this.$set(this, `form`, res.data);
+        this.$set(this, `form`, res.data[0]);
+        if (this.form.config) {
+          this.form = {
+            ...this.form,
+            logo: this.form.config.logo,
+            buyPoint: this.form.config.buyPoint,
+            pointPlan: this.form.config.pointPlan,
+            share: this.form.config.share,
+          };
+        }
       }
     },
     async toSave({ data }) {
       let config = { logo: data.logo, buyPoint: data.buyPoint, pointPlan: data.pointPlan, share: data.share };
       data.config = config;
-      console.log(data);
       const res = await this.update(data);
       this.$checkRes(res, '操作成功', '操作失败');
     },

+ 1 - 1
src/views/system/goodsTags/index.vue

@@ -66,7 +66,7 @@ export default {
       ],
       list: [],
       total: 0,
-      limit: 20,
+      limit: 10,
       btnFields: [{ label: '添加', method: 'add' }],
       defaultSearch: {},
       searchInfo: {},