|
@@ -90,7 +90,7 @@ import { mapState } from '@wepy/x';
|
|
|
import store from '@/store';
|
|
|
import config from '@/config';
|
|
|
import { setAvatar, setUserInfoByAuth } from '@/service/user';
|
|
|
-import { getCompanyByPhone } from '@/api/user';
|
|
|
+import { getHttpPhoneNumber } from '@/api/user';
|
|
|
let defaultAvatarUrl =
|
|
|
config.h5StaticPath + '/page-bind-tenant/default_avatar.svg';
|
|
|
wepy.page({
|
|
@@ -136,17 +136,18 @@ wepy.page({
|
|
|
},
|
|
|
// 手机号认证
|
|
|
phonenumberAuth(e) {
|
|
|
- console.log(e);
|
|
|
- // this.goBindTenant();
|
|
|
let detail = e.$wx.detail;
|
|
|
let code = detail.code;
|
|
|
- let errMsg = detail.errMsg;
|
|
|
- console.log(detail);
|
|
|
- store.commit('setUserPhone', 15321277745);
|
|
|
- // wx.setStorage('userPhone', 15321277745);
|
|
|
- // wx.navigateTo({
|
|
|
- // url: '/pages/bindTenant/index'
|
|
|
- // });
|
|
|
+ this.getHttpPhoneNumber(code);
|
|
|
+ },
|
|
|
+ // code 换取手机号
|
|
|
+ getHttpPhoneNumber(code) {
|
|
|
+ getHttpPhoneNumber(code).then(res => {
|
|
|
+ let data = res.data || {};
|
|
|
+ let phoneNumber = data.purePhoneNumber;
|
|
|
+ store.commit('setUserPhone', phoneNumber);
|
|
|
+ this.goBindTenant();
|
|
|
+ });
|
|
|
},
|
|
|
goBindTenant() {
|
|
|
console.log('被点击了');
|