diff --git a/pages/moneyRecharge/moneyRecharge.vue b/pages/moneyRecharge/moneyRecharge.vue index e0767ca..82a258f 100644 --- a/pages/moneyRecharge/moneyRecharge.vue +++ b/pages/moneyRecharge/moneyRecharge.vue @@ -61,7 +61,7 @@ export default { }, onLoad() { uni.setStorageSync("wxCode", '') - this.getCode(); + this.recharge(); this.rechargeList(); }, @@ -70,12 +70,15 @@ export default { onShow() { }, methods: { + getCode() { + let that = this uni.login({ provider: 'weixin', success: function (loginRes) { console.log('获取微信code-loginRes.code: ' + loginRes.code); uni.setStorageSync("wxCode", loginRes.code) + that.getOpenID() } }); }, @@ -159,7 +162,8 @@ export default { }, payClick() { let that = this; - that.getOpenID() + this.getCode(); + }, wxPayOrder() { let that = this;