用户A将小程序的一个页面(设:具体路径PageC)分享给用户B,用户B为小程序的新用户(首次打开),用户B打开分享的链接时,虽打开了对应的指定页面PageC,但是却立即自动跳转至首页,PageC中无任何跳转代码,请问什么原因?
PageC页面代码:
< template > < div class = "container" > < div class = "home" > < div class = "topBarBg" > < div class = "topBar" > < a class = "item toolBaritem" > < img src = "/static/images/diamond.png" > 0 </ a > </ div > < img src = "/static/images/colorful_line.png" > </ div > < scroll-view class = "list" scroll-y = "true" > < div class = "item" v-for = "(item,index) in dataSource" :key = "index" > < div class = "left" ></ div > < div class = "mid" > < p >{{item.name}}</ p > < p style = "color:#f16128; line-height:40rpx; text-indent:0; padding:0 10rpx;" > 获得1000个钻石 </ p > </ div > < div class = "right" > < p >¥100元</ p > < button class = "red" @ click = "toDo(item)" >支付</ button > </ div > </ div > </ scroll-view > </ div > </ div > </ template > < script > export default { data () { return { userAuth: false, isLogin: false, isShowProperty: true, dataSourceUrl: '', dataSource: [] } }, methods: { navTo (url) { if (!this.isLogin) { return } mpvue.navigateTo({ url: url }) }, redirectTo (url) { if (!this.isLogin) { return } mpvue.redirectTo({ url: url }) }, toDo (item) { // 掉起微信支付 } }, created () { this.isLogin = !!mpvue.getStorageSync('userInfo') && mpvue.getStorageSync('userInfo').userId > 0 this.userAuth = this.isLogin }, mounted () { let pageTitle = '充钻' mpvue.setNavigationBarTitle({ title: pageTitle }) this.dataSource.push({ name: '新手大礼包' }) } } </ script > |
很明显的问题,用户B为小程序的新用户打开分享的页面,并未登陆;从你粘贴的代码中js是做了登陆判断的
看你的url定义的是什么。一般都在js处理,你检查下看看。如果没做处理,不会自动跳转的
是不是有什么代码在启动时候判断有无登录 没有登陆自动跳转首页?
提供一下具体的代码片段