Pārlūkot izejas kodu

Merge branch 'new' of http://git.platomix.net/litong/purchase into new

yangfan 2 gadi atpakaļ
vecāks
revīzija
25db8ac738

+ 7 - 0
purchase_H5/src/api/index.js

@@ -265,4 +265,11 @@ export const sftpGet = data => request({
 export const strategytemplate = id => request({
   url: '/strategytemplate/' + id,
   method: 'post'
+})
+
+//新版策略匹配 高级+基础 /h5/matchstrategy/
+export const newStrategy = data => request({
+  url: '/matchstrategy/',
+  method: 'post',
+  data
 })

+ 17 - 7
purchase_H5/src/components/repeatModal.vue

@@ -20,6 +20,7 @@
 import {
   strategyGetID,
   detMainProduct,
+  strategytemplate
 } from "../api";
 export default {
   data () {
@@ -42,13 +43,22 @@ export default {
   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
+      if (this.pageData.channl.edition !== 1) {
+        let productId = await strategyGetID({
+          id: this.pageData.remarks.orderRepeat,
+        });
+        let res = await detMainProduct({
+          productId: productId.data.primaryProductId,
+        });
+        this.repeatText = res.data.productName
+      } else {
+        let productId = await strategytemplate(this.pageData.remarks.orderRepeat);
+        let res = await detMainProduct({
+          productId: productId.data.primaryProductId,
+        });
+        this.repeatText = res.data.productName
+      }
+
     }
 
   },

+ 50 - 87
purchase_H5/src/components/unbuyModal.vue

@@ -7,45 +7,26 @@
         <div class="body-box">
           <div class="input-box">
             <div class="input">
-              <input
-                type="text"
-                v-model="loginForm.phone"
-                placeholder="手机号码"
-              />
+              <input type="text" v-model="loginForm.phone" placeholder="手机号码" />
             </div>
           </div>
           <div class="input-box">
             <div class="input">
-              <input
-                type="text"
-                v-model="loginForm.vcode"
-                v-on:input="checkVcode"
-                placeholder="验证码"
-              />
+              <input type="text" v-model="loginForm.vcode" v-on:input="checkVcode" placeholder="验证码" />
             </div>
-            <div
-              :class="{ code: 1, number: codeState.state }"
-              @click="getCode()"
-            >
+            <div :class="{ code: 1, number: codeState.state }" @click="getCode()">
               {{ codeState.state ? codeState.time + "s" : "获取验证码" }}
             </div>
           </div>
           <div class="input-box">
-            <div
-              class="input"
-              style="
+            <div class="input" style="
                 text-overflow: ellipsis;
                 overflow: hidden;
                 white-space: nowrap;
-              "
-            >
+              ">
               {{ radio === "0" ? "退订原因" : reason }}
             </div>
-            <div
-              class="code"
-              style="color: #d6000f; text-align: end"
-              @click="showSheet = true"
-            >
+            <div class="code" style="color: #d6000f; text-align: end" @click="showSheet = true">
               请选择
             </div>
           </div>
@@ -60,44 +41,25 @@
       </div>
     </van-overlay>
     <vue-puzzle :show="showVcode" @success="onSuccessCode()"></vue-puzzle>
-    <van-action-sheet
-      lock-scroll
-      close-on-popstate
-      v-model="showSheet"
-      title="退订原因"
-      @close="closeSheet"
-    >
+    <van-action-sheet lock-scroll close-on-popstate v-model="showSheet" title="退订原因" @close="closeSheet">
       <van-radio-group v-model="radio">
         <van-cell-group>
-            <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-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="2"
-            autosize
-            type="textarea"
-            placeholder="请描述原因,如遇到其他问题请反馈给我们"
-            show-word-limit
-          />
+          <van-field v-model="message" rows="2" autosize type="textarea" placeholder="请描述原因,如遇到其他问题请反馈给我们" show-word-limit />
         </div>
         <!--        <div-->
         <!--          v-if=" radio === '3'"-->
@@ -129,7 +91,7 @@ export default {
     vuePuzzle,
     Notify,
   },
-  data() {
+  data () {
     return {
       loginForm: {
         phone: "",
@@ -148,49 +110,50 @@ export default {
       reason: "",
       resonList: [
         {
-          title: "流量无法激活",
+          title: "价格太贵",
           value: "1",
         },
         {
-          title: "会员无法领取",
+          title: "误点误操作",
           value: "2",
         },
         {
           title: "最近不用客户端",
           value: "3",
         },
-          {
-              title: "流量用不完",
-              value: "4",
-          },
-          {
-              title: "价格太贵",
-              value: "5",
-          },
-          {
-              title: "误点误操作",
-              value: "6",
-          },
-          {
-              title: "其他",
-              value: "7",
-          },
+        {
+          title: "流量用不完",
+          value: "4",
+        },
+        {
+
+          title: "流量无法激活",
+          value: "5",
+        },
+        {
+          title: "会员无法领取",
+          value: "6",
+        },
+        {
+          title: "其他",
+          value: "7",
+        },
       ],
     };
   },
   methods: {
-    closeUnbuy() {
+    closeUnbuy () {
       this.reason = "";
       this.message = "";
       this.radio = "0";
       this.$emit("change", false);
     },
-    checkVcode() {
+    checkVcode () {
       if (this.loginForm.vcode.length > 6) {
         this.loginForm.vcode = this.loginForm.vcode.slice(0, 6);
       }
     },
-    getCode() {
+    getCode () {
       if (this.codeState.state) return;
       let { phone } = this.loginForm;
       if (!/^1[23456789]\d{9}$/.test(phone)) {
@@ -198,7 +161,7 @@ export default {
       }
       this.showVcode = true;
     },
-    onSuccessCode() {
+    onSuccessCode () {
       this.showVcode = false;
       let { phone } = this.loginForm;
       getCode({
@@ -223,7 +186,7 @@ export default {
         }
       );
     },
-    unbuy() {
+    unbuy () {
       let { phone, vcode } = this.loginForm;
       if (!vcode) {
         return this.$toast("请输入验证码");
@@ -260,7 +223,7 @@ export default {
             type: "1",
             userid: this.$store.state.user.userid,
           };
-        await this.postReson(res.data.userid,phone);
+          await this.postReson(res.data.userid, phone);
           postBuy(updata).then(
             (res) => {
               if (res.code === 10000) {
@@ -287,7 +250,7 @@ export default {
         }
       });
     },
-    closeSheet() {
+    closeSheet () {
       if (this.radio !== "0" && this.reason !== "") {
         this.showSheet = false;
       } else {
@@ -297,7 +260,7 @@ export default {
         this.totasShow = false;
       }
     },
-    sureClick() {
+    sureClick () {
       if (this.radio !== "0") {
         this.reason = this.resonList.find((item) => {
           if (item.value === this.radio) {
@@ -327,16 +290,16 @@ export default {
         // }
       }
     },
-    postReson(userid,phone) {
+    postReson (userid, phone) {
       // let {userid , phone} = this.$store.state.users
       let feedBack = {
         phone: phone,
         content: "",
-        reason:"",
+        reason: "",
         channelName: this.pageData.channl.channelName,
         productName: this.pageData.mainProduct.productName,
         spid: this.pageData.mainProduct.spid,
-        userid:userid
+        userid: userid
       };
       let msg = "";
       this.resonList.forEach((item) => {

BIN
purchase_H5/src/templates/assets/fankui.png


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

@@ -79,11 +79,11 @@
 
     @keyframes scale1 {
       from {
-        transform: scaleX(1.1);
+        transform: scale(1.1);
       }
 
       to {
-        transform: scaleX(1);
+        transform: scale(1);
       }
     }
 

+ 16 - 7
purchase_H5/src/templates/templateColor/index.vue

@@ -80,6 +80,10 @@
         <img src="../assets/guanzhu.png" alt="" />
         <div>剩余流量查询</div>
       </div>
+      <div class="tab" v-if="pageData.remarks.guanzhuBtn ==='1'" @click="toPhone()">
+        <img src="../assets/fankui.png" alt="" />
+        <div>一键反馈</div>
+      </div>
       <div class="tab" v-if="pageData.remarks.tuidingBtn === '1'" @click="beforeLogin('unBUy')">
         <img src="../assets/tuiding.png" alt="" />
         <div>退订产品</div>
@@ -214,6 +218,11 @@ export default {
     this.callSvg()
   },
   methods: {
+    // 一键拨号反馈
+    toPhone () {
+      let phone = 4000600611
+      window.location.href = "tel://" + phone;
+    },
     extendClick () {
       if (
         this.pageData.remarks.extendVal &&
@@ -278,7 +287,7 @@ export default {
             this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
             this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
           ) {
-            if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+            if (this.pageData.channl.edition && this.pageData.channl.edition === 1) {
               let productId = await strategytemplate({
                 id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
               });
@@ -311,7 +320,7 @@ export default {
           this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
           this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
         ) {
-          if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+          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,
@@ -380,7 +389,7 @@ export default {
     // 推荐产品跳转
     recommend (val) {
       let edition = this.$store.state.pageData.channl.edition
-      if (edition && edition === '1') {
+      if (edition && edition === 1) {
         strategytemplate(val).then(async res => {
           let info = await detMainProduct({
             productId: res.data.primaryProductId,
@@ -445,10 +454,10 @@ export default {
           let pageData = {
             mainProduct: mainProduct,
             channl: {
-              channelKey: "464c87375658",
-              channelName: "新策略H5整合测试",
-              fullCode: "173966823233",
-              edition: "1"
+              channelKey: this.pageData.channl.channelKey,
+              channelName: this.pageData.channl.channelName,
+              fullCode: this.pageData.channl.fullCode,
+              edition: this.pageData.channl.edition,
             },
             recommend: recommend,
             remarks: JSON.parse(res.data.extJson), //策略信息

+ 19 - 16
purchase_H5/src/templates/templateCom/index.vue

@@ -77,6 +77,10 @@
         <img src="../assets/guanzhu.png" alt="" />
         <div>剩余流量查询</div>
       </div>
+      <div class="tab" v-if="pageData.remarks.guanzhuBtn ==='1'" @click="toPhone()">
+        <img src="../assets/fankui.png" alt="" />
+        <div>一键反馈</div>
+      </div>
       <div class="tab" v-if="pageData.remarks.tuidingBtn === '1'" @click="beforeLogin('unBUy')">
         <img src="../assets/tuiding.png" alt="" />
         <div>退订产品</div>
@@ -126,7 +130,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>
 
@@ -216,6 +220,11 @@ export default {
     this.callSvg()
   },
   methods: {
+    // 一键拨号反馈
+    toPhone () {
+      let phone = 4000600611
+      window.location.href = "tel://" + phone;
+    },
     extendClick () {
       if (this.pageData.remarks.extendVal && this.pageData.remarks.extendVal === "1") {
         if (this.isBuy === "未订购") {
@@ -273,11 +282,8 @@ export default {
           this.toLink(type);
         } else if (type === "unBUy") {
           addR.unBuyClick();
-          if (
-            this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
-            this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
-          ) {
-            if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+          if (this.pageData.strategyInfo.unsubscribeStrategyList !== null && this.pageData.strategyInfo.unsubscribeStrategyList.length > 0) {
+            if (this.pageData.channl.edition && this.pageData.channl.edition === 1) {
               let productId = await strategytemplate({
                 id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
               });
@@ -305,11 +311,8 @@ export default {
         }
       } else if (type === "unBUy") {
         addR.unBuyClick();
-        if (
-          this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
-          this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
-        ) {
-          if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+        if (this.pageData.strategyInfo.unsubscribeStrategyList !== null && this.pageData.strategyInfo.unsubscribeStrategyList.length > 0) {
+          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,
@@ -375,7 +378,7 @@ export default {
     // 推荐产品跳转
     recommend (val) {
       let edition = this.$store.state.pageData.channl.edition
-      if (edition && edition === '1') {
+      if (edition && edition === 1) {
         strategytemplate(val).then(async res => {
           let info = await detMainProduct({
             productId: res.data.primaryProductId,
@@ -440,10 +443,10 @@ export default {
           let pageData = {
             mainProduct: mainProduct,
             channl: {
-              channelKey: "464c87375658",
-              channelName: "新策略H5整合测试",
-              fullCode: "173966823233",
-              edition: "1"
+              channelKey: this.pageData.channl.channelKey,
+              channelName: this.pageData.channl.channelName,
+              fullCode: this.pageData.channl.fullCode,
+              edition: this.pageData.channl.edition,
             },
             recommend: recommend,
             remarks: JSON.parse(res.data.extJson), //策略信息

+ 17 - 8
purchase_H5/src/templates/templateTogether-Col/index.vue

@@ -66,6 +66,10 @@
         <img src="../assets/guanzhu.png" alt="" />
         <div>剩余流量查询</div>
       </div>
+      <div class="tab" v-if="pageData.remarks.guanzhuBtn ==='1'" @click="toPhone()">
+        <img src="../assets/fankui.png" alt="" />
+        <div>一键反馈</div>
+      </div>
       <div class="tab" v-if="pageData.remarks.tuidingBtn === '1'" @click="beforeLogin('unBUy')">
         <img src="../assets/tuiding.png" alt="" />
         <div>退订产品</div>
@@ -196,12 +200,17 @@ export default {
     this.callSvg()
   },
   methods: {
+    // 一键拨号反馈
+    toPhone () {
+      let phone = 4000600611
+      window.location.href = "tel://" + phone;
+    },
     async productClick (id, index) {
       this.indexNum = -1
       setTimeout(() => {
         this.indexNum = index;
       }, 1)
-      if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+      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
@@ -388,7 +397,7 @@ export default {
             this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
             this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
           ) {
-            if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+            if (this.pageData.channl.edition && this.pageData.channl.edition === 1) {
               let productId = await strategytemplate({
                 id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
               });
@@ -420,7 +429,7 @@ export default {
           this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
           this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
         ) {
-          if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+          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,
@@ -490,7 +499,7 @@ export default {
     recommend (val) {
       // this.$store.commit("setTempName", "loading");
       let edition = this.$store.state.pageData.channl.edition
-      if (edition && edition === '1') {
+      if (edition && edition === 1) {
         strategytemplate(val).then(async res => {
           let info = await detMainProduct({
             productId: res.data.primaryProductId,
@@ -555,10 +564,10 @@ export default {
           let pageData = {
             mainProduct: mainProduct,
             channl: {
-              channelKey: "464c87375658",
-              channelName: "新策略H5整合测试",
-              fullCode: "173966823233",
-              edition: "1"
+              channelKey: this.pageData.channl.channelKey,
+              channelName: this.pageData.channl.channelName,
+              fullCode: this.pageData.channl.fullCode,
+              edition: this.pageData.channl.edition,
             },
             recommend: recommend,
             remarks: JSON.parse(res.data.extJson), //策略信息

+ 19 - 10
purchase_H5/src/templates/templateTogether/index.vue

@@ -62,7 +62,7 @@
         pageData.remarks.attestation === 3 ||
         pageData.remarks.attestation === 4 ||
         pageData.remarks.attestation === 5
-      " @btnClick="btnUnify" :pageData="pageData" :isBuy="isBuy" @hideClick="showConceal = true" @ruleClick="ruleClick" @toBuy="toBuy" @toNewBuy="toNewBuy" :indexNum="indexNum" >
+      " @btnClick="btnUnify" :pageData="pageData" :isBuy="isBuy" @hideClick="showConceal = true" @ruleClick="ruleClick" @toBuy="toBuy" @toNewBuy="toNewBuy" :indexNum="indexNum">
     </unify-modal>
     <div v-if="pageData.remarks.attestation !== 3 &&pageData.remarks.attestation !== 4 && pageData.remarks.attestation !== 5">
       <div class="privacyBox">
@@ -121,6 +121,10 @@
         <img src="../assets/guanzhu.png" alt="" />
         <div>剩余流量查询</div>
       </div>
+      <div class="tab" v-if="pageData.remarks.guanzhuBtn ==='1'" @click="toPhone()">
+        <img src="../assets/fankui.png" alt="" />
+        <div>一键反馈</div>
+      </div>
       <div class="tab" v-if="pageData.remarks.tuidingBtn === '1'" @click="beforeLogin('unBUy')">
         <img src="../assets/tuiding.png" alt="" />
         <div>退订产品</div>
@@ -288,6 +292,11 @@ export default {
     this.callSvg()
   },
   methods: {
+    // 一键拨号反馈
+    toPhone () {
+      let phone = 4000600611
+      window.location.href = "tel://" + phone;
+    },
     extendClick () {
       if (this.pageData.remarks.extendVal && this.pageData.remarks.extendVal === "1") {
         if (this.isBuy === "未订购") {
@@ -329,7 +338,7 @@ export default {
       setTimeout(() => {
         this.indexNum = index;
       }, 1)
-      if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+      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
@@ -365,7 +374,7 @@ export default {
               p: viceProduct.explainImg
             },
             id: info.data.primaryProductId,
-            isCompositeProduct: 0,   //是否复合产品
+            isCompositeProduct: info.data.isCompositeProduct,   //是否复合产品
             logoPic: mainJson.logoPic,
             manualInfo: info.data.manualInfo,
             memberName: info.data.memberName,
@@ -521,7 +530,7 @@ export default {
             this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
             this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
           ) {
-            if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+            if (this.pageData.channl.edition && this.pageData.channl.edition === 1) {
               let productId = await strategytemplate({
                 id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
               });
@@ -553,7 +562,7 @@ export default {
           this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
           this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
         ) {
-          if (this.pageData.channl.edition && this.pageData.channl.edition === '1') {
+          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,
@@ -618,7 +627,7 @@ export default {
     recommend (val) {
       // this.$store.commit("setTempName", "loading");
       let edition = this.$store.state.pageData.channl.edition
-      if (edition && edition === '1') {
+      if (edition && edition === 1) {
         strategytemplate(val).then(async res => {
           let info = await detMainProduct({
             productId: res.data.primaryProductId,
@@ -683,10 +692,10 @@ export default {
           let pageData = {
             mainProduct: mainProduct,
             channl: {
-              channelKey: "464c87375658",
-              channelName: "新策略H5整合测试",
-              fullCode: "173966823233",
-              edition: "1"
+              channelKey: this.pageData.channl.channelKey,
+              channelName: this.pageData.channl.channelName,
+              fullCode: this.pageData.channl.fullCode,
+              edition: this.pageData.channl.edition,
             },
             recommend: recommend,
             remarks: JSON.parse(res.data.extJson), //策略信息

+ 123 - 129
purchase_H5/src/views/index.vue

@@ -5,30 +5,29 @@
 </template>
 <script>
 import {
-  strategyGet,
   detMainProduct,
   channelGet,
   strategyGetNew,
   strategyGetID,
-  getstrategyglobal,
-  seniorStrategy,
+  newStrategy,
+  strategytemplate
 } from "../api";
 import MgtvApi from "@/util/mgTvJssdk.js";
 import { getWxCode } from "../api/wx";
 import util from "../util";
 export default {
   name: "home",
-  data() {
+  data () {
     return {
       imgUrl: process.env.VUE_APP_IMGS_URL,
     };
   },
   computed: {
-    user() {
+    user () {
       return this.$store.state.user;
     },
   },
-  created() {
+  created () {
     let channelKey = this.$route.params.key;
     channelGet({
       channelKey: channelKey,
@@ -59,9 +58,9 @@ export default {
               obj.push(item.number);
             }
           });
-        this.$store.commit("setGlobal", obj.join(','));
+          this.$store.commit("setGlobal", obj.join(','));
         }
-        if (res.data.channelPattern === "1") {
+        if (res.data.onOffStatus !== 1) {
           if (res.data.channelStatus === 0) {
             this.$router.push("servicing");
             return false;
@@ -79,14 +78,14 @@ export default {
             );
           }
         } else {
-          this.onload(channelKey, res.data.fullCode);
+          this.onload(channelKey, res.data.fullCode, res.data.onOffStatus);
         }
       } else {
         this.$router.push("servicing");
       }
     });
   },
-  beforeRouteUpdate(to, from, next) {
+  beforeRouteUpdate (to, from, next) {
     next();
     let channelKey = this.$route.params.key;
     channelGet({
@@ -110,7 +109,7 @@ export default {
           this.createJs(list.point);
         }
       }
-      if (res.data.channelPattern === "1") {
+      if (res.data.onOffStatus !== 1) {
         if (res.data.channelStatus === 0) {
           this.$router.push("servicing");
           return false;
@@ -123,13 +122,12 @@ export default {
           );
         }
       } else {
-        this.onload(channelKey, res.data.fullCode);
+        this.onload(channelKey, res.data.fullCode, res.data.onOffStatus);
       }
     });
   },
   methods: {
-    onload(channelKey) {
-      // this.$store.commit("setTempName", "loading");
+    onload (channelKey, fullCode, edition) {
       if (channelKey) {
         localStorage.setItem("key", channelKey);
       } else {
@@ -137,47 +135,121 @@ export default {
         return false;
       }
       let userid = this.user.userid;
-      // if (userid) VuePageVisitor.setMp(this.user.phone);
-      strategyGet({
-        channelKey,
-      }).then(async (res) => {
+      let anonymousId = this.$sensors.store._state.$device_id;
+      let params = {
+        anonymousId: anonymousId,
+        channelKey: channelKey,
+        location: "",
+      }
+      newStrategy(params).then(async (res) => {
         let data = res.data;
-        if (data.id === null) {
-          this.$toast.fail("当前页面无效");
-          return false;
-        }
         if (userid) {
           this.$sensors.login(userid);
         }
         this.$sensors.registerPage({
-          attr2: data.strategyDetailVOList[0].templateCode,
+          attr2: data.templateCode,
           attr3: "订购页",
         });
-        // localStorage.setItem("beCome", "订购页");
-        let mainProduct = data.strategyDetailVOList[0];
-        if (!mainProduct.primaryProductInfo) {
-          let res = await this.getPorduct(mainProduct.primaryProductId);
-          mainProduct.primaryProductInfo = res.data;
+        let info = await detMainProduct({ productId: data.primaryProductId })
+        // console.log(info)
+        let productJson = JSON.parse(data.productJson)
+        let mainJson = productJson.product;
+        let viceJson = productJson.viceProduct ? productJson.viceProduct : ''
+        let mainProduct = {
+          activeType: 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: info.data.isCompositeProduct,   //是否复合产品
+          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],
+        }
+        mainProduct.primaryProductInfo = info.data;
+        let recommend = [];
+        if (data.recommendStrategyIds.length > 0 && data.recommendStrategyIds) {
+          data.recommendStrategyIds.forEach(async val => {
+            let list = await strategytemplate(val)
+            recommend.push(list.data);
+          });
         }
         let pageData = {
-          mainProduct: mainProduct.primaryProductInfo,
+          mainProduct: mainProduct,
           channl: {
-            fullCode: data.fullCode,
+            fullCode: fullCode,
             channelKey: channelKey,
+            edition: edition
           },
-          recommend: data.strategyDetailVOList[0].recommendProductVOList,
-          remarks: {
-            isZezhao: mainProduct.remark1,
-            zhezhao: mainProduct.remark2,
-            unBuyText: mainProduct.remark3, //退订弹窗文案
-            btnText: mainProduct.remark4, //订购按钮文案
-            isBuy: mainProduct.remark5, //订购开启0/关闭1
-          },
+          recommend: recommend,
+          remarks: JSON.parse(data.extJson),
+          viceJson: viceJson, //副产品json
+          mainJson: productJson,
+          otherJson: data.otherJson, //备用json
+          strategyInfo: {
+            activityLogo: data.activityLogo,
+            activityType: data.activityType,
+            directCharge: null,
+            extJson: data.extJson,
+            id: null,
+            linkUrl: data.linkUrl,
+            maskText: data.maskText,
+            posterPhoto: data.posterPhoto,
+            primaryProductId: data.primaryProductId,
+            primarySpid: null,
+            productInfo: [],
+            promotePhoto: data.promotePhoto,
+            strategyName: data.strategyName,
+            strategyStatus: data.strategyStatus,
+            strategyType: data.strategyType,
+            templateCode: data.templateCode,
+            templateId: data.templateId,
+            templateName: "",
+            recommendStrategyList: data.recommendStrategyIds,
+            unsubscribeStrategyList: data.unsubscribeStrategyIds,
+            viceProductStrategyList: data.viceProductIds,
+          }
         };
-        if (
-          window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i) ==
-          "micromessenger"
-        ) {
+        this.$store.commit("setPageData", pageData);
+        if (window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger") {
           let banners = pageData.mainProduct.bannerPics[0];
           let img = pageData.mainProduct.logoPic
             ? this.imgUrl + pageData.mainProduct.logoPic
@@ -188,28 +260,16 @@ export default {
             : "联通畅视流量包";
           getWxCode(pageData.mainProduct.productName, img, url, desc);
         }
-        document.title = mainProduct.primaryProductInfo.productName;
+        document.title = mainProduct.pageTitle;
         if (navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
-          // const hackIframe = document.createElement("iframe");
-          // hackIframe.style.display = "none";
-          // hackIframe.src = "https://operation.mige.tv/a/mgTitle.html";
-          // document.body.appendChild(hackIframe);
-          // setTimeout((_) => {
-          //   document.body.removeChild(hackIframe);
-          // }, 300);
           MgtvApi.setWebviewTitle({
-            title: mainProduct.primaryProductInfo.productName,
+            title: mainProduct.pageTitle,
           });
         }
-        this.$store.commit("setPageData", pageData);
-        this.$store.commit(
-          "setTempName",
-          data.strategyDetailVOList[0].templateCode
-        );
-        // this.tempName = data.strategyDetailVOList[0].templateCode;
+        this.$store.commit("setTempName", data.templateCode);
       });
     },
-    onloadNew(channelKey, id, channelName, fullCode) {
+    onloadNew (channelKey, id, channelName, fullCode) {
       document.body.style.height = document.documentElement.clientHeight + "px";
       // this.$store.commit("setTempName", "loading");
       if (channelKey) {
@@ -258,27 +318,12 @@ export default {
               });
             }
             let recommend = [];
-            if (
-              data[0].recommendStrategyList !== null &&
-              data[0].recommendStrategyList.length > 0
-            ) {
+            if (data[0].recommendStrategyList !== null && data[0].recommendStrategyList.length > 0) {
               for (let i = 0; i < data[0].recommendStrategyList.length; i++) {
-                let list = await strategyGetID(
-                  {
-                    id: data[0].recommendStrategyList[i],
-                  },
-                  true
-                );
+                let list = await strategyGetID({ id: data[0].recommendStrategyList[i] }, true);
                 recommend.push(list.data);
               }
             }
-            let params = {
-              anonymousId: anonymousId,
-              channleKey: channelKey,
-              spId: data[0].productInfo.spid,
-              userId: localStorage.getItem("userid"),
-            };
-            let item = await seniorStrategy(params);
             let pageData = {
               mainProduct: data[0].productInfo,
               strategyInfo: data[0],
@@ -290,49 +335,6 @@ export default {
               },
               recommend: recommend,
             };
-
-            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((val) => {
-                  strategyGetID(
-                    {
-                      id: val,
-                    },
-                    true
-                  ).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(",");
-              }
-            }
-
             document.title = pageData.mainProduct.productName;
             if (
               window.navigator.userAgent
@@ -363,14 +365,6 @@ export default {
             }
             this.$store.commit("setPageData", pageData);
             this.$store.commit("setTempName", data[0].templateCode);
-            if (item.data !== null) {
-              if (
-                item.data.templateName !== "" &&
-                item.data.templateName !== null
-              ) {
-                this.$store.commit("setTempName", item.data.templateName);
-              }
-            }
           } else {
             this.$toast.fail("当前策略未生效");
           }
@@ -383,13 +377,13 @@ export default {
           // }, 1500);
         });
     },
-    getPorduct(productId) {
+    getPorduct (productId) {
       return detMainProduct({
         productId: productId,
       });
     },
     // 外部js
-    createJs(num) {
+    createJs (num) {
       if (num === 0) {
         //判定是否开启拦截用户中心埋点js创建
         let script = document.createElement("script");
@@ -415,7 +409,7 @@ export default {
       document.body.appendChild(script5);
     },
     // 埋点
-    buriedPoint() {
+    buriedPoint () {
       let { mappid } = util.query2obj(location.search);
       let beCome = this.$route.query.become;
       if (mappid) {

+ 1 - 1
purchase_H5/src/views/indexMobile.vue

@@ -98,7 +98,7 @@ export default {
             channelKey: "464c87375658",
             channelName: "新策略H5整合测试",
             fullCode: "173966823233",
-            edition: "1"
+            edition: 1
           },
           recommend: recommend,
           remarks: data.extJson, //策略信息

+ 309 - 239
purchase_ao/src/views/schemeV2/channelEdit.vue

@@ -8,8 +8,7 @@
               <el-input placeholder="请输入内容" v-model="form.channelName" clearable @change="changeInputer"></el-input>
             </el-form-item>
             <el-form-item label="一级渠道">
-              <el-select v-model="form.parentId" filterable remote reserve-keyword placeholder="请输入关键词"
-                :remote-method="remoteMethod" :loading="loading">
+              <el-select v-model="form.parentId" filterable remote reserve-keyword placeholder="请输入关键词" :remote-method="remoteMethod" :loading="loading">
                 <el-option v-for="item in options" :key="item.id" :label="item.channelName" :value="item.id">
                 </el-option>
               </el-select>
@@ -31,36 +30,39 @@
             </el-form-item>
             <el-form-item label="上线时间">
               <el-col :span="11">
-                <el-date-picker type="datetime" placeholder="选择日期" v-model="form.onlineTime" start-placeholder="开始日期"
-                  end-placeholder="结束日期" range-separator="至" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%;">
+                <el-date-picker type="datetime" placeholder="选择日期" v-model="form.onlineTime" start-placeholder="开始日期" end-placeholder="结束日期" range-separator="至" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%;">
                 </el-date-picker>
               </el-col>
             </el-form-item>
+            <el-form-item label="策略类型">
+              <el-radio @change="radioClick(1)" v-model="form.onOffStatus" :label="1">新策略</el-radio>
+              <el-radio @change="radioClick(2)" v-model="form.onOffStatus" :label="2">旧策略</el-radio>
+            </el-form-item>
 
-            <el-form-item label="绑定策略" prop="strategyId">
-              <el-select v-model="form.strategyId" filterable remote reserve-keyword placeholder="请输入关键词"
-                :remote-method="remoteMethodstrategyId" :loading="loading">
+            <el-form-item v-if="form.onOffStatus!==0" label="绑定策略" prop="strategyId">
+              <el-select v-model="form.strategyId" filterable clearable  placeholder="请选择策略" :loading="loading">
                 <el-option v-for="item in celueList" :key="item.id" :label="item.strategyName" :value="item.id">
                 </el-option>
               </el-select>
               <span style="margin-left: 20px">
-                <vxe-button @click="refresh" icon="el-icon-refresh" size="mini" content="刷新"></vxe-button>
+                <vxe-button @click="refreshClick" icon="el-icon-refresh" size="mini" content="刷新"></vxe-button>
               </span>
               <span style="margin-left: 20px">
                 <vxe-button @click="toAdd" icon="el-icon-plus" size="mini" content="新建"></vxe-button>
               </span>
-              <span style="margin-left: 20px">
+              <span v-if="form.strategyId" style="margin-left: 20px">
                 <vxe-button @click="toEdit(form.strategyId)" icon="el-icon-edit" size="mini" content="编辑"></vxe-button>
               </span>
             </el-form-item>
+            <el-form-item label="高级策略">
+              <el-select filterable clearable placeholder="高级策略" v-model="form.adStrategyId">
+                <el-option v-for="item in adStrategyList" :label="item.name" :key="item.id" :value="item.id"></el-option>
+              </el-select>
+            </el-form-item>
             <el-form-item label="生效状态">
               <el-radio v-model="form.channelStatus" :label="0">失效</el-radio>
               <el-radio v-model="form.channelStatus" :label="1">生效</el-radio>
             </el-form-item>
-            <el-form-item label="渠道形态">
-              <el-radio v-model="form.channelPattern" label="0">V1</el-radio>
-              <el-radio v-model="form.channelPattern" label="1">V2</el-radio>
-            </el-form-item>
             <!-- <el-form-item label="开启WO186域名">
               <el-radio v-model="form.wotv" label="0">关闭</el-radio>
               <el-radio v-model="form.wotv" label="1">开启</el-radio>
@@ -72,8 +74,6 @@
           </el-form>
         </template>
 
-
-
         <template v-else>
           <el-form ref="form" :model="form" :rules="rules" label-width="160px">
             <el-form-item label="渠道名称" prop="channelName">
@@ -84,8 +84,7 @@
             </el-form-item>
             <el-form-item label="上线时间">
               <el-col :span="11">
-                <el-date-picker type="datetime" placeholder="选择日期" v-model="form.onlineTime" start-placeholder="开始日期"
-                  end-placeholder="结束日期" range-separator="至" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%;">
+                <el-date-picker type="datetime" placeholder="选择日期" v-model="form.onlineTime" start-placeholder="开始日期" end-placeholder="结束日期" range-separator="至" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%;">
                 </el-date-picker>
               </el-col>
             </el-form-item>
@@ -120,268 +119,339 @@
 </template>
 
 <script>
-  import {
-    post,
-    get
-  } from '@/api/common'
-  import XEUtils from 'xe-utils'
-  var text = '';
-  export default {
-    name: 'SchemeEdit',
-    data() {
-      return {
-        form: {
-          channelPattern: '1',
-          channelStatus: 1
-        },
-        oldform: {},
-        id: null,
+import {
+  post,
+  get
+} from '@/api/common'
+import XEUtils from 'xe-utils'
+var text = '';
+export default {
+  name: 'SchemeEdit',
+  data () {
+    return {
+      // 高级策略列表
+      adStrategyList: [],
+      form: {
+        channelPattern: '1',
+        channelStatus: 1,
+        onOffStatus: 0,
+        adStrategyId: "",
+        strategyId:""
+      },
+      oldform: {},
+      id: null,
 
-        options: [],
-        loading: false,
+      options: [],
+      loading: false,
 
-        celueList: [],
+      celueList: [],
 
-        typeList: [{
-            value: '集团渠道',
-            label: '集团渠道'
-          },
-          {
-            value: '省分线下渠道',
-            label: '省分线下渠道'
-          },
-          {
-            value: '省分线上渠道',
-            label: '省分线上渠道'
-          },
-          {
-            value: '互联网渠道',
-            label: '互联网渠道'
-          },
-          {
-            value: '自有线上渠道',
-            label: '自有线上渠道'
-          },
-          {
-            value: '社会代理和其他渠道',
-            label: '社会代理和其他渠道'
-          }
-        ],
+      typeList: [{
+        value: '集团渠道',
+        label: '集团渠道'
+      },
+      {
+        value: '省分线下渠道',
+        label: '省分线下渠道'
+      },
+      {
+        value: '省分线上渠道',
+        label: '省分线上渠道'
+      },
+      {
+        value: '互联网渠道',
+        label: '互联网渠道'
+      },
+      {
+        value: '自有线上渠道',
+        label: '自有线上渠道'
+      },
+      {
+        value: '社会代理和其他渠道',
+        label: '社会代理和其他渠道'
+      }
+      ],
 
-        rules: {
-          channelName: [{
-            required: true,
-            message: '请输入渠道名称',
-            trigger: 'blur'
-          }]
-        },
-        ruless: {
-          channelName: [{
-            required: true,
-            message: '请输入渠道名称',
-            trigger: 'blur'
-          }],
-          strategyId: [{
-            required: true,
-            message: '请选择渠道名称',
-            trigger: 'change'
-          }],
-          channelType: [{
-            required: true,
-            message: '请选择渠道类型',
-            trigger: 'change'
-          }]
+      rules: {
+        channelName: [{
+          required: true,
+          message: '请输入渠道名称',
+          trigger: 'blur'
+        }]
+      },
+      ruless: {
+        channelName: [{
+          required: true,
+          message: '请输入渠道名称',
+          trigger: 'blur'
+        }],
+        strategyId: [{
+          required: true,
+          message: '请选择渠道名称',
+          trigger: 'change'
+        }],
+        channelType: [{
+          required: true,
+          message: '请选择渠道类型',
+          trigger: 'change'
+        }]
+
+      }
+    }
+  },
+  created () {
+    document.title = '新增渠道'
+    let that = this
+    this.id = this.$route.query.id
+    if (this.id) {
+      get('/channelInfo/detail', {
+        'id': this.id
+      }).then(res => {
+        that.oldform = JSON.parse(JSON.stringify(res.data))
+        if (this.$route.query.type == 'erji') {
+          this.oldchannelName = that.oldform.channelName
+          delete this.form.id
+          delete this.form.channelName
+          delete this.form.channelKey
+          delete this.form.fullCode
+          delete this.form.channelCode
+          this.form.parentId = this.id * 1
+        } else {
+          this.form = res.data
+          if (this.form.onOffStatus === 1) {
+            get('/strategytemplate/list', {
+              pageNum: 1,
+              pageSize: 99999,
+            }).then(res => {
+              this.celueList = res.data.list
+            })
+          } else {
+            this.refresh()
+          }
 
         }
+      })
+
+    }
+    // 获取一级渠道列表
+    get('/channelInfo/page', {
+      parentId: 0,
+      'pageSize': 9999,
+      'pageNum': 1
+    }).then(res => {
+      this.options = res.data.list
+    })
+  },
+  mounted () {
+    this.getAdStrategyidList()
+  },
+  methods: {
+    // 获取高级策略列表
+    getAdStrategyidList () {
+      get('/strategysenior/list', { pageNum: 1, pageSize: 99999 }).then(res => {
+        this.adStrategyList = res.data.list
+      })
+    },
+    // 刷新策略列表
+    refreshClick () {
+      if (this.form.onOffStatus === 1) {
+        get('/strategytemplate/list', {
+          pageNum: 1,
+          pageSize: 99999,
+        }).then(res => {
+          this.celueList = res.data.list
+        })
+      } else {
+        this.refresh()
       }
     },
-    created() {
-      document.title = '新增渠道'
-      let that = this
-      this.id = this.$route.query.id
-      if (this.id) {
-        get('/channelInfo/detail', {
-          'id': this.id
+    // 切换新旧策略
+    radioClick (num) {
+      this.form.strategyId = ''
+      if (num === 2) {
+        this.refresh()
+      } else {
+        get('/strategytemplate/list', {
+          pageNum: 1,
+          pageSize: 99999,
         }).then(res => {
-          that.oldform = JSON.parse(JSON.stringify(res.data))
-          if (this.$route.query.type == 'erji') {
-            this.oldchannelName = that.oldform.channelName
-            delete this.form.id
-            delete this.form.channelName
-            delete this.form.channelKey
-            delete this.form.fullCode
-            delete this.form.channelCode
-            this.form.parentId = this.id * 1
-          } else {
-            this.form = res.data
-          }
+          this.celueList = res.data.list
         })
       }
-      get('/channelInfo/page', {
-        parentId: 0,
-        'pageSize': 9999,
-        'pageNum': 1
-      }).then(res => {
-        this.options = res.data.list
-      })
-      this.refresh()
-      console.log(this.form)
+
     },
-    methods: {
-      onSubmit(formName) {
-        this.$confirm('此操作将永久改变数据, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          var array1 = this.oldform;
-          var array2 = this.form;
-          let text = '渠道:' + this.form.channelName
-          XEUtils.objectEach(array2, (item, key) => {
-            if (item != array1[key]) {
-              text += `\n${key}:${array1[key]} 改为 ${item}`;
-            }
-          })
-          let type = 1
-          let channelId = this.id
-          if (this.form.parentId || this.$route.query.type == 'erji') {
-            type = 2
-            channelId = this.form.parentId
+    onSubmit (formName) {
+      this.$confirm('此操作将永久改变数据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        if (this.form.onOffStatus === 0) {
+          this.$message.error('请选择策略类型!')
+          return false
+        }
+        var array1 = this.oldform;
+        var array2 = this.form;
+        let text = '渠道:' + this.form.channelName
+        XEUtils.objectEach(array2, (item, key) => {
+          if (item != array1[key]) {
+            text += `\n${key}:${array1[key]} 改为 ${item}`;
           }
-          post('/channelInfo/createChannlelog', {
-            'type': type,
-            'notes': text,
-            'channelId': channelId
-          })
-          this.$refs[formName].validate((valid) => {
-            if (valid) {
-              if (this.id && !this.$route.query.type) {
-                post('/channelInfo/update/' + this.id, this.form).then(res => {
-                  this.$message({
-                    message: res.message,
-                    type: 'success',
-                    duration: 3000,
-                    offset: 360
-                  });
-                  setTimeout(() => {
-                    window.close()
-                  }, 1200)
-                })
-              } else {
-                post('/channelInfo/create', this.form).then(res => {
-                  this.$message({
-                    message: res.message,
-                    type: 'success',
-                    duration: 3000,
-                    offset: 360
-                  })
-                  setTimeout(() => {
-                    window.close()
-                  }, 1200)
-                })
-              }
+        })
+        let type = 1
+        let channelId = this.id
+        if (this.form.parentId || this.$route.query.type == 'erji') {
+          type = 2
+          channelId = this.form.parentId
+        }
+        post('/channelInfo/createChannlelog', {
+          'type': type,
+          'notes': text,
+          'channelId': channelId
+        })
+        this.$refs[formName].validate((valid) => {
+          if (valid) {
+            if (this.id && !this.$route.query.type) {
+              post('/channelInfo/update/' + this.id, this.form).then(res => {
+                this.$message({
+                  message: res.message,
+                  type: 'success',
+                  duration: 3000,
+                  offset: 360
+                });
+                setTimeout(() => {
+                  window.close()
+                }, 1200)
+              })
             } else {
-              console.log('error submit!!');
-              return false;
+              post('/channelInfo/create', this.form).then(res => {
+                this.$message({
+                  message: res.message,
+                  type: 'success',
+                  duration: 3000,
+                  offset: 360
+                })
+                setTimeout(() => {
+                  window.close()
+                }, 1200)
+              })
             }
-          });
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消删除'
-          });
+          } else {
+            console.log('error submit!!');
+            return false;
+          }
         });
-      },
-      changeInput() {
-        this.form.channelName = this.form.channelName.includes("H5") ? this.form.channelName :
-          `${this.form.channelName}H5`
-        // this.$set(this.form,'name',`${newV}H5`)
-      },
-      changeInputer() {
-        this.form.channelName = `${this.oldchannelName || '' }${this.form.channelName}`
-        // this.$set(this.form,'name',`${newV}H5`)
-      },
-      close() {
-        this.$confirm('此操作不会保存已编辑数据, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          window.location.href = 'about:blank'
-          window.close()
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消'
-          });
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
         });
-      },
-      toAdd(e) {
+      });
+    },
+    changeInput () {
+      this.form.channelName = this.form.channelName.includes("H5") ? this.form.channelName :
+        `${this.form.channelName}H5`
+      // this.$set(this.form,'name',`${newV}H5`)
+    },
+    changeInputer () {
+      this.form.channelName = `${this.oldchannelName || ''}${this.form.channelName}`
+      // this.$set(this.form,'name',`${newV}H5`)
+    },
+    close () {
+      this.$confirm('此操作不会保存已编辑数据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        window.location.href = 'about:blank'
+        window.close()
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        });
+      });
+    },
+    toAdd () {
+      if (this.form.onOffStatus === 1) {
+        let routeUrl = this.$router.resolve({
+          path: '/strategy/add'
+        })
+        window.open(routeUrl.href, '_blank')
+      } else {
+        let routeUrl = this.$router.resolve({
+          path: '/schemeV2/schemeAdd'
+        })
+        window.open(routeUrl.href, '_blank')
+      }
+
+    },
+    toEdit (e) {
+      if (this.form.onOffStatus === 1) {
         const routeUrl = this.$router.resolve({
-          path: '/schemeV2/schemeAdd',
+          path: '/strategy/add',
           query: {
             id: e.id
           }
         })
-        window.open(routeUrl.href, '_blank')
-      },
-      toEdit(e) {
+        window.open(routeUrl.href + '?id=' + e, '_blank')
+      } else {
         const routeUrl = this.$router.resolve({
           path: '/schemeV2/schemeAdd',
           query: {
             id: e.id
           }
         })
-        console.log(routeUrl)
         window.open(routeUrl.href + '?id=' + e, '_blank')
-      },
-      refresh() {
+      }
+
+    },
+    refresh () {
+      get('/strategyInfoNew/page', {
+        'strategyType': 0,
+        'pageSize': 9999,
+        'pageNum': 1,
+        'strategyType': 0
+      }).then(res => {
+        this.celueList = res.data.list
+      })
+    },
+    remoteMethod (query) {
+      let that = this
+      if (query !== '') {
+        this.loading = true;
+        get('/channelInfo/page', {
+          parentId: 0,
+          channelName: query
+        }).then(res => {
+          this.loading = false;
+          that.options = res.data.list
+        })
+      } else {
+        this.options = [];
+      }
+    },
+    remoteMethodstrategyId (query) {
+      let that = this
+      if (query !== '') {
+        this.loading = true;
         get('/strategyInfoNew/page', {
-          'strategyType': 0,
+          strategyName: query,
           'pageSize': 9999,
           'pageNum': 1,
           'strategyType': 0
         }).then(res => {
-          this.celueList = res.data.list
+          this.loading = false;
+          that.celueList = res.data.list
         })
-      },
-      remoteMethod(query) {
-        let that = this
-        if (query !== '') {
-          this.loading = true;
-          get('/channelInfo/page', {
-            parentId: 0,
-            channelName: query
-          }).then(res => {
-            this.loading = false;
-            that.options = res.data.list
-          })
-        } else {
-          this.options = [];
-        }
-      },
-      remoteMethodstrategyId(query) {
-        let that = this
-        if (query !== '') {
-          this.loading = true;
-          get('/strategyInfoNew/page', {
-            strategyName: query,
-            'pageSize': 9999,
-            'pageNum': 1,
-            'strategyType': 0
-          }).then(res => {
-            this.loading = false;
-            that.celueList = res.data.list
-          })
-        } else {
-          this.options = [];
-        }
+      } else {
+        this.options = [];
       }
     }
   }
+}
 
 </script>
 
 <style scoped>
-
 </style>

+ 293 - 327
purchase_ao/src/views/schemeV2/channelSubList.vue

@@ -1,348 +1,314 @@
 <template>
-    <div>
-        <el-container>
-            <!--搜索-->
-            <el-header class="searchBox">
-                <el-form :inline="true" :model="searchForm" ref="searchForm" class="demo-form-inline">
-                    <el-form-item label="渠道名称">
-                        <el-input v-model="searchForm.channelName" name="channelName" placeholder="渠道名称"/>
-                    </el-form-item>
-                    <el-form-item label="渠道key">
-                        <el-input v-model="searchForm.channelKey" name="channelKey" placeholder="渠道Key"/>
-                    </el-form-item>
-                    <el-form-item label="完整渠道编码">
-                        <el-input v-model="searchForm.fullCode" name="fullCode" placeholder="完整渠道编码"/>
-                    </el-form-item>
-                    <el-form-item style="float: right">
-                        <el-button type="primary" @click="init()">搜索</el-button>
-                        <el-button @click="reset('searchForm')">重置</el-button>
-                    </el-form-item>
-                </el-form>
-            </el-header>
-            <!--表格-->
-            <el-main class="tableBox">
-                <vxe-table
-                        border
-                        resizable
-                        keep-source
-                        highlight-hover-row
-                        ref="xTable"
-                        :data="tableData"
-                        :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, }"
-                        @edit-closed="editClosedEvent"
-                >
-                    <vxe-table-column
-                            field="channelName"
-                            title="渠道名称"
-                    />
-                    <vxe-table-column
-                            field="channelKey"
-                            title="渠道Key"
-                            width="120"
-                    />
-                    <vxe-table-column
-                            field="fullCode"
-                            title="完整渠道编码"
-                            width="120"
-                    />
-                    <vxe-table-column
-                            field="channelType"
-                            title="渠道类别"
-                    />
-                    <vxe-table-column field="channelPattern"title="渠道形态"width="100">
-                        <template #default="{ row,_columnIndex}">
+  <div>
+    <el-container>
+      <!--搜索-->
+      <el-header class="searchBox">
+        <el-form :inline="true" :model="searchForm" ref="searchForm" class="demo-form-inline">
+          <el-form-item label="渠道名称">
+            <el-input v-model="searchForm.channelName" name="channelName" placeholder="渠道名称" />
+          </el-form-item>
+          <el-form-item label="渠道key">
+            <el-input v-model="searchForm.channelKey" name="channelKey" placeholder="渠道Key" />
+          </el-form-item>
+          <el-form-item label="完整渠道编码">
+            <el-input v-model="searchForm.fullCode" name="fullCode" placeholder="完整渠道编码" />
+          </el-form-item>
+          <el-form-item style="float: right">
+            <el-button type="primary" @click="init()">搜索</el-button>
+            <el-button @click="reset('searchForm')">重置</el-button>
+          </el-form-item>
+        </el-form>
+      </el-header>
+      <!--表格-->
+      <el-main class="tableBox">
+        <vxe-table border resizable keep-source highlight-hover-row ref="xTable" :data="tableData" :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, }" @edit-closed="editClosedEvent">
+          <vxe-table-column field="channelName" title="渠道名称" />
+          <vxe-table-column field="channelKey" title="渠道Key" width="120" />
+          <vxe-table-column field="fullCode" title="完整渠道编码" width="120" />
+          <vxe-table-column field="channelType" title="渠道类别" />
+          <vxe-table-column title="渠道形态" width="100">
+            <!-- <template #default="{ row,_columnIndex}">
                             {{ patnerList[row.channelPattern*1].label }}
-                        </template>
-                    </vxe-table-column>
-                    <vxe-table-column
-                            field="channelStatus"
-                            title="状态"
-                            :edit-render="{name: '$select', options: strategyStatus}"
-                            width="80"
-                    />
-                    <vxe-table-column
-                            field="onlineTime"
-                            title="生效时间"
-                    />
-                    <vxe-table-column title="操作" fixed="right" width="360">
-                        <template #default="{ row }">
-                            <vxe-button @click="toEdit(row)">编辑</vxe-button>
-                            <vxe-button @click="copy(row)">复制链接</vxe-button>
-                            <vxe-button @click="giveShort(row)">短连接</vxe-button>
-                            <vxe-button @click="ewm(row)">二维码</vxe-button>
-                        </template>
-                    </vxe-table-column>
-                </vxe-table>
-                <el-dialog title="二维码下载" :visible.sync="dialogVisible" width="350px">
-                    <div style="text-align: center">
-                        <div id="qrcode"></div>
-                        <div style="height: 25px;line-height: 25px;margin-top: 30px">鼠标右键图片另存为</div>
-                    </div>
-                    <span slot="footer" class="dialog-footer">
-                <el-button @click="dialogVisible = false">取 消</el-button>
-            </span>
-                </el-dialog>
-                <vxe-pager
-                        :loading="loading"
-                        :current-page="searchForm.pageNum"
-                        :page-size="searchForm.pageSize"
-                        :total="searchForm.totalResult"
-                        :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
-                        @page-change="handlePageChange"
-                />
-            </el-main>
-        </el-container>
-    </div>
+                        </template> -->
+            <template #default="{ row }">
+              <span v-if="row.onOffStatus === 1">新版本</span>
+              <span v-else style="color:#F56C6C">旧版本</span>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="channelStatus" title="状态" :edit-render="{name: '$select', options: strategyStatus}" width="80" />
+          <vxe-table-column field="onlineTime" title="生效时间" />
+          <vxe-table-column title="操作" fixed="right" width="360">
+            <template #default="{ row }">
+              <vxe-button @click="toEdit(row)">编辑</vxe-button>
+              <vxe-button @click="copy(row)">复制链接</vxe-button>
+              <vxe-button @click="giveShort(row)">短连接</vxe-button>
+              <vxe-button @click="ewm(row)">二维码</vxe-button>
+            </template>
+          </vxe-table-column>
+        </vxe-table>
+        <el-dialog title="二维码下载" :visible.sync="dialogVisible" width="350px">
+          <div style="text-align: center">
+            <div id="qrcode"></div>
+            <div style="height: 25px;line-height: 25px;margin-top: 30px">鼠标右键图片另存为</div>
+          </div>
+          <span slot="footer" class="dialog-footer">
+            <el-button @click="dialogVisible = false">取 消</el-button>
+          </span>
+        </el-dialog>
+        <vxe-pager :loading="loading" :current-page="searchForm.pageNum" :page-size="searchForm.pageSize" :total="searchForm.totalResult" :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']" @page-change="handlePageChange" />
+      </el-main>
+    </el-container>
+  </div>
 </template>
 
 <script>
-    import {post, get} from '@/api/common'
-    import QRCode from 'qrcodejs2'
-    import XEUtils from 'xe-utils'
+import { post, get } from '@/api/common'
+import QRCode from 'qrcodejs2'
+import XEUtils from 'xe-utils'
 
-    export default {
-        name: 'SchemeEdit',
-        data() {
-            return {
-                searchForm: {
-                    channelName: '',
-                    channelPartner: '',
-                    channelKey: '',
-                    fullCode: '',
-                    parentId: 0,
-                    pageNum: 1,
-                    pageSize: 10,
-                    totalResult: 0
-                },
-                loading: false,
-                tableData: [],
-                content: {},
-                strategyStatus: [
-                    {label: '生效中', value: '1'},
-                    {label: '未生效', value: '0'}
-                ],
-                typeList: [
-                    {value: '集团渠道', label: '集团渠道'},
-                    {value: '省分线下渠道', label: '省分线下渠道'},
-                    {value: '省分线上渠道', label: '省分线上渠道'},
-                    {value: '互联网渠道', label: '互联网渠道'},
-                    {value: '自有线上渠道', label: '自有线上渠道'},
-                    {value: '社会代理和其他渠道', label: '社会代理和其他渠道'}
-                ],
-                patnerList: [
-                    {value: '0', label: 'V1'},
-                    {value: '1', label: 'V2'},
-                ],
+export default {
+  name: 'SchemeEdit',
+  data () {
+    return {
+      searchForm: {
+        channelName: '',
+        channelPartner: '',
+        channelKey: '',
+        fullCode: '',
+        parentId: 0,
+        pageNum: 1,
+        pageSize: 10,
+        totalResult: 0
+      },
+      loading: false,
+      tableData: [],
+      content: {},
+      strategyStatus: [
+        { label: '生效中', value: '1' },
+        { label: '未生效', value: '0' }
+      ],
+      typeList: [
+        { value: '集团渠道', label: '集团渠道' },
+        { value: '省分线下渠道', label: '省分线下渠道' },
+        { value: '省分线上渠道', label: '省分线上渠道' },
+        { value: '互联网渠道', label: '互联网渠道' },
+        { value: '自有线上渠道', label: '自有线上渠道' },
+        { value: '社会代理和其他渠道', label: '社会代理和其他渠道' }
+      ],
+      patnerList: [
+        { value: '0', label: 'V1' },
+        { value: '1', label: 'V2' },
+      ],
 
-                dialogVisible: false,
+      dialogVisible: false,
 
 
-                value5: false,
-                pushdata: false,
-                pushdataDate: '',
-                channelog: [],
-                channelogList: [],
-                filterName1: '',
-                channelogParam: {
-                    channelId: this.$route.query.id,
-                    pageNum: 1,
-                    pageSize: 10,
-                    totalResult: 0
-                },
-            }
-        },
-        watch: {
-            value5(val) {
-                if (val) {
-                    get('/channelInfo/channelogpage', this.channelogParam).then(res => {
-                        this.channelog = res.data.list
-                        this.channelogParam.totalResult = res.data.total
-                    })
-                    this.channelogParam.pageSize = 100
-                    get('/channelInfo/channelogpage', this.channelogParam).then(res => {
-                        this.channelogList = JSON.parse(JSON.stringify(res.data.list))
-                    })
-                }
-            }
-        },
-        created() {
-            this.searchForm.parentId = this.$route.query.id?this.$route.query.id:null
-            get('/channelInfo/detail', {id: this.$route.query.id}).then(res => {
-                this.content = res.data
-            })
-            this.init()
-            document.title = '所有二级渠道'
-        },
-        methods: {
-            onSubmit() {
-                post('/channelInfo/pushdata?beginTime=' + this.pushdataDate[0] + '&endTime=' + this.pushdataDate[1], {}).then(res => {
-                    this.$message({
-                        message: res.message,
-                        type: 'success'
-                    });
-                    this.pushdata = false
-                })
-            },
-            reset(formName) { // 重置
-                this.searchForm = {}
-                get('/channelInfo/listChannelslistChannels', {}).then(res => {
-                    this.tableData = res.data.list
-                })
-            },
-            checkpushdata(e) {
-                get('/channelInfo/checkpushdata', {'fullCode': e}).then(res => {
-                    let data = JSON.parse(res.data)[0]
-                    if (data.resdesc == 'ok') {
-                        this.$message({
-                            message: data.subchannelname + '已同步',
-                            type: 'success'
-                        });
-                    } else {
-                        this.$message({
-                            message: data.subchannelname + '未同步',
-                            type: 'error'
-                        });
-                    }
-                })
-            },
-            init() {
-                console.log(this.searchForm)
-                get('/channelInfo/listChannels', this.searchForm).then(res => {
-                    this.tableData = res.data.list
-                    this.searchForm.totalResult = res.data.total
-                })
-            },
-            editClosedEvent({row, column}) {
-                const $table = this.$refs.xTable
-                const field = column.property
-                const cellValue = row[field]
-                // 判断单元格值是否被修改
-                if ($table.isUpdateByRow(row, field)) {
-                    setTimeout(() => {
-                        let param = {}
-                        param[field] = cellValue
-                        post('/channelInfo/update/' + row.id, row).then(res => {
-                            this.$message({
-                                message: res.message,
-                                type: 'success'
-                            });
-                        })
-                        // 局部更新单元格为已保存状态
-                        $table.reloadRow(row, null, field)
-                    }, 300)
-                }
-            },
-            toEdit(e, type) {
-                const routeUrl = this.$router.resolve({path: '/schemeV2/channelEdit', query: {id: e.id, 'type': type}})
-                window.open(routeUrl.href, '_blank')
-            },
-            copy(row) {
-                let oInput = document.createElement('input');
-                oInput.value = `https://operation.mige.tv/a/#/${row.channelKey}`;
-                document.body.appendChild(oInput);
-                oInput.select(); // 选择对象;
-                document.execCommand("Copy"); // 执行浏览器复制命令
-                this.$message({
-                    message: '复制成功',
-                    type: 'success'
-                });
-                oInput.remove()
-            },
-            giveShort(row) {
-                let stUrl = row.shortUrl
-                if (stUrl) {
-                    let oInput = document.createElement('input');
-                    oInput.value = `http://v.mige.tv/${stUrl}`;
-                    document.body.appendChild(oInput);
-                    oInput.select(); // 选择对象;
-                    document.execCommand("Copy"); // 执行浏览器复制命令
-                    this.$message({
-                        message: '复制成功',
-                        type: 'success'
-                    });
-                    oInput.remove()
-                } else {
-                    let updata = {
-                        channel: row.channelKey,
-                        longUrl: `https://operation.mige.tv/a/#/${row.channelKey}`
-                    }
-                    post('/channelInfo/shorturl', updata).then(res => {
-                        let resUrl = res.data.shortCode
-                        let oInput = document.createElement('input');
-                        oInput.value = `http://v.mige.tv/${resUrl}`;
-                        document.body.appendChild(oInput);
-                        oInput.select(); // 选择对象;
-                        document.execCommand("Copy"); // 执行浏览器复制命令
-                        this.$message({
-                            message: '复制成功',
-                            type: 'success'
-                        });
-                        oInput.remove()
-                    })
-                }
-            },
-            ewm(row) {
-                this.dialogVisible = true;
-                this.$nextTick(function () {
-                    document.getElementById("qrcode").innerHTML = "";
-                    let qrcode = new QRCode("qrcode", {
-                        width: 300,
-                        height: 300,
-                        text: `https://operation.mige.tv/a/#/${row.channelKey}`
-                    });
-                });
-            },
-            handlePageChange({currentPage, pageSize}) {
-                this.searchForm.pageNum = currentPage
-                this.searchForm.pageSize = pageSize
-                this.init()
-            },
-            handlePageChangeChannelog({currentPage, pageSize}) {
-                this.channelogParam.pageNum = currentPage
-                this.channelogParam.pageSize = pageSize
-                get('/channelInfo/channelogpage', this.channelogParam).then(res => {
-                    this.channelog = res.data.list
-                    this.channelogParam.totalResult = res.data.total
-                })
-            },
-            searchEvent() {
-                get('/channelInfo/channelogpage', this.channelogParam).then(res => {
-                    this.channelog = res.data.list
-                    this.channelogParam.totalResult = res.data.total
-                })
-            }
+      value5: false,
+      pushdata: false,
+      pushdataDate: '',
+      channelog: [],
+      channelogList: [],
+      filterName1: '',
+      channelogParam: {
+        channelId: this.$route.query.id,
+        pageNum: 1,
+        pageSize: 10,
+        totalResult: 0
+      },
+    }
+  },
+  watch: {
+    value5 (val) {
+      if (val) {
+        get('/channelInfo/channelogpage', this.channelogParam).then(res => {
+          this.channelog = res.data.list
+          this.channelogParam.totalResult = res.data.total
+        })
+        this.channelogParam.pageSize = 100
+        get('/channelInfo/channelogpage', this.channelogParam).then(res => {
+          this.channelogList = JSON.parse(JSON.stringify(res.data.list))
+        })
+      }
+    }
+  },
+  created () {
+    this.searchForm.parentId = this.$route.query.id ? this.$route.query.id : null
+    get('/channelInfo/detail', { id: this.$route.query.id }).then(res => {
+      this.content = res.data
+    })
+    this.init()
+    document.title = '所有二级渠道'
+  },
+  methods: {
+    onSubmit () {
+      post('/channelInfo/pushdata?beginTime=' + this.pushdataDate[0] + '&endTime=' + this.pushdataDate[1], {}).then(res => {
+        this.$message({
+          message: res.message,
+          type: 'success'
+        });
+        this.pushdata = false
+      })
+    },
+    reset (formName) { // 重置
+      this.searchForm = {}
+      get('/channelInfo/listChannelslistChannels', {}).then(res => {
+        this.tableData = res.data.list
+      })
+    },
+    checkpushdata (e) {
+      get('/channelInfo/checkpushdata', { 'fullCode': e }).then(res => {
+        let data = JSON.parse(res.data)[0]
+        if (data.resdesc == 'ok') {
+          this.$message({
+            message: data.subchannelname + '已同步',
+            type: 'success'
+          });
+        } else {
+          this.$message({
+            message: data.subchannelname + '未同步',
+            type: 'error'
+          });
+        }
+      })
+    },
+    init () {
+      console.log(this.searchForm)
+      get('/channelInfo/listChannels', this.searchForm).then(res => {
+        this.tableData = res.data.list
+        this.searchForm.totalResult = res.data.total
+      })
+    },
+    editClosedEvent ({ row, column }) {
+      const $table = this.$refs.xTable
+      const field = column.property
+      const cellValue = row[field]
+      // 判断单元格值是否被修改
+      if ($table.isUpdateByRow(row, field)) {
+        setTimeout(() => {
+          let param = {}
+          param[field] = cellValue
+          post('/channelInfo/update/' + row.id, row).then(res => {
+            this.$message({
+              message: res.message,
+              type: 'success'
+            });
+          })
+          // 局部更新单元格为已保存状态
+          $table.reloadRow(row, null, field)
+        }, 300)
+      }
+    },
+    toEdit (e, type) {
+      const routeUrl = this.$router.resolve({ path: '/schemeV2/channelEdit', query: { id: e.id, 'type': type } })
+      window.open(routeUrl.href, '_blank')
+    },
+    copy (row) {
+      let oInput = document.createElement('input');
+      oInput.value = `https://operation.mige.tv/a/#/${row.channelKey}`;
+      document.body.appendChild(oInput);
+      oInput.select(); // 选择对象;
+      document.execCommand("Copy"); // 执行浏览器复制命令
+      this.$message({
+        message: '复制成功',
+        type: 'success'
+      });
+      oInput.remove()
+    },
+    giveShort (row) {
+      let stUrl = row.shortUrl
+      if (stUrl) {
+        let oInput = document.createElement('input');
+        oInput.value = `http://v.mige.tv/${stUrl}`;
+        document.body.appendChild(oInput);
+        oInput.select(); // 选择对象;
+        document.execCommand("Copy"); // 执行浏览器复制命令
+        this.$message({
+          message: '复制成功',
+          type: 'success'
+        });
+        oInput.remove()
+      } else {
+        let updata = {
+          channel: row.channelKey,
+          longUrl: `https://operation.mige.tv/a/#/${row.channelKey}`
         }
+        post('/channelInfo/shorturl', updata).then(res => {
+          let resUrl = res.data.shortCode
+          let oInput = document.createElement('input');
+          oInput.value = `http://v.mige.tv/${resUrl}`;
+          document.body.appendChild(oInput);
+          oInput.select(); // 选择对象;
+          document.execCommand("Copy"); // 执行浏览器复制命令
+          this.$message({
+            message: '复制成功',
+            type: 'success'
+          });
+          oInput.remove()
+        })
+      }
+    },
+    ewm (row) {
+      this.dialogVisible = true;
+      this.$nextTick(function () {
+        document.getElementById("qrcode").innerHTML = "";
+        let qrcode = new QRCode("qrcode", {
+          width: 300,
+          height: 300,
+          text: `https://operation.mige.tv/a/#/${row.channelKey}`
+        });
+      });
+    },
+    handlePageChange ({ currentPage, pageSize }) {
+      this.searchForm.pageNum = currentPage
+      this.searchForm.pageSize = pageSize
+      this.init()
+    },
+    handlePageChangeChannelog ({ currentPage, pageSize }) {
+      this.channelogParam.pageNum = currentPage
+      this.channelogParam.pageSize = pageSize
+      get('/channelInfo/channelogpage', this.channelogParam).then(res => {
+        this.channelog = res.data.list
+        this.channelogParam.totalResult = res.data.total
+      })
+    },
+    searchEvent () {
+      get('/channelInfo/channelogpage', this.channelogParam).then(res => {
+        this.channelog = res.data.list
+        this.channelogParam.totalResult = res.data.total
+      })
     }
+  }
+}
 </script>
 
 <style lang="scss">
-    .searchBox {
-        background-color: #fff;
-        border-radius: 4px;
-        box-shadow: #bfbfbf 0 0 2px;
-        height: unset !important;
-        padding: 10px 10px;
+.searchBox {
+  background-color: #fff;
+  border-radius: 4px;
+  box-shadow: #bfbfbf 0 0 2px;
+  height: unset !important;
+  padding: 10px 10px;
 
-        form {
-            margin: auto;
+  form {
+    margin: auto;
 
-            .el-form-item {
-                margin: 5px 5px;
-            }
-        }
+    .el-form-item {
+      margin: 5px 5px;
     }
+  }
+}
 
-    .tableBox {
-        margin-top: 10px;
-        background-color: #fff;
-        border-radius: 4px;
-        box-shadow: #bfbfbf 0 0 2px;
+.tableBox {
+  margin-top: 10px;
+  background-color: #fff;
+  border-radius: 4px;
+  box-shadow: #bfbfbf 0 0 2px;
 
-        .block {
-            .el-pagination {
-                margin-top: 30px;
-                float: right;
-            }
-        }
+  .block {
+    .el-pagination {
+      margin-top: 30px;
+      float: right;
     }
+  }
+}
 </style>

+ 297 - 302
purchase_ao/src/views/schemeV2/channelView.vue

@@ -88,17 +88,20 @@
             <vxe-button @click="init()">刷新</vxe-button>
           </template>
         </vxe-toolbar>
-        <vxe-table border resizable keep-source highlight-hover-row ref="xTable" :data="tableData"
-          :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, }" @edit-closed="editClosedEvent">
+        <vxe-table border resizable keep-source highlight-hover-row ref="xTable" :data="tableData" :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, }" @edit-closed="editClosedEvent">
           <vxe-table-column field="channelName" title="渠道名称" :edit-render="{name: 'input'}" width="300" />
           <vxe-table-column field="channelKey" title="渠道Key" width="120" />
           <vxe-table-column field="fullCode" title="完整渠道编码" width="120" />
           <vxe-table-column field="channelType" title="渠道类别" width="160" />
-          <vxe-table-column field="channelPattern" title="渠道形态" width="100" />
+          <vxe-table-column title="渠道形态" width="100">
+            <template #default="{ row }">
+              <span v-if="row.onOffStatus === 1">新版本</span>
+              <span v-else style="color:#F56C6C">旧版本</span>
+            </template>
+          </vxe-table-column>
           <vxe-table-column field="channelPartner" title="合作方" width="120" />
-          <vxe-table-column field="channelStatus" title="状态" :edit-render="{name: '$select', options: strategyStatus}"
-            width="80" />
-          <vxe-table-column field="wotv" title="wo186域名" width="120" :formatter="formatterWotv"/>
+          <vxe-table-column field="channelStatus" title="状态" :edit-render="{name: '$select', options: strategyStatus}" width="80" />
+          <!-- <vxe-table-column field="wotv" title="wo186域名" width="120" :formatter="formatterWotv" /> -->
           <vxe-table-column field="onlineTime" title="生效时间" />
           <vxe-table-column title="操作" width="460">
             <template #default="{ row }">
@@ -110,10 +113,7 @@
             </template>
           </vxe-table-column>
         </vxe-table>
-        <vxe-pager :loading="loading" :current-page="searchForm.pageNum" :page-size="searchForm.pageSize"
-          :total="searchForm.totalResult"
-          :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
-          @page-change="handlePageChange" />
+        <vxe-pager :loading="loading" :current-page="searchForm.pageNum" :page-size="searchForm.pageSize" :total="searchForm.totalResult" :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']" @page-change="handlePageChange" />
         <el-dialog title="二维码下载" :visible.sync="dialogVisible" width="350px">
           <div style="text-align: center">
             <div id="qrcode"></div>
@@ -143,10 +143,7 @@
               </vxe-table-column>
               <vxe-table-column field="userName" title="操作人"></vxe-table-column>
             </vxe-table>
-            <vxe-pager :loading="loading" :current-page="channelogParam.pageNum" :page-size="channelogParam.pageSize"
-              :total="channelogParam.totalResult"
-              :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
-              @page-change="handlePageChangeChannelog" />
+            <vxe-pager :loading="loading" :current-page="channelogParam.pageNum" :page-size="channelogParam.pageSize" :total="channelogParam.totalResult" :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']" @page-change="handlePageChangeChannelog" />
           </template>
         </vxe-modal>
 
@@ -154,8 +151,7 @@
           <template #default>
             <el-form ref="form" label-width="80px">
               <el-form-item label="选择时间">
-                <el-date-picker v-model="pushdataDate" type="daterange" range-separator="至" start-placeholder="开始日期"
-                  end-placeholder="结束日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
+                <el-date-picker v-model="pushdataDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
                 </el-date-picker>
               </el-form-item>
               <el-form-item>
@@ -171,190 +167,190 @@
 </template>
 
 <script>
-  import {
-    post,
-    get
-  } from '@/api/common'
-  import QRCode from 'qrcodejs2'
-  import axios from "axios";
-  import {
-    getToken
-  } from "../../utils/auth";
-  import XEUtils from 'xe-utils'
+import {
+  post,
+  get
+} from '@/api/common'
+import QRCode from 'qrcodejs2'
+import axios from "axios";
+import {
+  getToken
+} from "../../utils/auth";
+import XEUtils from 'xe-utils'
 
-  export default {
-    name: 'SchemeEdit',
-    data() {
-      return {
-        searchForm: {
-          channelName: '',
-          channelPartner: '',
-          parentId: 0,
-          pageNum: 1,
-          pageSize: 10,
-          totalResult: 0
-        },
-        loading: false,
-        tableData: [],
-        content: {},
-        strategyStatus: [{
-            label: '生效中',
-            value: '1'
-          },
-          {
-            label: '未生效',
-            value: '0'
-          }
-        ],
-        typeList: [{
-            value: '集团渠道',
-            label: '集团渠道'
-          },
-          {
-            value: '省分线下渠道',
-            label: '省分线下渠道'
-          },
-          {
-            value: '省分线上渠道',
-            label: '省分线上渠道'
-          },
-          {
-            value: '互联网渠道',
-            label: '互联网渠道'
-          },
-          {
-            value: '自有线上渠道',
-            label: '自有线上渠道'
-          },
-          {
-            value: '社会代理和其他渠道',
-            label: '社会代理和其他渠道'
-          }
-        ],
-        patnerList: [{
-            value: '0',
-            label: 'V1'
-          },
-          {
-            value: '1',
-            label: 'V2'
-          },
-        ],
+export default {
+  name: 'SchemeEdit',
+  data () {
+    return {
+      searchForm: {
+        channelName: '',
+        channelPartner: '',
+        parentId: 0,
+        pageNum: 1,
+        pageSize: 10,
+        totalResult: 0
+      },
+      loading: false,
+      tableData: [],
+      content: {},
+      strategyStatus: [{
+        label: '生效中',
+        value: '1'
+      },
+      {
+        label: '未生效',
+        value: '0'
+      }
+      ],
+      typeList: [{
+        value: '集团渠道',
+        label: '集团渠道'
+      },
+      {
+        value: '省分线下渠道',
+        label: '省分线下渠道'
+      },
+      {
+        value: '省分线上渠道',
+        label: '省分线上渠道'
+      },
+      {
+        value: '互联网渠道',
+        label: '互联网渠道'
+      },
+      {
+        value: '自有线上渠道',
+        label: '自有线上渠道'
+      },
+      {
+        value: '社会代理和其他渠道',
+        label: '社会代理和其他渠道'
+      }
+      ],
+      patnerList: [{
+        value: '0',
+        label: 'V1'
+      },
+      {
+        value: '1',
+        label: 'V2'
+      },
+      ],
 
-        dialogVisible: false,
+      dialogVisible: false,
 
 
-        value5: false,
-        pushdata: false,
-        pushdataDate: '',
-        channelog: [],
-        channelogList: [],
-        filterName1: '',
-        channelogParam: {
-          channelId: this.$route.query.id,
-          pageNum: 1,
-          pageSize: 10,
-          totalResult: 0
-        },
+      value5: false,
+      pushdata: false,
+      pushdataDate: '',
+      channelog: [],
+      channelogList: [],
+      filterName1: '',
+      channelogParam: {
+        channelId: this.$route.query.id,
+        pageNum: 1,
+        pageSize: 10,
+        totalResult: 0
+      },
+    }
+  },
+  watch: {
+    value5 (val) {
+      if (val) {
+        get('/channelInfo/channelogpage', this.channelogParam).then(res => {
+          this.channelog = res.data.list
+          this.channelogParam.totalResult = res.data.total
+        })
+        this.channelogParam.pageSize = 100
+        get('/channelInfo/channelogpage', this.channelogParam).then(res => {
+          this.channelogList = JSON.parse(JSON.stringify(res.data.list))
+        })
       }
+    }
+  },
+  created () {
+    document.title = '一级渠道详情'
+    this.searchForm.parentId = this.$route.query.id
+    get('/channelInfo/detail', {
+      id: this.$route.query.id
+    }).then(res => {
+      this.content = res.data
+    })
+    this.init()
+  },
+  methods: {
+    formatterWotv ({
+      cellValue
+    }) {
+      return cellValue !== '1' ? '关闭' : '开启'
     },
-    watch: {
-      value5(val) {
-        if (val) {
-          get('/channelInfo/channelogpage', this.channelogParam).then(res => {
-            this.channelog = res.data.list
-            this.channelogParam.totalResult = res.data.total
-          })
-          this.channelogParam.pageSize = 100
-          get('/channelInfo/channelogpage', this.channelogParam).then(res => {
-            this.channelogList = JSON.parse(JSON.stringify(res.data.list))
-          })
+    //导出
+    download () {
+      let formData = new FormData();
+      formData.append("channelName", this.content.channelName);
+      formData.append("channelStatus", 1);
+      formData.append("parentId", this.searchForm.parentId);
+      let loading = this.$loading({
+        lock: true,
+        text: "下载量较大,请耐心等待",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      axios({
+        method: "post",
+        url: process.env.VUE_APP_BASE_API + "/channelInfo/download",
+        data: formData,
+        responseType: "blob",
+        headers: {
+          "Content-Type": "multipart/form-data",
+          token: getToken(),
+        },
+      }).then((res) => {
+        if (res.data) {
+          loading.close();
+          let a = document.createElement("a");
+          let blob = new Blob([res.data], {
+            type: "application/vnd.ms-excel",
+          });
+          let objectUrl = URL.createObjectURL(blob);
+          a.setAttribute("href", objectUrl);
+          a.setAttribute("download", "渠道数据.xlsx");
+          a.click();
+          URL.revokeObjectURL(a.objectUrl);
         }
-      }
+      });
     },
-    created() {
-      document.title = '一级渠道详情'
-      this.searchForm.parentId = this.$route.query.id
-      get('/channelInfo/detail', {
-        id: this.$route.query.id
-      }).then(res => {
-        this.content = res.data
-      })
-      this.init()
-    },
-    methods: {
-      formatterWotv({
-        cellValue
-      }) {
-        return cellValue !== '1' ? '关闭' : '开启'
-      },
-      //导出
-      download() {
-        let formData = new FormData();
-        formData.append("channelName", this.content.channelName);
-        formData.append("channelStatus", 1);
-        formData.append("parentId", this.searchForm.parentId);
-        let loading = this.$loading({
-          lock: true,
-          text: "下载量较大,请耐心等待",
-          spinner: "el-icon-loading",
-          background: "rgba(0, 0, 0, 0.7)",
-        });
-        axios({
-          method: "post",
-          url: process.env.VUE_APP_BASE_API + "/channelInfo/download",
-          data: formData,
-          responseType: "blob",
-          headers: {
-            "Content-Type": "multipart/form-data",
-            token: getToken(),
-          },
-        }).then((res) => {
-          if (res.data) {
-            loading.close();
-            let a = document.createElement("a");
-            let blob = new Blob([res.data], {
-              type: "application/vnd.ms-excel",
-            });
-            let objectUrl = URL.createObjectURL(blob);
-            a.setAttribute("href", objectUrl);
-            a.setAttribute("download", "渠道数据.xlsx");
-            a.click();
-            URL.revokeObjectURL(a.objectUrl);
-          }
-        });
-      },
 
-      onSubmit() {
-        post('/channelInfo/pushdata?beginTime=' + this.pushdataDate[0] + '&endTime=' + this.pushdataDate[1], {}).then(
-          res => {
+    onSubmit () {
+      post('/channelInfo/pushdata?beginTime=' + this.pushdataDate[0] + '&endTime=' + this.pushdataDate[1], {}).then(
+        res => {
+          this.$message({
+            message: res.message,
+            type: 'success'
+          });
+          this.pushdata = false
+        })
+    },
+    checkpushdata (e) {
+      get('/channelInfo/detail', {
+        id: e.id
+      }).then(res1 => {
+        let channel = res1.data
+        get('/channelInfo/checkpushdata', {
+          'fullCode': channel.fullCode
+        }).then(res => {
+          let data = JSON.parse(res.data)[0]
+          if (data.resdesc == 'ok' && data.subchannelkey !== "null") {
             this.$message({
-              message: res.message,
+              message: data.subchannelname + '已同步',
               type: 'success'
             });
-            this.pushdata = false
-          })
-      },
-      checkpushdata(e) {
-        get('/channelInfo/detail', {
-          id: e.id
-        }).then(res1 => {
-          let channel = res1.data
-          get('/channelInfo/checkpushdata', {
-            'fullCode': channel.fullCode
-          }).then(res => {
-            let data = JSON.parse(res.data)[0]
-            if (data.resdesc == 'ok' && data.subchannelkey !== "null") {
-              this.$message({
-                message: data.subchannelname + '已同步',
-                type: 'success'
-              });
-            } else {
-              let bigentime = channel.createTime
-              let endtime = this.dateNew(new Date(bigentime).getTime() + 3600000)
-              this.pushdataDate = [bigentime, endtime]
-              post('/channelInfo/pushdata?beginTime=' + this.pushdataDate[0] + '&endTime=' + this.pushdataDate[
-                1], {}).then(res => {
+          } else {
+            let bigentime = channel.createTime
+            let endtime = this.dateNew(new Date(bigentime).getTime() + 3600000)
+            this.pushdataDate = [bigentime, endtime]
+            post('/channelInfo/pushdata?beginTime=' + this.pushdataDate[0] + '&endTime=' + this.pushdataDate[
+              1], {}).then(res => {
                 console.log(res)
                 this.$message({
                   message: channel.channelName + '同步成功',
@@ -362,63 +358,77 @@
                 });
                 console.log('success')
               })
-            }
-          })
-        })
-      },
-      dateNew(timestamp) {
-        var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
-        var Y = date.getFullYear() + '-';
-        var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
-        // var D = date.getDate() + ' ';
-        var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
-        var h = date.getHours() + ':';
-        var m = date.getMinutes() + ':';
-        var s = date.getSeconds();
-        return Y + M + D + h + m + s;
-      },
-      init() {
-        get('/channelInfo/listChannels', this.searchForm).then(res => {
-          this.tableData = res.data.list
-          this.searchForm.totalResult = res.data.total
-        })
-      },
-      editClosedEvent({
-        row,
-        column
-      }) {
-        const $table = this.$refs.xTable
-        const field = column.property
-        const cellValue = row[field]
-        // 判断单元格值是否被修改
-        if ($table.isUpdateByRow(row, field)) {
-          setTimeout(() => {
-            let param = {}
-            param[field] = cellValue
-            post('/channelInfo/update/' + row.id, row).then(res => {
-              this.$message({
-                message: res.message,
-                type: 'success'
-              });
-            })
-            // 局部更新单元格为已保存状态
-            $table.reloadRow(row, null, field)
-          }, 300)
-        }
-      },
-      toEdit(e, type) {
-        const routeUrl = this.$router.resolve({
-          path: '/schemeV2/channelEdit',
-          query: {
-            id: e.id,
-            'type': type
           }
         })
-        window.open(routeUrl.href, '_blank')
-      },
-      copy(row) {
+      })
+    },
+    dateNew (timestamp) {
+      var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
+      var Y = date.getFullYear() + '-';
+      var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
+      // var D = date.getDate() + ' ';
+      var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
+      var h = date.getHours() + ':';
+      var m = date.getMinutes() + ':';
+      var s = date.getSeconds();
+      return Y + M + D + h + m + s;
+    },
+    init () {
+      get('/channelInfo/listChannels', this.searchForm).then(res => {
+        this.tableData = res.data.list
+        this.searchForm.totalResult = res.data.total
+      })
+    },
+    editClosedEvent ({
+      row,
+      column
+    }) {
+      const $table = this.$refs.xTable
+      const field = column.property
+      const cellValue = row[field]
+      // 判断单元格值是否被修改
+      if ($table.isUpdateByRow(row, field)) {
+        setTimeout(() => {
+          let param = {}
+          param[field] = cellValue
+          post('/channelInfo/update/' + row.id, row).then(res => {
+            this.$message({
+              message: res.message,
+              type: 'success'
+            });
+          })
+          // 局部更新单元格为已保存状态
+          $table.reloadRow(row, null, field)
+        }, 300)
+      }
+    },
+    toEdit (e, type) {
+      const routeUrl = this.$router.resolve({
+        path: '/schemeV2/channelEdit',
+        query: {
+          id: e.id,
+          'type': type
+        }
+      })
+      window.open(routeUrl.href, '_blank')
+    },
+    copy (row) {
+      let oInput = document.createElement('input');
+      oInput.value = `https://operation.mige.tv/a/#/${row.channelKey}`;
+      document.body.appendChild(oInput);
+      oInput.select(); // 选择对象;
+      document.execCommand("Copy"); // 执行浏览器复制命令
+      this.$message({
+        message: '复制成功',
+        type: 'success'
+      });
+      oInput.remove()
+    },
+    giveShort (row) {
+      let stUrl = row.shortUrl
+      if (stUrl) {
         let oInput = document.createElement('input');
-        oInput.value = `https://operation.mige.tv/a/#/${row.channelKey}`;
+        oInput.value = `http://v.mige.tv/${stUrl}`;
         document.body.appendChild(oInput);
         oInput.select(); // 选择对象;
         document.execCommand("Copy"); // 执行浏览器复制命令
@@ -427,12 +437,15 @@
           type: 'success'
         });
         oInput.remove()
-      },
-      giveShort(row) {
-        let stUrl = row.shortUrl
-        if (stUrl) {
+      } else {
+        let updata = {
+          channel: row.channelKey,
+          longUrl: `https://operation.mige.tv/a/#/${row.channelKey}`
+        }
+        post('/channelInfo/shorturl', updata).then(res => {
+          let resUrl = res.data.shortCode
           let oInput = document.createElement('input');
-          oInput.value = `http://v.mige.tv/${stUrl}`;
+          oInput.value = `http://v.mige.tv/${resUrl}`;
           document.body.appendChild(oInput);
           oInput.select(); // 选择对象;
           document.execCommand("Copy"); // 执行浏览器复制命令
@@ -441,67 +454,49 @@
             type: 'success'
           });
           oInput.remove()
-        } else {
-          let updata = {
-            channel: row.channelKey,
-            longUrl: `https://operation.mige.tv/a/#/${row.channelKey}`
-          }
-          post('/channelInfo/shorturl', updata).then(res => {
-            let resUrl = res.data.shortCode
-            let oInput = document.createElement('input');
-            oInput.value = `http://v.mige.tv/${resUrl}`;
-            document.body.appendChild(oInput);
-            oInput.select(); // 选择对象;
-            document.execCommand("Copy"); // 执行浏览器复制命令
-            this.$message({
-              message: '复制成功',
-              type: 'success'
-            });
-            oInput.remove()
-          })
-        }
-      },
-      ewm(row) {
-        this.dialogVisible = true;
-        this.$nextTick(function () {
-          document.getElementById("qrcode").innerHTML = "";
-          let qrcode = new QRCode("qrcode", {
-            width: 300,
-            height: 300,
-            text: `https://operation.mige.tv/a/#/${row.channelKey}`
-          });
-        });
-      },
-      handlePageChange({
-        currentPage,
-        pageSize
-      }) {
-        this.searchForm.pageNum = currentPage
-        this.searchForm.pageSize = pageSize
-        this.init()
-      },
-      handlePageChangeChannelog({
-        currentPage,
-        pageSize
-      }) {
-        this.channelogParam.pageNum = currentPage
-        this.channelogParam.pageSize = pageSize
-        get('/channelInfo/channelogpage', this.channelogParam).then(res => {
-          this.channelog = res.data.list
-          this.channelogParam.totalResult = res.data.total
-        })
-      },
-      searchEvent() {
-        get('/channelInfo/channelogpage', this.channelogParam).then(res => {
-          this.channelog = res.data.list
-          this.channelogParam.totalResult = res.data.total
         })
       }
+    },
+    ewm (row) {
+      this.dialogVisible = true;
+      this.$nextTick(function () {
+        document.getElementById("qrcode").innerHTML = "";
+        let qrcode = new QRCode("qrcode", {
+          width: 300,
+          height: 300,
+          text: `https://operation.mige.tv/a/#/${row.channelKey}`
+        });
+      });
+    },
+    handlePageChange ({
+      currentPage,
+      pageSize
+    }) {
+      this.searchForm.pageNum = currentPage
+      this.searchForm.pageSize = pageSize
+      this.init()
+    },
+    handlePageChangeChannelog ({
+      currentPage,
+      pageSize
+    }) {
+      this.channelogParam.pageNum = currentPage
+      this.channelogParam.pageSize = pageSize
+      get('/channelInfo/channelogpage', this.channelogParam).then(res => {
+        this.channelog = res.data.list
+        this.channelogParam.totalResult = res.data.total
+      })
+    },
+    searchEvent () {
+      get('/channelInfo/channelogpage', this.channelogParam).then(res => {
+        this.channelog = res.data.list
+        this.channelogParam.totalResult = res.data.total
+      })
     }
   }
+}
 
 </script>
 
 <style scoped>
-
 </style>

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

@@ -216,7 +216,7 @@
               </el-row>
               <el-row :gutter="20">
                 <el-col :span="6">
-                  <el-form-item label="领取话费">
+                  <el-form-item label="一键反馈">
                     <el-switch v-model="extJson.guanzhuBtn" active-text="启用" inactive-text="不启用" active-value="1" inactive-value="0" />
                   </el-form-item>
                 </el-col>

+ 112 - 116
purchase_ao/src/views/strategy/add.vue

@@ -3,7 +3,12 @@
     <div class="content">
       <!-- 预览页 -->
       <div class="page">
-        <el-button :disabled="templateList.length===0" class="look" size="small" type="primary" @click="preview"> 预览</el-button>
+        <div class="look">
+          <el-button style="margin-left: 15px;" size="small" icon="el-icon-circle-close" @click="$router.go(-1)">取消</el-button>
+          <el-button style="margin-left: 15px;" type="primary" icon="el-icon-folder-add" size="small" @click="keepClick()">保存</el-button>
+          <el-button :disabled="templateList.length===0" size="small" icon="el-icon-view" type="warning" @click="preview"> 预览</el-button>
+        </div>
+
         <div class="ifreamBox">
           <iframe id="ifreamId" class="ifream" height="100%" width="100%" :src="ifreamSrc"></iframe>
         </div>
@@ -26,7 +31,7 @@
             <el-form :model="form" size="small" ref="form" label-width="100px" style="width:65%">
               <el-form-item>
                 <template slot="label">
-                  <el-tooltip content="当前策略名称" placement="top">
+                  <el-tooltip :open-delay="500" content="当前策略名称" placement="top">
                     <span>策略名称</span>
                   </el-tooltip>
                 </template>
@@ -35,7 +40,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-tooltip content="当前配置主产品" placement="top">
+                  <el-tooltip :open-delay="500" content="当前配置主产品" placement="top">
                     <span>主产品</span>
                   </el-tooltip>
                 </template>
@@ -48,7 +53,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-tooltip content="聚合模板或炫彩聚合模板副产品,其余模板不生效" placement="top">
+                  <el-tooltip :open-delay="500" content="聚合模板或炫彩聚合模板副产品,其余模板不生效" placement="top">
                     <span>副产品</span>
                   </el-tooltip>
                 </template>
@@ -58,7 +63,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-tooltip content="选择使用模板" placement="top">
+                  <el-tooltip :open-delay="500" content="选择使用模板" placement="top">
                     <span>模板选择</span>
                   </el-tooltip>
                 </template>
@@ -67,7 +72,7 @@
                     <span style="float: left; margin-right: 10px">{{
                           item.templateName
                         }}</span>
-                    <el-popover placement="right" trigger="hover">
+                    <el-popover :open-delay="500" placement="right" trigger="hover">
                       <img :src="item.templatePhoto" width="400" />
                       <img slot="reference" :src="item.templatePhoto" width="30" height="30" style="float: right" />
                     </el-popover>
@@ -76,7 +81,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-tooltip content="选择产品的订购认证方式" placement="top">
+                  <el-tooltip :open-delay="500" content="选择产品的订购认证方式" placement="top">
                     <span>认证方式</span>
                   </el-tooltip>
                 </template>
@@ -100,7 +105,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-tooltip content="选择产品适配的客户端" placement="top">
+                  <el-tooltip :open-delay="500" content="选择产品适配的客户端" placement="top">
                     <span>产品适配</span>
                   </el-tooltip>
                 </template>
@@ -111,7 +116,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-tooltip content="选择策略回传埋点方式" placement="top">
+                  <el-tooltip :open-delay="500" content="选择策略回传埋点方式" placement="top">
                     <span>信息流回传</span>
                   </el-tooltip>
                 </template>
@@ -126,7 +131,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-popover placement="right" trigger="hover">
+                  <el-popover :open-delay="500" placement="right" trigger="hover">
                     <img src="./totasImg/title.png" alt="">
                     <span slot="reference">页面标题</span>
                   </el-popover>
@@ -136,7 +141,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-popover placement="right" trigger="hover">
+                  <el-popover :open-delay="500" placement="right" trigger="hover">
                     <img style="width:400px;height:120px" src="./totasImg/fx.jpg" alt="">
                     <span slot="reference">分享描述</span>
                   </el-popover>
@@ -146,7 +151,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-popover placement="right" trigger="hover">
+                  <el-popover :open-delay="500" placement="right" trigger="hover">
                     <img src="./totasImg/tj.png" alt="">
                     <span slot="reference">推广图</span>
                   </el-popover>
@@ -159,7 +164,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-popover placement="right" trigger="hover">
+                  <el-popover :open-delay="500" placement="right" trigger="hover">
                     <img style="width:400px;height:120px" src="./totasImg/logo.jpg" alt="">
                     <span slot="reference">LOGO图</span>
                   </el-popover>
@@ -179,20 +184,20 @@
                 <el-collapse-item title="配色方案-主产品" name="0">
                   <el-row style="margin:0" :gutter="24">
                     <el-col style="display: flex;" :span="7">
-                      <el-tooltip effect="dark" content="页面背景底色" placement="top">
+                      <el-tooltip :open-delay="500" effect="dark" content="页面背景底色" placement="top">
                         <el-button style="margin-right:20px ;width: 100px;" type="text">背景色</el-button>
                       </el-tooltip>
                       <el-color-picker v-model="productJson.pageBgcol" size="small" show-alpha />
                     </el-col>
                     <el-col style="display: flex;" :span="7">
-                      <el-popover placement="right" trigger="hover">
+                      <el-popover :open-delay="500" placement="right" trigger="hover">
                         <img src="./totasImg/dgBg.png" alt="">
                         <el-button style="margin-right:20px ;width: 100px;" slot="reference" type="text">订购窗背景</el-button>
                       </el-popover>
                       <el-color-picker v-model="productJson.orderBgcol" size="small" show-alpha />
                     </el-col>
                     <el-col style="display: flex;" :span="7">
-                      <el-popover placement="right" trigger="hover">
+                      <el-popover :open-delay="500" placement="right" trigger="hover">
                         <img src="./totasImg/dgBr.png" alt="">
                         <el-button style="margin-right:20px ;width: 100px;" slot="reference" type="text">订购窗边框</el-button>
                       </el-popover>
@@ -201,14 +206,14 @@
                   </el-row>
                   <el-row style="margin:0" :gutter="24">
                     <el-col style="display: flex;" :span="7">
-                      <el-popover placement="right" trigger="hover">
+                      <el-popover :open-delay="500" placement="right" trigger="hover">
                         <img src="./totasImg/btnC1.png" alt="">
                         <el-button style="margin-right:20px ;width: 100px;" slot="reference" type="text">按钮色(上)</el-button>
                       </el-popover>
                       <el-color-picker v-model="productJson.btnTopcol" size="small" show-alpha />
                     </el-col>
                     <el-col style="display: flex;" :span="7">
-                      <el-popover placement="right" trigger="hover">
+                      <el-popover :open-delay="500" placement="right" trigger="hover">
                         <img src="./totasImg/btnC2.png" alt="">
                         <el-button style="margin-right:20px ;width: 100px;" slot="reference" type="text">按钮色(下)</el-button>
                       </el-popover>
@@ -217,14 +222,14 @@
                   </el-row>
                   <el-row style="margin:0" :gutter="24">
                     <el-col style="display: flex;" :span="7">
-                      <el-popover placement="right" trigger="hover">
+                      <el-popover :open-delay="500" placement="right" trigger="hover">
                         <img src="./totasImg/qgNumC.png" alt="">
                         <el-button style="margin-right:20px ;width: 100px;" slot="reference" type="text">抢购人数配色</el-button>
                       </el-popover>
                       <el-color-picker v-model="productJson.orderNumcol" size="small" show-alpha />
                     </el-col>
                     <el-col style="display: flex;" :span="7">
-                      <el-popover placement="right" trigger="hover">
+                      <el-popover :open-delay="500" placement="right" trigger="hover">
                         <img src="./totasImg/qgTextC.png" alt="">
                         <el-button style="margin-right:20px ;width: 100px;" slot="reference" type="text">抢购文案配色</el-button>
                       </el-popover>
@@ -233,14 +238,14 @@
                   </el-row>
                   <el-row style="margin:0" :gutter="24">
                     <el-col style="display: flex;" :span="7">
-                      <el-popover placement="right" trigger="hover">
+                      <el-popover :open-delay="500" placement="right" trigger="hover">
                         <img src="./totasImg/ymC.png" alt="">
                         <el-button style="margin-right:20px ;width: 100px;" slot="reference" type="text">页面文字配色</el-button>
                       </el-popover>
                       <el-color-picker v-model="productJson.pageTextcol" size="small" show-alpha />
                     </el-col>
                     <el-col style="display: flex;" :span="7">
-                      <el-popover placement="right" trigger="hover">
+                      <el-popover :open-delay="500" placement="right" trigger="hover">
                         <img src="./totasImg/ysC.png" alt="">
                         <el-button style="margin-right:20px ;width: 100px;" slot="reference" type="text">隐私声明配色</el-button>
                       </el-popover>
@@ -249,14 +254,14 @@
                   </el-row>
                   <el-row style="margin:0" :gutter="24">
                     <el-col style="display: flex;" :span="7">
-                      <el-popover placement="right" trigger="hover">
+                      <el-popover :open-delay="500" placement="right" trigger="hover">
                         <img src="./totasImg/cpC2.png" alt="">
                         <el-button style="margin-right:20px ;width: 100px;" slot="reference" type="text">主产品键配色</el-button>
                       </el-popover>
                       <el-color-picker v-model="productJson.tabMaincol" size="small" show-alpha />
                     </el-col>
                     <el-col style="display: flex;" :span="7">
-                      <el-popover placement="right" trigger="hover">
+                      <el-popover :open-delay="500" placement="right" trigger="hover">
                         <img src="./totasImg/cpC1.png" alt="">
                         <el-button style="margin-right:20px ;width: 100px;" slot="reference" type="text">副产品键配色</el-button>
                       </el-popover>
@@ -267,7 +272,7 @@
                 <el-collapse-item title="产品配图-主产品" name="1">
                   <el-form-item style="margin-top:20px">
                     <template slot="label">
-                      <el-tooltip content="开启后控制页面banner图和上层图片素材进行动画缩放" placement="top">
+                      <el-tooltip :open-delay="500" content="开启后控制页面banner图和上层图片素材进行动画缩放" placement="top">
                         <span>页面动效</span>
                       </el-tooltip>
                     </template>
@@ -275,7 +280,7 @@
                   </el-form-item>
                   <el-form-item>
                     <template slot="label">
-                      <el-tooltip content="底层banner背景图" placement="top">
+                      <el-tooltip :open-delay="500" content="底层banner背景图" placement="top">
                         <span>banner图</span>
                       </el-tooltip>
                     </template>
@@ -287,21 +292,19 @@
                   </el-form-item>
                   <el-form-item>
                     <template slot="label">
-                      <el-tooltip content="背景图之上的json动图" placement="top">
+                      <el-tooltip :open-delay="500" content="背景图之上的json动图" placement="top">
                         <span>动态文件</span>
                       </el-tooltip>
                     </template>
-                    <div v-if="productJson.jsonImg!==''" class="svgImg">
-                      <div id="lottie_box"></div>
-                    </div>
+                    <div style="max-width:260px !important" id="lottie_box"></div>
                     <el-upload v-if="productJson.jsonImg===''" class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'主jsonImg')})">
                       <i class="el-icon-plus avatar-uploader-icon"></i>
                     </el-upload>
-                    <span v-if="productJson.jsonImg!==''" @click="productJson.jsonImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
+                    <span v-if="productJson.jsonImg!==''" @click="svgRemove('主')" style="color: #F56C6C; cursor: pointer">删除</span>
                   </el-form-item>
                   <el-form-item>
                     <template slot="label">
-                      <el-tooltip content="json动图上层的图片素材" placement="top">
+                      <el-tooltip :open-delay="500" content="json动图上层的图片素材" placement="top">
                         <span>上层素材</span>
                       </el-tooltip>
                     </template>
@@ -313,7 +316,7 @@
                   </el-form-item>
                   <el-form-item>
                     <template slot="label">
-                      <el-tooltip content="最上层图片元素" placement="top">
+                      <el-tooltip :open-delay="500" content="最上层图片元素" placement="top">
                         <span>顶层素材</span>
                       </el-tooltip>
                     </template>
@@ -325,27 +328,27 @@
                   </el-form-item>
                   <el-form-item>
                     <template slot="label">
-                      <el-tooltip content="页面中产品说明配图  产品说明title配图" placement="top">
-                        <span>产品说明标题</span>
+                      <el-tooltip :open-delay="500" content="订购窗配图" placement="top">
+                        <span>订购窗配图</span>
                       </el-tooltip>
                     </template>
-                    <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'主orderImg')})">
-                      <img v-if="productJson.orderImg !==''" :src="imgUrl+productJson.orderImg" class="avatar" />
+                    <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'主explainImg')})">
+                      <img v-if="productJson.explainImg !== ''" :src="imgUrl+productJson.explainImg" class="avatar" />
                       <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                     </el-upload>
-                    <span v-if="productJson.orderImg!==''" @click="productJson.orderImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
+                    <span v-if="productJson.explainImg!==''" @click="productJson.explainImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
                   </el-form-item>
                   <el-form-item>
                     <template slot="label">
-                      <el-tooltip content="订购窗配图" placement="top">
-                        <span>订购窗配图</span>
+                      <el-tooltip :open-delay="500" content="页面中产品说明配图  产品说明title配图" placement="top">
+                        <span>产品说明标题</span>
                       </el-tooltip>
                     </template>
-                    <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'主explainImg')})">
-                      <img v-if="productJson.explainImg !== ''" :src="imgUrl+productJson.explainImg" class="avatar" />
+                    <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'主orderImg')})">
+                      <img v-if="productJson.orderImg !==''" :src="imgUrl+productJson.orderImg" class="avatar" />
                       <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                     </el-upload>
-                    <span v-if="productJson.explainImg!==''" @click="productJson.explainImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
+                    <span v-if="productJson.orderImg!==''" @click="productJson.orderImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
                   </el-form-item>
                 </el-collapse-item>
                 <el-collapse-item v-if="form.viceProductIds.length>0" title="配色方案-副产品" name="2">
@@ -425,13 +428,11 @@
                     <template slot="label">
                       <span>动态文件</span>
                     </template>
-                    <div v-if="viceJson.jsonImg!==''" class="svgImg">
-                      <div id="lottieVice"></div>
-                    </div>
+                    <div style="max-width:260px !important" id="lottieVice"></div>
                     <el-upload v-if="viceJson.jsonImg===''" class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'副jsonImg')})">
                       <i class="el-icon-plus avatar-uploader-icon"></i>
                     </el-upload>
-                    <span v-if="viceJson.jsonImg!==''" @click="viceJson.jsonImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
+                    <span v-if="viceJson.jsonImg!==''" @click="svgRemove('副')" style="color: #F56C6C; cursor: pointer">删除</span>
                   </el-form-item>
                   <el-form-item>
                     <template slot="label">
@@ -456,35 +457,35 @@
                   </el-form-item>
                   <el-form-item>
                     <template slot="label">
-                      <span>产品说明标题</span>
+                      <span>订购窗配图</span>
                     </template>
-                    <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'副orderImg')})">
-                      <img v-if="viceJson.orderImg" :src="imgUrl+viceJson.orderImg" class="avatar" />
+                    <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'副explainImg')})">
+                      <img v-if="viceJson.explainImg" :src="imgUrl+viceJson.explainImg" class="avatar" />
                       <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                     </el-upload>
-                    <span v-if="viceJson.orderImg!==''" @click="viceJson.orderImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
+                    <span v-if="viceJson.explainImg!==''" @click="viceJson.explainImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
                   </el-form-item>
                   <el-form-item>
                     <template slot="label">
-                      <span>订购窗配图</span>
+                      <span>产品说明标题</span>
                     </template>
-                    <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'副explainImg')})">
-                      <img v-if="viceJson.explainImg" :src="imgUrl+viceJson.explainImg" class="avatar" />
+                    <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'副orderImg')})">
+                      <img v-if="viceJson.orderImg" :src="imgUrl+viceJson.orderImg" class="avatar" />
                       <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                     </el-upload>
-                    <span v-if="viceJson.explainImg!==''" @click="viceJson.explainImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
+                    <span v-if="viceJson.orderImg!==''" @click="viceJson.orderImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
                   </el-form-item>
                 </el-collapse-item>
                 <el-collapse-item title="菜单按钮" name="4">
                   <el-row style="margin:0" :gutter="24">
                     <el-col style="display: flex;" :span="10">
-                      <el-tooltip effect="dark" content="底部导航订购记录按钮" placement="top">
+                      <el-tooltip :open-delay="500" effect="dark" content="底部导航订购记录按钮" placement="top">
                         <span class="spanStyle">订购记录</span>
                       </el-tooltip>
                       <el-switch v-model="extJson.jiluBtn" active-text="勾选" inactive-text="不勾选" active-value="1" inactive-value="0" />
                     </el-col>
                     <el-col style="display: flex;" :span="10">
-                      <el-tooltip effect="dark" content="底部导航流量激活按钮" placement="top">
+                      <el-tooltip :open-delay="500" effect="dark" content="底部导航流量激活按钮" placement="top">
                         <span class="spanStyle">流量激活</span>
                       </el-tooltip>
                       <el-switch v-model="extJson.jihuoBtn" active-text="勾选" inactive-text="不勾选" active-value="1" inactive-value="0" />
@@ -492,13 +493,13 @@
                   </el-row>
                   <el-row style="margin:0" :gutter="24">
                     <el-col style="display: flex;" :span="10">
-                      <el-tooltip effect="dark" content="底部导航领取话费按钮" placement="top">
-                        <span class="spanStyle">领取话费</span>
+                      <el-tooltip :open-delay="500" effect="dark" content="底部导航一键反馈按钮" placement="top">
+                        <span class="spanStyle">一键反馈</span>
                       </el-tooltip>
                       <el-switch v-model="extJson.guanzhuBtn" active-text="勾选" inactive-text="不勾选" active-value="1" inactive-value="0" />
                     </el-col>
                     <el-col style="display: flex;" :span="10">
-                      <el-tooltip effect="dark" content="底部导航退订产品按钮" placement="top">
+                      <el-tooltip :open-delay="500" effect="dark" content="底部导航退订产品按钮" placement="top">
                         <span class="spanStyle">退订产品</span>
                       </el-tooltip>
                       <el-switch v-model="extJson.tuidingBtn" active-text="勾选" inactive-text="不勾选" active-value="1" inactive-value="0" />
@@ -506,13 +507,13 @@
                   </el-row>
                   <el-row style="margin:0" :gutter="24">
                     <el-col style="display: flex;" :span="10">
-                      <el-tooltip effect="dark" content="底部导航流量查询按钮" placement="top">
+                      <el-tooltip :open-delay="500" effect="dark" content="底部导航流量查询按钮" placement="top">
                         <span class="spanStyle">流量查询</span>
                       </el-tooltip>
                       <el-switch v-model="extJson.chaxunBtn" active-text="勾选" inactive-text="不勾选" active-value="1" inactive-value="0" />
                     </el-col>
                     <el-col style="display: flex;" :span="10">
-                      <el-tooltip effect="dark" content="底部导航会员领取按钮" placement="top">
+                      <el-tooltip :open-delay="500" effect="dark" content="底部导航会员领取按钮" placement="top">
                         <span class="spanStyle">会员领取</span>
                       </el-tooltip>
                       <el-switch v-model="extJson.memberBtn" active-text="勾选" inactive-text="不勾选" active-value="1" inactive-value="0" />
@@ -527,7 +528,7 @@
             <el-form size="small" ref="form" label-width="100px" style="width:65%">
               <el-form-item>
                 <template slot="label">
-                  <el-popover placement="right" trigger="hover">
+                  <el-popover :open-delay="500" placement="right" trigger="hover">
                     <img src="./totasImg/ysBtn.png" alt="">
                     <span slot="reference">隐私声明</span>
                   </el-popover>
@@ -536,7 +537,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-popover placement="right" trigger="hover">
+                  <el-popover :open-delay="500" placement="right" trigger="hover">
                     <img src="./totasImg/fj.png" alt="">
                     <span slot="reference">附加声明</span>
                   </el-popover>
@@ -553,7 +554,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-popover placement="right" trigger="hover">
+                  <el-popover :open-delay="500" placement="right" trigger="hover">
                     <img src="./totasImg/hy.png" alt="">
                     <span slot="reference">提示文案</span>
                   </el-popover>
@@ -562,7 +563,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-tooltip content="用于产品订购时是否开启遮罩层" placement="top">
+                  <el-tooltip :open-delay="500" content="用于产品订购时是否开启遮罩层" placement="top">
                     <span>启用遮罩</span>
                   </el-tooltip>
                 </template>
@@ -570,7 +571,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-popover placement="right" trigger="hover">
+                  <el-popover :open-delay="500" placement="right" trigger="hover">
                     <img src="./totasImg/zz.png" alt="">
                     <span slot="reference">遮罩文案</span>
                   </el-popover>
@@ -596,7 +597,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-tooltip content="用于控制订购按钮的显示隐藏" placement="top">
+                  <el-tooltip :open-delay="500" content="用于控制订购按钮的显示隐藏" placement="top">
                     <span>开启订购</span>
                   </el-tooltip>
                 </template>
@@ -604,7 +605,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-popover placement="right" trigger="hover">
+                  <el-popover :open-delay="500" placement="right" trigger="hover">
                     <img src="./totasImg/btn1.png" alt="">
                     <span slot="reference">主产品文案</span>
                   </el-popover>
@@ -613,7 +614,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-popover placement="right" trigger="hover">
+                  <el-popover :open-delay="500" placement="right" trigger="hover">
                     <img src="./totasImg/btn2.png" alt="">
                     <span slot="reference">副产品文案</span>
                   </el-popover>
@@ -622,7 +623,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-popover placement="right" trigger="hover">
+                  <el-popover :open-delay="500" placement="right" trigger="hover">
                     <img src="./totasImg/num.png" alt="">
                     <span slot="reference">订购人数</span>
                   </el-popover>
@@ -641,7 +642,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-popover placement="right" trigger="hover">
+                  <el-popover :open-delay="500" placement="right" trigger="hover">
                     <img src="./totasImg/td.png" alt="">
                     <span slot="reference">退订窗文案</span>
                   </el-popover>
@@ -650,7 +651,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-tooltip content="开启后,订购产品成功,自动调用领取会员" placement="top">
+                  <el-tooltip :open-delay="500" content="开启后,订购产品成功,自动调用领取会员" placement="top">
                     <span>会员自动直冲</span>
                   </el-tooltip>
                 </template>
@@ -658,7 +659,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-tooltip content="开启后,订购产品成功,自动调用流量激活" placement="top">
+                  <el-tooltip :open-delay="500" content="开启后,订购产品成功,自动调用流量激活" placement="top">
                     <span>流量自动激活</span>
                   </el-tooltip>
                 </template>
@@ -671,7 +672,7 @@
             <el-form size="small" ref="form" label-width="100px" style="width:65%">
               <el-form-item>
                 <template slot="label">
-                  <el-tooltip content="用于推荐的策略" placement="top">
+                  <el-tooltip :open-delay="500" content="用于推荐的策略" placement="top">
                     <span>推荐策略</span>
                   </el-tooltip>
                 </template>
@@ -681,7 +682,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-popover placement="right" trigger="hover">
+                  <el-popover :open-delay="500" placement="right" trigger="hover">
                     <img src="./totasImg/tdyl.png" alt="">
                     <span slot="reference">退订引流</span>
                   </el-popover>
@@ -692,7 +693,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-popover placement="right" trigger="hover">
+                  <el-popover :open-delay="500" placement="right" trigger="hover">
                     <img src="./totasImg/cfyl.png" alt="">
                     <span slot="reference">重复订购引流</span>
                   </el-popover>
@@ -708,7 +709,7 @@
             <el-form size="small" ref="form" label-width="100px" style="width:65%">
               <el-form-item>
                 <template slot="label">
-                  <el-tooltip content="跳转活动页面的活动链接" placement="top">
+                  <el-tooltip :open-delay="500" content="跳转活动页面的活动链接" placement="top">
                     <span>活动链接</span>
                   </el-tooltip>
                 </template>
@@ -716,7 +717,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-tooltip content="当前跳转活动链接属于活动类型" placement="top">
+                  <el-tooltip :open-delay="500" content="当前跳转活动链接属于活动类型" placement="top">
                     <span>活动类型</span>
                   </el-tooltip>
                 </template>
@@ -736,7 +737,7 @@
               </el-form-item> -->
               <el-form-item>
                 <template slot="label">
-                  <el-tooltip content="位于banner图侧方跳转活动logo图标" placement="top">
+                  <el-tooltip :open-delay="500" content="位于banner图侧方跳转活动logo图标" placement="top">
                     <span>活动LOGO</span>
                   </el-tooltip>
                 </template>
@@ -748,7 +749,7 @@
               </el-form-item>
               <el-form-item>
                 <template slot="label">
-                  <el-tooltip content="位于推荐位可跳转活动页面活动海报" placement="top">
+                  <el-tooltip :open-delay="500" content="位于推荐位可跳转活动页面活动海报" placement="top">
                     <span>活动海报</span>
                   </el-tooltip>
                 </template>
@@ -761,10 +762,9 @@
             </el-form>
           </div>
         </div>
-        <div class="footer">
-          <el-button style="float:right;margin-left: 15px;" type="primary" icon="el-icon-folder-add" size="mini" @click="keepClick()">保存</el-button>
-          <el-button style="float:right;margin-left: 15px;" size="mini" icon="el-icon-circle-close" @click="$router.go(-1)">取消</el-button>
-        </div>
+        <!-- <div class="footer">
+
+        </div> -->
       </div>
     </div>
 
@@ -915,7 +915,6 @@ export default {
     this.getProductList()
     this.getStrategyList()
   },
-  watch: {},
   mounted () {
     if (this.$route.query.id) {
       let id = this.$route.query.id
@@ -928,7 +927,7 @@ export default {
   },
   methods: {
     inputBlur () {
-      this.form.strategyName = this.form.strategyName + '-' + this.$store.state.user.name
+      this.form.strategyName = this.$store.state.user.name+'——'+this.form.strategyName
     },
     // 选择模板
     templateChange (e) {
@@ -967,8 +966,13 @@ export default {
         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.productJson.jsonImg !== '') {
+          let imgUrl = this.imgUrl + this.productJson.jsonImg
+          this.svgClick('主', imgUrl)
+        }
+        if (this.viceJson.jsonImg !== '') {
+          let imgUrl = this.imgUrl + this.viceJson.jsonImg
+          this.svgClick('副', imgUrl)
         }
         if (this.$route.query.copy) {
           this.form.strategyName = this.form.strategyName + '-复制'
@@ -981,7 +985,7 @@ export default {
     },
     // 获取新策略列表
     getStrategyList () {
-      get('/strategytemplate/list', this.form).then(res => {
+      get('/strategytemplate/list', { pageNum: 1, pageSize: 9999 }).then(res => {
         this.strategyInfoList = res.data.list
       })
     },
@@ -1136,7 +1140,8 @@ export default {
           this.productJson.bannerImg = file.data
         } else if (name === '主jsonImg') {
           this.productJson.jsonImg = file.data
-          this.svgClick('主', file.data)
+          let imgUrl = this.imgUrl + file.data
+          this.svgClick('主', imgUrl)
         } else if (name === '主upImg') {
           this.productJson.upImg = file.data
         } else if (name === '主topImg') {
@@ -1149,7 +1154,8 @@ export default {
           this.viceJson.bannerImg = file.data
         } else if (name === '副jsonImg') {
           this.viceJson.jsonImg = file.data
-          this.svgClick('副', file.data)
+          let imgUrl = this.imgUrl + file.data
+          this.svgClick('副', imgUrl)
         } else if (name === '副upImg') {
           this.viceJson.upImg = file.data
         } else if (name === '副topImg') {
@@ -1183,7 +1189,7 @@ export default {
           renderer: 'svg',
           loop: true,
           autoplay: true,
-          path: this.imgUrl + path
+          path: path
         })
       } else if (name === '副') {
         this.lottie = lottie.loadAnimation({
@@ -1191,25 +1197,20 @@ export default {
           renderer: 'svg',
           loop: true,
           autoplay: true,
-          path: this.imgUrl + path
-        })
-      } else if (name === 'all') {
-        this.lottie = lottie.loadAnimation({
-          container: document.getElementById('lottieVice'),
-          renderer: 'svg',
-          loop: true,
-          autoplay: true,
-          path: this.imgUrl + this.viceJson.jsonImg
-        })
-        this.lottie = lottie.loadAnimation({
-          container: document.getElementById('lottie_box'),
-          renderer: 'svg',
-          loop: true,
-          autoplay: true,
-          path: this.imgUrl + this.productJson.jsonImg
+          path: path
         })
       }
-
+    },
+    svgRemove (name) {
+      if (name === '主') {
+        this.productJson.jsonImg = ''
+        let div = document.getElementById('lottie_box')
+        div.innerHTML = ""
+      } else if (name === '副') {
+        this.viceJson.jsonImg = ''
+        let div = document.getElementById('lottieVice')
+        div.innerHTML = ""
+      }
     }
   },
 }
@@ -1250,7 +1251,7 @@ export default {
       0 16px 24px 2px rgb(0 0 0 / 14%), 0 6px 30px 5px rgb(0 0 0 / 12%);
     .main {
       width: 100%;
-      height: 80vh;
+      height: 100vh;
       overflow-y: scroll;
     }
     ::-webkit-scrollbar {
@@ -1270,11 +1271,6 @@ export default {
       overflow: hidden;
     }
   }
-  .svgImg {
-    max-width: 260px;
-    margin-right: 10px;
-    display: inline-block;
-  }
 
   .avatar-uploader-icon {
     background-color: #fbfdff;

+ 4 - 4
purchase_ao/src/views/strategy/index.vue

@@ -41,9 +41,9 @@
       <el-table-column prop="createTime" label="创建时间"></el-table-column>
       <el-table-column label="操作">
         <template slot-scope="scope">
-          <el-button type="text" size="small" @click="invalid(scope.row)">失效</el-button>
           <el-button type="text" size="small" icon="el-icon-document-copy" @click="addClick('copy',scope.row)">复制</el-button>
           <el-button type="text" size="small" icon="el-icon-edit" @click="addClick('edit',scope.row)">编辑</el-button>
+          <el-button type="text" size="small" @click="invalid(scope.row)">失效</el-button>
           <el-button type="text" size="small" icon="el-icon-delete" @click="addClick('remove',scope.row)">删除</el-button>
         </template>
       </el-table-column>
@@ -155,13 +155,13 @@ export default {
     },
     // 每页数量
     handleSizeChange (val) {
-      this.form.pageNum = val
+      this.form.pageNum = 1
+      this.form.pageSize = val
       this.getStrategyList()
     },
     // 当前页
     handleCurrentChange (val) {
-      this.form.pageNum = 1
-      this.form.pageSize = val
+      this.form.pageNum = val
       this.getStrategyList()
     },
     // 数据失效处理