const app = getApp(); // const commonUtil = require("../../utils/commonUtil"); // pages/company/company/index.js Page({ /** * 页面的初始数据 */ data: { storeInfo: {}, storeId:"" }, /** * 生命周期函数--监听页面加载 */ onLoad (options) { console.log(options.id) this.setData({ storeId:options.id }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady () { }, goMap () { console.log("123") let that = this wx.openLocation({ latitude: Number(that.data.storeInfo.lat), longitude: Number(that.data.storeInfo.lng), name: that.data.storeInfo.storeName, address: that.data.storeInfo.address, scale: 18 }) }, /** * 生命周期函数--监听页面显示 */ onShow () { this.getInfo() }, /** * 获取企业信息 */ getInfo () { let that = this wx.request({ url: app.globalData.ip + "/yishoudan/agency/store/get/"+that.data.storeId, method: "get", header: app.globalData.headers, success: function (res) { console.log(res) let data = res.data.data if (res.data.status == 200) { data.imgList = data.imgs.split(',') that.setData({ storeInfo: data }) } } }) }, /** * 拨打电话 */ makePhoneCall () { var that = this; if (!that.data.storeInfo.phone) { wx.showToast({ title: '暂无联系方式', icon: 'none' }) return } wx.makePhoneCall({ phoneNumber: that.data.storeInfo.phone, }); }, /** * 生命周期函数--监听页面隐藏 */ onHide () { }, /** * 生命周期函数--监听页面卸载 */ onUnload () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom () { }, /** * 用户点击右上角分享 */ onShareAppMessage () { } })