修改夜校接活动跳转

This commit is contained in:
张凯 2025-05-16 18:41:06 +08:00
parent 51549177fa
commit c42ae18cd4
3 changed files with 55 additions and 5 deletions

53
App.vue
View File

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

View File

@ -1,6 +1,6 @@
{
"name" : "多样青春",
"appid" : "__UNI__ABEB145",
"appid" : "__UNI__1F083BC",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",

View File

@ -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: {
//