You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
2.0 KiB
JavaScript

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