shish 3 лет назад
Родитель
Сommit
bdeeea7c68
1 измененных файлов с 58 добавлено и 14 удалено
  1. 58 14
      hdApp/src/pagesPurchase/wechatPay.vue

+ 58 - 14
hdApp/src/pagesPurchase/wechatPay.vue

@@ -113,19 +113,44 @@ export default {
       })
 
     },
-    debtPay () {
+    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
       that.$util.confirmModal({content:'确认赊账?'},() => {
-            uni.showLoading({mask:true})
-						purchaseDebtPay({ orderSn: that.orderSn }).then(res => {
-              uni.hideLoading()
-              if(res.code == 1){
-                that.pageTo({
-                  url: '/pagesPurchase/particulars?id=' + res.data.id,
-                  type: 2
-                })
-              }
+        uni.showLoading({mask:true})
+        purchaseDebtPay({ orderSn: that.orderSn }).then(res => {
+          uni.hideLoading()
+          if(res.code == 1){
+            that.pageTo({
+              url: '/pagesPurchase/particulars?id=' + res.data.id,
+              type: 2
             })
+          }
+        })
       })      
     },
     wxPayFn () {
@@ -162,10 +187,29 @@ export default {
       })
     },
     getSuccess () {
-      this.pageTo({
-        url: '/pagesPurchase/particulars?id=' + this.pageId,
-        type: 2
-      })
+      let that = this
+      // #ifdef APP-PLUS
+      that.pageTo({ url: '/pagesPurchase/particulars?id=' + that.pageId, type: 2 })
+      // #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.pageTo({ url: '/pagesPurchase/particulars?id=' + that.pageId, type: 2 })
+          },
+          fail(err) {
+            console.log(err)
+          },
+          complete() {
+
+          }
+        })
+      }else{
+        that.pageTo({ url: '/pagesPurchase/particulars?id=' + that.pageId, type: 2 })
+      }
+      // #endif
     },
     // 关闭键盘
     closeKeyFn () {