|
|
@@ -3,10 +3,12 @@ import {
|
|
|
} from '../../config/config.js'
|
|
|
import $wuxCountDown from '../../utils/coutdown.js'
|
|
|
import {
|
|
|
- sendPhoneCode,
|
|
|
- saveMinaPhone
|
|
|
+ sendPhoneCode
|
|
|
} from '../../services/index.js'
|
|
|
import {
|
|
|
+ saveMinaPhone
|
|
|
+} from '../../services/wx.js'
|
|
|
+import {
|
|
|
showToast
|
|
|
} from '../../utils/tips.js'
|
|
|
Page({
|
|
|
@@ -76,25 +78,34 @@ Page({
|
|
|
},
|
|
|
//绑定手机号
|
|
|
phone_login() {
|
|
|
- if (this.data.phone.length != 11) {
|
|
|
+ if (this.data.iphone.length != 11) {
|
|
|
return false;
|
|
|
}
|
|
|
- if (this.data.ymz.length != 6) {
|
|
|
+ if (this.data.yzm.length != 6) {
|
|
|
return false;
|
|
|
}
|
|
|
var openId = wx.getStorageSync('openId');
|
|
|
var sessionKey = wx.getStorageSync('sessionKey');
|
|
|
var unionId = wx.getStorageSync('unionId');
|
|
|
let paramsObj = {
|
|
|
- phone: this.data.phone,
|
|
|
- code: this.data.ymz,
|
|
|
+ phone: this.data.iphone,
|
|
|
+ code: this.data.yzm,
|
|
|
openId: openId,
|
|
|
unionId: unionId,
|
|
|
sessionKey: sessionKey
|
|
|
}
|
|
|
Object.assign(paramsObj);
|
|
|
saveMinaPhone(paramsObj).then(data => {
|
|
|
-
|
|
|
+ console.log("save", data)
|
|
|
+ wx.setStorageSync("hpuser", data.data.hpUser);
|
|
|
+ wx.setStorageSync("hpMember", data.data.hpMember);
|
|
|
+ wx.setStorageSync("user_id", data.data.hpUser.id);
|
|
|
+ wx.setStorageSync("member_id", data.data.hpMember.id);
|
|
|
+ wx.setStorageSync("user_token", data.data.hpUser.userToken);
|
|
|
+ showToast("登录成功");
|
|
|
+ setTimeout(function() {
|
|
|
+ wx.navigateBack();
|
|
|
+ }, 500)
|
|
|
})
|
|
|
},
|
|
|
|