This commit is contained in:
2024-08-29 00:30:49 +08:00
parent 7041d5b092
commit fc7912e01c
11 changed files with 360 additions and 141 deletions

114
pages/about/about.js Normal file
View File

@@ -0,0 +1,114 @@
const request = require('../../utils/request')
const ui = require('../../utils/ui')
const wxParse = require("../../wxParse/wxParse.js");
Page({
/**
* 页面的初始数据
*/
data: {
navTitle: "联系我们",
title: "北京欧华莱茵科技有限公司"
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let that = this;
that.GetLabelList()
},
GetLabelList() {
let that = this;
request.request({
method: "GET",
// https://app.19year.cn/api.php/doc/details?id=51
url: "/api.php/doc/label_list"
}).then(res => {
if (res.data.code === 1) {
let list = res.data.data.data
for(let j = 0, len=list.length; j < len; j++) {
that.setData({[`${list[j].name}`]:list[j].value})
}
that.initContent()
}
}).catch(err => {
console.log('ERROR', err)
});
},
initContent() {
let that = this;
console.log(that.data.contact_content);
if (that.data.contact_content.length > 0) {
wxParse.wxParse('content', 'html', that.data.contact_content, that, 0);
}
},
// 拨打电话事件
phoneOn() {
let that = this;
wx.makePhoneCall({
phoneNumber: that.data.contact_tel, //此号码仅用于测试
success: function () {
console.log("拨打电话成功!")
},
fail: function () {
console.log("拨打电话失败!")
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})