239 lines
7.2 KiB
JavaScript
Raw Normal View History

2024-02-21 17:43:11 +08:00
const app = getApp()
Page({
2024-02-22 18:57:41 +08:00
onShareAppMessage(res) {},
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": "首页"
},
{
"pagePath": "pages/parkRepair/parkRepair",
"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-02-21 17:43:11 +08:00
2024-02-22 18:57:41 +08:00
IMG_NAME: app.IMG_NAME,
indicatorDots: true,
autoplay: true,
interval: 3000,
duration: 1000,
bannerList: [{
bannerImg: ''
}],
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-23 09:56:56 +08:00
name: "会议预约",
img: "/profile/static/index/menu-hyyy.png",
path: ""
2024-02-22 18:57:41 +08:00
},
{
2024-02-23 09:56:56 +08:00
name: "预约记录",
img: "/profile/static/index/menu-yyjl.png",
path: ""
2024-02-22 18:57:41 +08:00
},
{
2024-02-23 09:56:56 +08:00
name: "访客邀约",
img: "/profile/static/index/menu-fkyy.png",
path: ""
2024-02-22 18:57:41 +08:00
},
{
2024-02-23 09:56:56 +08:00
name: "远程门禁",
img: "/profile/static/index/menu-ycmj.png",
path: ""
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-02-23 09:56:56 +08:00
name: "社区活动",
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"
},
{
name: "展厅预约",
img: "/profile/static/index/menu-ztyy.png",
2024-02-22 18:57:41 +08:00
path: ""
},
],
homelist: [],
background: [{
bg: '/profile/banner/1.jpg',
url: ''
}, {
bg: '/profile/banner/2.jpg',
url: ''
}]
},
// 切换tabbar
switchTab(e) {
const data = e.currentTarget.dataset
console.log('switchTab', data)
const url = data.path
wx.switchTab({
url: '/' + url
})
},
onShow() {
let that = this
if (wx.getStorageSync('token')) {
app.AjaxRequest('get', {
'content-type': 'application/json',
'Authorization': 'Bearer ' + app.Getopenid()
}, '/user/profile', {}, function (res) {
if (res.code == 0) {
that.setData({
parkName: wx.getStorageSync('parkName')
})
wx.setStorageSync('MemberInfo', res.data)
that.getHotList()
}
})
} else {
wx.reLaunch({
url: '/pages/login/login',
})
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-02-22 18:57:41 +08:00
//轮播高度自适应——获取图片高度
imgHeight: function (e) {
var winWid = wx.getSystemInfoSync().windowWidth; //获取当前屏幕的宽度
var imgh = e.detail.height; //图片高度
var imgw = e.detail.width; //图片宽度
var swiperH = winWid * imgh / imgw + "px"
this.setData({
Height: swiperH //设置高度
})
// this.setData({
// Height: '300rpx' //设置高度
// })
},
2024-02-21 17:43:11 +08:00
2024-02-22 18:57:41 +08:00
getHotList() {
let that = this
app.AjaxRequest('get', {
'content-type': 'application/json',
'Authorization': 'Bearer ' + app.Getopenid()
}, '/menu/bannerList', {
isTop: true
}, function (res) {
that.setData({
homelist: res.data
})
})
},
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-02-22 18:57:41 +08:00
navparkList() {
wx.navigateTo({
url: '/pages/index/parkList/parkList'
})
},
2024-02-21 17:43:11 +08:00
})