linwenxin 7 місяців тому
батько
коміт
d8e44806d5

+ 5 - 5
src/views/mallManagement/activity/seckill_index/index.vue

@@ -1,6 +1,6 @@
 <template>
   <zj-page-container>
-    <div style="box-sizing: border-box;padding: 5px 20px 0;height: 45px;overflow: hidden;">
+    <div style="box-sizing: border-box; padding: 5px 20px 0; height: 45px; overflow: hidden">
       <el-tabs v-model="type">
         <el-tab-pane label="活动管理" name="hdgl"></el-tab-pane>
         <el-tab-pane label="商品管理" name="spgl"></el-tab-pane>
@@ -14,14 +14,14 @@
 </template>
 
 <script>
-import index1 from "./index_1.vue"
-import index2 from "./index_2.vue"
+import index1 from './index_1.vue'
+import index2 from './index_2.vue'
 export default {
   components: { index1, index2 },
   data() {
     return {
-      type: "hdgl",
+      type: 'hdgl'
     }
-  },
+  }
 }
 </script>

+ 3 - 4
src/views/mallManagement/activity/special_index/index.vue

@@ -242,20 +242,19 @@ export default {
         this.dataList[11].bottomBannerBackgroundColor = res.data[index].bottomBannerBackgroundColor // 专场专区背景颜色用(,)隔开
         this.dataList[11].bottomBannerHeadImage = res.data[index].bottomBannerHeadImage // 专场专区表头图片
         this.dataList[11].bottomBannerImage = res.data[index].bottomBannerImage // 专场专区图片
-
+        console.log(res.data[index].companyWechatTemplateId)
         this.companyWechatTemplateId = res.data[index].companyWechatTemplateId
       })
     },
 
     // 配置
     toConfigure(item) {
-      console.log('配置', item)
       item.objectId = this.companyWechatTemplateId
-
+      console.log(encodeURI(JSON.stringify(item)))
       this.$router.push({
         name: 'special_set',
         query: {
-          item: JSON.stringify(item)
+          item: encodeURI(JSON.stringify(item))
         }
       })
     }

+ 61 - 60
src/views/mallManagement/activity/special_set/index.vue

@@ -347,71 +347,72 @@ export default {
   },
   created() {
     const { item } = this.$route.query
-    item = JSON.parse(item)
-    this.activityName = item.activityName
-    this.objectId = item.objectId
-    this.type = item.type
-    this.ratio = item.ratio
+    var item1 = JSON.parse(decodeURI(item))
+    console.log(item1)
+    this.activityName = item1.activityName
+    this.objectId = item1.objectId
+    this.type = item1.type
+    this.ratio = item1.ratio
 
     this.companyWechatId = JSON.parse(localStorage.getItem('greemall_user')).companyWechatId
     this.useTemplate = JSON.parse(localStorage.getItem('greemall_user')).useTemplate
 
     this.getactivityGoodsDetail()
 
-    if (item.type == 2) {
-      this.img1_url = item.popupImage
-      this.img2_url = item.popupHeadImage
-      this.mainForm.backGroundColor = item.popupBackgroundColor
-    } else if (item.type == 3) {
-      this.img1_url = item.active1Image
-      this.img2_url = item.active1HeadImage
-      this.mainForm.backGroundColor = item.active1BackgroundColor
-    } else if (item.type == 4) {
-      this.img1_url = item.active2LeftImage
-      this.img2_url = item.active2LeftHeadImage
-      this.mainForm.backGroundColor = item.active2LeftBackgroundColor
-    } else if (item.type == 5) {
-      this.img1_url = item.active2RightImage
-      this.img2_url = item.active2RightHeadImage
-      this.mainForm.backGroundColor = item.active2RightBackgroundColor
-    } else if (item.type == 6) {
-      this.img1_url = item.only1Image
-      this.img2_url = item.only1HeadImage
-      this.mainForm.backGroundColor = item.only1BackgroundColor
-    } else if (item.type == 7) {
-      this.img1_url = item.only2Image
-      this.img2_url = item.only2HeadImage
-      this.mainForm.backGroundColor = item.only2BackgroundColor
-    } else if (item.type == 8) {
-      this.img1_url = item.only3Image
-      this.img2_url = item.only3HeadImage
-      this.mainForm.backGroundColor = item.only3BackgroundColor
-    } else if (item.type == 9) {
-      this.img1_url = item.only4Image
-      this.img2_url = item.only4HeadImage
-      this.mainForm.backGroundColor = item.only4BackgroundColor
-    } else if (item.type == 10) {
-      this.img1_url = item.topics1Image
-      this.img2_url = item.topics1HeadImage
-      this.mainForm.backGroundColor = item.topics1BackgroundColor
-      this.mainForm.title1 = item.topics1Title
-      this.mainForm.title2 = item.topics1Title2
-    } else if (item.type == 11) {
-      this.img1_url = item.topics2Image
-      this.img2_url = item.topics2HeadImage
-      this.mainForm.backGroundColor = item.topics2BackgroundColor
-      this.mainForm.title1 = item.topics2Title
-      this.mainForm.title2 = item.topics2Title2
-    } else if (item.type == 12) {
-      this.img1_url = item.topics3Image
-      this.img2_url = item.topics3HeadImage
-      this.mainForm.backGroundColor = item.topics3BackgroundColor
-      this.mainForm.title1 = item.topics3Title
-      this.mainForm.title2 = item.topics3Title2
-    } else if (item.type == 13) {
-      this.img1_url = item.bottomBannerImage
-      this.img2_url = item.bottomBannerHeadImage
-      this.mainForm.backGroundColor = item.bottomBannerBackgroundColor
+    if (item1.type == 2) {
+      this.img1_url = item1.popupImage
+      this.img2_url = item1.popupHeadImage
+      this.mainForm.backGroundColor = item1.popupBackgroundColor
+    } else if (item1.type == 3) {
+      this.img1_url = item1.active1Image
+      this.img2_url = item1.active1HeadImage
+      this.mainForm.backGroundColor = item1.active1BackgroundColor
+    } else if (item1.type == 4) {
+      this.img1_url = item1.active2LeftImage
+      this.img2_url = item1.active2LeftHeadImage
+      this.mainForm.backGroundColor = item1.active2LeftBackgroundColor
+    } else if (item1.type == 5) {
+      this.img1_url = item1.active2RightImage
+      this.img2_url = item1.active2RightHeadImage
+      this.mainForm.backGroundColor = item1.active2RightBackgroundColor
+    } else if (item1.type == 6) {
+      this.img1_url = item1.only1Image
+      this.img2_url = item1.only1HeadImage
+      this.mainForm.backGroundColor = item1.only1BackgroundColor
+    } else if (item1.type == 7) {
+      this.img1_url = item1.only2Image
+      this.img2_url = item1.only2HeadImage
+      this.mainForm.backGroundColor = item1.only2BackgroundColor
+    } else if (item1.type == 8) {
+      this.img1_url = item1.only3Image
+      this.img2_url = item1.only3HeadImage
+      this.mainForm.backGroundColor = item1.only3BackgroundColor
+    } else if (item1.type == 9) {
+      this.img1_url = item1.only4Image
+      this.img2_url = item1.only4HeadImage
+      this.mainForm.backGroundColor = item1.only4BackgroundColor
+    } else if (item1.type == 10) {
+      this.img1_url = item1.topics1Image
+      this.img2_url = item1.topics1HeadImage
+      this.mainForm.backGroundColor = item1.topics1BackgroundColor
+      this.mainForm.title1 = item1.topics1Title
+      this.mainForm.title2 = item1.topics1Title2
+    } else if (item1.type == 11) {
+      this.img1_url = item1.topics2Image
+      this.img2_url = item1.topics2HeadImage
+      this.mainForm.backGroundColor = item1.topics2BackgroundColor
+      this.mainForm.title1 = item1.topics2Title
+      this.mainForm.title2 = item1.topics2Title2
+    } else if (item1.type == 12) {
+      this.img1_url = item1.topics3Image
+      this.img2_url = item1.topics3HeadImage
+      this.mainForm.backGroundColor = item1.topics3BackgroundColor
+      this.mainForm.title1 = item1.topics3Title
+      this.mainForm.title2 = item1.topics3Title2
+    } else if (item1.type == 13) {
+      this.img1_url = item1.bottomBannerImage
+      this.img2_url = item1.bottomBannerHeadImage
+      this.mainForm.backGroundColor = item1.bottomBannerBackgroundColor
     }
   },
 
@@ -440,7 +441,7 @@ export default {
       }
       getactivityGoodsDetail(params).then(res => {
         res.data.activeGoodsList.forEach(item => {
-          item.imgUrl = item.goods.imgUrl
+          item.imgUrl = item.goods?.imgUrl || ''
         })
 
         this.goodsList = res.data.activeGoodsList