Forráskód Böngészése

订购成功及智家退订模板调整订购成功提示逻辑

litong 2 éve
szülő
commit
993f9d2a18

+ 23 - 20
purchase_H5/src/componentsNew/handelModal.vue

@@ -10,29 +10,29 @@
         </div>
         <div v-if="pageData.mainProduct.spid == '1299'">
           <div v-if="is1298 == false">
-            <div class="text-box">
+            <div class="text-box" style="text-align: center">
               订购成功,5秒后请点击确认转入服务页面
             </div>
             <div class="btn-box">
-              <div class="btnRow" @click="goUrl" :class="timeCode>0?'btnDisabled':''">确定 <span v-if="timeCode>0">{{ timeCode }}</span></div>
+              <div class="btnRow" @click="goUrl" :class="timeCode>0?'btnDisabled':''">确定 <span v-if="timeCode>0">{{ timeCode }}</span></div>
             </div>
           </div>
           <div v-else>
-            <div class="text-box">
+            <div class="text-box" style="text-align: center">
               您同时订购了智家守护基础版”产品,如需退订请返回服务页面,点击头像--订购记录--智家守护基础版进行退订
             </div>
             <div class="btn-box">
-              <div class="btnRow" @click="goUrl" :class="timeCode>0?'btnDisabled':''">跳转服务页<span v-if="timeCode>0">{{ timeCode }}</span></div>
+              <div class="btnRow" @click="goUrl" :class="timeCode>0?'btnDisabled':''">跳转服务页<span v-if="timeCode>0">{{ timeCode }}</span></div>
             </div>
           </div>
 
         </div>
         <div v-else>
-          <div class="text-box">
+          <div class="text-box" style="text-align: center">
             订购成功,5秒后请点击确认转入服务页面
           </div>
           <div class="btn-box">
-            <div class="btnRow" :class="timeCode>0?'btnDisabled':''">确定 <span v-if="timeCode>0">{{ timeCode }}</span></div>
+            <div class="btnRow" @click="goUrl" :class="timeCode>0?'btnDisabled':''">确定 <span v-if="timeCode>0">{{ timeCode }}</span></div>
           </div>
         </div>
 
@@ -78,18 +78,21 @@ export default {
   props: {
     value: Boolean
   },
-  mounted () {
-    if (this.value == true) {
-      setInterval(() => {
-        if (this.timeCode > 0) {
-          this.timeCode--
-        } else if (this.timeCode == 0) {
-          clearInterval()
-        }
-      }, 1000)
-      this.getIsBuy()
-    }
-  },
+    watch: {
+      value: function () {
+          if (this.value == true) {
+              setInterval(() => {
+                  if (this.timeCode > 0) {
+                      this.timeCode--
+                      console.log(this.timeCode)
+                  } else if (this.timeCode == 0) {
+                      clearInterval()
+                  }
+              }, 1000)
+              this.getIsBuy()
+          }
+      }
+    },
   methods: {
     getIsBuy () {
       let userid = this.$store.state.user.userid
@@ -109,7 +112,7 @@ export default {
       });
     },
     goUrl () {
-      window.open('https://www.baidu.com/')
+      window.open('https://mec.5gi.10010.com/gold/test/index.html#/home')
     },
   }
 };
@@ -229,4 +232,4 @@ export default {
     transform: translateX(-50%);
   }
 }
-</style>
+</style>

+ 16 - 13
purchase_H5/src/templates/tuiding-zhijia/index.vue

@@ -38,7 +38,7 @@
           退订成功,5秒后请点击确认转入服务页面
         </div>
         <div class="btn-box">
-          <div class="btnRow" @click="goUrl" :class="timeCode>0?'btnDisabled':''">确定 <span v-if="timeCode>0">{{ timeCode }}</span></div>
+          <div class="btnRow" @click="goUrl" :class="timeCode>0?'btnDisabled':''">确定 <span v-if="timeCode>0">{{ timeCode }}</span></div>
         </div>
       </div>
     </van-overlay>
@@ -68,6 +68,19 @@ export default {
       return this.$store.state.pageData
     }
   },
+    watch: {
+        tuidingModal: function () {
+            if (this.tuidingModal == true) {
+                setInterval(() => {
+                    if (this.timeCode > 0) {
+                        this.timeCode--
+                    } else if (this.timeCode == 0) {
+                        clearInterval()
+                    }
+                }, 1000)
+            }
+        }
+    },
   created () {
     addR.openPage() // 页面打开事件
     let {
@@ -85,20 +98,10 @@ export default {
         addR.loginSuccess()
       })
     }
-
-    if (this.tuidingModal == true) {
-      setInterval(() => {
-        if (this.timeCode > 0) {
-          this.timeCode--
-        } else if (this.timeCode == 0) {
-          clearInterval()
-        }
-      }, 1000)
-    }
   },
   methods: {
     goUrl () {
-      window.open('https://www.baidu.com/')
+      window.open('https://mec.5gi.10010.com/gold/test/index.html#/home')
     },
     // 获取订购记录
     getIsbuy (userid) {
@@ -339,4 +342,4 @@ export default {
     }
   }
 }
-</style>
+</style>