133 lines
2.6 KiB
JavaScript
Raw Normal View History

2024-03-01 10:30:46 +08:00
let app = getApp()
2024-03-06 18:09:17 +08:00
import {
selfFormatTimeYMD,
selfFormatTimeHM,
twoTimeIntervalReturnHours
} from "../../../utils/util.js"
import {
selectReservationByIdRq,
selectCoordinateRq
} from "../../../api/meeting/meetingRoom.js"
2024-03-01 10:30:46 +08:00
Page({
/**
* 页面的初始数据
*/
data: {
IMG_NAME: app.IMG_NAME,
mapData: {
2024-03-06 18:09:17 +08:00
// latitude: 33.601291,
// longitude: 119.031829,
// markers: [{
// id: 1,
// latitude: 33.601291,
// longitude: 119.031829,
// title: '淮安茂业天地购物中心'
// }]
},
id: null,
detail: null,
address: {},
2024-03-01 10:30:46 +08:00
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
2024-03-06 18:09:17 +08:00
let _this = this;
_this.setData({
...options
})
// 获取详情
_this.getDetail();
// 获取地址信息
_this.getAddress()
},
// 获取地址信息
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,
}]
},
})
})
},
// 获取详情
getDetail() {
let _this = this;
let id = _this.data.id;
selectReservationByIdRq(id).then(res => {
let detail = res.data;
// 时间段
detail.timeSlot = selfFormatTimeYMD(detail.startTime) + ' ' + selfFormatTimeHM(detail.startTime) + '~' + selfFormatTimeHM(detail.endDate);
_this.setData({
detail
})
2024-03-01 10:30:46 +08:00
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})