Commit cbd5c7b4cf46a5bece8d17769f932e14b0cd8e18
1 parent
812589cf5d
Exists in
master
and in
2 other branches
支付前刷新openid
Showing 4 changed files with 36 additions and 3 deletions
littleApp_child/pages/Setting/Setting.js
View file @
cbd5c7b
littleApp_child/pages/order_payment/order_payment.js
View file @
cbd5c7b
... | ... | @@ -55,6 +55,33 @@ |
55 | 55 | |
56 | 56 | }) |
57 | 57 | }, |
58 | + | |
59 | + refreshOpenid() { | |
60 | + var self = this | |
61 | + var jscode = '' | |
62 | + wx.login({ | |
63 | + success: function (res) { | |
64 | + // success | |
65 | + jscode = res.code | |
66 | + | |
67 | + | |
68 | + networkUtil._get(api.refreshOpenId + "?jscode=" + jscode + "&type=2", {}, function (res) { | |
69 | + | |
70 | + console.log(res) | |
71 | + self.getPayMessage() | |
72 | + }, function (res) { | |
73 | + | |
74 | + }) | |
75 | + }, | |
76 | + fail: function (res) { | |
77 | + // fail | |
78 | + }, | |
79 | + complete: function (res) { | |
80 | + // complete | |
81 | + } | |
82 | + }) | |
83 | + }, | |
84 | + | |
58 | 85 | getPayMessage(){ |
59 | 86 | networkUtil.showLoading() |
60 | 87 | var self = this |
... | ... | @@ -88,7 +115,7 @@ |
88 | 115 | }) |
89 | 116 | }, |
90 | 117 | payClick:function(e){ |
91 | - this.getPayMessage() | |
118 | + this.refreshOpenid() | |
92 | 119 | } |
93 | 120 | |
94 | 121 | }) |
littleApp_child/pages/order_payment/order_payment.wxss
View file @
cbd5c7b