Commit cbd5c7b4cf46a5bece8d17769f932e14b0cd8e18

Authored by xianghenggang
1 parent 812589cf5d

支付前刷新openid

Showing 4 changed files with 36 additions and 3 deletions

littleApp_child/pages/Setting/Setting.js View file @ cbd5c7b
... ... @@ -110,7 +110,9 @@
110 110 wx.setStorageSync('userId', '')
111 111 getApp().globalData.token = ''
112 112 getApp().globalData.userId = ''
113   - that.toLogin()
  113 + wx.navigateBack({
  114 +
  115 + })
114 116 }
115 117 },
116 118 fail: function (res) {
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
... ... @@ -57,6 +57,7 @@
57 57 height: 30px;
58 58 margin-left: 15px;
59 59 margin-top: 10px;
  60 + border-radius: 15px;
60 61 }
61 62  
62 63 .title_text {
littleApp_child/utils/apiFile.js View file @ cbd5c7b
... ... @@ -53,7 +53,10 @@
53 53 //下单
54 54 buy: 'goods/pay/buy',
55 55 //医生详情/id
56   - doctor: 'v1/doctors'
  56 + doctor: 'v1/doctors',
  57 +
  58 + //刷新openid
  59 + refreshOpenId: '/wx/bind/openid',
57 60  
58 61 }