微信小程序 提审时隐藏功能;微信小程序添加微信快捷登录、随便看看(登的user用户)
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
// pages/person/person.js
|
||||
|
||||
const toggleCustomTabBar = require('../../custom-tab-bar/toggleCustomTabBar')
|
||||
|
||||
const {
|
||||
user
|
||||
} = require("../../utils/const")
|
||||
@@ -16,7 +18,8 @@ Page({
|
||||
avatarUrl: defaultAvatarUrl,
|
||||
nickName: "请登录",
|
||||
displayUserId: "",
|
||||
menuList: [
|
||||
menuList: [],
|
||||
menuListRaw: [
|
||||
{
|
||||
id: "myOrder",
|
||||
title: "我的订单",
|
||||
@@ -26,14 +29,14 @@ Page({
|
||||
color: 'red',
|
||||
title: "退出登录",
|
||||
}
|
||||
]
|
||||
],
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
toggleCustomTabBar.toggle(this)
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -47,6 +50,20 @@ Page({
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
toggleCustomTabBar.toggle(this)
|
||||
|
||||
// 是否隐藏 我的订单
|
||||
let arr = wx.getStorageSync("indexItem")
|
||||
if (!arr || !arr.includes("/pages/shop/shop")) {
|
||||
this.setData({
|
||||
menuList: this.data.menuListRaw.filter(i => i.id != 'myOrder')
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
menuList: this.data.menuListRaw
|
||||
})
|
||||
}
|
||||
|
||||
let userInfo = wx.getStorageSync("userInfo")
|
||||
if (!userInfo) {
|
||||
console.log("用户未登录")
|
||||
@@ -109,7 +126,6 @@ Page({
|
||||
console.log("e", userInfo)
|
||||
this.setData({
|
||||
avatarUrl: userInfo.avatarUrl,
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user