2024-02-21 17:43:11 +08:00
|
|
|
const app = getApp()
|
2024-03-13 18:27:17 +08:00
|
|
|
|
|
|
|
import Notify from '@vant/weapp/notify/notify';
|
|
|
|
|
|
|
|
import {
|
|
|
|
callScanUrl
|
|
|
|
} from "../../api/common/scan.js"
|
|
|
|
|
2024-03-14 08:54:04 +08:00
|
|
|
import {
|
2024-03-28 17:02:58 +08:00
|
|
|
userProfile,
|
|
|
|
getUserInfoRq
|
2024-03-14 08:54:04 +08:00
|
|
|
} from "../../api/user/user.js"
|
|
|
|
|
2024-03-14 15:31:25 +08:00
|
|
|
import {
|
|
|
|
visitorCarouselRq
|
|
|
|
} from "../../api/index/index.js"
|
|
|
|
|
2024-03-13 18:27:17 +08:00
|
|
|
|
2024-02-21 17:43:11 +08:00
|
|
|
Page({
|
2024-02-22 18:57:41 +08:00
|
|
|
data: {
|
|
|
|
// tabBar param
|
|
|
|
tabBarParam: {
|
|
|
|
selected: 0,
|
|
|
|
color: "#515151",
|
|
|
|
selectedColor: "#217CFF",
|
|
|
|
backgroundColor: "#ffffff",
|
|
|
|
},
|
|
|
|
// 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": "我的"
|
|
|
|
},
|
|
|
|
],
|
|
|
|
IMG_NAME: app.IMG_NAME,
|
2024-02-23 09:56:56 +08:00
|
|
|
menuList: [
|
|
|
|
// {
|
|
|
|
// name: "创业活动",
|
|
|
|
// img: "/images/hicon/chuangyehuodong.png",
|
|
|
|
// path: "/pages/community/community"
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: "政策信息",
|
|
|
|
// img: "/images/hicon/zhengcexinxi.png",
|
|
|
|
// path: "/pages/notice/notice"
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: "党建园地",
|
|
|
|
// img: "/images/hicon/zhaozhengce.png",
|
|
|
|
// path: "/pages/party/party"
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: "租办公室",
|
|
|
|
// img: "/images/hicon/zubangongshi.png",
|
|
|
|
// path: "/pages/office/office"
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: "项目入孵",
|
|
|
|
// img: "/images/hicon/xiangmurufu.png",
|
|
|
|
// path: "/pages/applyType/applyType"
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: "企业入驻",
|
|
|
|
// img: "/images/hicon/qiyeruzhu.png",
|
|
|
|
// path: "/pages/applyType/applyType"
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: "厂房申请",
|
|
|
|
// img: "/images/hicon/qianrushenqing.png",
|
|
|
|
// path: "/pages/applyType/applyType"
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: "园区建议",
|
|
|
|
// img: "/images/hicon/yuanqujianyi.png",
|
|
|
|
// path: "/pages/complaint/complaint"
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: "商业计划书",
|
|
|
|
// img: "/images/hicon/wenjuandiaocha.png",
|
|
|
|
// path: "/pages/outer/outer"
|
|
|
|
// },
|
|
|
|
/*
|
2024-02-22 18:57:41 +08:00
|
|
|
{
|
2024-02-23 09:56:56 +08:00
|
|
|
name: "园区报修",
|
|
|
|
img: "/images/hicon/zhaozhuanli.png",
|
|
|
|
path: "/pages/parkRepair/parkRepair"
|
|
|
|
},
|
|
|
|
*/
|
2024-02-22 18:57:41 +08:00
|
|
|
{
|
2024-02-28 14:34:35 +08:00
|
|
|
name: "会议预约",
|
2024-02-23 09:56:56 +08:00
|
|
|
img: "/profile/static/index/menu-hyyy.png",
|
2024-02-26 09:06:34 +08:00
|
|
|
path: "/pages/meeting/meetingReservation/meetingReservation"
|
2024-02-22 18:57:41 +08:00
|
|
|
},
|
|
|
|
{
|
2024-03-04 14:38:21 +08:00
|
|
|
name: "展厅预约",
|
|
|
|
img: "/profile/static/index/menu-ztyy.png",
|
2024-03-18 11:59:41 +08:00
|
|
|
path: "/pages/meeting/exhibition/booked/booked"
|
2024-02-22 18:57:41 +08:00
|
|
|
},
|
|
|
|
{
|
2024-02-28 13:42:40 +08:00
|
|
|
name: "访客预约",
|
2024-02-23 09:56:56 +08:00
|
|
|
img: "/profile/static/index/menu-fkyy.png",
|
2024-03-08 13:57:54 +08:00
|
|
|
path: "/pages/meeting/visitorIinvitation/list/list"
|
2024-02-22 18:57:41 +08:00
|
|
|
},
|
2024-03-04 14:38:21 +08:00
|
|
|
{
|
|
|
|
name: "预约记录",
|
|
|
|
img: "/profile/static/index/menu-yyjl.png",
|
|
|
|
path: "/pages/meeting/reservationRecord/reservationRecord"
|
|
|
|
},
|
2024-03-08 13:57:54 +08:00
|
|
|
|
2024-02-22 18:57:41 +08:00
|
|
|
{
|
2024-02-23 09:56:56 +08:00
|
|
|
name: "远程门禁",
|
|
|
|
img: "/profile/static/index/menu-ycmj.png",
|
2024-02-23 17:54:15 +08:00
|
|
|
path: "/pages/meeting/accessControl/accessControl"
|
2024-02-22 18:57:41 +08:00
|
|
|
},
|
|
|
|
{
|
2024-02-23 09:56:56 +08:00
|
|
|
name: "报修服务",
|
|
|
|
img: "/profile/static/index/menu-bxfw.png",
|
|
|
|
path: "/pages/parkRepair/parkRepair"
|
2024-02-22 18:57:41 +08:00
|
|
|
},
|
|
|
|
{
|
2024-02-23 09:56:56 +08:00
|
|
|
name: "投诉建议",
|
|
|
|
img: "/profile/static/index/menu-tsjy.png",
|
2024-02-22 18:57:41 +08:00
|
|
|
path: "/pages/complaint/complaint"
|
|
|
|
},
|
|
|
|
{
|
2024-03-13 16:52:53 +08:00
|
|
|
name: "社群活动",
|
2024-02-23 09:56:56 +08:00
|
|
|
img: "/profile/static/index/menu-sqhd.png",
|
|
|
|
path: "/pages/community/community"
|
2024-02-22 18:57:41 +08:00
|
|
|
},
|
|
|
|
{
|
2024-02-23 09:56:56 +08:00
|
|
|
name: "政策中心",
|
|
|
|
img: "/profile/static/index/menu-zczx.png",
|
|
|
|
path: "/pages/notice/notice"
|
|
|
|
},
|
2024-02-22 18:57:41 +08:00
|
|
|
{
|
2024-02-23 09:56:56 +08:00
|
|
|
name: "入住申请",
|
|
|
|
img: "/profile/static/index/menu-rzsq.png",
|
|
|
|
path: "/pages/applyType/applyType"
|
|
|
|
},
|
2024-03-08 13:57:54 +08:00
|
|
|
|
2024-02-22 18:57:41 +08:00
|
|
|
],
|
2024-03-14 15:31:25 +08:00
|
|
|
bannerList: [],
|
2024-03-14 08:54:04 +08:00
|
|
|
userDetail: {},
|
2024-02-22 18:57:41 +08:00
|
|
|
},
|
|
|
|
|
2024-03-15 14:15:03 +08:00
|
|
|
onLoad(options) {
|
2024-03-28 17:02:58 +08:00
|
|
|
console.log('onLoad options', options);
|
2024-03-15 14:15:03 +08:00
|
|
|
|
2024-03-14 15:31:25 +08:00
|
|
|
let _this = this;
|
|
|
|
// 轮播图
|
|
|
|
visitorCarouselRq().then(res => {
|
|
|
|
console.log('visitorCarouselRq', res);
|
|
|
|
_this.setData({
|
|
|
|
bannerList: res.data
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
2024-02-22 18:57:41 +08:00
|
|
|
// 切换tabbar
|
|
|
|
switchTab(e) {
|
|
|
|
const data = e.currentTarget.dataset
|
|
|
|
console.log('switchTab', data)
|
|
|
|
const url = data.path
|
2024-03-08 13:57:54 +08:00
|
|
|
if (url == 'pages/meeting/accessControl/accessControl') {
|
2024-02-23 15:15:37 +08:00
|
|
|
wx.navigateTo({
|
|
|
|
url: '/' + url
|
|
|
|
})
|
2024-03-08 13:57:54 +08:00
|
|
|
} else {
|
2024-02-23 15:15:37 +08:00
|
|
|
wx.switchTab({
|
|
|
|
url: '/' + url
|
|
|
|
})
|
|
|
|
}
|
2024-02-22 18:57:41 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
onShow() {
|
2024-03-14 08:54:04 +08:00
|
|
|
let _this = this
|
|
|
|
let userId = wx.getStorageSync('userId');
|
|
|
|
if (userId) {
|
2024-03-28 17:02:58 +08:00
|
|
|
getUserInfoRq(userId).then(res => {
|
|
|
|
console.log('getUserInfoRq', res);
|
|
|
|
let userDetail = res.data;
|
|
|
|
// 存储用户信息
|
|
|
|
wx.setStorageSync('openid', userDetail.openid)
|
|
|
|
wx.setStorageSync('user', userDetail)
|
|
|
|
wx.setStorageSync('userId', userDetail.id)
|
2024-03-14 08:54:04 +08:00
|
|
|
_this.setData({
|
2024-03-28 17:02:58 +08:00
|
|
|
userDetail
|
2024-03-14 08:54:04 +08:00
|
|
|
})
|
2024-04-02 17:51:41 +08:00
|
|
|
// 登录用户是否选择园区
|
|
|
|
_this.userIsPark()
|
2024-03-14 08:54:04 +08:00
|
|
|
})
|
|
|
|
} else {
|
|
|
|
app.getlogin()
|
2024-04-02 17:51:41 +08:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 登录用户是否选择园区
|
|
|
|
userIsPark() {
|
|
|
|
let parkId = wx.getStorageSync('parkId');
|
|
|
|
if (!parkId) {
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/index/parkList/parkList',
|
|
|
|
})
|
2024-03-14 08:54:04 +08:00
|
|
|
}
|
2024-02-22 18:57:41 +08:00
|
|
|
},
|
2024-02-21 17:43:11 +08:00
|
|
|
|
2024-02-22 18:57:41 +08:00
|
|
|
navapply(e) {
|
|
|
|
if (wx.getStorageSync('token')) {
|
|
|
|
if (e.currentTarget.dataset.path) {
|
2024-02-23 09:56:56 +08:00
|
|
|
wx.navigateTo({
|
|
|
|
url: e.currentTarget.dataset.path + '?name=' + e.currentTarget.dataset.name,
|
|
|
|
})
|
2024-02-22 18:57:41 +08:00
|
|
|
} else {
|
|
|
|
wx.showModal({
|
|
|
|
content: '模块暂未开放,敬请期待',
|
|
|
|
showCancel: false,
|
|
|
|
})
|
|
|
|
}
|
2024-02-21 17:43:11 +08:00
|
|
|
} else {
|
2024-02-22 18:57:41 +08:00
|
|
|
app.getlogin()
|
2024-02-21 17:43:11 +08:00
|
|
|
}
|
2024-02-22 18:57:41 +08:00
|
|
|
},
|
2024-02-21 17:43:11 +08:00
|
|
|
|
2024-03-13 18:27:17 +08:00
|
|
|
|
|
|
|
// 扫一扫
|
|
|
|
jumpScan() {
|
|
|
|
let _this = this;
|
|
|
|
wx.scanCode({
|
|
|
|
scanType: 'qrCode',
|
|
|
|
success(res) {
|
|
|
|
console.log('success', res)
|
|
|
|
let url = res.result;
|
|
|
|
// 扫码调用地址
|
|
|
|
_this.scanCallUrl(url)
|
|
|
|
},
|
|
|
|
fail(res) {
|
|
|
|
console.log('fail', res)
|
|
|
|
// 危险通知
|
|
|
|
_this.showErrMsg('扫码失败!')
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
// 扫码调用地址
|
|
|
|
scanCallUrl(url) {
|
|
|
|
let _this = this;
|
|
|
|
let paramUrl = '&userId=' + wx.getStorageSync('userId')
|
|
|
|
callScanUrl(url, paramUrl).then(res => {
|
|
|
|
if (res.code == 0) {
|
|
|
|
// 成功通知
|
|
|
|
_this.showSuccessMsg(res.msg)
|
|
|
|
} else {
|
|
|
|
// 危险通知
|
|
|
|
_this.showErrMsg(res.msg)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
// 成功通知
|
|
|
|
showSuccessMsg(msg) {
|
|
|
|
Notify({
|
|
|
|
type: 'success',
|
|
|
|
top: '160rpx',
|
|
|
|
message: msg
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
// 危险通知
|
|
|
|
showErrMsg(msg) {
|
|
|
|
Notify({
|
|
|
|
type: 'danger',
|
|
|
|
top: '160rpx',
|
|
|
|
message: msg
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2024-02-21 17:43:11 +08:00
|
|
|
})
|