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() {
}
})

6
pages/about/about.json Normal file
View File

@@ -0,0 +1,6 @@
{
"usingComponents": {
"list-nav-bar": "/components/list-nav-bar/list-nav-bar"
}
}

23
pages/about/about.wxml Normal file
View File

@@ -0,0 +1,23 @@
<import src="../../wxParse/wxParse.wxml"></import>
<list-nav-bar title="{{navTitle}}" background="#3c8bf6" showNavBtn="{{true}}"></list-nav-bar>
<scroll-view style="height: 100%;overflow:hidden;" scroll-y type="list">
<view class="container">
<view class="title">
<text>{{contact_title}}</text>
<text class="date">{{date}}</text>
</view>
<view class="content">
<view class="text">
<template is="wxParse" data="{{wxParseData:content.nodes}}"/>
</view>
<view class="text-list">地址:{{contact_address}}</view>
<view class="text-list">电话:{{contact_tel}}</view>
<view class="text-list">邮编:{{contact_post_code}}</view>
<view class="text-list">邮箱:{{contact_email}}</view>
</view>
</view>
</scroll-view>
<view class='btn-view'>
<button bind:tap="phoneOn" style="background: #3c8bf6;;border-radius: 60rpx;width: 85%;color: #fff;font-size: 30rpx;font-weight: normal;">拨打电话</button>
</view>

66
pages/about/about.wxss Normal file
View File

@@ -0,0 +1,66 @@
@import "../../wxParse/wxParse.wxss";
page {
height: 100vh;
display: flex;
flex-direction: column;
background: #ffffff;
min-height: 100vh;
}
.container{
margin-top: 45rpx;
margin-bottom: 120rpx;
/* margin-left: 30rpx;
margin-right: 30rpx; */
}
.title {
border-bottom: 2rpx solid #e9e9e9;
/* padding-bottom: 30rpx; */
padding-left: 30rpx;
padding-right: 30rpx;
font-size: 36rpx;
text-align: center;
/* margin-bottom: 20rpx; */
}
.date {
font-size: 24rpx;
color: #737373;
margin-top: 30rpx;
}
.content {
margin-top: 30rpx;
margin-left: 30rpx;
margin-right: 30rpx;
}
.text {
/* margin-top: 16px; */
font-size: 28rpx;
line-height: 55rpx;
color: #333;
}
.text-list {
/* margin-top: 16px; */
font-size: 28rpx;
line-height: 55rpx;
color: #333;
}
.btn-view {
box-shadow: 0 -5px 5px -5px rgba(0, 0, 0, 0.2);
width: 100%;
padding: 20rpx 0;
background-color: #fff;
position: fixed;
bottom: 0;
left: 0;
}