From a25f4cb2b6dd4e89b8c4fb3a22402f34094a877d Mon Sep 17 00:00:00 2001 From: wangxia <779219182@qq.com> Date: Sat, 2 Mar 2024 16:55:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/company/company/index.js | 76 ++++++++++++++++++++++++++++++---------- pages/company/company/index.wxml | 21 ++++++----- 2 files changed, 70 insertions(+), 27 deletions(-) diff --git a/pages/company/company/index.js b/pages/company/company/index.js index db575e5..0b4c77e 100644 --- a/pages/company/company/index.js +++ b/pages/company/company/index.js @@ -1,3 +1,5 @@ +const app = getApp(); +// const commonUtil = require("../../utils/commonUtil"); // pages/company/company/index.js Page({ @@ -5,82 +7,118 @@ Page({ * 页面的初始数据 */ data: { - + storeInfo: {} }, /** * 生命周期函数--监听页面加载 */ - onLoad(options) { - + onLoad (options) { + this.getInfo() }, /** * 生命周期函数--监听页面初次渲染完成 */ - onReady() { + onReady () { }, - goMap(){ + goMap () { console.log("123") + let that = this wx.getLocation({ type: 'gcj02', //返回可以用于wx.openLocation的经纬度 success (res) { console.log(res); - const latitude = 34.757034; - const longitude = 113.772587; wx.openLocation({ - latitude, - longitude, - name:'郑州一才企业管理有限公司', - address:'河南省郑州市管城回族区心怡路与东站南街交叉口郑东升龙广场2号楼5楼', + latitude: Number(that.data.storeInfo.lat), + longitude: Number(that.data.storeInfo.lng), + name: that.data.storeInfo.fullName, + address: that.data.storeInfo.address, scale: 18 }) }, - fail(res){ + fail (res) { console.log(res) } - }) + }) }, /** * 生命周期函数--监听页面显示 */ - onShow() { + onShow () { }, + /** + * 获取企业信息 + */ + getInfo () { + let that = this + wx.request({ + url: app.globalData.ip + "/yishoudan/agency/getInfo", + method: "get", + header: app.globalData.headers, + success: function (res) { + console.log(res) + let data = res.data.data + if (res.data.status == 200) { + data.agency.imgList = data.agency.imgs.split(',') + that.setData({ + storeInfo: data.agency + }) + } + } + }) + }, + /** + * 拨打电话 + */ + makePhoneCall () { + var that = this; + if (!that.data.storeInfo.contactTel) { + wx.showToast({ + title: '暂无联系方式', + icon: 'none' + }) + return + } + wx.makePhoneCall({ + phoneNumber: that.data.storeInfo.contactTel, + }); + }, /** * 生命周期函数--监听页面隐藏 */ - onHide() { + onHide () { }, /** * 生命周期函数--监听页面卸载 */ - onUnload() { + onUnload () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ - onPullDownRefresh() { + onPullDownRefresh () { }, /** * 页面上拉触底事件的处理函数 */ - onReachBottom() { + onReachBottom () { }, /** * 用户点击右上角分享 */ - onShareAppMessage() { + onShareAppMessage () { } }) \ No newline at end of file diff --git a/pages/company/company/index.wxml b/pages/company/company/index.wxml index 3e95c28..102b1cd 100644 --- a/pages/company/company/index.wxml +++ b/pages/company/company/index.wxml @@ -1,10 +1,15 @@ - + + + + + + 关于我们 - 郑州一才企业管理是一家我是一段公司简介很长的简介我是一段公司简介很长的简介我是一段公司简介很长的简介我是一段公司简介很长的简介我是一段公司简介很长的简介我是一段公司我是一段公司简介很长的简介我是一段公司 + {{storeInfo.aboutUs || '对方还未介绍自己'}} @@ -12,9 +17,9 @@ - 郑州一才企业管理有限公司 + {{storeInfo.fullName || '-'}} - 河南省郑州市管城回族区心怡路与东站南街交叉口郑东升龙广场2号楼5楼 + {{storeInfo.address || '-'}} @@ -30,16 +35,16 @@ - 客户经理 + {{serviceInfo.contactUserName || '暂无联系人' }} - {{serviceInfo.userName || '李经理' }} + -

{{serviceInfo.tel || '0371-6611 3723'}}

+

{{serviceInfo.contactTel || '暂无联系方式'}}

- +