hml 2 năm trước cách đây
mục cha
commit
12168376b0

+ 36 - 3
purchase_H5/src/common/common.js

@@ -10,7 +10,8 @@ import {
     seniorStrategy,
     strategyGetID,
     aqyUser,
-    numberSearch
+    numberSearch,
+    getPhoneAddres
 } from '../api'
 import util from '../util'
 import addR from "../common/addRecord";
@@ -130,7 +131,7 @@ export default {
         // console.log(this.user.userid)
         // 统一认证监听
         window.addEventListener('message', e => {
-            document.body.style.overflow = ''; 
+            document.body.style.overflow = '';
             if (e.data.type === 'onActiveCallback') {} else if (e.data.type === 'onBuyCallback') {
                 window.console.log(e.data.data.msg)
                 // this.$toast(e.data.data.msg)
@@ -358,6 +359,11 @@ export default {
                     userid: res.data.userid,
                     phone: infoForm.phone
                 })
+                if (this.param.spid == "1048") { // 对广东用户拦截
+                    let jixu = await this.getPhoneInfo(res.data.userid)
+                    if (jixu !== 1) return false
+                }
+
                 if (flag) {
                     addR.loginSuccess()
                     setTimeout(() => {
@@ -499,6 +505,11 @@ export default {
                     }
                 }
                 addR.getToken()
+                if (this.param.spid == "1048") { // 对广东用户拦截
+                    let jixu = await this.getPhoneInfo(this.user.userid)
+                    if (jixu !== 1) return false
+                }
+
                 postNewBuy(updata).then(res => {
                     if (res.code == 10000) {
                         this.isBuy = '已订购'
@@ -712,5 +723,27 @@ export default {
                 })
             }
         },
+
+        getPhoneInfo(userid) {  //验证归属地 拦截广东用户 优酷合约专用
+            let pResult = new Promise((resolve, reject) => {
+                getPhoneAddres({
+                    userId: decodeURIComponent(userid),
+                }).then((res) => {
+                    if (res.data.province == "广东") {
+                        Dialog({
+                            message: '由于系统升级原因,请广东用户到“联通畅视”公众号进行订购',
+                            theme: 'round-button',
+                        })
+                        resolve(2);
+                    } else {
+                        resolve(1);
+                    }
+                }).catch(err => {
+                    resolve(1);
+                });
+
+            })
+            return pResult;
+        },
     }
-}
+}

+ 5 - 7
purchase_H5/src/components/gongZongHao.vue

@@ -2,15 +2,13 @@
   <div>
     <van-overlay :show="value" :duration="0.1" @click="showQr = false">
       <div class="modal qr-modal" @click.stop>
-        <img
-          src="../assets/img/close.png"
-          class="close"
-           @click="$emit('change', false)"
-        />
+        <img src="../assets/img/close.png" class="close" @click="$emit('change', false)" />
         <div>
-          <img src="../assets/img/wxqr.jpg" class="qr" />
+          <img src="../assets/img/mpqr.jpg" class="qr" />
           <div class="text">
-            流量查询及充值、订购记录、人工客服<br />请关注“联通畅视”公众号
+            流量查询、订购退订、人工客服<br />
+            尽在“联通畅视”小程序
+            <!-- 流量查询及充值、订购记录、人工客服<br />请关注“联通畅视”公众号 -->
           </div>
         </div>
       </div>

+ 111 - 111
purchase_H5/src/components/repeatModal.vue

@@ -1,126 +1,126 @@
 <template>
-    <van-overlay :show="value" :duration="0.1">
-        <div class="repeat-modal modal" @click.stop>
-            <!-- <img src="../assets/img/close.png" class="close" @click="$emit('change', false)" /> -->
-            <div class="text-box">您已订购,请不要重复订购哦~</div>
-            <div class="text-box">
-                {{ repeatText }}
-            </div>
-            <div class="text-box">不要错过!</div>
-            <div class="btn-box">
-                <div class="btn left" @click="$emit('change', false)">确定</div>
-                <div class="btn right" @click="getStrategy">
-                    去看看
-                </div>
-            </div>
+  <van-overlay :show="value" :duration="0.1">
+    <div class="repeat-modal modal" @click.stop>
+      <!-- <img src="../assets/img/close.png" class="close" @click="$emit('change', false)" /> -->
+      <div class="text-box">您已订购,请不要重复订购哦~</div>
+      <div class="text-box">
+        {{ repeatText }}
+      </div>
+      <div class="text-box">不要错过!</div>
+      <div class="btn-box">
+        <div class="btn left" @click="$emit('change', false)">确定</div>
+        <div class="btn right" @click="getStrategy">
+          去看看
         </div>
-    </van-overlay>
+      </div>
+    </div>
+  </van-overlay>
 </template>
 <script>
-    import {
-        strategyGetID,
-        detMainProduct,
-    } from "../api";
-    export default {
-        data() {
-            return {
-                repeatText: ""
-            }
-        },
-        model: {
-            prop: "value",
-            event: "change"
-        },
-        props: {
-            value: Boolean
-        },
-        computed: {
-            pageData() {
-                return this.$store.state.pageData;
-            },
-        },
-        async created() {
-            if (this.pageData.remarks.orderRepeat && this.pageData.remarks.orderRepeat !== null && this.pageData
-                .remarks.orderRepeat !== '') {
-                let productId = await strategyGetID({
-                    id: this.pageData.remarks.orderRepeat,
-                });
-                let res = await detMainProduct({
-                    productId: productId.data.primaryProductId,
-                });
-                this.repeatText = res.data.productName
-            }
+import {
+  strategyGetID,
+  detMainProduct,
+} from "../api";
+export default {
+  data () {
+    return {
+      repeatText: ""
+    }
+  },
+  model: {
+    prop: "value",
+    event: "change"
+  },
+  props: {
+    value: Boolean
+  },
+  computed: {
+    pageData () {
+      return this.$store.state.pageData;
+    },
+  },
+  async created () {
+    if (this.pageData.remarks.orderRepeat && this.pageData.remarks.orderRepeat !== null && this.pageData
+      .remarks.orderRepeat !== '') {
+      let productId = await strategyGetID({
+        id: this.pageData.remarks.orderRepeat,
+      });
+      let res = await detMainProduct({
+        productId: productId.data.primaryProductId,
+      });
+      this.repeatText = res.data.productName
+    }
 
-        },
-        methods: {
-            getStrategy() {
-                this.$emit('repeat', this.pageData.remarks.orderRepeat)
-            }
-        }
-    };
+  },
+  methods: {
+    getStrategy () {
+      this.$emit('repeat', this.pageData.remarks.orderRepeat)
+    }
+  }
+};
 </script>
 <style lang="scss" scoped>
-    .repeat-modal {
-        top: 412px;
-        padding: 60px 51px;
-        font-size: 30px;
-        font-family: Source Han Sans CN;
-        font-weight: 400;
-        color: #222222;
-
-        .text-box {
-            line-height: 48px;
-            text-align: center;
-        }
+.repeat-modal {
+  top: 412px;
+  padding: 60px 51px;
+  font-size: 30px;
+  font-family: Source Han Sans CN;
+  font-weight: 400;
+  color: #222222;
 
-        .btn-box {
-            display: flex;
-            justify-content: space-between;
+  .text-box {
+    line-height: 48px;
+    text-align: center;
+  }
 
-            .btn {
-                width: 190px;
-                margin-top: 60px;
-                height: 80px;
-                line-height: 80px;
-                border-radius: 40px;
-                font-size: 34px;
-                font-weight: bold;
-                text-align: center;
-            }
+  .btn-box {
+    display: flex;
+    justify-content: space-between;
 
-            .left {
-                border: 2px #fdc51b solid;
-                color: #fdc51b;
-                background-color: #ffffff;
-            }
-
-            .right {
-                color: #0d0d0d;
-                background: #fdc51b;
-            }
-        }
+    .btn {
+      width: 190px;
+      margin-top: 60px;
+      height: 80px;
+      line-height: 80px;
+      border-radius: 40px;
+      font-size: 34px;
+      font-weight: bold;
+      text-align: center;
+    }
 
-        // .btn {
-        //     margin-top: 40px;
-        //     height: 80px;
-        //     line-height: 80px;
-        //     background: #fdc51b;
-        //     border-radius: 40px;
-        //     font-size: 34px;
-        //     font-weight: bold;
-        //     color: #0d0d0d;
-        //     text-align: center;
-        // }
+    .left {
+      border: 2px #fdc51b solid;
+      color: #fdc51b;
+      background-color: #ffffff;
     }
 
-    .modal {
-        box-sizing: border-box;
-        position: absolute;
-        left: 50%;
-        top: 333px;
-        transform: translateX(-50%);
-        width: 520px;
-        background-color: #fff;
-        border-radius: 8px;
+    .right {
+      color: #0d0d0d;
+      background: #fdc51b;
     }
+  }
+
+  // .btn {
+  //     margin-top: 40px;
+  //     height: 80px;
+  //     line-height: 80px;
+  //     background: #fdc51b;
+  //     border-radius: 40px;
+  //     font-size: 34px;
+  //     font-weight: bold;
+  //     color: #0d0d0d;
+  //     text-align: center;
+  // }
+}
+
+.modal {
+  box-sizing: border-box;
+  position: absolute;
+  left: 50%;
+  top: 333px;
+  transform: translateX(-50%);
+  width: 520px;
+  background-color: #fff;
+  border-radius: 8px;
+}
 </style>

+ 39 - 15
purchase_H5/src/components/unbuyModal.vue

@@ -69,22 +69,30 @@
     >
       <van-radio-group v-model="radio">
         <van-cell-group>
-          <van-cell
-            v-for="(item, index) in resonList"
-            :key="index"
-            :title="item.title"
-            clickable
-            @click="radio = item.value"
-          >
-            <template #right-icon>
-              <van-radio checked-color="#d6000f" :name="item.value" />
-            </template>
-          </van-cell>
+            <van-row>
+                <div v-for="(item, index) in resonList" style="width: 100%">
+                    <van-col span="12">
+                        <van-cell
+                                :key="index"
+                                :title="item.title"
+                                clickable
+                                @click="radio = item.value"
+                        >
+                            <template #right-icon>
+                                <van-radio checked-color="#d6000f" :name="item.value" />
+                            </template>
+                        </van-cell>
+                    </van-col>
+
+                </div>
+            </van-row>
+
+
         </van-cell-group>
         <div class="fileBox">
           <van-field
             v-model="message"
-            rows="4"
+            rows="2"
             autosize
             type="textarea"
             placeholder="请描述原因,如遇到其他问题请反馈给我们"
@@ -140,17 +148,33 @@ export default {
       reason: "",
       resonList: [
         {
-          title: "最近不用客户端",
+          title: "流量无法激活",
           value: "1",
         },
         {
-          title: "套餐流量用不完",
+          title: "会员无法领取",
           value: "2",
         },
         {
-          title: "其他",
+          title: "最近不用客户端",
           value: "3",
         },
+          {
+              title: "流量用不完",
+              value: "4",
+          },
+          {
+              title: "价格太贵",
+              value: "5",
+          },
+          {
+              title: "误点误操作",
+              value: "6",
+          },
+          {
+              title: "其他",
+              value: "7",
+          },
       ],
     };
   },

+ 3 - 14
purchase_H5/src/components/unifyColor.vue

@@ -44,23 +44,12 @@
     </div>
     <!-- 订购按钮 -->
     <div class="buyBox" v-if="pageData.remarks.isBuy === '1'">
-      <div v-if="
-          productJson.length > 0 &&
-          productJson[0].btnUrl !== '' &&
-          productJson[0].productV === '2'
-        " class="btnImg" @click="btnClick()">
+      <div v-if="productJson.length > 0 &&productJson[0].btnUrl !== '' && productJson[0].productV === '2'" class="btnImg" @click="btnClick()">
         <img :src="productJson[0].btnUrl" alt="" />
       </div>
       <div v-else class="btn" @click="btnClick()" :style="
-          pageData.remarks.btnText.length <= 7
-            ? {
-                'background-image': `linear-gradient(${pageData.mainProduct.themeColor[0]},${pageData.mainProduct.themeColor[1]})`,
-              }
-            : {
-                'background-image': `linear-gradient(${pageData.mainProduct.themeColor[0]},${pageData.mainProduct.themeColor[1]})`,
-                width: 345 + 'px',
-              }
-        ">
+          pageData.remarks.btnText.length <= 7? {'background-image': `linear-gradient(${pageData.mainProduct.themeColor[0]},${pageData.mainProduct.themeColor[1]})`,}
+            : {'background-image': `linear-gradient(${pageData.mainProduct.themeColor[0]},${pageData.mainProduct.themeColor[1]})`,width: 345 + 'px',}">
         {{ pageData.remarks.btnText ? pageData.remarks.btnText : "点我领取" }}
         <div class="originalPrice" :style="{ color: pageData.mainProduct.bgColor[2] }">
           <s>{{ pageData.mainProduct.originalPrice }}元/月</s>

+ 3 - 3
purchase_H5/src/components/unifyModal.vue

@@ -8,7 +8,7 @@
         pageData.remarks.attestation === 5)
     ">
     <div class="buyBox">
-      <div :style="{ 'border-color': pageData.mainProduct.themeColor[1] }" class="btnInput">
+      <div style="border-color:#333333" class="btnInput">
         <input type="text" @input="inpChange" maxlength="11" placeholder="请输入联通号码" v-model="loginForm.phone" />
       </div>
       <div class="btn" @click="btnClick" v-if="!indexNum || indexNum === 0" :style="{
@@ -370,7 +370,7 @@ export default {
         if (!this.loginForm.vcode) {
           return this.$toast("请输入验证码");
         }
-        if (this.authType !== null) {
+        if (this.authType !== '') {
           if (this.authType === 4) {
             this.$emit("toBuy", this.loginForm);
             this.value = false;
@@ -600,4 +600,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 1 - 1
purchase_H5/src/templates/templateColor/index.scss

@@ -115,7 +115,7 @@
     background: #F6F5F5;
     box-shadow: 0px 0px 12px 0px #ACACAC;
     opacity: 0.5;
-    border-radius: 30px 0px 0px 30px;
+    border-radius: 40px 0px 0px 40px;
     font-size: 24px;
     color: #0D0D0D;
     line-height: 75px;

+ 203 - 95
purchase_H5/src/templates/templateColor/index.vue

@@ -135,11 +135,11 @@
 
 <script>
 import {
-  orderList,
   changeUserid,
   strategyGetID,
-  detMainProduct,
   seniorStrategy,
+  strategytemplate,
+  detMainProduct,
 } from "../../api";
 import common from "../../common/common";
 import loginModal from "../../components/login.vue";
@@ -278,13 +278,23 @@ export default {
             this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
             this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
           ) {
-            let productId = await strategyGetID({
-              id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
-            });
-            let drainageRes = await detMainProduct({
-              productId: productId.data.primaryProductId,
-            });
-            this.unBuyDrainageText = drainageRes.data.productName;
+            if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+              let productId = await strategytemplate({
+                id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
+              });
+              let drainageRes = await detMainProduct({
+                productId: productId.data.primaryProductId,
+              });
+              this.unBuyDrainageText = drainageRes.data.productName;
+            } else {
+              let productId = await strategyGetID({
+                id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
+              });
+              let drainageRes = await detMainProduct({
+                productId: productId.data.primaryProductId,
+              });
+              this.unBuyDrainageText = drainageRes.data.productName;
+            }
             this.unBuyDrainage = true;
           } else {
             if (this.pageData.remarks.treaty && this.pageData.remarks.treaty === '1') {
@@ -295,18 +305,27 @@ export default {
           }
         }
       } else if (type === "unBUy") {
+        console.log(this.pageData)
         addR.unBuyClick();
         if (
           this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
           this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
         ) {
-          let productId = await strategyGetID({
-            id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
-          });
-          let drainageRes = await detMainProduct({
-            productId: productId.data.primaryProductId,
-          });
-          this.unBuyDrainageText = drainageRes.data.productName;
+          if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+            let productId = await strategytemplate(this.pageData.strategyInfo.unsubscribeStrategyList[0]);
+            let drainageRes = await detMainProduct({
+              productId: productId.data.primaryProductId,
+            });
+            this.unBuyDrainageText = drainageRes.data.productName;
+          } else {
+            let productId = await strategyGetID({
+              id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
+            });
+            let drainageRes = await detMainProduct({
+              productId: productId.data.primaryProductId,
+            });
+            this.unBuyDrainageText = drainageRes.data.productName;
+          }
           this.unBuyDrainage = true;
         } else {
           if (this.pageData.remarks.treaty && this.pageData.remarks.treaty === '1') {
@@ -360,107 +379,196 @@ export default {
     },
     // 推荐产品跳转
     recommend (val) {
-      // this.$store.commit("setTempName", "loading");
-      strategyGetID({
-        id: val,
-      }).then(async (res) => {
-        if (res.data.strategyStatus === 1) {
-          let data = res.data;
+      let edition = this.$store.state.pageData.channl.edition
+      if (edition && edition === '1') {
+        strategytemplate(val).then(async res => {
           let info = await detMainProduct({
-            productId: data.primaryProductId,
+            productId: res.data.primaryProductId,
           });
-          if (this.user.userid) {
-            this.getIsBuy();
+          let productJson = JSON.parse(res.data.productJson).product
+          let mainProduct = {
+            activeType: info.data.activeType,
+            bannerPics: [productJson.bannerImg, productJson.jsonImg, productJson.upImg, productJson.topImg,],
+            bgColor: [productJson.pageBgcol, '', productJson.orderBgcol, productJson.orderBdcol],
+            cacheSeatOne: [{
+              dongHua: productJson.drawVal,
+              memberUrl: info.data.cacheSeatOne[0].memberUrl,
+              proC: {
+                e: productJson.hideCol,
+                s: productJson.pageTextcol
+              },
+              productV: productJson.productV,
+              rushC: {
+                e: productJson.orderTextcol,
+                s: productJson.orderNumcol,
+              },
+              tabC: {
+                e: productJson.tabVicecol,
+                s: productJson.tabMaincol,
+              },
+              btnUrl: "",
+            }],
+            cpid: info.data.cpid,
+            discountInfo: null,
+            flowJumpUrl: info.data.flowJumpUrl,
+            givePhoneInfo: info.data.givePhoneInfo,
+            guidancePic: {
+              c: productJson.orderImg,
+              p: productJson.explainImg
+            },
+            id: res.data.primaryProductId,
+            isCompositeProduct: 0,   //是否复合产品
+            logoPic: productJson.logoPic,
+            manualInfo: info.data.manualInfo,
+            memberName: info.data.memberName,
+            orderingInfo: info.data.orderingInfo,
+            originalPrice: info.data.originalPrice,
+            pageTitle: productJson.pageTitle,
+            productName: info.data.productName,
+            productType: info.data.productType,
+            promotionPic: info.data.promotionPic,
+            pushJumpUrl: info.data.pushJumpUrl,
+            remark: info.data.producremarktName,
+            remark1: info.data.remark1,
+            remark2: info.data.remark2,
+            remark3: productJson.remark3,
+            spid: info.data.spid,
+            themeColor: [productJson.btnTopcol, productJson.btnBotcol],
           }
           let recommend = [];
-          if (
-            data.recommendStrategyList !== null &&
-            data.recommendStrategyList.length > 0
-          ) {
-            for (let i = 0; i < data.recommendStrategyList.length; i++) {
-              let list = await strategyGetID({
-                id: data.recommendStrategyList[i],
-              });
+          if (res.data.recommendStrategyIds.length > 0 && res.data.recommendStrategyIds) {
+            res.data.recommendStrategyIds.forEach(async val => {
+              let list = await strategytemplate(val)
               recommend.push(list.data);
-            }
+            });
           }
           let pageData = {
-            mainProduct: info.data,
-            strategyInfo: data,
-            remarks: data.extJson,
+            mainProduct: mainProduct,
             channl: {
-              channelKey: localStorage.getItem("key"),
+              channelKey: "464c87375658",
+              channelName: "新策略H5整合测试",
+              fullCode: "173966823233",
+              edition: "1"
             },
             recommend: recommend,
+            remarks: JSON.parse(res.data.extJson), //策略信息
+            otherJson: JSON.parse(res.data.otherJson), //备用json
+            strategyInfo: res.data
           };
-          let params = {
-            anonymousId: this.$sensors.store._state.$device_id,
-            channleKey: localStorage.getItem("key"),
-            spId: info.data.spid,
-            userId: this.user.userid,
-          };
-          let item = await seniorStrategy(params);
-          if (item.data !== null) {
-            // 判断高级策略是否开启遮罩
-            if (item.data.enableMask !== null) {
-              pageData.remarks.isMask = String(item.data.enableMask);
-              // 判断高级策略是否有遮罩文案 并替换
-              if (item.data.maskText !== null && item.data.maskText !== "") {
-                pageData.remarks.maskText = item.data.maskText;
-              }
+          pageData.strategyInfo.recommendStrategyList = res.data.recommendStrategyIds
+          pageData.strategyInfo.unsubscribeStrategyList = res.data.unsubscribeStrategyIds
+          pageData.strategyInfo.viceProductStrategyList = res.data.viceProductIds
+          if (JSON.parse(res.data.productJson).viceProduct) {
+            pageData.viceJson = JSON.parse(res.data.productJson).viceProduct
+          }
+          pageData.mainJson = JSON.parse(res.data.productJson).product
+          this.$store.commit("setPageData", pageData);
+          this.$store.commit('setTempName', res.data.templateCode)
+        })
+
+      } else {
+        strategyGetID({
+          id: val,
+        }).then(async (res) => {
+          if (res.data.strategyStatus === 1) {
+            let data = res.data;
+            let info = await detMainProduct({
+              productId: data.primaryProductId,
+            });
+            if (this.user.userid) {
+              this.getIsBuy();
             }
-            // 判断高级策略是否开启有推荐
+            let recommend = [];
             if (
-              item.data.recommendStrategy !== "" &&
-              item.data.recommendStrategy !== null
+              data.recommendStrategyList !== null &&
+              data.recommendStrategyList.length > 0
             ) {
-              let itemList = item.data.recommendStrategy.split(",");
-              pageData.recommend = [];
-              itemList.forEach((v) => {
-                strategyGetID({
-                  id: v,
-                }).then((resp) => {
-                  pageData.recommend.push(resp.data);
+              for (let i = 0; i < data.recommendStrategyList.length; i++) {
+                let list = await strategyGetID({
+                  id: data.recommendStrategyList[i],
                 });
-              });
-            }
-            if (item.data.cancelRule !== "" && item.data.cancelRule !== null) {
-              pageData.strategyInfo.unsubscribeStrategyList =
-                item.data.cancelRule.split(",");
+                recommend.push(list.data);
+              }
             }
-            if (item.data.interceptRule === "1") {
-              pageData.interceptRule = item.data.interceptRule;
+            let pageData = {
+              mainProduct: info.data,
+              strategyInfo: data,
+              remarks: data.extJson,
+              channl: {
+                channelKey: localStorage.getItem("key"),
+              },
+              recommend: recommend,
+            };
+            let params = {
+              anonymousId: this.$sensors.store._state.$device_id,
+              channleKey: localStorage.getItem("key"),
+              spId: info.data.spid,
+              userId: this.user.userid,
+            };
+            let item = await seniorStrategy(params);
+            if (item.data !== null) {
+              // 判断高级策略是否开启遮罩
+              if (item.data.enableMask !== null) {
+                pageData.remarks.isMask = String(item.data.enableMask);
+                // 判断高级策略是否有遮罩文案 并替换
+                if (item.data.maskText !== null && item.data.maskText !== "") {
+                  pageData.remarks.maskText = item.data.maskText;
+                }
+              }
+              // 判断高级策略是否开启有推荐
+              if (
+                item.data.recommendStrategy !== "" &&
+                item.data.recommendStrategy !== null
+              ) {
+                let itemList = item.data.recommendStrategy.split(",");
+                pageData.recommend = [];
+                itemList.forEach((v) => {
+                  strategyGetID({
+                    id: v,
+                  }).then((resp) => {
+                    pageData.recommend.push(resp.data);
+                  });
+                });
+              }
+              if (item.data.cancelRule !== "" && item.data.cancelRule !== null) {
+                pageData.strategyInfo.unsubscribeStrategyList =
+                  item.data.cancelRule.split(",");
+              }
+              if (item.data.interceptRule === "1") {
+                pageData.interceptRule = item.data.interceptRule;
+              }
+              if (item.data.location !== "" && item.data.location !== null) {
+                pageData.location = item.data.location.split(",");
+              }
             }
-            if (item.data.location !== "" && item.data.location !== null) {
-              pageData.location = item.data.location.split(",");
+            document.title = pageData.mainProduct.productName;
+            this.$store.commit("setPageData", pageData);
+            if (this.$store.state.tempName === data.templateCode) {
+              setTimeout(() => {
+                this.callSvg()
+              }, 500)
             }
-          }
-          document.title = pageData.mainProduct.productName;
-          this.$store.commit("setPageData", pageData);
-          if (this.$store.state.tempName === data.templateCode) {
-            setTimeout(() => {
-              this.callSvg()
-            }, 500)
-          }
-          this.$store.commit("setTempName", data.templateCode);
-          if (item.data !== null) {
-            if (
-              item.data.templateName !== "" &&
-              item.data.templateName !== null
-            ) {
-              if (this.$store.state.tempName === item.data.templateName) {
-                setTimeout(() => {
-                  this.callSvg()
-                }, 500)
+            this.$store.commit("setTempName", data.templateCode);
+            if (item.data !== null) {
+              if (
+                item.data.templateName !== "" &&
+                item.data.templateName !== null
+              ) {
+                if (this.$store.state.tempName === item.data.templateName) {
+                  setTimeout(() => {
+                    this.callSvg()
+                  }, 500)
+                }
+                this.$store.commit("setTempName", item.data.templateName);
               }
-              this.$store.commit("setTempName", item.data.templateName);
             }
+
+          } else {
+            this.$toast.fail("当前策略未生效");
           }
+        });
+      }
 
-        } else {
-          this.$toast.fail("当前策略未生效");
-        }
-      });
       this.unBuyDrainage = false;
     },
     // 活动链接跳转

+ 1 - 1
purchase_H5/src/templates/templateCom/index.scss

@@ -133,7 +133,7 @@
     background: #FFFFFF;
     box-shadow: 0px 0px 12px 0px #ACACAC;
     opacity: 0.8;
-    border-radius: 30px 0px 0px 30px;
+    border-radius: 40px 0px 0px 40px;
     font-size: 30px;
     color: #0D0D0D;
     line-height: 75px;

+ 203 - 97
purchase_H5/src/templates/templateCom/index.vue

@@ -126,7 +126,7 @@
     <!-- 重复订购引流 -->
     <repeat-modal @repeat="recommend" v-model="repeatShow"></repeat-modal>
     <!-- 合约产品退订提示 -->
-    <opOut v-model="opoutShow" @opoutClick="showUnbuy = true"></opOut>
+    <!-- <opOut v-model="opoutShow" @opoutClick="showUnbuy = true"></opOut> -->
   </div>
 </template>
 
@@ -136,6 +136,7 @@ import {
   strategyGetID,
   detMainProduct,
   seniorStrategy,
+  strategytemplate,
 } from "../../api";
 import lottie from 'lottie-web';
 import common from "../../common/common";
@@ -276,13 +277,23 @@ export default {
             this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
             this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
           ) {
-            let productId = await strategyGetID({
-              id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
-            });
-            let drainageRes = await detMainProduct({
-              productId: productId.data.primaryProductId,
-            });
-            this.unBuyDrainageText = drainageRes.data.productName;
+            if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+              let productId = await strategytemplate({
+                id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
+              });
+              let drainageRes = await detMainProduct({
+                productId: productId.data.primaryProductId,
+              });
+              this.unBuyDrainageText = drainageRes.data.productName;
+            } else {
+              let productId = await strategyGetID({
+                id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
+              });
+              let drainageRes = await detMainProduct({
+                productId: productId.data.primaryProductId,
+              });
+              this.unBuyDrainageText = drainageRes.data.productName;
+            }
             this.unBuyDrainage = true;
           } else {
             if (this.pageData.remarks.treaty && this.pageData.remarks.treaty === '1') {
@@ -298,13 +309,21 @@ export default {
           this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
           this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
         ) {
-          let productId = await strategyGetID({
-            id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
-          });
-          let drainageRes = await detMainProduct({
-            productId: productId.data.primaryProductId,
-          });
-          this.unBuyDrainageText = drainageRes.data.productName;
+          if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+            let productId = await strategytemplate(this.pageData.strategyInfo.unsubscribeStrategyList[0]);
+            let drainageRes = await detMainProduct({
+              productId: productId.data.primaryProductId,
+            });
+            this.unBuyDrainageText = drainageRes.data.productName;
+          } else {
+            let productId = await strategyGetID({
+              id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
+            });
+            let drainageRes = await detMainProduct({
+              productId: productId.data.primaryProductId,
+            });
+            this.unBuyDrainageText = drainageRes.data.productName;
+          }
           this.unBuyDrainage = true;
         } else {
           if (this.pageData.remarks.treaty && this.pageData.remarks.treaty === '1') {
@@ -355,109 +374,196 @@ export default {
     },
     // 推荐产品跳转
     recommend (val) {
-      // this.$store.commit("setTempName", "loading");
-      strategyGetID({
-        id: val,
-      }).then(async (res) => {
-        if (res.data.strategyStatus === 1) {
-          let data = res.data;
+      let edition = this.$store.state.pageData.channl.edition
+      if (edition && edition === '1') {
+        strategytemplate(val).then(async res => {
           let info = await detMainProduct({
-            productId: data.primaryProductId,
+            productId: res.data.primaryProductId,
           });
-          if (this.user.userid) {
-            this.getIsBuy();
+          let productJson = JSON.parse(res.data.productJson).product
+          let mainProduct = {
+            activeType: info.data.activeType,
+            bannerPics: [productJson.bannerImg, productJson.jsonImg, productJson.upImg, productJson.topImg,],
+            bgColor: [productJson.pageBgcol, '', productJson.orderBgcol, productJson.orderBdcol],
+            cacheSeatOne: [{
+              dongHua: productJson.drawVal,
+              memberUrl: info.data.cacheSeatOne[0].memberUrl,
+              proC: {
+                e: productJson.hideCol,
+                s: productJson.pageTextcol
+              },
+              productV: productJson.productV,
+              rushC: {
+                e: productJson.orderTextcol,
+                s: productJson.orderNumcol,
+              },
+              tabC: {
+                e: productJson.tabVicecol,
+                s: productJson.tabMaincol,
+              },
+              btnUrl: "",
+            }],
+            cpid: info.data.cpid,
+            discountInfo: null,
+            flowJumpUrl: info.data.flowJumpUrl,
+            givePhoneInfo: info.data.givePhoneInfo,
+            guidancePic: {
+              c: productJson.orderImg,
+              p: productJson.explainImg
+            },
+            id: res.data.primaryProductId,
+            isCompositeProduct: 0,   //是否复合产品
+            logoPic: productJson.logoPic,
+            manualInfo: info.data.manualInfo,
+            memberName: info.data.memberName,
+            orderingInfo: info.data.orderingInfo,
+            originalPrice: info.data.originalPrice,
+            pageTitle: productJson.pageTitle,
+            productName: info.data.productName,
+            productType: info.data.productType,
+            promotionPic: info.data.promotionPic,
+            pushJumpUrl: info.data.pushJumpUrl,
+            remark: info.data.producremarktName,
+            remark1: info.data.remark1,
+            remark2: info.data.remark2,
+            remark3: productJson.remark3,
+            spid: info.data.spid,
+            themeColor: [productJson.btnTopcol, productJson.btnBotcol],
           }
           let recommend = [];
-          if (
-            data.recommendStrategyList !== null &&
-            data.recommendStrategyList.length > 0
-          ) {
-            for (let i = 0; i < data.recommendStrategyList.length; i++) {
-              let list = await strategyGetID({
-                id: data.recommendStrategyList[i],
-              });
+          if (res.data.recommendStrategyIds.length > 0 && res.data.recommendStrategyIds) {
+            res.data.recommendStrategyIds.forEach(async val => {
+              let list = await strategytemplate(val)
               recommend.push(list.data);
-            }
+            });
           }
           let pageData = {
-            mainProduct: info.data,
-            strategyInfo: data,
-            remarks: data.extJson,
+            mainProduct: mainProduct,
             channl: {
-              channelKey: localStorage.getItem("key"),
+              channelKey: "464c87375658",
+              channelName: "新策略H5整合测试",
+              fullCode: "173966823233",
+              edition: "1"
             },
             recommend: recommend,
+            remarks: JSON.parse(res.data.extJson), //策略信息
+            // viceJson: JSON.parse(res.data.viceJson), //副产品json
+            otherJson: JSON.parse(res.data.otherJson), //备用json
+            strategyInfo: res.data
           };
-          MgtvApi.setWebviewTitle({
-            title: pageData.mainProduct.productName,
-          });
-          let params = {
-            anonymousId: this.$sensors.store._state.$device_id,
-            channleKey: localStorage.getItem("key"),
-            spId: info.data.spid,
-            userId: this.user.userid,
-          };
-          let item = await seniorStrategy(params);
-          if (item.data !== null) {
-            // 判断高级策略是否开启遮罩;
-            if (item.data.enableMask !== null) {
-              pageData.remarks.isMask = String(item.data.enableMask);
-              // 判断高级策略是否有遮罩文案 并替换
-              if (item.data.maskText !== null && item.data.maskText !== "") {
-                pageData.remarks.maskText = item.data.maskText;
-              }
+          pageData.strategyInfo.recommendStrategyList = res.data.recommendStrategyIds
+          pageData.strategyInfo.unsubscribeStrategyList = res.data.unsubscribeStrategyIds
+          pageData.strategyInfo.viceProductStrategyList = res.data.viceProductIds
+          if (JSON.parse(res.data.productJson).viceProduct) {
+            pageData.viceJson = JSON.parse(res.data.productJson).viceProduct
+          }
+          pageData.mainJson = JSON.parse(res.data.productJson).product
+          this.$store.commit("setPageData", pageData);
+          this.$store.commit('setTempName', res.data.templateCode)
+        })
+
+      } else {
+        strategyGetID({ id: val, }).then(async (res) => {
+          if (res.data.strategyStatus === 1) {
+            let data = res.data;
+            let info = await detMainProduct({
+              productId: data.primaryProductId,
+            });
+            if (this.user.userid) {
+              this.getIsBuy();
             }
-            // 判断高级策略是否开启有推荐
+            let recommend = [];
             if (
-              item.data.recommendStrategy !== "" &&
-              item.data.recommendStrategy !== null
+              data.recommendStrategyList !== null &&
+              data.recommendStrategyList.length > 0
             ) {
-              let itemList = item.data.recommendStrategy.split(",");
-              pageData.recommend = [];
-              itemList.forEach((v) => {
-                strategyGetID({
-                  id: v,
-                }).then((resp) => {
-                  pageData.recommend.push(resp.data);
+              for (let i = 0; i < data.recommendStrategyList.length; i++) {
+                let list = await strategyGetID({
+                  id: data.recommendStrategyList[i],
                 });
-              });
-            }
-            if (item.data.cancelRule !== "" && item.data.cancelRule !== null) {
-              pageData.strategyInfo.unsubscribeStrategyList =
-                item.data.cancelRule.split(",");
+                recommend.push(list.data);
+              }
             }
-            if (item.data.interceptRule === "1") {
-              pageData.interceptRule = item.data.interceptRule;
+            let pageData = {
+              mainProduct: info.data,
+              strategyInfo: data,
+              remarks: data.extJson,
+              channl: {
+                channelKey: localStorage.getItem("key"),
+              },
+              recommend: recommend,
+            };
+            MgtvApi.setWebviewTitle({
+              title: pageData.mainProduct.productName,
+            });
+            let params = {
+              anonymousId: this.$sensors.store._state.$device_id,
+              channleKey: localStorage.getItem("key"),
+              spId: info.data.spid,
+              userId: this.user.userid,
+            };
+            let item = await seniorStrategy(params);
+            if (item.data !== null) {
+              // 判断高级策略是否开启遮罩;
+              if (item.data.enableMask !== null) {
+                pageData.remarks.isMask = String(item.data.enableMask);
+                // 判断高级策略是否有遮罩文案 并替换
+                if (item.data.maskText !== null && item.data.maskText !== "") {
+                  pageData.remarks.maskText = item.data.maskText;
+                }
+              }
+              // 判断高级策略是否开启有推荐
+              if (
+                item.data.recommendStrategy !== "" &&
+                item.data.recommendStrategy !== null
+              ) {
+                let itemList = item.data.recommendStrategy.split(",");
+                pageData.recommend = [];
+                itemList.forEach((v) => {
+                  strategyGetID({
+                    id: v,
+                  }).then((resp) => {
+                    pageData.recommend.push(resp.data);
+                  });
+                });
+              }
+              if (item.data.cancelRule !== "" && item.data.cancelRule !== null) {
+                pageData.strategyInfo.unsubscribeStrategyList =
+                  item.data.cancelRule.split(",");
+              }
+              if (item.data.interceptRule === "1") {
+                pageData.interceptRule = item.data.interceptRule;
+              }
+              if (item.data.location !== "" && item.data.location !== null) {
+                pageData.location = item.data.location.split(",");
+              }
             }
-            if (item.data.location !== "" && item.data.location !== null) {
-              pageData.location = item.data.location.split(",");
+            document.title = pageData.mainProduct.productName;
+            this.$store.commit("setPageData", pageData);
+            if (this.$store.state.tempName === data.templateCode) {
+              setTimeout(() => {
+                this.callSvg()
+              }, 500)
             }
-          }
-          document.title = pageData.mainProduct.productName;
-          this.$store.commit("setPageData", pageData);
-          if (this.$store.state.tempName === data.templateCode) {
-            setTimeout(() => {
-              this.callSvg()
-            }, 500)
-          }
-          this.$store.commit("setTempName", data.templateCode);
-          if (item.data !== null) {
-            if (
-              item.data.templateName !== "" &&
-              item.data.templateName !== null
-            ) {
-              if (this.$store.state.tempName === item.data.templateName) {
-                setTimeout(() => {
-                  this.callSvg()
-                }, 500)
+            this.$store.commit("setTempName", data.templateCode);
+            if (item.data !== null) {
+              if (
+                item.data.templateName !== "" &&
+                item.data.templateName !== null
+              ) {
+                if (this.$store.state.tempName === item.data.templateName) {
+                  setTimeout(() => {
+                    this.callSvg()
+                  }, 500)
+                }
+                this.$store.commit("setTempName", item.data.templateName);
               }
-              this.$store.commit("setTempName", item.data.templateName);
             }
+          } else {
+            this.$toast.fail("当前策略未生效");
           }
-        } else {
-          this.$toast.fail("当前策略未生效");
-        }
-      });
+        });
+      }
       this.unBuyDrainage = false;
     },
     // 活动链接跳转

+ 1 - 1
purchase_H5/src/templates/templateTogether-Col/index.scss

@@ -115,7 +115,7 @@
     background: #F6F5F5;
     box-shadow: 0px 0px 12px 0px #ACACAC;
     opacity: 0.5;
-    border-radius: 30px 0px 0px 30px;
+    border-radius: 40px 0px 0px 40px;
     font-size: 24px;
     color: #0D0D0D;
     line-height: 75px;

+ 329 - 109
purchase_H5/src/templates/templateTogether-Col/index.vue

@@ -4,8 +4,8 @@
     <div class="bannerBox" @click="bannerClick">
       <!-- 底层banner -->
       <img class="banner" v-if="pageData.mainProduct.bannerPics[0]" :class="productJson.length>0 &&productJson[0].dongHua &&productJson[0].dongHua=='1'?'cartoon1':''" :src="imgUrl + pageData.mainProduct.bannerPics[0]" alt="" />
-       <!-- json动图 -->
-      <div class="svgBanner" >
+      <!-- json动图 -->
+      <div class="svgBanner">
         <div id="lottie_box"></div>
       </div>
       <!-- 上层png -->
@@ -125,6 +125,7 @@ import {
   strategyGetID,
   detMainProduct,
   seniorStrategy,
+  strategytemplate,
 } from "../../api";
 import common from "../../common/common";
 import loginModal from "../../components/login.vue";
@@ -195,22 +196,135 @@ export default {
     this.callSvg()
   },
   methods: {
-    productClick (id, index) {
+    async productClick (id, index) {
       this.indexNum = index
-      detMainProduct({
-        productId: id,
-      }).then((res) => {
-        this.pageData.mainProduct = res.data;
-        this.param.cpid = res.data.cpid;
-        this.param.spid = res.data.spid;
-        document.title = res.data.remark;
-        this.productJson =res.data.cacheSeatOne;
+      if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+        let info = await detMainProduct({ productId: id })
+        let viceProduct = this.pageData.viceJson
+        let mainJson = this.pageData.mainJson
+        if (index === 1) {
+          let mainProduct = {
+            activeType: info.data.activeType,
+            bannerPics: [viceProduct.bannerImg, viceProduct.jsonImg, viceProduct.upImg, viceProduct.topImg,],
+            bgColor: [viceProduct.pageBgcol, '', viceProduct.orderBgcol, viceProduct.orderBdcol],
+            cacheSeatOne: [{
+              dongHua: viceProduct.drawVal,
+              memberUrl: info.data.cacheSeatOne[0].memberUrl,
+              proC: {
+                e: viceProduct.hideCol,
+                s: viceProduct.pageTextcol
+              },
+              productV: viceProduct.productV,
+              rushC: {
+                e: viceProduct.orderTextcol,
+                s: viceProduct.orderNumcol,
+              },
+              tabC: {
+                e: viceProduct.tabVicecol,
+                s: viceProduct.tabMaincol,
+              },
+              btnUrl: "",
+            }],
+            cpid: info.data.cpid,
+            discountInfo: null,
+            flowJumpUrl: info.data.flowJumpUrl,
+            givePhoneInfo: info.data.givePhoneInfo,
+            guidancePic: {
+              c: viceProduct.orderImg,
+              p: viceProduct.explainImg
+            },
+            id: info.data.primaryProductId,
+            isCompositeProduct: 0,   //是否复合产品
+            logoPic: mainJson.logoPic,
+            manualInfo: info.data.manualInfo,
+            memberName: info.data.memberName,
+            orderingInfo: info.data.orderingInfo,
+            originalPrice: info.data.originalPrice,
+            pageTitle: mainJson.pageTitle,
+            productName: info.data.productName,
+            productType: info.data.productType,
+            promotionPic: info.data.promotionPic,
+            pushJumpUrl: info.data.pushJumpUrl,
+            remark: info.data.producremarktName,
+            remark1: info.data.remark1,
+            remark2: info.data.remark2,
+            remark3: mainJson.remark3,
+            spid: info.data.spid,
+            themeColor: [viceProduct.btnTopcol, viceProduct.btnBotcol],
+          }
+          this.productJson = mainProduct.cacheSeatOne;
+          this.pageData.mainProduct = mainProduct;
+        } else if (index === 0) {
+          let mainProduct = {
+            activeType: info.data.activeType,
+            bannerPics: [mainJson.bannerImg, mainJson.jsonImg, mainJson.upImg, mainJson.topImg,],
+            bgColor: [mainJson.pageBgcol, '', mainJson.orderBgcol, mainJson.orderBdcol],
+            cacheSeatOne: [{
+              dongHua: mainJson.drawVal,
+              memberUrl: info.data.cacheSeatOne[0].memberUrl,
+              proC: {
+                e: mainJson.hideCol,
+                s: mainJson.pageTextcol
+              },
+              productV: mainJson.productV,
+              rushC: {
+                e: mainJson.orderTextcol,
+                s: mainJson.orderNumcol,
+              },
+              tabC: {
+                e: mainJson.tabVicecol,
+                s: mainJson.tabMaincol,
+              },
+              btnUrl: "",
+            }],
+            cpid: info.data.cpid,
+            discountInfo: null,
+            flowJumpUrl: info.data.flowJumpUrl,
+            givePhoneInfo: info.data.givePhoneInfo,
+            guidancePic: {
+              c: mainJson.orderImg,
+              p: mainJson.explainImg
+            },
+            id: info.data.primaryProductId,
+            isCompositeProduct: 0,   //是否复合产品
+            logoPic: mainJson.logoPic,
+            manualInfo: info.data.manualInfo,
+            memberName: info.data.memberName,
+            orderingInfo: info.data.orderingInfo,
+            originalPrice: info.data.originalPrice,
+            pageTitle: mainJson.pageTitle,
+            productName: info.data.productName,
+            productType: info.data.productType,
+            promotionPic: info.data.promotionPic,
+            pushJumpUrl: info.data.pushJumpUrl,
+            remark: info.data.producremarktName,
+            remark1: info.data.remark1,
+            remark2: info.data.remark2,
+            remark3: mainJson.remark3,
+            spid: info.data.spid,
+            themeColor: [mainJson.btnTopcol, mainJson.btnBotcol],
+          }
+          this.productJson = mainProduct.cacheSeatOne;
+          this.pageData.mainProduct = mainProduct;
+        }
+        this.param.cpid = info.data.cpid;
+        this.param.spid = info.data.spid;
+        document.title = info.data.remark;
         this.$store.commit("setPageData", this.pageData);
-        this.callSvg()
-        // if (this.pageData.mainProduct.cacheSeatOne ) {
-        //   this.productJson = this.pageData.mainProduct.cacheSeatOne;
-        // }
-      });
+      } else {
+        detMainProduct({
+          productId: id,
+        }).then((res) => {
+          this.pageData.mainProduct = res.data;
+          this.param.cpid = res.data.cpid;
+          this.param.spid = res.data.spid;
+          document.title = res.data.remark;
+          this.productJson = res.data.cacheSeatOne;
+          this.$store.commit("setPageData", this.pageData);
+        });
+      }
+
+      this.callSvg()
     },
     extendClick () {
       if (this.pageData.remarks.extendVal && this.pageData.remarks.extendVal === "1") {
@@ -272,13 +386,23 @@ export default {
             this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
             this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
           ) {
-            let productId = await strategyGetID({
-              id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
-            });
-            let drainageRes = await detMainProduct({
-              productId: productId.data.primaryProductId,
-            });
-            this.unBuyDrainageText = drainageRes.data.productName;
+            if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+              let productId = await strategytemplate({
+                id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
+              });
+              let drainageRes = await detMainProduct({
+                productId: productId.data.primaryProductId,
+              });
+              this.unBuyDrainageText = drainageRes.data.productName;
+            } else {
+              let productId = await strategyGetID({
+                id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
+              });
+              let drainageRes = await detMainProduct({
+                productId: productId.data.primaryProductId,
+              });
+              this.unBuyDrainageText = drainageRes.data.productName;
+            }
             this.unBuyDrainage = true;
           } else {
             if (this.pageData.remarks.treaty && this.pageData.remarks.treaty === '1') {
@@ -294,13 +418,21 @@ export default {
           this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
           this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
         ) {
-          let productId = await strategyGetID({
-            id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
-          });
-          let drainageRes = await detMainProduct({
-            productId: productId.data.primaryProductId,
-          });
-          this.unBuyDrainageText = drainageRes.data.productName;
+          if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+            let productId = await strategytemplate(this.pageData.strategyInfo.unsubscribeStrategyList[0]);
+            let drainageRes = await detMainProduct({
+              productId: productId.data.primaryProductId,
+            });
+            this.unBuyDrainageText = drainageRes.data.productName;
+          } else {
+            let productId = await strategyGetID({
+              id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
+            });
+            let drainageRes = await detMainProduct({
+              productId: productId.data.primaryProductId,
+            });
+            this.unBuyDrainageText = drainageRes.data.productName;
+          }
           this.unBuyDrainage = true;
         } else {
           if (this.pageData.remarks.treaty && this.pageData.remarks.treaty === '1') {
@@ -355,106 +487,194 @@ export default {
     // 推荐产品跳转
     recommend (val) {
       // this.$store.commit("setTempName", "loading");
-      strategyGetID({
-        id: val,
-      }).then(async (res) => {
-        if (res.data.strategyStatus === 1) {
-          let data = res.data;
+      let edition = this.$store.state.pageData.channl.edition
+      if (edition && edition === '1') {
+        strategytemplate(val).then(async res => {
           let info = await detMainProduct({
-            productId: data.primaryProductId,
+            productId: res.data.primaryProductId,
           });
-          if (this.user.userid) {
-            this.getIsBuy();
+          let productJson = JSON.parse(res.data.productJson).product
+          let mainProduct = {
+            activeType: info.data.activeType,
+            bannerPics: [productJson.bannerImg, productJson.jsonImg, productJson.upImg, productJson.topImg,],
+            bgColor: [productJson.pageBgcol, '', productJson.orderBgcol, productJson.orderBdcol],
+            cacheSeatOne: [{
+              dongHua: productJson.drawVal,
+              memberUrl: info.data.cacheSeatOne[0].memberUrl,
+              proC: {
+                e: productJson.hideCol,
+                s: productJson.pageTextcol
+              },
+              productV: productJson.productV,
+              rushC: {
+                e: productJson.orderTextcol,
+                s: productJson.orderNumcol,
+              },
+              tabC: {
+                e: productJson.tabVicecol,
+                s: productJson.tabMaincol,
+              },
+              btnUrl: "",
+            }],
+            cpid: info.data.cpid,
+            discountInfo: null,
+            flowJumpUrl: info.data.flowJumpUrl,
+            givePhoneInfo: info.data.givePhoneInfo,
+            guidancePic: {
+              c: productJson.orderImg,
+              p: productJson.explainImg
+            },
+            id: res.data.primaryProductId,
+            isCompositeProduct: 0,   //是否复合产品
+            logoPic: productJson.logoPic,
+            manualInfo: info.data.manualInfo,
+            memberName: info.data.memberName,
+            orderingInfo: info.data.orderingInfo,
+            originalPrice: info.data.originalPrice,
+            pageTitle: productJson.pageTitle,
+            productName: info.data.productName,
+            productType: info.data.productType,
+            promotionPic: info.data.promotionPic,
+            pushJumpUrl: info.data.pushJumpUrl,
+            remark: info.data.producremarktName,
+            remark1: info.data.remark1,
+            remark2: info.data.remark2,
+            remark3: productJson.remark3,
+            spid: info.data.spid,
+            themeColor: [productJson.btnTopcol, productJson.btnBotcol],
           }
           let recommend = [];
-          if (
-            data.recommendStrategyList !== null &&
-            data.recommendStrategyList.length > 0
-          ) {
-            for (let i = 0; i < data.recommendStrategyList.length; i++) {
-              let list = await strategyGetID({
-                id: data.recommendStrategyList[i],
-              });
+          if (res.data.recommendStrategyIds.length > 0 && res.data.recommendStrategyIds) {
+            res.data.recommendStrategyIds.forEach(async val => {
+              let list = await strategytemplate(val)
               recommend.push(list.data);
-            }
+            });
           }
           let pageData = {
-            mainProduct: info.data,
-            strategyInfo: data,
-            remarks: data.extJson,
+            mainProduct: mainProduct,
             channl: {
-              channelKey: localStorage.getItem("key"),
+              channelKey: "464c87375658",
+              channelName: "新策略H5整合测试",
+              fullCode: "173966823233",
+              edition: "1"
             },
             recommend: recommend,
+            remarks: JSON.parse(res.data.extJson), //策略信息
+            // viceJson: JSON.parse(res.data.viceJson), //副产品json
+            otherJson: JSON.parse(res.data.otherJson), //备用json
+            strategyInfo: res.data
           };
-          let params = {
-            anonymousId: this.$sensors.store._state.$device_id,
-            channleKey: localStorage.getItem("key"),
-            spId: info.data.spid,
-            userId: this.user.userid,
-          };
-          let item = await seniorStrategy(params);
-          if (item.data !== null) {
-            // 判断高级策略是否开启遮罩
-            if (item.data.enableMask !== null) {
-              pageData.remarks.isMask = String(item.data.enableMask);
-              // 判断高级策略是否有遮罩文案 并替换
-              if (item.data.maskText !== null && item.data.maskText !== "") {
-                pageData.remarks.maskText = item.data.maskText;
-              }
+          pageData.strategyInfo.recommendStrategyList = res.data.recommendStrategyIds
+          pageData.strategyInfo.unsubscribeStrategyList = res.data.unsubscribeStrategyIds
+          pageData.strategyInfo.viceProductStrategyList = res.data.viceProductIds
+          if (JSON.parse(res.data.productJson).viceProduct) {
+            pageData.viceJson = JSON.parse(res.data.productJson).viceProduct
+          }
+          pageData.mainJson = JSON.parse(res.data.productJson).product
+          this.$store.commit("setPageData", pageData);
+          this.$store.commit('setTempName', res.data.templateCode)
+        })
+
+      } else {
+        strategyGetID({ id: val, }).then(async (res) => {
+          if (res.data.strategyStatus === 1) {
+            let data = res.data;
+            let info = await detMainProduct({
+              productId: data.primaryProductId,
+            });
+            if (this.user.userid) {
+              this.getIsBuy();
             }
-            // 判断高级策略是否开启有推荐
+            let recommend = [];
             if (
-              item.data.recommendStrategy !== "" &&
-              item.data.recommendStrategy !== null
+              data.recommendStrategyList !== null &&
+              data.recommendStrategyList.length > 0
             ) {
-              let itemList = item.data.recommendStrategy.split(",");
-              pageData.recommend = [];
-              itemList.forEach((v) => {
-                strategyGetID({
-                  id: v,
-                }).then((resp) => {
-                  pageData.recommend.push(resp.data);
+              for (let i = 0; i < data.recommendStrategyList.length; i++) {
+                let list = await strategyGetID({
+                  id: data.recommendStrategyList[i],
                 });
-              });
-            }
-            if (item.data.cancelRule !== "" && item.data.cancelRule !== null) {
-              pageData.strategyInfo.unsubscribeStrategyList =
-                item.data.cancelRule.split(",");
+                recommend.push(list.data);
+              }
             }
-            if (item.data.interceptRule === "1") {
-              pageData.interceptRule = item.data.interceptRule;
+            let pageData = {
+              mainProduct: info.data,
+              strategyInfo: data,
+              remarks: data.extJson,
+              channl: {
+                channelKey: localStorage.getItem("key"),
+              },
+              recommend: recommend,
+            };
+            let params = {
+              anonymousId: this.$sensors.store._state.$device_id,
+              channleKey: localStorage.getItem("key"),
+              spId: info.data.spid,
+              userId: this.user.userid,
+            };
+            let item = await seniorStrategy(params);
+            if (item.data !== null) {
+              // 判断高级策略是否开启遮罩
+              if (item.data.enableMask !== null) {
+                pageData.remarks.isMask = String(item.data.enableMask);
+                // 判断高级策略是否有遮罩文案 并替换
+                if (item.data.maskText !== null && item.data.maskText !== "") {
+                  pageData.remarks.maskText = item.data.maskText;
+                }
+              }
+              // 判断高级策略是否开启有推荐
+              if (
+                item.data.recommendStrategy !== "" &&
+                item.data.recommendStrategy !== null
+              ) {
+                let itemList = item.data.recommendStrategy.split(",");
+                pageData.recommend = [];
+                itemList.forEach((v) => {
+                  strategyGetID({
+                    id: v,
+                  }).then((resp) => {
+                    pageData.recommend.push(resp.data);
+                  });
+                });
+              }
+              if (item.data.cancelRule !== "" && item.data.cancelRule !== null) {
+                pageData.strategyInfo.unsubscribeStrategyList =
+                  item.data.cancelRule.split(",");
+              }
+              if (item.data.interceptRule === "1") {
+                pageData.interceptRule = item.data.interceptRule;
+              }
+              if (item.data.location !== "" && item.data.location !== null) {
+                pageData.location = item.data.location.split(",");
+              }
             }
-            if (item.data.location !== "" && item.data.location !== null) {
-              pageData.location = item.data.location.split(",");
+            document.title = pageData.mainProduct.productName;
+            this.$store.commit("setPageData", pageData);
+            if (this.$store.state.tempName === data.templateCode) {
+              setTimeout(() => {
+                this.callSvg()
+              }, 500)
             }
-          }
-          document.title = pageData.mainProduct.productName;
-          this.$store.commit("setPageData", pageData);
-          if (this.$store.state.tempName === data.templateCode) {
-            setTimeout(() => {
-              this.callSvg()
-            }, 500)
-          }
-          this.$store.commit("setTempName", data.templateCode);
-          if (item.data !== null) {
-            if (
-              item.data.templateName !== "" &&
-              item.data.templateName !== null
-            ) {
-              if (this.$store.state.tempName === item.data.templateName) {
-                setTimeout(() => {
-                  this.callSvg()
-                }, 500)
+            this.$store.commit("setTempName", data.templateCode);
+            if (item.data !== null) {
+              if (
+                item.data.templateName !== "" &&
+                item.data.templateName !== null
+              ) {
+                if (this.$store.state.tempName === item.data.templateName) {
+                  setTimeout(() => {
+                    this.callSvg()
+                  }, 500)
+                }
+                this.$store.commit("setTempName", item.data.templateName);
               }
-              this.$store.commit("setTempName", item.data.templateName);
             }
-          }
 
-        } else {
-          this.$toast.fail("当前策略未生效");
-        }
-      });
+          } else {
+            this.$toast.fail("当前策略未生效");
+          }
+        });
+      }
       this.unBuyDrainage = false;
     },
     // 活动链接跳转

+ 1 - 1
purchase_H5/src/templates/templateTogether/index.scss

@@ -134,7 +134,7 @@
     background: #FFFFFF;
     box-shadow: 0px 0px 12px 0px #ACACAC;
     opacity: 0.8;
-    border-radius: 30px 0px 0px 30px;
+    border-radius: 40px 0px 0px 40px;
     font-size: 30px;
     color: #0D0D0D;
     line-height: 75px;

+ 349 - 128
purchase_H5/src/templates/templateTogether/index.vue

@@ -186,6 +186,7 @@ import {
   strategyGetID,
   detMainProduct,
   seniorStrategy,
+  strategytemplate,
 } from "../../api";
 import { Dialog } from "vant";
 import common from "../../common/common";
@@ -325,7 +326,7 @@ export default {
     ruleShow () {
       this.showRule = false;
     },
-    productClick (val, index) {
+    async productClick (val, index) {
       this.clickCss = index;
       this.pageData.mainProduct.isTreaty = index;
       this.indexNum = index;
@@ -342,41 +343,155 @@ export default {
         let times = (now - 1600476800000) / 180000;
         this.times = String(Math.ceil(times * add) + start);
       }
-      detMainProduct({
-        productId: val,
-      }).then(async (res) => {
-        if (res.data.cacheSeatOne && res.data.cacheSeatOne !== null) {
-          this.productJson = res.data.cacheSeatOne;
+      if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+        let info = await detMainProduct({ productId: val })
+        let viceProduct = this.pageData.viceJson
+        let mainJson = this.pageData.mainJson
+        if (index === 1) {
+          let mainProduct = {
+            activeType: info.data.activeType,
+            bannerPics: [viceProduct.bannerImg, viceProduct.jsonImg, viceProduct.upImg, viceProduct.topImg,],
+            bgColor: [viceProduct.pageBgcol, '', viceProduct.orderBgcol, viceProduct.orderBdcol],
+            cacheSeatOne: [{
+              dongHua: viceProduct.drawVal,
+              memberUrl: info.data.cacheSeatOne[0].memberUrl,
+              proC: {
+                e: viceProduct.hideCol,
+                s: viceProduct.pageTextcol
+              },
+              productV: viceProduct.productV,
+              rushC: {
+                e: viceProduct.orderTextcol,
+                s: viceProduct.orderNumcol,
+              },
+              tabC: {
+                e: viceProduct.tabVicecol,
+                s: viceProduct.tabMaincol,
+              },
+              btnUrl: "",
+            }],
+            cpid: info.data.cpid,
+            discountInfo: null,
+            flowJumpUrl: info.data.flowJumpUrl,
+            givePhoneInfo: info.data.givePhoneInfo,
+            guidancePic: {
+              c: viceProduct.orderImg,
+              p: viceProduct.explainImg
+            },
+            id: info.data.primaryProductId,
+            isCompositeProduct: 0,   //是否复合产品
+            logoPic: mainJson.logoPic,
+            manualInfo: info.data.manualInfo,
+            memberName: info.data.memberName,
+            orderingInfo: info.data.orderingInfo,
+            originalPrice: info.data.originalPrice,
+            pageTitle: mainJson.pageTitle,
+            productName: info.data.productName,
+            productType: info.data.productType,
+            promotionPic: info.data.promotionPic,
+            pushJumpUrl: info.data.pushJumpUrl,
+            remark: info.data.producremarktName,
+            remark1: info.data.remark1,
+            remark2: info.data.remark2,
+            remark3: mainJson.remark3,
+            spid: info.data.spid,
+            themeColor: [viceProduct.btnTopcol, viceProduct.btnBotcol],
+          }
+          this.productJson = mainProduct.cacheSeatOne;
+          this.pageData.mainProduct = mainProduct;
+        } else if (index === 0) {
+          let mainProduct = {
+            activeType: info.data.activeType,
+            bannerPics: [mainJson.bannerImg, mainJson.jsonImg, mainJson.upImg, mainJson.topImg,],
+            bgColor: [mainJson.pageBgcol, '', mainJson.orderBgcol, mainJson.orderBdcol],
+            cacheSeatOne: [{
+              dongHua: mainJson.drawVal,
+              memberUrl: info.data.cacheSeatOne[0].memberUrl,
+              proC: {
+                e: mainJson.hideCol,
+                s: mainJson.pageTextcol
+              },
+              productV: mainJson.productV,
+              rushC: {
+                e: mainJson.orderTextcol,
+                s: mainJson.orderNumcol,
+              },
+              tabC: {
+                e: mainJson.tabVicecol,
+                s: mainJson.tabMaincol,
+              },
+              btnUrl: "",
+            }],
+            cpid: info.data.cpid,
+            discountInfo: null,
+            flowJumpUrl: info.data.flowJumpUrl,
+            givePhoneInfo: info.data.givePhoneInfo,
+            guidancePic: {
+              c: mainJson.orderImg,
+              p: mainJson.explainImg
+            },
+            id: info.data.primaryProductId,
+            isCompositeProduct: 0,   //是否复合产品
+            logoPic: mainJson.logoPic,
+            manualInfo: info.data.manualInfo,
+            memberName: info.data.memberName,
+            orderingInfo: info.data.orderingInfo,
+            originalPrice: info.data.originalPrice,
+            pageTitle: mainJson.pageTitle,
+            productName: info.data.productName,
+            productType: info.data.productType,
+            promotionPic: info.data.promotionPic,
+            pushJumpUrl: info.data.pushJumpUrl,
+            remark: info.data.producremarktName,
+            remark1: info.data.remark1,
+            remark2: info.data.remark2,
+            remark3: mainJson.remark3,
+            spid: info.data.spid,
+            themeColor: [mainJson.btnTopcol, mainJson.btnBotcol],
+          }
+          this.productJson = mainProduct.cacheSeatOne;
+          this.pageData.mainProduct = mainProduct;
         }
-        this.pageData.mainProduct = res.data;
-        this.param.cpid = res.data.cpid;
-        this.param.spid = res.data.spid;
-        document.title = res.data.remark;
-
-        // this.pageData.remarks.btnText  =  res.data.
+        this.param.cpid = info.data.cpid;
+        this.param.spid = info.data.spid;
+        document.title = info.data.remark;
         this.$store.commit("setPageData", this.pageData);
-        if (this.user.userid) {
-          await orderList({
-            userid: this.user.userid,
-            cpid: res.data.cpid,
-            spid: res.data.spid,
-          }).then((res) => {
-            let data = res.data;
-            if (data.length === 0) {
-              this.isBuy = "未订购";
-            } else {
-              for (let i = 0; i < data.length; i++) {
-                if (data[i].STATUS === "0") {
-                  this.isBuy = "已订购";
-                } else {
-                  this.isBuy = "已退订";
-                }
+      } else {
+        detMainProduct({
+          productId: val,
+        }).then(async (res) => {
+          if (res.data.cacheSeatOne && res.data.cacheSeatOne !== null) {
+            this.productJson = res.data.cacheSeatOne;
+          }
+          this.pageData.mainProduct = res.data;
+          this.param.cpid = res.data.cpid;
+          this.param.spid = res.data.spid;
+          document.title = res.data.remark;
+          this.$store.commit("setPageData", this.pageData);
+        });
+      }
+      if (this.user.userid) {
+        await orderList({
+          userid: this.user.userid,
+          cpid: res.data.cpid,
+          spid: res.data.spid,
+        }).then((res) => {
+          let data = res.data;
+          if (data.length === 0) {
+            this.isBuy = "未订购";
+          } else {
+            for (let i = 0; i < data.length; i++) {
+              if (data[i].STATUS === "0") {
+                this.isBuy = "已订购";
+              } else {
+                this.isBuy = "已退订";
               }
             }
-          });
-        }
-        this.callSvg()
-      });
+          }
+        });
+      }
+      this.callSvg()
+
     },
     result (a, b) {
       return (a - b).toFixed(2);
@@ -415,13 +530,23 @@ export default {
             this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
             this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
           ) {
-            let productId = await strategyGetID({
-              id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
-            });
-            let drainageRes = await detMainProduct({
-              productId: productId.data.primaryProductId,
-            });
-            this.unBuyDrainageText = drainageRes.data.productName;
+            if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+              let productId = await strategytemplate({
+                id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
+              });
+              let drainageRes = await detMainProduct({
+                productId: productId.data.primaryProductId,
+              });
+              this.unBuyDrainageText = drainageRes.data.productName;
+            } else {
+              let productId = await strategyGetID({
+                id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
+              });
+              let drainageRes = await detMainProduct({
+                productId: productId.data.primaryProductId,
+              });
+              this.unBuyDrainageText = drainageRes.data.productName;
+            }
             this.unBuyDrainage = true;
           } else {
             if (this.pageData.remarks.treaty && this.pageData.remarks.treaty === '1') {
@@ -437,13 +562,21 @@ export default {
           this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
           this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
         ) {
-          let productId = await strategyGetID({
-            id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
-          });
-          let drainageRes = await detMainProduct({
-            productId: productId.data.primaryProductId,
-          });
-          this.unBuyDrainageText = drainageRes.data.productName;
+          if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+            let productId = await strategytemplate(this.pageData.strategyInfo.unsubscribeStrategyList[0]);
+            let drainageRes = await detMainProduct({
+              productId: productId.data.primaryProductId,
+            });
+            this.unBuyDrainageText = drainageRes.data.productName;
+          } else {
+            let productId = await strategyGetID({
+              id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
+            });
+            let drainageRes = await detMainProduct({
+              productId: productId.data.primaryProductId,
+            });
+            this.unBuyDrainageText = drainageRes.data.productName;
+          }
           this.unBuyDrainage = true;
         } else {
           if (this.pageData.remarks.treaty && this.pageData.remarks.treaty === '1') {
@@ -469,7 +602,7 @@ export default {
         url = "/order001";
       } else if (type === "member") {
         addR.memberClick();
-        if (this.productJson[0].memberUrl && this.productJson.length>0 && this.pageData.mainProduct.cacheSeatOne[0].memberUrl !== "") {
+        if (this.productJson[0].memberUrl && this.productJson.length > 0 && this.pageData.mainProduct.cacheSeatOne[0].memberUrl !== "") {
           window.location.href = this.productJson[0].memberUrl;
           return false;
         } else {
@@ -493,108 +626,196 @@ export default {
     // 推荐产品跳转
     recommend (val) {
       // this.$store.commit("setTempName", "loading");
-      strategyGetID({
-        id: val,
-      }).then(async (res) => {
-        if (res.data.strategyStatus === 1) {
-          let data = res.data;
+      let edition = this.$store.state.pageData.channl.edition
+      if (edition && edition === '1') {
+        strategytemplate(val).then(async res => {
           let info = await detMainProduct({
-            productId: data.primaryProductId,
+            productId: res.data.primaryProductId,
           });
-          if (this.user.userid) {
-            this.getIsBuy();
+          let productJson = JSON.parse(res.data.productJson).product
+          let mainProduct = {
+            activeType: info.data.activeType,
+            bannerPics: [productJson.bannerImg, productJson.jsonImg, productJson.upImg, productJson.topImg,],
+            bgColor: [productJson.pageBgcol, '', productJson.orderBgcol, productJson.orderBdcol],
+            cacheSeatOne: [{
+              dongHua: productJson.drawVal,
+              memberUrl: info.data.cacheSeatOne[0].memberUrl,
+              proC: {
+                e: productJson.hideCol,
+                s: productJson.pageTextcol
+              },
+              productV: productJson.productV,
+              rushC: {
+                e: productJson.orderTextcol,
+                s: productJson.orderNumcol,
+              },
+              tabC: {
+                e: productJson.tabVicecol,
+                s: productJson.tabMaincol,
+              },
+              btnUrl: "",
+            }],
+            cpid: info.data.cpid,
+            discountInfo: null,
+            flowJumpUrl: info.data.flowJumpUrl,
+            givePhoneInfo: info.data.givePhoneInfo,
+            guidancePic: {
+              c: productJson.orderImg,
+              p: productJson.explainImg
+            },
+            id: res.data.primaryProductId,
+            isCompositeProduct: 0,   //是否复合产品
+            logoPic: productJson.logoPic,
+            manualInfo: info.data.manualInfo,
+            memberName: info.data.memberName,
+            orderingInfo: info.data.orderingInfo,
+            originalPrice: info.data.originalPrice,
+            pageTitle: productJson.pageTitle,
+            productName: info.data.productName,
+            productType: info.data.productType,
+            promotionPic: info.data.promotionPic,
+            pushJumpUrl: info.data.pushJumpUrl,
+            remark: info.data.producremarktName,
+            remark1: info.data.remark1,
+            remark2: info.data.remark2,
+            remark3: productJson.remark3,
+            spid: info.data.spid,
+            themeColor: [productJson.btnTopcol, productJson.btnBotcol],
           }
           let recommend = [];
-          if (
-            data.recommendStrategyList !== null &&
-            data.recommendStrategyList.length > 0
-          ) {
-            for (let i = 0; i < data.recommendStrategyList.length; i++) {
-              let list = await strategyGetID({
-                id: data.recommendStrategyList[i],
-              });
+          if (res.data.recommendStrategyIds.length > 0 && res.data.recommendStrategyIds) {
+            res.data.recommendStrategyIds.forEach(async val => {
+              let list = await strategytemplate(val)
               recommend.push(list.data);
-            }
+            });
           }
           let pageData = {
-            mainProduct: info.data,
-            strategyInfo: data,
-            remarks: data.extJson,
+            mainProduct: mainProduct,
             channl: {
-              channelKey: localStorage.getItem("key"),
+              channelKey: "464c87375658",
+              channelName: "新策略H5整合测试",
+              fullCode: "173966823233",
+              edition: "1"
             },
             recommend: recommend,
+            remarks: JSON.parse(res.data.extJson), //策略信息
+            // viceJson: JSON.parse(res.data.viceJson), //副产品json
+            otherJson: JSON.parse(res.data.otherJson), //备用json
+            strategyInfo: res.data
           };
-          MgtvApi.setWebviewTitle({
-            title: pageData.mainProduct.productName,
-          });
-          let params = {
-            anonymousId: this.$sensors.store._state.$device_id,
-            channleKey: localStorage.getItem("key"),
-            spId: info.data.spid,
-            userId: this.user.userid,
-          };
-          let item = await seniorStrategy(params);
-          if (item.data !== null) {
-            // 判断高级策略是否开启遮罩;
-            if (item.data.enableMask !== null) {
-              pageData.remarks.isMask = String(item.data.enableMask);
-              // 判断高级策略是否有遮罩文案 并替换
-              if (item.data.maskText !== null && item.data.maskText !== "") {
-                pageData.remarks.maskText = item.data.maskText;
-              }
+          pageData.strategyInfo.recommendStrategyList = res.data.recommendStrategyIds
+          pageData.strategyInfo.unsubscribeStrategyList = res.data.unsubscribeStrategyIds
+          pageData.strategyInfo.viceProductStrategyList = res.data.viceProductIds
+          if (JSON.parse(res.data.productJson).viceProduct) {
+            pageData.viceJson = JSON.parse(res.data.productJson).viceProduct
+          }
+          pageData.mainJson = JSON.parse(res.data.productJson).product
+          this.$store.commit("setPageData", pageData);
+          this.$store.commit('setTempName', res.data.templateCode)
+        })
+
+      } else {
+        strategyGetID({ id: val, }).then(async (res) => {
+          if (res.data.strategyStatus === 1) {
+            let data = res.data;
+            let info = await detMainProduct({
+              productId: data.primaryProductId,
+            });
+            if (this.user.userid) {
+              this.getIsBuy();
             }
-            // 判断高级策略是否开启有推荐
+            let recommend = [];
             if (
-              item.data.recommendStrategy !== "" &&
-              item.data.recommendStrategy !== null
+              data.recommendStrategyList !== null &&
+              data.recommendStrategyList.length > 0
             ) {
-              let itemList = item.data.recommendStrategy.split(",");
-              pageData.recommend = [];
-              itemList.forEach((v) => {
-                strategyGetID({
-                  id: v,
-                }).then((resp) => {
-                  pageData.recommend.push(resp.data);
+              for (let i = 0; i < data.recommendStrategyList.length; i++) {
+                let list = await strategyGetID({
+                  id: data.recommendStrategyList[i],
                 });
-              });
-            }
-            if (item.data.cancelRule !== "" && item.data.cancelRule !== null) {
-              pageData.strategyInfo.unsubscribeStrategyList =
-                item.data.cancelRule.split(",");
+                recommend.push(list.data);
+              }
             }
-            if (item.data.interceptRule === "1") {
-              pageData.interceptRule = item.data.interceptRule;
+            let pageData = {
+              mainProduct: info.data,
+              strategyInfo: data,
+              remarks: data.extJson,
+              channl: {
+                channelKey: localStorage.getItem("key"),
+              },
+              recommend: recommend,
+            };
+            MgtvApi.setWebviewTitle({
+              title: pageData.mainProduct.productName,
+            });
+            let params = {
+              anonymousId: this.$sensors.store._state.$device_id,
+              channleKey: localStorage.getItem("key"),
+              spId: info.data.spid,
+              userId: this.user.userid,
+            };
+            let item = await seniorStrategy(params);
+            if (item.data !== null) {
+              // 判断高级策略是否开启遮罩;
+              if (item.data.enableMask !== null) {
+                pageData.remarks.isMask = String(item.data.enableMask);
+                // 判断高级策略是否有遮罩文案 并替换
+                if (item.data.maskText !== null && item.data.maskText !== "") {
+                  pageData.remarks.maskText = item.data.maskText;
+                }
+              }
+              // 判断高级策略是否开启有推荐
+              if (
+                item.data.recommendStrategy !== "" &&
+                item.data.recommendStrategy !== null
+              ) {
+                let itemList = item.data.recommendStrategy.split(",");
+                pageData.recommend = [];
+                itemList.forEach((v) => {
+                  strategyGetID({
+                    id: v,
+                  }).then((resp) => {
+                    pageData.recommend.push(resp.data);
+                  });
+                });
+              }
+              if (item.data.cancelRule !== "" && item.data.cancelRule !== null) {
+                pageData.strategyInfo.unsubscribeStrategyList =
+                  item.data.cancelRule.split(",");
+              }
+              if (item.data.interceptRule === "1") {
+                pageData.interceptRule = item.data.interceptRule;
+              }
+              if (item.data.location !== "" && item.data.location !== null) {
+                pageData.location = item.data.location.split(",");
+              }
             }
-            if (item.data.location !== "" && item.data.location !== null) {
-              pageData.location = item.data.location.split(",");
+            document.title = pageData.mainProduct.productName;
+            this.$store.commit("setPageData", pageData);
+            if (this.$store.state.tempName === data.templateCode) {
+              setTimeout(() => {
+                this.callSvg()
+              }, 500)
             }
-          }
-          document.title = pageData.mainProduct.productName;
-          this.$store.commit("setPageData", pageData);
-          if (this.$store.state.tempName === data.templateCode) {
-            setTimeout(() => {
-              this.callSvg()
-            }, 500)
-          }
-          this.$store.commit("setTempName", data.templateCode);
-          if (item.data !== null) {
-            if (
-              item.data.templateName !== "" &&
-              item.data.templateName !== null
-            ) {
-              if (this.$store.state.tempName === item.data.templateName) {
-                setTimeout(() => {
-                  this.callSvg()
-                }, 500)
+            this.$store.commit("setTempName", data.templateCode);
+            if (item.data !== null) {
+              if (
+                item.data.templateName !== "" &&
+                item.data.templateName !== null
+              ) {
+                if (this.$store.state.tempName === item.data.templateName) {
+                  setTimeout(() => {
+                    this.callSvg()
+                  }, 500)
+                }
+                this.$store.commit("setTempName", item.data.templateName);
               }
-              this.$store.commit("setTempName", item.data.templateName);
             }
+          } else {
+            this.$toast.fail("当前策略未生效");
           }
-        } else {
-          this.$toast.fail("当前策略未生效");
-        }
-      });
+        });
+      }
       this.unBuyDrainage = false;
     },
     // 活动链接跳转

+ 6 - 4
purchase_H5/src/views/indexMobile.vue

@@ -33,7 +33,6 @@ export default {
       });
     },
     pageData (data) {
-      this.$store.commit('setTempName', data.template)
       detMainProduct({
         productId: data.item.primaryProductId,
       }).then(res => {
@@ -62,7 +61,7 @@ export default {
           cpid: res.data.cpid,
           discountInfo: null,
           flowJumpUrl: res.data.flowJumpUrl,
-          givePhoneInfo:res.data.givePhoneInfo,
+          givePhoneInfo: res.data.givePhoneInfo,
           guidancePic: {
             c: data.productJson.orderImg,
             p: data.productJson.explainImg
@@ -76,7 +75,7 @@ export default {
           originalPrice: res.data.originalPrice,
           pageTitle: data.productJson.pageTitle,
           productName: res.data.productName,
-          productType:res.data.productType,
+          productType: res.data.productType,
           promotionPic: res.data.promotionPic,
           pushJumpUrl: res.data.pushJumpUrl,
           remark: res.data.producremarktName,
@@ -99,10 +98,12 @@ export default {
             channelKey: "464c87375658",
             channelName: "新策略H5整合测试",
             fullCode: "173966823233",
+            edition: "1"
           },
           recommend: recommend,
           remarks: data.extJson, //策略信息
           viceJson: data.viceJson, //副产品json
+          mainJson: data.productJson,
           otherJson: data.otherJson, //备用json
           strategyInfo: {
             activityLogo: data.item.activityLogo,
@@ -114,7 +115,7 @@ export default {
             maskText: data.item.maskText,
             posterPhoto: data.item.posterPhoto,
             primaryProductId: data.item.primaryProductId,
-            primarySpid: "1234",
+            primarySpid: null,
             productInfo: [],
             promotePhoto: data.item.promotePhoto,
             recommendStrategyList: data.item.recommendStrategyIds,
@@ -130,6 +131,7 @@ export default {
             viceProductStrategyList: data.item.viceProductIds,
           }
         };
+        this.$store.commit('setTempName', data.template)
         this.$store.commit("setPageData", pageData);
       })
 

+ 157 - 133
purchase_ao/src/views/productV2/addProduct.vue

@@ -2,19 +2,23 @@
   <div class="addProduct">
     <el-form :model="form" label-width="100px">
       <el-form-item label="产品名称">
-        <el-input style="width: 300px" v-model="form.productName" placeholder="产品名称"></el-input>
+        <!-- <el-input style="width: 300px" v-model="form.productName" placeholder="产品名称"></el-input> -->
+        <el-select style="width: 300px" v-model="form.productName" filterable placeholder="选择产品" @change="productChange">
+          <el-option v-for="item in productList" :label="item.productName" :key="item.id" :value="item.productName"></el-option>
+        </el-select>
       </el-form-item>
       <el-form-item label="spid">
-        <el-input style="width: 300px" v-model="form.spid" placeholder="spid"></el-input>
+        <el-input disabled style="width: 300px" v-model="form.spid" placeholder="spid"></el-input>
       </el-form-item>
       <el-form-item label="cpid">
-        <el-select v-model="form.cpid" placeholder="cpid" style="width: 300px">
+        <el-input disabled style="width: 300px" v-model="form.cpid" placeholder="cpid"></el-input>
+        <!-- <el-select v-model="form.cpid" placeholder="cpid" style="width: 300px">
           <el-option v-for="item in cpidList" :key="item.cpid" :label="item.cpid" :value="item.cpid">
           </el-option>
-        </el-select>
+        </el-select> -->
       </el-form-item>
       <el-form-item label="activeType">
-        <el-input style="width: 300px" v-model="form.activeType" placeholder="科创定义activeType,根据对照表填写"></el-input>
+        <el-input disabled style="width: 300px" v-model="form.activeType" placeholder="activeType"></el-input>
       </el-form-item>
       <el-form-item label="产品形态">
         <el-select v-model="form.isCompositeProduct" placeholder="请选择" style="width: 300px">
@@ -304,6 +308,8 @@ export default {
           ],
         },
       },
+      //产品列表
+      productList: []
     };
   },
   created () {
@@ -318,80 +324,98 @@ export default {
         row.threshold = row.threshold ? row.threshold : 0;
         this.form = row;
         this.form.productName = row.productName + " 副本";
-        if (row.bannerPics) {
-          this.imgUrl = JSON.parse(row.bannerPics)
-          if (this.imgUrl[0] !== '' && this.imgUrl[0] !== null && this.imgUrl[0]) {
-            this.bannerUrl = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[0];
-          }
-          if (this.imgUrl[2] !== '' && this.imgUrl[2] !== null && this.imgUrl[2]) {
-            this.bannerUrl2 = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[2];
-          }
-          if (this.imgUrl[3] !== '' && this.imgUrl[3]) {
-            this.bannerUrl3 = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[3];
-          }
-          if (this.imgUrl[1] !== '' && this.imgUrl[1] !== null && this.imgUrl[1]) {
-            this.svgUrl = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[1];
-            this.lottie = lottie.loadAnimation({
-              container: document.getElementById('lottie_box'),
-              renderer: 'svg',
-              loop: true,
-              autoplay: true,
-              path: this.svgUrl
-            })
-          }
-        }
-        if (row.logoPic) {
-          this.logoUrl = process.env.VUE_APP_BASE_IMG_URL + "/" + row.logoPic;
-        }
-        this.addColors.thc = {
-          s: JSON.parse(row.themeColor)[0],
-          e: JSON.parse(row.themeColor)[1],
-        };
-        this.addColors.bgc = {
-          s: JSON.parse(row.bgColor)[0],
-          e: JSON.parse(row.bgColor)[1],
-          ss: JSON.parse(row.bgColor)[2],
-          ee: JSON.parse(row.bgColor)[3],
-        };
-        if (JSON.parse(row.guidancePic).p) {
-          this.guideUrlP =
-            process.env.VUE_APP_BASE_IMG_URL + JSON.parse(row.guidancePic).p;
-          this.guidancePic.p = JSON.parse(row.guidancePic).p;
-        }
-        if (JSON.parse(row.guidancePic).c) {
-          this.guideUrlC =
-            process.env.VUE_APP_BASE_IMG_URL + JSON.parse(row.guidancePic).c;
-          this.guidancePic.c = JSON.parse(row.guidancePic).c;
-        }
-        if (row.cacheSeatOne !== null) {
-          let arr = JSON.parse(row.cacheSeatOne)
-          let list = []
-          arr.forEach(val => {
-            if (!val.tabC) {
-              val.tabC = {
-                s: "",
-                e: ""
-              }
-            } else if (!val.dongHua) {
-              val.dongHua = '0'
-            }
-            list.push(val)
-          });
-          this.productJson = list;
-        }
+        // if (row.bannerPics) {
+        //   this.imgUrl = JSON.parse(row.bannerPics)
+        //   if (this.imgUrl[0] !== '' && this.imgUrl[0] !== null && this.imgUrl[0]) {
+        //     this.bannerUrl = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[0];
+        //   }
+        //   if (this.imgUrl[2] !== '' && this.imgUrl[2] !== null && this.imgUrl[2]) {
+        //     this.bannerUrl2 = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[2];
+        //   }
+        //   if (this.imgUrl[3] !== '' && this.imgUrl[3]) {
+        //     this.bannerUrl3 = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[3];
+        //   }
+        //   if (this.imgUrl[1] !== '' && this.imgUrl[1] !== null && this.imgUrl[1]) {
+        //     this.svgUrl = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[1];
+        //     this.lottie = lottie.loadAnimation({
+        //       container: document.getElementById('lottie_box'),
+        //       renderer: 'svg',
+        //       loop: true,
+        //       autoplay: true,
+        //       path: this.svgUrl
+        //     })
+        //   }
+        // }
+        // if (row.logoPic) {
+        //   this.logoUrl = process.env.VUE_APP_BASE_IMG_URL + "/" + row.logoPic;
+        // }
+        // this.addColors.thc = {
+        //   s: JSON.parse(row.themeColor)[0],
+        //   e: JSON.parse(row.themeColor)[1],
+        // };
+        // this.addColors.bgc = {
+        //   s: JSON.parse(row.bgColor)[0],
+        //   e: JSON.parse(row.bgColor)[1],
+        //   ss: JSON.parse(row.bgColor)[2],
+        //   ee: JSON.parse(row.bgColor)[3],
+        // };
+        // if (JSON.parse(row.guidancePic).p) {
+        //   this.guideUrlP =
+        //     process.env.VUE_APP_BASE_IMG_URL + JSON.parse(row.guidancePic).p;
+        //   this.guidancePic.p = JSON.parse(row.guidancePic).p;
+        // }
+        // if (JSON.parse(row.guidancePic).c) {
+        //   this.guideUrlC =
+        //     process.env.VUE_APP_BASE_IMG_URL + JSON.parse(row.guidancePic).c;
+        //   this.guidancePic.c = JSON.parse(row.guidancePic).c;
+        // }
+        // if (row.cacheSeatOne !== null) {
+        //   let arr = JSON.parse(row.cacheSeatOne)
+        //   let list = []
+        //   arr.forEach(val => {
+        //     if (!val.tabC) {
+        //       val.tabC = {
+        //         s: "",
+        //         e: ""
+        //       }
+        //     } else if (!val.dongHua) {
+        //       val.dongHua = '0'
+        //     }
+        //     list.push(val)
+        //   });
+        //   this.productJson = list;
+        // }
       });
     }
+    // this.getProductList()
   },
   mounted () {
-    this.$get("/cpidInfo/page", {
-      pageSize: 9999,
-      pageNum: 1
-    }).then((res) => {
-      this.cpidList = res.data.list;
-    });
-
+    // this.$get("/cpidInfo/page", {
+    //   pageSize: 9999,
+    //   pageNum: 1
+    // }).then((res) => {
+    //   this.cpidList = res.data.list;
+    // });
+    this.getProductList()
   },
   methods: {
+    // 选择产品
+    productChange (e) {
+      let arr = this.productList
+      this.form.cpid = arr.find(val => { return e === val.productName }).cpid
+      this.form.spid = arr.find(val => { return e === val.productName }).spid
+      this.form.activeType = arr.find(val => { return e === val.productName }).activeType
+    },
+    // 获取产品列表
+    getProductList () {
+      this.$get("/productInfo/page", {
+        pageSize: 9999,
+        pageNum: 1
+      }).then(res => {
+        // console.log(res)
+        this.productList = res.data.list
+      })
+    },
     // 确认新增
     addClick () {
       this.form.themeColor = JSON.stringify([
@@ -405,10 +429,10 @@ export default {
         this.addColors.bgc.ee ? this.addColors.bgc.ee : ''
       ]);
       this.form.bannerPics = JSON.stringify(this.imgUrl);
-      if (this.productJson[0].dongHua === '0' && this.form.bannerUrl2 === '') {
-        this.$message.error('请上传顶层素材!')
-        return false
-      }
+      // if (this.productJson[0].dongHua === '0' && this.form.bannerUrl2 === '') {
+      //   this.$message.error('请上传顶层素材!')
+      //   return false
+      // }
       this.form.cacheSeatOne = JSON.stringify(this.productJson)
       this.form.guidancePic = JSON.stringify(this.guidancePic);
       this.$confirm("确定要提交吗?").then((_) => {
@@ -426,44 +450,44 @@ export default {
     close () {
       window.close();
     },
-    bannerSuccess (file, fileList) {
-      this.bannerUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
-      this.imgUrl[0] = file.data
-    },
-    bannerSuccess2 (file, fileList) {
-      this.bannerUrl2 = process.env.VUE_APP_BASE_IMG_URL + file.data;
-      this.imgUrl[2] = file.data
-    },
-    bannerSuccess3 (file, fileList) {
-      this.bannerUrl3 = process.env.VUE_APP_BASE_IMG_URL + file.data;
-      this.imgUrl[3] = file.data
-    },
-    svgSuccess (file) {
-      this.svgUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
-      this.imgUrl[1] = file.data
-      this.lottie = lottie.loadAnimation({
-        container: document.getElementById('lottie_box'),
-        renderer: 'svg',
-        loop: true,
-        autoplay: true,
-        path: this.svgUrl
-      })
-    },
-    logoSuccess (file) {
-      this.logoUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
-      this.form.logoPic = file.data;
-    },
-    guideSuccessP (file) {
-      this.guideUrlP = process.env.VUE_APP_BASE_IMG_URL + file.data;
-      this.guidancePic.p = file.data;
-    },
-    guideSuccessC (file) {
-      this.guideUrlC = process.env.VUE_APP_BASE_IMG_URL + file.data;
-      this.guidancePic.c = file.data;
-    },
-    btnSuccess (file) {
-      this.productJson[0].btnUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
-    },
+    // bannerSuccess (file, fileList) {
+    //   this.bannerUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
+    //   this.imgUrl[0] = file.data
+    // },
+    // bannerSuccess2 (file, fileList) {
+    //   this.bannerUrl2 = process.env.VUE_APP_BASE_IMG_URL + file.data;
+    //   this.imgUrl[2] = file.data
+    // },
+    // bannerSuccess3 (file, fileList) {
+    //   this.bannerUrl3 = process.env.VUE_APP_BASE_IMG_URL + file.data;
+    //   this.imgUrl[3] = file.data
+    // },
+    // svgSuccess (file) {
+    //   this.svgUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
+    //   this.imgUrl[1] = file.data
+    //   this.lottie = lottie.loadAnimation({
+    //     container: document.getElementById('lottie_box'),
+    //     renderer: 'svg',
+    //     loop: true,
+    //     autoplay: true,
+    //     path: this.svgUrl
+    //   })
+    // },
+    // logoSuccess (file) {
+    //   this.logoUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
+    //   this.form.logoPic = file.data;
+    // },
+    // guideSuccessP (file) {
+    //   this.guideUrlP = process.env.VUE_APP_BASE_IMG_URL + file.data;
+    //   this.guidancePic.p = file.data;
+    // },
+    // guideSuccessC (file) {
+    //   this.guideUrlC = process.env.VUE_APP_BASE_IMG_URL + file.data;
+    //   this.guidancePic.c = file.data;
+    // },
+    // btnSuccess (file) {
+    //   this.productJson[0].btnUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
+    // },
     radioChange () {
       if (this.productJson[0].productV === '2') {
         this.form.givePhoneInfo =
@@ -472,24 +496,24 @@ export default {
         this.form.givePhoneInfo = "赠送话费说明"
       }
     },
-    svgRemove () {
-      this.svgUrl = ""
-      this.imgUrl[1] = ''
-      let div = document.getElementById('lottie_box')
-      div.innerHTML = ""
-    },
-    bannerRemove () {
-      this.bannerUrl = ""
-      this.imgUrl[0] = ''
-    },
-    bannerRemove2 () {
-      this.bannerUrl2 = ""
-      this.imgUrl[2] = ''
-    },
-    bannerRemove3 () {
-      this.bannerUrl3 = ""
-      this.imgUrl[3] = ''
-    }
+    // svgRemove () {
+    //   this.svgUrl = ""
+    //   this.imgUrl[1] = ''
+    //   let div = document.getElementById('lottie_box')
+    //   div.innerHTML = ""
+    // },
+    // bannerRemove () {
+    //   this.bannerUrl = ""
+    //   this.imgUrl[0] = ''
+    // },
+    // bannerRemove2 () {
+    //   this.bannerUrl2 = ""
+    //   this.imgUrl[2] = ''
+    // },
+    // bannerRemove3 () {
+    //   this.bannerUrl3 = ""
+    //   this.imgUrl[3] = ''
+    // }
   },
 };
 

+ 162 - 144
purchase_ao/src/views/productV2/editProduct.vue

@@ -2,19 +2,23 @@
   <div class="edit">
     <el-form :model="form" label-width="100px">
       <el-form-item label="产品名称">
-        <el-input style="width: 300px" v-model="form.productName" placeholder="产品名称"></el-input>
+        <!-- <el-input style="width: 300px" v-model="form.productName" placeholder="产品名称"></el-input> -->
+        <el-select style="width: 300px" v-model="form.productName" filterable placeholder="选择产品" @change="productChange">
+          <el-option v-for="item in productList" :label="item.productName" :key="item.id" :value="item.productName"></el-option>
+        </el-select>
       </el-form-item>
       <el-form-item label="spid">
-        <el-input style="width: 300px" v-model="form.spid" placeholder="spid"></el-input>
+        <el-input disabled style="width: 300px" v-model="form.spid" placeholder="spid"></el-input>
       </el-form-item>
       <el-form-item label="cpid">
-        <el-select v-model="form.cpid" placeholder="cpid" style="width: 300px">
+        <el-input disabled style="width: 300px" v-model="form.cpid" placeholder="cpid"></el-input>
+        <!-- <el-select v-model="form.cpid" placeholder="cpid" style="width: 300px">
           <el-option v-for="item in cpidList" :key="item.cpid" :label="item.cpid" :value="item.cpid">
           </el-option>
-        </el-select>
+        </el-select> -->
       </el-form-item>
       <el-form-item label="activeType">
-        <el-input style="width: 300px" v-model="form.activeType" placeholder="科创定义activeType,根据对照表填写"></el-input>
+        <el-input disabled style="width: 300px" v-model="form.activeType" placeholder="activeType"></el-input>
       </el-form-item>
       <!-- <el-form-item label="直冲阈值">
         <el-input style="width: 300px" v-model="form.threshold" placeholder="如无阈值设置,则填0"></el-input>
@@ -44,10 +48,7 @@
       <el-form-item label="激活指引">
         <el-input style="width: 500px" placeholder="激活指引" v-model="form.flowJumpUrl"></el-input>
       </el-form-item>
-      <!-- <el-form-item label="分享标题">
-                    <el-input style="width: 500px" v-model="form.pageTitle"></el-input>
-                  </el-form-item> -->
-      <el-form-item label="分享文案">
+      <!-- <el-form-item label="分享文案">
         <el-input style="width: 500px" v-model="form.remark3" placeholder="微信分享副标题"></el-input>
       </el-form-item>
       <el-form-item label="页面背景配色">
@@ -55,9 +56,6 @@
           <el-col :span="1">
             <el-color-picker v-model="addColors.bgc.s" show-alpha />
           </el-col>
-          <!--                <el-col :span="1">-->
-          <!--                    <el-color-picker v-model="addColors.bgc.e" />-->
-          <!--                </el-col>-->
         </el-row>
       </el-form-item>
       <el-form-item label="订购窗配色">
@@ -172,7 +170,7 @@
       </el-form-item>
       <el-form-item label="动画效果">
         <el-switch v-model="productJson[0].dongHua" active-text="启用" inactive-text="不启用" active-value="1" inactive-value="0" />
-      </el-form-item>
+      </el-form-item> -->
       <!-- 富文本编辑 -->
       <el-form-item>
         <el-tabs type="border-card" style="margin-top: 20px">
@@ -288,6 +286,8 @@ export default {
           ],
         },
       },
+      //产品列表
+      productList: []
     };
   },
   created () {
@@ -299,78 +299,96 @@ export default {
       let row = res.data.list[0];
       row.threshold = row.threshold ? row.threshold : 0;
       this.form = row;
-      if (row.bannerPics) {
-        this.imgUrl = JSON.parse(row.bannerPics);
-        if (this.imgUrl[0] !== "" && this.imgUrl[0] !== null && this.imgUrl[0]) {
-          this.bannerUrl = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[0];
-        }
-        if (this.imgUrl[2] !== "" && this.imgUrl[2] !== null && this.imgUrl[2]) {
-          this.bannerUrl2 = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[2];
-        }
-        if (this.imgUrl[3] !== '' && this.imgUrl[3]) {
-          this.bannerUrl3 = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[3];
-        }
-        if (this.imgUrl[1] !== "" && this.imgUrl[1] !== null && this.imgUrl[1]) {
-          this.svgUrl = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[1];
-          this.lottie = lottie.loadAnimation({
-            container: document.getElementById("lottie_box"),
-            renderer: "svg",
-            loop: true,
-            autoplay: true,
-            path: this.svgUrl,
-          });
-        }
-      }
-      if (row.logoPic) {
-        this.logoUrl = process.env.VUE_APP_BASE_IMG_URL + "/" + row.logoPic;
-      }
-      this.addColors.thc = {
-        s: JSON.parse(row.themeColor)[0],
-        e: JSON.parse(row.themeColor)[1],
-      };
-      this.addColors.bgc = {
-        s: JSON.parse(row.bgColor)[0],
-        e: JSON.parse(row.bgColor)[1],
-        ss: JSON.parse(row.bgColor)[2],
-        ee: JSON.parse(row.bgColor)[3],
-      };
-      if (JSON.parse(row.guidancePic).p) {
-        this.guideUrlP =
-          process.env.VUE_APP_BASE_IMG_URL + JSON.parse(row.guidancePic).p;
-        this.guidancePic.p = JSON.parse(row.guidancePic).p;
-      }
-      if (JSON.parse(row.guidancePic).c) {
-        this.guideUrlC =
-          process.env.VUE_APP_BASE_IMG_URL + JSON.parse(row.guidancePic).c;
-        this.guidancePic.c = JSON.parse(row.guidancePic).c;
-      }
-      if (row.cacheSeatOne !== null) {
-        let arr = JSON.parse(row.cacheSeatOne)
-        let list = []
-        arr.forEach(val => {
-          if (!val.tabC) {
-            val.tabC = {
-              s: "",
-              e: ""
-            }
-          } else if (!val.dongHua) {
-            val.dongHua = '0'
-          }
-          list.push(val)
-        });
-        this.productJson = list;
-      }
+      // if (row.bannerPics) {
+      //   this.imgUrl = JSON.parse(row.bannerPics);
+      //   if (this.imgUrl[0] !== "" && this.imgUrl[0] !== null && this.imgUrl[0]) {
+      //     this.bannerUrl = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[0];
+      //   }
+      //   if (this.imgUrl[2] !== "" && this.imgUrl[2] !== null && this.imgUrl[2]) {
+      //     this.bannerUrl2 = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[2];
+      //   }
+      //   if (this.imgUrl[3] !== '' && this.imgUrl[3]) {
+      //     this.bannerUrl3 = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[3];
+      //   }
+      //   if (this.imgUrl[1] !== "" && this.imgUrl[1] !== null && this.imgUrl[1]) {
+      //     this.svgUrl = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[1];
+      //     this.lottie = lottie.loadAnimation({
+      //       container: document.getElementById("lottie_box"),
+      //       renderer: "svg",
+      //       loop: true,
+      //       autoplay: true,
+      //       path: this.svgUrl,
+      //     });
+      //   }
+      // }
+      // if (row.logoPic) {
+      //   this.logoUrl = process.env.VUE_APP_BASE_IMG_URL + "/" + row.logoPic;
+      // }
+      // this.addColors.thc = {
+      //   s: JSON.parse(row.themeColor)[0],
+      //   e: JSON.parse(row.themeColor)[1],
+      // };
+      // this.addColors.bgc = {
+      //   s: JSON.parse(row.bgColor)[0],
+      //   e: JSON.parse(row.bgColor)[1],
+      //   ss: JSON.parse(row.bgColor)[2],
+      //   ee: JSON.parse(row.bgColor)[3],
+      // };
+      // if (JSON.parse(row.guidancePic).p) {
+      //   this.guideUrlP =
+      //     process.env.VUE_APP_BASE_IMG_URL + JSON.parse(row.guidancePic).p;
+      //   this.guidancePic.p = JSON.parse(row.guidancePic).p;
+      // }
+      // if (JSON.parse(row.guidancePic).c) {
+      //   this.guideUrlC =
+      //     process.env.VUE_APP_BASE_IMG_URL + JSON.parse(row.guidancePic).c;
+      //   this.guidancePic.c = JSON.parse(row.guidancePic).c;
+      // }
+      // if (row.cacheSeatOne !== null) {
+      //   let arr = JSON.parse(row.cacheSeatOne)
+      //   let list = []
+      //   arr.forEach(val => {
+      //     if (!val.tabC) {
+      //       val.tabC = {
+      //         s: "",
+      //         e: ""
+      //       }
+      //     } else if (!val.dongHua) {
+      //       val.dongHua = '0'
+      //     }
+      //     list.push(val)
+      //   });
+      //   this.productJson = list;
+      // }
     });
   },
   mounted () {
-    this.$get("/cpidInfo/page", {
-      pageSize: 9999,
-      pageNum: 1,
-    }).then((res) => {
-      this.cpidList = res.data.list;
-    });
+    // this.$get("/cpidInfo/page", {
+    //   pageSize: 9999,
+    //   pageNum: 1,
+    // }).then((res) => {
+    //   this.cpidList = res.data.list;
+    // });
+    this.getProductList()
   },
   methods: {
+    // 选择产品
+    productChange (e) {
+      let arr = this.productList
+      this.form.cpid = arr.find(val => { return e === val.productName }).cpid
+      this.form.spid = arr.find(val => { return e === val.productName }).spid
+      this.form.activeType = arr.find(val => { return e === val.productName }).activeType
+    },
+    // 获取产品列表
+    getProductList () {
+      this.$get("/productInfo/page", {
+        pageSize: 9999,
+        pageNum: 1
+      }).then(res => {
+        // console.log(res)
+        this.productList = res.data.list
+      })
+    },
     sureClick () {
       this.$confirm("确定要修改吗?")
         .then((_) => {
@@ -387,10 +405,10 @@ export default {
           if (!this.form.threshold) this.form.threshold = 0;
           this.form.bannerPics = JSON.stringify(this.imgUrl);
           this.form.guidancePic = JSON.stringify(this.guidancePic);
-          if (this.productJson[0].dongHua === '0' && this.form.bannerUrl2 === '') {
-            this.$message.error('请上传顶层素材!')
-            return false
-          }
+          // if (this.productJson[0].dongHua === '0' && this.form.bannerUrl2 === '') {
+          //   this.$message.error('请上传顶层素材!')
+          //   return false
+          // }
           this.form.cacheSeatOne = JSON.stringify(this.productJson);
           this.$post("/productInfo/update/" + this.form.id, this.form).then(
             (res) => {
@@ -408,66 +426,66 @@ export default {
     close () {
       window.close();
     },
-    bannerSuccess (file) {
-      this.bannerUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
-      this.imgUrl[0] = file.data;
-      // this.bannerUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
-      // let arr = [];
-      // arr.push(file.data);
-      // this.form.bannerPics = JSON.stringify(arr);
-    },
-    bannerSuccess2 (file, fileList) {
-      this.bannerUrl2 = process.env.VUE_APP_BASE_IMG_URL + file.data;
-      this.imgUrl[2] = file.data;
-    },
-    bannerSuccess3 (file, fileList) {
-      this.bannerUrl3 = process.env.VUE_APP_BASE_IMG_URL + file.data;
-      this.imgUrl[3] = file.data
-    },
-    svgSuccess (file) {
-      this.svgUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
-      this.imgUrl[1] = file.data;
-      this.lottie = lottie.loadAnimation({
-        container: document.getElementById("lottie_box"),
-        renderer: "svg",
-        loop: true,
-        autoplay: true,
-        path: this.svgUrl,
-      });
-    },
-    logoSuccess (file) {
-      this.logoUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
-      this.form.logoPic = file.data;
-    },
-    guideSuccessP (file) {
-      this.guideUrlP = process.env.VUE_APP_BASE_IMG_URL + file.data;
-      this.guidancePic.p = file.data;
-    },
-    guideSuccessC (file) {
-      this.guideUrlC = process.env.VUE_APP_BASE_IMG_URL + file.data;
-      this.guidancePic.c = file.data;
-    },
-    btnSuccess (file) {
-      this.productJson[0].btnUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
-    },
-    svgRemove () {
-      this.svgUrl = "";
-      this.imgUrl[1] = "";
-      let div = document.getElementById("lottie_box");
-      div.innerHTML = "";
-    },
-    bannerRemove () {
-      this.bannerUrl = "";
-      this.imgUrl[0] = "";
-    },
-    bannerRemove2 () {
-      this.bannerUrl2 = "";
-      this.imgUrl[2] = "";
-    },
-    bannerRemove3 () {
-      this.bannerUrl3 = ""
-      this.imgUrl[3] = ''
-    }
+    // bannerSuccess (file) {
+    //   this.bannerUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
+    //   this.imgUrl[0] = file.data;
+    //   // this.bannerUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
+    //   // let arr = [];
+    //   // arr.push(file.data);
+    //   // this.form.bannerPics = JSON.stringify(arr);
+    // },
+    // bannerSuccess2 (file, fileList) {
+    //   this.bannerUrl2 = process.env.VUE_APP_BASE_IMG_URL + file.data;
+    //   this.imgUrl[2] = file.data;
+    // },
+    // bannerSuccess3 (file, fileList) {
+    //   this.bannerUrl3 = process.env.VUE_APP_BASE_IMG_URL + file.data;
+    //   this.imgUrl[3] = file.data
+    // },
+    // svgSuccess (file) {
+    //   this.svgUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
+    //   this.imgUrl[1] = file.data;
+    //   this.lottie = lottie.loadAnimation({
+    //     container: document.getElementById("lottie_box"),
+    //     renderer: "svg",
+    //     loop: true,
+    //     autoplay: true,
+    //     path: this.svgUrl,
+    //   });
+    // },
+    // logoSuccess (file) {
+    //   this.logoUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
+    //   this.form.logoPic = file.data;
+    // },
+    // guideSuccessP (file) {
+    //   this.guideUrlP = process.env.VUE_APP_BASE_IMG_URL + file.data;
+    //   this.guidancePic.p = file.data;
+    // },
+    // guideSuccessC (file) {
+    //   this.guideUrlC = process.env.VUE_APP_BASE_IMG_URL + file.data;
+    //   this.guidancePic.c = file.data;
+    // },
+    // btnSuccess (file) {
+    //   this.productJson[0].btnUrl = process.env.VUE_APP_BASE_IMG_URL + file.data;
+    // },
+    // svgRemove () {
+    //   this.svgUrl = "";
+    //   this.imgUrl[1] = "";
+    //   let div = document.getElementById("lottie_box");
+    //   div.innerHTML = "";
+    // },
+    // bannerRemove () {
+    //   this.bannerUrl = "";
+    //   this.imgUrl[0] = "";
+    // },
+    // bannerRemove2 () {
+    //   this.bannerUrl2 = "";
+    //   this.imgUrl[2] = "";
+    // },
+    // bannerRemove3 () {
+    //   this.bannerUrl3 = ""
+    //   this.imgUrl[3] = ''
+    // }
   },
 };
 </script>

+ 3 - 1
purchase_ao/src/views/schemeV2/schemeAdd.vue

@@ -492,7 +492,6 @@ export default {
         strategyStatus: "1",
         extJson: {},
         maskText: "",
-        maskText2: "",
         activityUuid: "",
         activityType: "",
         posterPhoto: "",
@@ -532,6 +531,9 @@ export default {
         treatyText: "",
         fitText: "",
         fitText2: "",
+        maskText: "",
+        maskText2: "",
+        unBuyText: ""
       },
       //策略匹配信息
       rulesform: {

+ 32 - 20
purchase_ao/src/views/strategy/add.vue

@@ -265,6 +265,14 @@
                   </el-row>
                 </el-collapse-item>
                 <el-collapse-item title="产品配图-主产品" name="1">
+                  <el-form-item style="margin-top:20px">
+                    <template slot="label">
+                      <el-tooltip content="开启后控制页面banner图和上层图片素材进行动画缩放" placement="top">
+                        <span>页面动效</span>
+                      </el-tooltip>
+                    </template>
+                    <el-switch v-model="productJson.drawVal" active-text="勾选" inactive-text="不勾选" active-value="1" inactive-value="0" />
+                  </el-form-item>
                   <el-form-item>
                     <template slot="label">
                       <el-tooltip content="底层banner背景图" placement="top">
@@ -397,6 +405,12 @@
                   </el-row>
                 </el-collapse-item>
                 <el-collapse-item v-if="form.viceProductIds.length>0" title="产品配图-副产品" name="3">
+                  <el-form-item style="margin-top:20px">
+                    <template slot="label">
+                      <span>页面动效</span>
+                    </template>
+                    <el-switch v-model="viceJson.drawVal" active-text="勾选" inactive-text="不勾选" active-value="1" inactive-value="0" />
+                  </el-form-item>
                   <el-form-item>
                     <template slot="label">
                       <span>banner图</span>
@@ -506,14 +520,6 @@
                   </el-row>
                 </el-collapse-item>
               </el-collapse>
-              <el-form-item style="margin-top:20px">
-                <template slot="label">
-                  <el-tooltip content="开启后控制页面banner图和上层图片素材进行动画缩放" placement="top">
-                    <span>页面动效</span>
-                  </el-tooltip>
-                </template>
-                <el-switch v-model="productJson.drawVal" active-text="勾选" inactive-text="不勾选" active-value="1" inactive-value="0" />
-              </el-form-item>
             </el-form>
           </div>
           <!-- 订购相关 -->
@@ -680,7 +686,7 @@
                     <span slot="reference">退订引流</span>
                   </el-popover>
                 </template>
-                <el-select clearable v-model="form.unsubscribeStrategyIds[0]" filterable placeholder="请选择退订引流产品">
+                <el-select clearable v-model="unsubscribeStrategyIds" filterable placeholder="请选择退订引流产品" @change="unChange">
                   <el-option v-for="(item, index) in strategyInfoList" :key="index" :label="item.strategyName" :value="item.id" />
                 </el-select>
               </el-form-item>
@@ -793,11 +799,13 @@ export default {
         strategyStatus: 1, //策略状态 0 失效 1生效
         strategyType: 0,  //	策略类型 0-基本策略 1-活动策略
         templateId: '',  //模板id
+        templateCode: "",//  模板code
         maskText: "",// 策略备注
         recommendStrategyIds: [],  //	推荐策略ids
         unsubscribeStrategyIds: [],  //退订引流策略ids
         viceProductIds: []   //副产品ids
       },
+      unsubscribeStrategyIds: null,
       viceProductId: null,
       extJson: {
         jiluBtn: "1",
@@ -878,6 +886,8 @@ export default {
         topImg: "",  //顶层素材 
         orderImg: "", //订购窗图
         explainImg: "", //产品说明图
+        productV: "2",
+        drawVal: "0", //副产品动画
       },
       // 客户端适配
       disposeList: [
@@ -898,7 +908,6 @@ export default {
       strategyInfoList: [],
       editId: null,
       copy: 0,
-      templateCode: ""
     }
   },
   created () {
@@ -906,6 +915,7 @@ export default {
     this.getProductList()
     this.getStrategyList()
   },
+  watch: {},
   mounted () {
     if (this.$route.query.id) {
       let id = this.$route.query.id
@@ -925,18 +935,13 @@ export default {
       if (e) {
         this.templateList.forEach(val => {
           if (this.form.templateId === val.id) {
-            this.templateCode = val.templateCode
+            this.form.templateCode = val.templateCode
           }
         })
       }
     },
     // 点击预览
     preview () {
-      this.templateList.forEach(val => {
-        if (this.form.templateId === val.id) {
-          this.templateCode = val.templateCode
-        }
-      })
       this.ifreamSrc = 'http://localhost:8081/mobile.html#/'
       setTimeout(() => {
         let ifream = document.getElementById('ifreamId')
@@ -946,7 +951,7 @@ export default {
           extJson: this.extJson,
           productJson: this.productJson,
           viceJson: this.viceJson,
-          template: this.templateCode
+          template: this.form.templateCode
         }
         iframeWin.postMessage(pageData, this.ifreamSrc)
       }, 1000)
@@ -961,10 +966,10 @@ export default {
         this.objVal(this.viceJson, JSON.parse(this.form.productJson).viceProduct)
         this.objVal(this.otherJson, JSON.parse(this.form.otherJson))
         this.viceProductId = this.form.viceProductIds[0]
+        this.unsubscribeStrategyIds = this.form.unsubscribeStrategyIds[0]
         if (this.productJson.jsonImg !== '' && this.viceJson.jsonImg !== '') {
           this.svgClick('all')
         }
-
         if (this.$route.query.copy) {
           this.form.strategyName = this.form.strategyName + '-复制'
         }
@@ -972,6 +977,7 @@ export default {
           this.preview()
         }, 1000)
       })
+
     },
     // 获取新策略列表
     getStrategyList () {
@@ -1059,17 +1065,23 @@ export default {
       if (e) {
         this.form.viceProductIds = []
         this.form.viceProductIds.push(e)
-        console.log(this.form.viceProductIds)
       } else {
         this.form.viceProductIds = []
       }
     },
     recommendChnage (e) {
-      console.log(e)
       if (!e) {
         this.form.recommendStrategyIds = []
       }
     },
+    unChange (e) {
+      if (e) {
+        this.form.unsubscribeStrategyIds = []
+        this.form.unsubscribeStrategyIds.push(e)
+      } else {
+        this.form.unsubscribeStrategyIds = []
+      }
+    },
     // 主产品  新增  编辑
     productClick (val) {
       if (val === 'edit') {