yujialong 6 days ago
parent 1773ee5d0e
commit d9bb1f258f
  1. 11
      src/components/getPhoneModal/index.tsx
  2. 2
      src/pages/DisplayVideo/index.less
  3. 34
      src/pages/Listen/index.tsx

@ -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({

@ -17,7 +17,7 @@
.select-epi {
z-index: 1000;
position: absolute;
bottom: 7.4rem;
bottom: 7.28rem;
right: 3rem;
color: #fff;
}

@ -86,6 +86,8 @@ export default function Listen() {
//管理登录弹窗
const [isLoginOpen, setisLoginOpen] = useState(false)
const [memberInfo, setMemberInfo] = useState({})
useDidShow(() => {
if(Taro.getStorageSync('UserToken')){
Taro.request({
@ -118,6 +120,24 @@ export default function Listen() {
setareaList(res.data.data.show)
}
})
// 获取会员跳转链接
Taro.request({
url: 'https://interapi.jm-kid.com/api/member/data',
method: 'POST',
header: {
authorization: `bearer ${Taro.getStorageSync('UserToken')}`
},
data: {
timestamp: Date.now(),
member_type: 'audio'
},
success: (res: any) => {
if(res.data.state === 200){
setMemberInfo(res.data.data.main)
}
},
})
}else{
Taro.request({
method: 'POST',
@ -214,9 +234,17 @@ export default function Listen() {
if(!Taro.getStorageSync('UserToken')){
//提醒用户登录
setisLoginOpen(true)
}else{
Taro.navigateTo({
url: '/pages/Vip/index'
} else {
// 跳转到熏听会员
Taro.navigateToMiniProgram({
appId: 'wxbd3d383851fea776',
path: memberInfo?.MallLink || '',
success: (res) => {
console.log('打开成功=>',res)
},
fail: (res) => {
console.log('打开失败=>',res)
}
})
}
}

Loading…
Cancel
Save