need bind mobile ?

wechat_user_type
Ge Hao 8 years ago
parent ed38637a58
commit e8ebb486b7
  1. 3
      pages/mine/mine.js
  2. 5
      utils/profile.js

@ -20,12 +20,11 @@ Page({
var that = this
var token = wx.getStorageSync('userToken')
if (token) {
that.setData({needBindMobile: false})
var data = {token: token}
profile.getCustomerInfo(data, that.infoCallback)
}
app.getUserInfo(function(userInfo){
that.setData({userInfo:userInfo})
that.setData({userInfo: userInfo})
})
},

@ -17,6 +17,11 @@ function getCustomerInfo (data, cb) {
header: { 'Content-Type': 'application/json'},
data: data,
success: function(res) {
if (res.data.msg === 'Need Mobile') {
return
}
var pages = getCurrentPages()
pages[pages.length-1].setData({needBindMobile: false})
app.globalData.currentCustomer = res.data.customer
app.globalData.token = res.data.token
wx.setStorage({

Loading…
Cancel
Save