From cbd5c7b4cf46a5bece8d17769f932e14b0cd8e18 Mon Sep 17 00:00:00 2001 From: xianghenggang Date: Fri, 24 Nov 2017 14:30:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=89=8D=E5=88=B7=E6=96=B0op?= =?UTF-8?q?enid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- littleApp_child/pages/Setting/Setting.js | 4 ++- .../pages/order_payment/order_payment.js | 29 +++++++++++++++++++++- .../pages/order_payment/order_payment.wxss | 1 + littleApp_child/utils/apiFile.js | 5 +++- 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/littleApp_child/pages/Setting/Setting.js b/littleApp_child/pages/Setting/Setting.js index b51b2aa..8496482 100644 --- a/littleApp_child/pages/Setting/Setting.js +++ b/littleApp_child/pages/Setting/Setting.js @@ -110,7 +110,9 @@ Page({ wx.setStorageSync('userId', '') getApp().globalData.token = '' getApp().globalData.userId = '' - that.toLogin() + wx.navigateBack({ + + }) } }, fail: function (res) { diff --git a/littleApp_child/pages/order_payment/order_payment.js b/littleApp_child/pages/order_payment/order_payment.js index 93dee79..b760e95 100644 --- a/littleApp_child/pages/order_payment/order_payment.js +++ b/littleApp_child/pages/order_payment/order_payment.js @@ -55,6 +55,33 @@ Page({ }) }, + + refreshOpenid() { + var self = this + var jscode = '' + wx.login({ + success: function (res) { + // success + jscode = res.code + + + networkUtil._get(api.refreshOpenId + "?jscode=" + jscode + "&type=2", {}, function (res) { + + console.log(res) + self.getPayMessage() + }, function (res) { + + }) + }, + fail: function (res) { + // fail + }, + complete: function (res) { + // complete + } + }) + }, + getPayMessage(){ networkUtil.showLoading() var self = this @@ -88,7 +115,7 @@ Page({ }) }, payClick:function(e){ - this.getPayMessage() + this.refreshOpenid() } }) diff --git a/littleApp_child/pages/order_payment/order_payment.wxss b/littleApp_child/pages/order_payment/order_payment.wxss index b721ec9..4ae7f99 100644 --- a/littleApp_child/pages/order_payment/order_payment.wxss +++ b/littleApp_child/pages/order_payment/order_payment.wxss @@ -57,6 +57,7 @@ background:#fff; height: 30px; margin-left: 15px; margin-top: 10px; + border-radius: 15px; } .title_text { diff --git a/littleApp_child/utils/apiFile.js b/littleApp_child/utils/apiFile.js index 14f6c6c..b9e7d95 100644 --- a/littleApp_child/utils/apiFile.js +++ b/littleApp_child/utils/apiFile.js @@ -53,6 +53,9 @@ module.exports = { //下单 buy: 'goods/pay/buy', //医生详情/id - doctor: 'v1/doctors' + doctor: 'v1/doctors', + + //刷新openid + refreshOpenId: '/wx/bind/openid', } \ No newline at end of file -- 1.8.3.1