|
|
|
@ -67,7 +67,9 @@ |
|
|
|
<view class="like-box"> |
|
|
|
<view class="like-title"> |
|
|
|
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/e0c44bc9b69a46559d3aa4160d3cf4a5.png" alt="" /> |
|
|
|
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">获取手机号</button> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="like-content-box"> |
|
|
|
<view class="like-left"> |
|
|
|
<view class="like-content-title"> |
|
|
|
@ -588,6 +590,34 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getPhoneNumber (e) { |
|
|
|
console.log(e) |
|
|
|
if (e.detail.code) { |
|
|
|
// 将 code 发送给后端 |
|
|
|
this.tui.request("/social/wechat/getPhone", "POST", { |
|
|
|
code: e.detail.code |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
// 授权成功后的处理逻辑 |
|
|
|
this.tui.toast('获取手机号成功'+res.result); |
|
|
|
|
|
|
|
// 如果后端返回了 phone,将其存入缓存,方便以后使用 |
|
|
|
if (res.result) { |
|
|
|
uni.setStorageSync('phone', res.result); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message || '获取失败'); |
|
|
|
} |
|
|
|
}).catch((err) => { |
|
|
|
console.log("请求异常: ", err); |
|
|
|
this.tui.toast('请求获取手机号失败'); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
// 用户拒绝授权 |
|
|
|
console.log('用户取消授权', e.detail.errMsg); |
|
|
|
this.tui.toast('您取消了手机号授权'); |
|
|
|
} |
|
|
|
}, |
|
|
|
//本方法展示所有已经完成页面,方便查找 |
|
|
|
aaaaaaa(item){ |
|
|
|
uni.navigateTo({ |
|
|
|
@ -616,6 +646,18 @@ |
|
|
|
}, |
|
|
|
onClickArea(item){ |
|
|
|
uni.setStorageSync('area',JSON.stringify(item)) |
|
|
|
let that = this |
|
|
|
that.tui.request("/worker/admin/add", "POST", {userId:uni.getStorageSync('id'),isChangeArea:0,region:item.id}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
if(res.result != null){ |
|
|
|
uni.setStorageSync('worker',res.result) |
|
|
|
} |
|
|
|
} else { |
|
|
|
that.tui.toast(res.message) |
|
|
|
return |
|
|
|
} |
|
|
|
uni.hideLoading() |
|
|
|
}).catch((res) => {}) |
|
|
|
this.$refs.areaPopup.close() |
|
|
|
}, |
|
|
|
checkArea(){ |
|
|
|
|