Commit ca9830aa authored by Junling Bu's avatar Junling Bu
Browse files

feat[litemall-wx, litemall-wx-api]: 关于页面读取后端配置信息

parent 8dc83a36
......@@ -175,4 +175,20 @@ public class WxHomeController {
}
return categoryList;
}
/**
* 商城介绍信息
* @return 商城介绍信息
*/
@GetMapping("/about")
public Object about() {
Map<String, Object> about = new HashMap<>();
about.put("name", SystemConfig.getMallName());
about.put("address", SystemConfig.getMallAddress());
about.put("phone", SystemConfig.getMallPhone());
about.put("qq", SystemConfig.getMallQQ());
about.put("longitude", SystemConfig.getMallLongitude());
about.put("latitude", SystemConfig.getMallLatitude());
return ResponseUtil.ok(about);
}
}
\ No newline at end of file
......@@ -10,6 +10,8 @@ var WxApiRoot = 'http://localhost:8080/wx/';
module.exports = {
IndexUrl: WxApiRoot + 'home/index', //首页数据接口
AboutUrl: WxApiRoot + 'home/about', //介绍信息
CatalogList: WxApiRoot + 'catalog/index', //分类目录全部分类数据接口
CatalogCurrent: WxApiRoot + 'catalog/current', //分类目录当前分类数据接口
......@@ -96,5 +98,4 @@ module.exports = {
UserIndex: WxApiRoot + 'user/index', //个人页面用户相关信息
IssueList: WxApiRoot + 'issue/list', //帮助信息
};
\ No newline at end of file
// about.js
var app = getApp()
var util = require("../../utils/util.js");
const util = require('../../utils/util.js');
const api = require('../../config/api.js');
//获取应用实例
const app = getApp();
var api = require("../../config/api.js");
Page({
/**
* 页面的初始数据
*/
data: {
load_statue: true,
shopInfo: {
name: 'litemall',
address: 'https://github.com/linlinjava/litemall',
latitude: 31.201900,
longitude: 121.587839,
linkPhone: '021-xxxx-xxxx',
qqNumber: '738696120'
},
name: 'litemall',
address: 'https://github.com/linlinjava/litemall',
latitude: '31.201900',
longitude: '121.587839',
phone: '021-xxxx-xxxx',
qq: '705144434'
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getAbout()
},
getAbout: function () {
let that = this;
util.request(api.AboutUrl).then(function (res) {
if (res.errno === 0) {
that.setData({
name: res.data.name,
address: res.data.address,
phone: res.data.phone,
qq: res.data.qq,
latitude: res.data.latitude,
longitude: res.data.longitude
});
}
});
},
showLocation: function (e) {
var that = this
wx.openLocation({
latitude: that.data.shopInfo.latitude,
longitude: that.data.shopInfo.longitude,
name: that.data.shopInfo.name,
address: that.data.shopInfo.address,
latitude: parseFloat(that.data.latitude),
longitude: parseFloat(that.data.longitude),
name: that.data.name,
address: that.data.address,
})
},
callPhone: function (e) {
var that = this
wx.makePhoneCall({
phoneNumber: that.data.shopInfo.linkPhone,
phoneNumber: that.data.phone,
})
},
reLoad: function (e) {
this.loadShopInfo();
}
})
\ No newline at end of file
<view class="container">
<view class="label">项目名称:</view>
<view class="about-item">
<view class="item-left">
<label>项目名称: </label>
<text>{{shopInfo.name}}</text>
<text>{{name}}</text>
</view>
</view>
<view class="label">项目地址:</view>
<view class="about-item">
<view class="item-left">
<label>项目地址: </label>
<text>{{shopInfo.address}}</text>
<text>{{address}}</text>
</view>
<view class="item-right" bindtap="showLocation">
<image src="/static/images/ico-addr.png" class="right-icon"></image>
</view>
</view>
<view class="label">电话号码:</view>
<view class="about-item">
<view class="item-left">
<label>电话号码: </label>
<text>{{shopInfo.linkPhone}}</text>
<text>{{phone}}</text>
</view>
<view class="item-right" bindtap="callPhone">
<image src="/static/images/telephone.png" class="right-icon"></image>
</view>
</view>
<view class="label">QQ交流群: </view>
<view class="about-item">
<view class="item-left">
<label>QQ交流群: </label>
<text>{{shopInfo.qqNumber}}</text>
<text>{{qq}}</text>
</view>
<view class="item-right">
<image src="/static/images/mobile.png" class="right-icon"></image>
</view>
</view>
<view class="about-item">
<view class="item-left">
<label>当前版本: </label>
<text>1.0.0</text>
</view>
</view>
<view class="about-item">
<view class="item-left">
<label>开源协议: </label>
<text>MIT</text>
</view>
</view>
</view>
\ No newline at end of file
/* about.wxss */
page{
height: 100%;
background-color: #F2f2f2;
}
.page-view{
height: 100%;
}
.banner-image{
width: 100%;
height: 350rpx;
background: #ee1;
margin-bottom: 30rpx;
border-bottom: solid #f2f2f2 0.5dp;
}
.label {
font-size: 26rpx;
margin-left: 20rpx;
padding: 10rpx 0;
}
.about-item{
background: white;
......@@ -27,18 +19,18 @@ page{
}
.item-left{
font-size: 32rpx;
margin-left: 15rpx;
font-size: 38rpx;
margin-left: 40rpx;
margin-top: auto;
margin-bottom: auto;
}
.item-right{
margin-right: 15rpx;
margin-top: auto;
margin-bottom: auto;
}
.right-icon{
width: 40rpx;
height: 40rpx;
height: 40rpx;
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment