修改夜校接活动跳转
This commit is contained in:
parent
51549177fa
commit
c42ae18cd4
53
App.vue
53
App.vue
@ -7,7 +7,10 @@
|
||||
this.updateManager();
|
||||
|
||||
},
|
||||
onShow: function() {
|
||||
onShow: function(options) {
|
||||
if(options?.referrerInfo?.extraData){
|
||||
this.getDyqc(options.referrerInfo.extraData);
|
||||
}
|
||||
console.log('App Show')
|
||||
},
|
||||
onHide: function() {
|
||||
@ -51,6 +54,54 @@
|
||||
})
|
||||
}
|
||||
},
|
||||
//获取多样青春的跳转参数
|
||||
getDyqc(extraData){
|
||||
uni.$u.http.post('/api/user/activityMiniLogin', extraData).then(res => {
|
||||
if (res.code == 1) {
|
||||
uni.setStorageSync('token', res.data.userinfo.token)
|
||||
this.getUserInfo();
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
uni.clearStorageSync();
|
||||
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log('error', error);
|
||||
});
|
||||
},
|
||||
// 获取个人信息
|
||||
getUserInfo() {
|
||||
uni.$u.http.get('/api/user/index', {}).then(res => {
|
||||
if (res.code == 1) {
|
||||
uni.setStorageSync('userInfo', res.data.user_info);
|
||||
uni.showToast({
|
||||
title: '登陆成功',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
uni.setStorageSync("niName", res.data.user_info.nickname);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '登陆失败',
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
|
||||
}).catch(error => {
|
||||
console.log('error', error);
|
||||
|
||||
uni.showToast({
|
||||
title: '登陆失败',
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "多样青春",
|
||||
"appid" : "__UNI__ABEB145",
|
||||
"appid" : "__UNI__1F083BC",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
|
@ -14,7 +14,7 @@
|
||||
<u-icon name="close" size="16"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box":style="{ marginTop: show ? '34rpx' : capsuleHeight() }">
|
||||
<view class="box":style="{ marginTop: show == true ? '34rpx' : capsuleHeight() }">
|
||||
<view class="swiper-box">
|
||||
<MySwiper :list="swiperList"></MySwiper>
|
||||
</view>
|
||||
@ -227,11 +227,10 @@
|
||||
this.getinit()
|
||||
this.getHotList()
|
||||
this.getTeacherList()
|
||||
this.getWqList()
|
||||
this.getWqList();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.autoplay = false
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 获取胶囊高度
|
||||
|
Loading…
x
Reference in New Issue
Block a user