Browse Source

修改广告管理

pangqijun 1 year ago
parent
commit
483360a0ee
3 changed files with 114 additions and 107 deletions
  1. 23 26
      src/views/groupon/groupon_perfact.vue
  2. 3 3
      src/views/mall/goodsinfo.vue
  3. 88 78
      src/views/platform/ads.vue

+ 23 - 26
src/views/groupon/groupon_perfact.vue

@@ -108,32 +108,29 @@
                 trigger: "blur"
               }]
             },
-            // {
-            //   label: "取货开始时间",
-            //   prop: "takeStartTime",
-            //   labelWidth: 120,
-            //   editDisplay: false,
-            //   rules: [{
-            //     required: true,
-            //     message: "请输入取货开始时间",
-            //     trigger: "blur"
-            //   }]
-            // },
-            // {
-            //   label: "取货结束时间",
-            //   prop: "takeEndTime",
-            //   labelWidth: 120,
-            //   editDisplay: false,
-            //   rules: [{
-            //     required: true,
-            //     message: "请输入取货结束时间",
-            //     trigger: "blur"
-            //   }]
-            // },
             {
               label: "信息是否完善",
               prop: "isPerfect",
               editDisplay: false,
+              viewDisplay: false,
+            },
+            {
+              labelWidth: 120,
+              label: '团购分享图',
+              prop: 'shareImage',
+              type: 'upload',
+              listType: 'picture-img',
+              loadText: '上传中,请稍等',
+              accept: 'image/png, image/jpeg',
+              fileSize: 500,
+              tip: '建议尺寸:800×640;只能上传jpg/png文件,且不超过500kb',
+              span: 24,
+              hide: true,
+              propsHttp: {
+                res: 'data',
+                url: 'link',
+              },
+              action: "/api/blade-resource/oss/endpoint/put-file-attach"
             },
             {
               label: '团购轮播图',
@@ -144,8 +141,8 @@
               listType: 'picture-card',
               loadText: '上传中,请稍等',
               accept: 'image/png, image/jpeg',
-              fileSize: 1024,
-              tip: '只能上传jpg/png文件,且不超过1M',
+              fileSize: 500,
+              tip: '建议尺寸:750×420;只能上传jpg/png文件,且不超过500kb',
               span: 24,
               hide: true,
               propsHttp: {
@@ -163,8 +160,8 @@
               listType: 'picture-card',
               loadText: '上传中,请稍等',
               accept: 'image/png, image/jpeg',
-              fileSize: 1024,
-              tip: '只能上传jpg/png文件,且不超过1M',
+              fileSize: 500,
+              tip: '只能上传jpg/png文件,且不超过500kb',
               limit: 25,
               span: 24,
               hide: true,

+ 3 - 3
src/views/mall/goodsinfo.vue

@@ -463,7 +463,7 @@
               loadText: '上传中,请稍等',
               accept: 'image/png, image/jpeg',
               fileSize: 500,
-              tip: '只能上传jpg/png文件,且不超过500M',
+              tip: '建议尺寸:70×70;只能上传jpg/png文件,且不超过500kb',
               span: 24,
               hide: true,
               propsHttp: {
@@ -480,8 +480,8 @@
               listType: 'picture-card',
               loadText: '上传中,请稍等',
               accept: 'image/png, image/jpeg',
-              fileSize: 1024,
-              tip: '只能上传jpg/png文件,且不超过1M',
+              fileSize: 500,
+              tip: '建议尺寸:360×360;只能上传jpg/png文件,且不超过500kb',
               span: 24,
               hide: true,
               propsHttp: {

+ 88 - 78
src/views/platform/ads.vue

@@ -61,19 +61,7 @@
           dialogClickModal: false,
           column: [
             {
-              label: "主键ID",
-              prop: "id",
-              hide: true,
-              addDisplay: false,
-              editDisabled: true,
-              rules: [{
-                required: true,
-                message: "请输入主键ID",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "主标题",
+              label: "标题",
               prop: "title",
               rules: [{
                 required: true,
@@ -82,22 +70,13 @@
               }]
             },
             {
-              label: "副标题",
-              prop: "name",
-              rules: [{
-                required: true,
-                message: "请输入副标题",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "类型",
+              label: "广告类型",
               prop: "typeDisplayName",
               display: false,
               width: 100,
             },
             {
-              label: "类型",
+              label: "广告类型",
               prop: "type",
               type: "select",
               dicUrl: "/api/blade-system/dict-biz/dictionary?code=ads_type",
@@ -115,28 +94,20 @@
               }]
             },
             {
-              label: "开始时间",
-              prop: "startTime",
-              hide: true,
-              type: "datetime",
-              format: "yyyy-MM-dd HH:mm:ss",
-              valueFormat: "yyyy-MM-dd HH:mm:ss",
-              rules: [{
-                required: true,
-                message: "请输入开始时间",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "结束时间",
-              prop: "endTime",
+              label: "跳转类型",
+              prop: "skipType",
+              type: "select",
+              dicUrl: "/api/blade-system/dict-biz/getEnumDict?enumName=SkipTypeEnum",
+              props: {
+                label: "name",
+                value: "value"
+              },
+              dataType: "number",
+              search: true,
               hide: true,
-              type: "datetime",
-              format: "yyyy-MM-dd HH:mm:ss",
-              valueFormat: "yyyy-MM-dd HH:mm:ss",
               rules: [{
                 required: true,
-                message: "请输入结束时间",
+                message: "请选择跳转类型",
                 trigger: "blur"
               }]
             },
@@ -158,7 +129,6 @@
               dataType: "number",
               search: true,
               hide: true,
-              addDisplay: false,
               rules: [{
                 required: true,
                 message: "请选择是否启用",
@@ -166,42 +136,56 @@
               }]
             },
             {
-              label: "排序",
-              prop: "sort",
-              width: 100,
+              label: "团购",
+              prop: "dataId",
+              addDisplay: false,
+              editDisplay: false,
+              viewDisplay: false,
+              hide: true,
+              type: "select",
+              dicUrl: "/api/groupon/groupon/list?status=1&auditStatus=1&current=1&size=100",
+              props: {
+                label: "mainTitle",
+                value: "id"
+              },
+              dicFormatter: function (res) {
+                return res.data.records;
+              },
               rules: [{
                 required: true,
-                message: "请输入排序",
+                message: "请选择团购",
                 trigger: "blur"
               }]
             },
             {
-              label: "目标链接",
-              prop: "targetUrl",
-              span: 24,
+              label: "排序",
+              prop: "sort",
+              width: 100,
               rules: [{
                 required: true,
-                message: "请输入目标链接",
+                message: "请输入排序",
                 trigger: "blur"
-              }]
+              }],
+              type: "number"
             },
             {
-              label: "图片路径",
+              label: "广告图片",
               prop: "imageUrl",
               type: 'upload',
               addDisplay: false,
               editDisplay: false,
               listType: 'picture-img',
               span: 24,
-              drag: true,
             },
             {
-              label: '图片上传',
+              label: '广告图片',
               prop: 'attachUrl',
               type: 'upload',
-              drag: true,
               listType: 'picture-img',
-              loadText: '模板上传中,请稍等',
+              loadText: '上传中,请稍等',
+              accept: 'image/png, image/jpeg',
+              fileSize: 500,
+              tip: '建议尺寸:750×420;只能上传jpg/png文件,且不超过500kb',
               span: 24,
               hide: true,
               viewDisplay: false,
@@ -212,29 +196,23 @@
               action: "/api/blade-resource/oss/endpoint/put-file-attach"
             },
             {
-              label: "创建时间",
-              prop: "createTime",
-              hide: true,
+              label: "文章内容",
+              prop: "content",
               addDisplay: false,
               editDisplay: false,
-              rules: [{
-                required: true,
-                message: "请输入创建时间",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "修改时间",
-              prop: "updateTime",
+              viewDisplay: false,
+              component: 'AvueUeditor',
+              options: {
+                action: '/api/blade-resource/oss/endpoint/put-file',
+                props: {
+                  res: "data",
+                  url: "link",
+                }
+              },
               hide: true,
-              addDisplay: false,
-              editDisplay: false,
-              rules: [{
-                required: true,
-                message: "请输入修改时间",
-                trigger: "blur"
-              }]
-            },
+              minRows: 6,
+              span: 24,
+            }
           ]
         },
         data: []
@@ -258,6 +236,37 @@
         return ids.join(",");
       }
     },
+    created() {
+      this.option.column[3].change = function (column) {
+        console.log("created ... ", column.value)
+        const content = this.findObject(this.option.column, "content");
+        const dataId = this.findObject(this.option.column, "dataId");
+        if (column.value === 1) {
+          this.$set(content, 'addDisplay', false)
+          this.$set(content, 'editDisplay', false)
+          this.$set(content, 'viewDisplay', false)
+          this.$set(dataId, 'addDisplay', false)
+          this.$set(dataId, 'editDisplay', false)
+          this.$set(dataId, 'viewDisplay', false)
+        }
+        if (column.value === 2) {//文章
+          this.$set(content, 'addDisplay', true)
+          this.$set(content, 'editDisplay', true)
+          this.$set(content, 'viewDisplay', true)
+          this.$set(dataId, 'addDisplay', false)
+          this.$set(dataId, 'editDisplay', false)
+          this.$set(dataId, 'viewDisplay', false)
+        }
+        if (column.value === 3) {// 团购
+          this.$set(content, 'addDisplay', false)
+          this.$set(content, 'editDisplay', false)
+          this.$set(content, 'viewDisplay', false)
+          this.$set(dataId, 'addDisplay', true)
+          this.$set(dataId, 'editDisplay', true)
+          this.$set(dataId, 'viewDisplay', true)
+        }
+      }.bind(this);
+    },
     methods: {
       rowSave(row, done, loading) {
         add(row).then(() => {
@@ -328,6 +337,7 @@
         if (["edit", "view"].includes(type)) {
           getDetail(this.form.id).then(res => {
             this.form = res.data.data;
+            this.form.attachUrl = this.form.imageUrl;
           });
         }
         done();