import { getShopDetail } from '../../api/index' Page({ /** * 页面的初始数据 */ data: { bottomLift: 0, clientHeight: 0, clientTop: 0, }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { this.getDetail(options.id) var app = getApp().globalData this.setData({ bottomLift: app.bottomLift }) const res = wx.getMenuButtonBoundingClientRect() this.setData({ clientHeight: res.height }) this.setData({ clientTop: res.top }) }, navback() { wx.navigateBack() }, makePhone(e) { const { linkPhone } = this.data.info wx.makePhoneCall({ phoneNumber: linkPhone }) }, callPhone(e) { const phone = e.currentTarget.dataset.phone wx.makePhoneCall({ phoneNumber: phone }) }, handleDetail(e) { const id = e.currentTarget.dataset.id wx.navigateTo({ url: '/pages/store/staff?id=' + id, }) }, handleNavigation() { const info = this.data.info const latitude = info.latitude const longitude = info.longitude wx.openLocation({ latitude, longitude, name: info.name, scale: 18 }) }, getDetail(id) { getShopDetail({ shopId: id }).then(res => { this.setData({ info: res.data }) }) }, onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { } })