const app = getApp() import { selectCoordinateRq } from "../../../../api/meeting/meetingRoom.js" import { showroomDetailRq } from "../../../../api/meeting/exhibition.js" Page({ /** * 页面的初始数据 */ data: { IMG_NAME: app.IMG_NAME, id: null, detail: {}, bannerList: [], mapData: {} }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { let _this = this; console.log('onLoad', options); _this.setData({ ...options }) showroomDetailRq(_this.data.id).then(res => { console.log('showroomDetailRq', res); _this.setData({ detail: res.data, bannerList: [res.data.indoorPicUrl] }) }) // 获取地址信息 _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, }] }, }) }) }, // 打开地图 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, }) }, // 跳转-预约 jumpBooked() { let id = this.data.id; wx.navigateTo({ url: "/pages/meeting/exhibition/booked/booked?id=" + id, }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { } })