Explorar o código

结账功能优化 订阅消息优化

shish %!s(int64=3) %!d(string=hai) anos
pai
achega
37743218db

+ 15 - 9
hdApp/src/pagesPurchase/gatherPay.vue

@@ -60,16 +60,22 @@ export default {
   },
   methods: {
     init(){
-      
+     
     },
-			orderTimeFun(){
-				if(this.orderTime==0)return;
-				setTimeout(()=>{
-					this.orderTime--;
-					this.orderTimeFun();
-				},1000)
-			},
-    wxPayFn () {
+    orderTimeFun(){
+      if(this.orderTime==0)return;
+      setTimeout(()=>{
+        this.orderTime--;
+        this.orderTimeFun();
+      },1000)
+    },
+    wxPayFn(){
+      let that = this
+      that.$util.confirmModal({content:'确认到货花材都没有问题?此账单支付后无法再申请售后'},() => {
+        that.confirmWxPayFn()
+      })
+    },
+    confirmWxPayFn () {
       let currentMiniOpenId = uni.getStorageSync('currentMiniOpenId')
       let that = this
       if(!this.$util.isEmpty(currentMiniOpenId)){

+ 26 - 1
hdApp/src/pagesPurchase/particulars.vue

@@ -53,7 +53,8 @@
 </template>
 <script>
 import { getCgItemInfo } from "@/api/purchase";
-import { batchChangePrice } from '@/api/product'
+import { batchChangePrice } from '@/api/product';
+import { mapGetters } from "vuex";
 export default {
   name: "AppResult",
   data() {
@@ -89,6 +90,9 @@ export default {
       this.$store.commit("setLoginInfo", {})
     }
   },
+  computed: {
+    ...mapGetters(['getDictionariesInfo']),
+  },
   methods: {
     init(){
 
@@ -141,16 +145,37 @@ export default {
     },
     goBack(){
       uni.navigateBack()
+      this.subscribe()
     },
     goHome () {
       uni.removeStorageSync('ghsCgScene')
       uni.removeStorageSync('ghsCgOption')
       this.pageTo({url:"/admin/home/workbench",type:4})
+      this.subscribe()
     },
     goDetail() {
       uni.removeStorageSync('ghsCgScene')
       uni.removeStorageSync('ghsCgOption')
       this.pageTo({url: '/pagesPurchase/purDetails?id='+this.option.id+'&status=2',type:2})
+      this.subscribe()
+    },
+    subscribe(){
+      // #ifdef MP-WEIXIN
+      if(this.getDictionariesInfo && this.getDictionariesInfo.subscribeMessage && this.getDictionariesInfo.subscribeMessage == 1 && this.getDictionariesInfo.hdMiniMessage && this.getDictionariesInfo.hdMiniMessage.cgSuccess && this.getDictionariesInfo.hdMiniMessage.remindHdClear && this.getDictionariesInfo.hdMiniMessage.giveCoupon){
+        uni.requestSubscribeMessage({
+          tmplIds: [this.getDictionariesInfo.hdMiniMessage.cgSuccess.msgId,this.getDictionariesInfo.hdMiniMessage.giveCoupon.msgId,this.getDictionariesInfo.hdMiniMessage.remindHdClear.msgId],
+          success(res) {
+            console.log(res)
+          },
+          fail(err) {
+            console.log(err)
+          },
+          complete() {
+
+          }
+        })
+      }
+      // #endif
     }
   },
 };

+ 1 - 41
hdApp/src/pagesPurchase/wechatPay.vue

@@ -115,28 +115,7 @@ export default {
     },
     debtPay(){
       let that = this
-      // #ifdef APP-PLUS
       that.confirmDebtPay()
-      // #endif
-      // #ifdef MP-WEIXIN
-      if(this.getDictionariesInfo && this.getDictionariesInfo.subscribeMessage && this.getDictionariesInfo.subscribeMessage == 1 && this.getDictionariesInfo.hdMiniMessage && this.getDictionariesInfo.hdMiniMessage.cgSuccess && this.getDictionariesInfo.hdMiniMessage.remindHdClear && this.getDictionariesInfo.hdMiniMessage.giveCoupon){
-        uni.requestSubscribeMessage({
-          tmplIds: [this.getDictionariesInfo.hdMiniMessage.cgSuccess.msgId,this.getDictionariesInfo.hdMiniMessage.giveCoupon.msgId,this.getDictionariesInfo.hdMiniMessage.remindHdClear.msgId],
-          success(res) {
-            console.log(res)
-            that.confirmDebtPay()
-          },
-          fail(err) {
-            console.log(err)
-          },
-          complete() {
-
-          }
-        })
-      }else{
-        that.confirmDebtPay()
-      }
-      // #endif
     },
     confirmDebtPay() {
       let that = this
@@ -145,10 +124,7 @@ export default {
         purchaseDebtPay({ orderSn: that.orderSn }).then(res => {
           uni.hideLoading()
           if(res.code == 1){
-            that.pageTo({
-              url: '/pagesPurchase/particulars?id=' + res.data.id,
-              type: 2
-            })
+            that.pageTo({ url: '/pagesPurchase/particulars?id=' + res.data.id, type: 2 })
           }
         })
       })      
@@ -189,22 +165,6 @@ export default {
     getSuccess () {
       let that = this
       that.pageTo({ url: '/pagesPurchase/particulars?id=' + that.pageId, type: 2 })
-      // #ifdef MP-WEIXIN
-      if(this.getDictionariesInfo && this.getDictionariesInfo.subscribeMessage && this.getDictionariesInfo.subscribeMessage == 1 && this.getDictionariesInfo.hdMiniMessage && this.getDictionariesInfo.hdMiniMessage.cgSuccess && this.getDictionariesInfo.hdMiniMessage.remindHdClear && this.getDictionariesInfo.hdMiniMessage.giveCoupon){
-        uni.requestSubscribeMessage({
-          tmplIds: [this.getDictionariesInfo.hdMiniMessage.cgSuccess.msgId,this.getDictionariesInfo.hdMiniMessage.giveCoupon.msgId,this.getDictionariesInfo.hdMiniMessage.remindHdClear.msgId],
-          success(res) {
-            console.log(res)
-          },
-          fail(err) {
-            console.log(err)
-          },
-          complete() {
-
-          }
-        })
-      }
-      // #endif
     },
     // 关闭键盘
     closeKeyFn () {