|
|
@ -20,19 +20,20 @@ const wxLogin = async () => {
|
|
|
|
// 获取用户手机号码
|
|
|
|
// 获取用户手机号码
|
|
|
|
const onGetphonenumber: UniHelper.ButtonOnGetphonenumber = async (ev) => {
|
|
|
|
const onGetphonenumber: UniHelper.ButtonOnGetphonenumber = async (ev) => {
|
|
|
|
await checkedAgreePrivacy()
|
|
|
|
await checkedAgreePrivacy()
|
|
|
|
|
|
|
|
if (code) {
|
|
|
|
const { encryptedData, iv } = ev.detail
|
|
|
|
const { encryptedData, iv } = ev.detail
|
|
|
|
if (encryptedData) {
|
|
|
|
if (encryptedData) {
|
|
|
|
const params = {
|
|
|
|
const params = {
|
|
|
|
code,
|
|
|
|
code,
|
|
|
|
encryptedData,
|
|
|
|
encryptedData,
|
|
|
|
iv,
|
|
|
|
iv,
|
|
|
|
userType: 1, // 1 散户 2 回收员
|
|
|
|
userType: 1, // 1 散户 2 回收员
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const res = await postLoginWxMinAPI(params)
|
|
|
|
|
|
|
|
loginSuccess(res.data)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
uni.showToast({ icon: 'none', title: '请授权手机号' })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const res = await postLoginWxMinAPI(params)
|
|
|
|
|
|
|
|
loginSuccess(res.data)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
uni.showToast({ icon: 'none', title: '请授权手机号' })
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|