mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 14:19:38 +08:00
133 lines
2.6 KiB
JavaScript
133 lines
2.6 KiB
JavaScript
let app = getApp()
|
|
|
|
import {
|
|
selfFormatTimeYMD,
|
|
selfFormatTimeHM,
|
|
twoTimeIntervalReturnHours
|
|
} from "../../../utils/util.js"
|
|
|
|
import {
|
|
selectReservationByIdRq,
|
|
selectCoordinateRq
|
|
} from "../../../api/meeting/meetingRoom.js"
|
|
|
|
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
IMG_NAME: app.IMG_NAME,
|
|
mapData: {
|
|
// latitude: 33.601291,
|
|
// longitude: 119.031829,
|
|
// markers: [{
|
|
// id: 1,
|
|
// latitude: 33.601291,
|
|
// longitude: 119.031829,
|
|
// title: '淮安茂业天地购物中心'
|
|
// }]
|
|
},
|
|
id: null,
|
|
detail: null,
|
|
address: {},
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad(options) {
|
|
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
|
|
})
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage() {
|
|
|
|
}
|
|
}) |