168 lines
3.8 KiB
JavaScript
Raw Normal View History

2024-02-26 19:30:25 +08:00
const app = getApp()
2024-03-02 16:57:04 +08:00
import {
2024-03-06 20:27:42 +08:00
meetingRoomDetailRq,
selectCoordinateRq
2024-03-02 16:57:04 +08:00
} from "../../../api/meeting/meetingRoom.js"
2024-03-06 20:27:42 +08:00
2024-02-26 19:30:25 +08:00
Page({
2024-02-26 17:17:27 +08:00
2024-02-26 19:30:25 +08:00
/**
* 页面的初始数据
*/
data: {
IMG_NAME: app.IMG_NAME,
2024-03-06 20:27:42 +08:00
meetingRoomId: null,
date: '',
timeRange: '',
2024-03-02 16:57:04 +08:00
detail: {},
2024-03-02 16:27:19 +08:00
bannerList: [],
mapData: {},
resList: [{
date: '2024年9月18日',
time: '14:00 - 17:30',
user: '王XX',
dep: '司法局',
tel: '15811111111'
},{
date: '2024年9月19日',
time: '14:00 - 17:30',
user: '王XX',
dep: '司法局',
tel: '15811111111'
}],
canRes: true // 是否允许预约
2024-02-26 19:30:25 +08:00
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
2024-03-02 16:27:19 +08:00
let _this = this;
2024-03-02 16:57:04 +08:00
console.log('onLoad', options);
let time = options.time
let timeRange = options.timeRange
_this.setData({
date: time,
timeRange: timeRange
})
2024-03-02 16:57:04 +08:00
let meetingRoomId = options.id;
meetingRoomDetailRq(meetingRoomId).then(res => {
console.log('meetingRoomDetailRq', res);
let detail = res.roomContent;
let bannerList = []
if (detail.indoorPicUrl) {
try {
bannerList = JSON.parse(detail.indoorPicUrl).map(item=>item.url)
} catch (error) {
console.log(`JSON error : ${error}`);
}
}
2024-03-02 16:27:19 +08:00
_this.setData({
2024-03-02 16:57:04 +08:00
meetingRoomId,
detail,
bannerList
2024-03-02 16:27:19 +08:00
})
})
2024-03-06 20:27:42 +08:00
// 获取地址信息
// _this.getAddress()
2024-03-06 20:27:42 +08:00
},
// 获取地址信息(不需要地址)
2024-03-06 20:27:42 +08:00
getAddress() {
let _this = this;
selectCoordinateRq().then(res => {
_this.setData({
address: res,
mapData: {
latitude: res.lat,
longitude: res.lng,
markers: [{
id: 1,
latitude: res.lat,
longitude: res.lng,
title: res.address,
}]
},
})
})
},
// 打开地图
openMap(e) {
console.log('openMap', e);
let _this = this;
wx.openLocation({
name: _this.data.address.address,
latitude: _this.data.address.lat,
longitude: _this.data.address.lng,
})
2024-02-26 19:30:25 +08:00
},
2024-02-27 10:41:35 +08:00
// 跳转空间设施
jumpMeetingFacilities() {
2024-03-04 14:38:21 +08:00
let meetingRoomId = this.data.meetingRoomId;
2024-02-27 10:41:35 +08:00
wx.navigateTo({
2024-03-04 14:38:21 +08:00
url: '/pages/meeting/meetingRoom/meetingFacilities/meetingFacilities?meetingRoomId=' + meetingRoomId,
2024-02-27 12:00:47 +08:00
})
},
2024-03-02 18:14:38 +08:00
// 跳转-会议室已预约
jumpMeetingBooked() {
2024-03-04 14:38:21 +08:00
let meetingRoomId = this.data.meetingRoomId;
let time = this.data.date
let timeRange = this.data.timeRange
2024-02-27 12:00:47 +08:00
wx.navigateTo({
url: "/pages/meeting/meetingRoom/meetingBooked/meetingBooked?meetingRoomId=" + meetingRoomId + '&time=' + time + '&timeRange=' + timeRange,
2024-02-27 10:41:35 +08:00
})
},
2024-02-26 19:30:25 +08:00
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
2024-02-26 17:17:27 +08:00
})