| xqd
@@ -16,25 +16,33 @@ Page({
|
|
|
onLoad: function (options) {
|
|
|
|
|
|
},
|
|
|
- handleFieldChange: function(e) {
|
|
|
- console.log(this.data.phone)
|
|
|
- console.log(e)
|
|
|
- },
|
|
|
|
|
|
formSubmit: e => {
|
|
|
if(!e.detail.value.phone) {
|
|
|
wx.showToast({
|
|
|
title: '手机号不能为空',
|
|
|
})
|
|
|
-
|
|
|
- // wx.request({
|
|
|
- // url: api.bindPhoneUrl,
|
|
|
- // method: 'GET',
|
|
|
- // data: {
|
|
|
- // 'id': wx.getStorageSync('we_chat_user_id'),
|
|
|
- // 'phone': e.detail.value.phone
|
|
|
- // }
|
|
|
- // })
|
|
|
+ } else {
|
|
|
+ wx.request({
|
|
|
+ url: api.bindPhoneUrl,
|
|
|
+ method: 'GET',
|
|
|
+ data: {
|
|
|
+ 'id': wx.getStorageSync('we_chat_user_id'),
|
|
|
+ 'phone': e.detail.value.phone
|
|
|
+ },
|
|
|
+ success: res => {
|
|
|
+ if (res.data.status == 'success') {
|
|
|
+ wx.setStorageSync('pt_student', res.data.data)
|
|
|
+ wx.switchTab({
|
|
|
+ url: '/pages/index/index',
|
|
|
+ })
|
|
|
+ } else if (res.data.status == 'fail') {
|
|
|
+ wx.showToast({
|
|
|
+ title: res.data.info,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
|
| xqd
@@ -50,7 +58,6 @@ Page({
|
|
|
'encryptedData': e.detail.encryptedData,
|
|
|
},
|
|
|
success: res => {
|
|
|
- console.log(res)
|
|
|
if(res.data.status == 'success') {
|
|
|
that.setData({
|
|
|
phone: res.data.phone
|