2024-02-21 17:43:11 +08:00
|
|
|
let app = getApp()
|
2024-03-13 15:14:37 +08:00
|
|
|
|
|
|
|
import {
|
|
|
|
userProfile
|
|
|
|
} from "../../api/user/user.js"
|
|
|
|
|
2024-02-21 17:43:11 +08:00
|
|
|
Page({
|
|
|
|
|
2024-02-22 18:57:41 +08:00
|
|
|
/**
|
|
|
|
* 页面的初始数据
|
|
|
|
*/
|
|
|
|
data: {
|
2024-03-13 15:14:37 +08:00
|
|
|
DOMAIN_NAME: app.IMG_NAME,
|
|
|
|
userDetail: {},
|
2024-02-22 18:57:41 +08:00
|
|
|
// tabBar param
|
|
|
|
tabBarParam: {
|
|
|
|
selected: 2,
|
|
|
|
color: "#515151",
|
|
|
|
selectedColor: "#217CFF",
|
|
|
|
backgroundColor: "#ffffff",
|
2024-02-21 17:43:11 +08:00
|
|
|
},
|
2024-02-22 18:57:41 +08:00
|
|
|
// tabBar menu
|
|
|
|
tabBarList: [{
|
|
|
|
"pagePath": "pages/index/index",
|
|
|
|
"iconPath": "/images/tabbar/home.png",
|
|
|
|
"selectedIconPath": "/images/tabbar/home-select.png",
|
|
|
|
"text": "首页"
|
|
|
|
},
|
|
|
|
{
|
2024-02-23 15:15:37 +08:00
|
|
|
"pagePath": "pages/meeting/accessControl/accessControl",
|
2024-02-22 18:57:41 +08:00
|
|
|
"iconPath": "/images/tabbar/openDoor.png",
|
|
|
|
"selectedIconPath": "/images/tabbar/openDoor.png",
|
|
|
|
"text": "开门",
|
|
|
|
"bulge": true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"pagePath": "pages/my/my",
|
|
|
|
"iconPath": "/images/tabbar/my.png",
|
|
|
|
"selectedIconPath": "/images/tabbar/my-select.png",
|
|
|
|
"text": "我的"
|
|
|
|
},
|
|
|
|
],
|
2024-03-13 15:14:37 +08:00
|
|
|
customerPages: [{
|
|
|
|
name: "我的活动",
|
|
|
|
url: "/pages/myActivities/myActivities",
|
|
|
|
},
|
|
|
|
{
|
2024-03-13 15:50:30 +08:00
|
|
|
name: "入驻管理",
|
2024-03-13 15:14:37 +08:00
|
|
|
url: "/pages/my/serviceApply/serviceApply"
|
|
|
|
},
|
|
|
|
{
|
2024-03-13 15:32:05 +08:00
|
|
|
name: "投诉建议",
|
2024-03-13 15:14:37 +08:00
|
|
|
url: "/pages/complaint/complaint",
|
|
|
|
},
|
2024-03-13 15:32:05 +08:00
|
|
|
// {
|
|
|
|
// name: "账号设置",
|
|
|
|
// url: "/pages/my/accountSetting/accountSetting",
|
|
|
|
// },
|
2024-03-13 15:14:37 +08:00
|
|
|
{
|
|
|
|
name: "我的服务",
|
|
|
|
url: "/pages/enterpriseServices/myServiceList/myServiceList"
|
|
|
|
},
|
2024-03-13 15:32:05 +08:00
|
|
|
// {
|
|
|
|
// name: "我的报修",
|
|
|
|
// url: "/pages/parkRepair/parkRepair",
|
|
|
|
// }
|
2024-02-22 18:57:41 +08:00
|
|
|
],
|
|
|
|
},
|
2024-02-21 17:43:11 +08:00
|
|
|
|
2024-03-13 15:14:37 +08:00
|
|
|
// 切换tabbar
|
|
|
|
switchTab(e) {
|
2024-02-22 18:57:41 +08:00
|
|
|
const data = e.currentTarget.dataset
|
|
|
|
console.log('switchTab', data)
|
|
|
|
const url = data.path
|
2024-03-13 15:14:37 +08:00
|
|
|
if (url == 'pages/meeting/accessControl/accessControl') {
|
2024-02-23 15:15:37 +08:00
|
|
|
wx.navigateTo({
|
|
|
|
url: '/' + url
|
|
|
|
})
|
2024-03-13 15:14:37 +08:00
|
|
|
} else {
|
2024-02-23 15:15:37 +08:00
|
|
|
wx.switchTab({
|
|
|
|
url: '/' + url
|
|
|
|
})
|
|
|
|
}
|
2024-02-22 18:57:41 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
2024-03-13 15:14:37 +08:00
|
|
|
onLoad(options) {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
2024-02-22 18:57:41 +08:00
|
|
|
onShow() {
|
2024-03-13 15:14:37 +08:00
|
|
|
let _this = this
|
|
|
|
let userId = wx.getStorageSync('userId');
|
|
|
|
if (userId) {
|
|
|
|
userProfile(userId).then(res => {
|
|
|
|
console.log('userProfile', res);
|
|
|
|
_this.setData({
|
|
|
|
userDetail: res.data
|
2024-02-22 18:57:41 +08:00
|
|
|
})
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
app.getlogin()
|
|
|
|
}
|
|
|
|
},
|
2024-03-13 15:14:37 +08:00
|
|
|
|
2024-02-22 18:57:41 +08:00
|
|
|
navigateTo(e) {
|
2024-03-13 15:14:37 +08:00
|
|
|
if (wx.getStorageSync('userId')) {
|
2024-03-13 15:32:05 +08:00
|
|
|
wx.navigateTo({
|
|
|
|
url: e.currentTarget.dataset.url,
|
|
|
|
})
|
2024-02-22 18:57:41 +08:00
|
|
|
} else {
|
|
|
|
app.getlogin()
|
|
|
|
}
|
|
|
|
},
|
2024-03-13 15:14:37 +08:00
|
|
|
|
2024-02-22 18:57:41 +08:00
|
|
|
navpersonalData() {
|
2024-03-13 15:14:37 +08:00
|
|
|
if (wx.getStorageSync('userId')) {
|
2024-02-22 18:57:41 +08:00
|
|
|
wx.navigateTo({
|
2024-03-13 15:14:37 +08:00
|
|
|
url: '/pages/my/personalData/personalData',
|
2024-02-22 18:57:41 +08:00
|
|
|
})
|
|
|
|
} else {
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/login/login',
|
|
|
|
})
|
|
|
|
}
|
2024-03-13 15:14:37 +08:00
|
|
|
},
|
|
|
|
|
2024-02-21 17:43:11 +08:00
|
|
|
})
|