Pārlūkot izejas kodu

add call pay success page

stanley-king 4 gadi atpakaļ
vecāks
revīzija
7d20cf117a

+ 17 - 8
pages/components/blockItem/blockItem.js

@@ -143,18 +143,27 @@ Component({
             let num = params['num'];
             buyVGoods(app,goods_id,num);
           }
-          else if(prefix == 'xyzshop://www.xyzshops.com/NavigatePage')
-            switch(params.page){
-              case "oil" : 
+          else if(prefix == 'xyzshop://www.xyzshops.com/NavigatePage') {
+            switch (params.page) {
+              case "oil":
                 app.switchtab('/pages/postage/postage')
                 break;
-              case "phone" : 
-                app.navigateto('/pages/phoneCharges/phoneCharges') 
+              case "phone":
+                app.navigateto('/pages/phoneCharges/phoneCharges')
                 break;
-              default: 
-              console.log(params.page + 'page找不到');
+              default:
+                console.log(params.page + 'page找不到');
             }
-          break;
+            break;
+          }
+          else if(prefix == 'xyzshop://www.xyzshops.com/InviteFriends') {
+            console.log('onShareInfo')
+            wx.getShareInfo({
+              success: function (res) {
+                console.log(res)
+              }
+            })    
+          }
         }
         default: {
           console.log(type + '类型找不到');

+ 0 - 1
pages/components/shareDialog/shareDialog.js

@@ -63,7 +63,6 @@ Component({
           console.log('setting:', itemSettings)
           if (itemSettings) {
             if (itemSettings['模版id'] === 'accept') {
-              
             }
           }
         }

+ 1 - 1
pages/index/index.wxml

@@ -21,5 +21,5 @@
          mode='widthFix' 
          class='back_top_btn' 
          src='../../image/back_top.png'>
-  </image> 
+  </image>
 </view>

+ 9 - 9
pages/phoneCharges/phoneCharges.js

@@ -23,7 +23,8 @@ Page({
     fromSource: '',
     payInfoChecked:true,
     showShareDialog:false,
-    showtermsOfServiceDialog:false
+    showtermsOfServiceDialog:false,
+    special_id: 0 //订单成功,弹出的专题页面
   },
 
   onShowShareDialog(){
@@ -110,6 +111,7 @@ Page({
           let goods_inviter_tips = self.formGoodsInviterTips(datas.goods_inviter_tips)
           let goods_id = datas.goods[0].goods_id
           let inviter_tip = goods_inviter_tips.get(goods_id)
+          let special_id = res.datas.special_id
 
           self.setData({
             tips: datas.tips,
@@ -117,15 +119,12 @@ Page({
             inviter_tip: inviter_tip,
             goods_inviter_tips,
             goods_id: goods_id,
-            card_no: card.card_no
+            card_no: card.card_no,
+            special_id: special_id
           });
         }
       } else {
-        wx.showToast({
-          icon: 'none',
-          title: '支付未完成,订单将在10分钟后取消...',
-          duration: 5000
-        })
+        app.showToast(res.message)
       }
       self.fGoodsRequesting = false
     })
@@ -156,8 +155,9 @@ Page({
       return
     }
     buyVGoods(app, goods_id, 1, { card_no, card_type}, (res) => {
-      let page = getCurrentPages().pop();
-      page.onLoad()
+      let special_id = this.data.special_id
+      let title = '支付成功'
+      app.navigateto(`/pages/special/special?special_id=${special_id}&title=${title}`)
     }, (err) => {
         wx.showToast({
           icon: 'none',

+ 10 - 8
pages/postage/postage.js

@@ -33,7 +33,9 @@ Page({
     payInfoChecked:true,
     showShareDialog:false,
     shareGoodsId:0,
-    showtermsOfServiceDialog:false
+    showtermsOfServiceDialog:false,
+
+    special_id:0 //订单成功,弹出的专题页面
   },
 
   onShowShareDialog(){
@@ -133,7 +135,7 @@ Page({
           const datas = res.datas
 
           let goods_inviter_tips = this.formGoodsInviterTips(res.datas.goods_inviter_tips)
-          const { tips = '', goods = [], cards = [], member_mobile} = datas
+          const { tips = '', goods = [], cards = [], member_mobile,special_id} = datas
 
           let phone = app.getValueByKey('phone', cards)
           let petrochina = app.getValueByKey('petrochina', cards)
@@ -145,7 +147,7 @@ Page({
 
           let goods_id = datas.goods[0].goods_id
           let inviter_tip = goods_inviter_tips.get(goods_id)
-          this.setData({tips, goods_inviter_tips, inviter_tip, goods, sinopec, petrochina, phone, goods_id, member_mobile});
+          this.setData({ tips, goods_inviter_tips, inviter_tip, goods, sinopec, petrochina, phone, goods_id, member_mobile, special_id});
         }
       }
       else {
@@ -196,11 +198,11 @@ Page({
       return
     }
     buyVGoods(app,goods_id,1,{ card_no,card_type }, (res) => {
-      console.table({card_no,card_type})
-      console.log('res:',res)
-      let page = getCurrentPages().pop();
-      page.onLoad()
+      let special_id = this.data.special_id
+      let title = '支付成功'
+      app.navigateto(`/pages/special/special?special_id=${special_id}&title=${title}`)
     }, (err) => {
+
         wx.showToast({
           icon: 'none',
           title: '支付未完成,订单将在10分钟后取消...',
@@ -255,7 +257,7 @@ Page({
         console.log(res)
       }
     })    
-  },
+  }, 
 
   /**
    * 生命周期函数--监听页面卸载