|
|
|
@ -9,8 +9,6 @@ export default function GetPhoneNumber({ onClose, scene = null, modalVisible, on |
|
|
|
|
//管理关闭动画状态
|
|
|
|
|
const [isAnimationOpen, setisAnimationOpen] = useState(false) |
|
|
|
|
|
|
|
|
|
const [inviteCode, setInviteCode] = useState() |
|
|
|
|
|
|
|
|
|
// 兑换成功弹窗
|
|
|
|
|
const [isUserExchangeSuccessModalOpen, setisUserExchangeSuccessModalOpen] = useState(false) |
|
|
|
|
|
|
|
|
@ -24,8 +22,8 @@ export default function GetPhoneNumber({ onClose, scene = null, modalVisible, on |
|
|
|
|
const [prdtList, setPrdtList] = useState([]) |
|
|
|
|
|
|
|
|
|
useLoad((query)=> { |
|
|
|
|
console.log(query.inviteCode) |
|
|
|
|
setInviteCode(query.inviteCode || '') |
|
|
|
|
console.log('通过分享拿到的邀请码是:',query.inviteCode) |
|
|
|
|
query.inviteCode && Taro.setStorageSync('othersInviteCode', query.inviteCode) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
if(!modalVisible){ |
|
|
|
@ -43,7 +41,7 @@ export default function GetPhoneNumber({ onClose, scene = null, modalVisible, on |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const handleGetUserPhone = (e: any) => { |
|
|
|
|
console.log(e.detail) |
|
|
|
|
console.log('注册接口:',e.detail, Taro.getStorageSync('othersInviteCode')) |
|
|
|
|
|
|
|
|
|
const open_id = Taro.getStorageSync('LoginKey') |
|
|
|
|
if (open_id) { |
|
|
|
@ -54,7 +52,7 @@ export default function GetPhoneNumber({ onClose, scene = null, modalVisible, on |
|
|
|
|
MCODE: e.detail.code, |
|
|
|
|
channel: 'wusehua_mini', |
|
|
|
|
open_id, |
|
|
|
|
invite_code: inviteCode |
|
|
|
|
invite_code: Taro.getStorageSync('othersInviteCode') |
|
|
|
|
}, |
|
|
|
|
success: (res: any) => { |
|
|
|
|
console.log('用户注册信息=>',res) |
|
|
|
@ -63,6 +61,7 @@ export default function GetPhoneNumber({ onClose, scene = null, modalVisible, on |
|
|
|
|
Taro.setStorageSync('UserPhoneNumber', res.data.user.Mobile) |
|
|
|
|
Taro.setStorageSync('UserInviteCode', res.data.user.InviteCode) |
|
|
|
|
Taro.setStorageSync('UserToken', res.data.token) |
|
|
|
|
Taro.removeStorageSync('othersInviteCode') |
|
|
|
|
|
|
|
|
|
if(scene){ |
|
|
|
|
Taro.request({ |
|
|
|
|