Commit df3402f7 by 高淑倩

无权限跳转

parent 503d5389
......@@ -55,14 +55,15 @@
"pages/categoryPro/categoryPro",
"pages/plus/plus",
"pages/friendShareList/friendShareList",
"pages/goToHome/goToHome"
"pages/goToHome/goToHome",
"pages/noPermission/noPermission"
]
}
],
"usingComponents": {
"authorization-modal": "/component/authorization-modal/authorization-modal"
},
"tabBar":{
"tabBar": {
"custom": false,
"color": "#BBBBBB",
"selectedColor": "#333",
......
......@@ -39,7 +39,7 @@
"list": []
},
"miniprogram": {
"current": 45,
"current": 46,
"list": [
{
"id": -1,
......@@ -348,6 +348,13 @@
"pathName": "pages/shopping/home/home",
"query": "",
"scene": null
},
{
"id": -1,
"name": "导购无权限",
"pathName": "subPackage/page/pages/noPermission/noPermission",
"query": "",
"scene": null
}
]
}
......
// subPackage/page/pages/noPermission/noPermission.js
const wxService = require('../../../../utils/wxService')
let intervalid;
wxService.page({
/**
* 页面的初始数据
*/
data: {
num: 3
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function () {
this.countdown()
},
countdown(){
const { num } = this.data
if (num <= 0) {
clearInterval(intervalid)
return
}
intervalid = setTimeout(() => {
this.setData({
num: num - 1
},()=>{
this.countdown();
this.goMall()
});
}, 1000)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
goMall() {
clearInterval(intervalid)
wxService.router(`/pages/userCenter/userCenter`).replace()
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
clearTimeout(intervalid)
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"navigationBarTitleText": ""
}
\ No newline at end of file
<!--subPackage/page/pages/noPermission/noPermission.wxml-->
<view class="no-permission df">
<view class="permission-view">
<image class="permission-img" mode="widthFix" src="/assets/imgs/shop/no_permission.png"></image>
<view class="permission-tips">
<view>您还不是导购身份哦~</view>
<view>无法访问当前页面</view>
</view>
<view class="permission-num"><span class="num">{{num}}</span>秒后返回商城首页</view>
<view class="go-mall" bindtap="goMall">立即返回商城</view>
</view>
</view>
\ No newline at end of file
/* subPackage/page/pages/noPermission/noPermission.wxss */
@import '/base/base.wxss';
.no-permission {
text-align: center;
}
.permission-view {
padding-top: 156rpx;
}
.permission-img {
width: 179rpx;
height: 179rpx;
}
.permission-tips {
padding-top: 82rpx;
color: rgba(51, 51, 51, 1);
font-size: 32rpx;
}
.permission-num {
padding: 216rpx 0 27rpx 0;
font-size: 26rpx;
color: #ccc;
}
.num {
color: rgba(224, 32, 32, 1);
}
.go-mall {
width: 550rpx;
height: 94rpx;
line-height: 94rpx;
border-radius: 6rpx;
background-color: rgba(0, 145, 255, 1);
color: rgba(255, 255, 255, 1);
font-size: 36rpx;
text-align: left;
text-align: center;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment