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 { ...@@ -175,4 +175,20 @@ public class WxHomeController {
} }
return categoryList; 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/'; ...@@ -10,6 +10,8 @@ var WxApiRoot = 'http://localhost:8080/wx/';
module.exports = { module.exports = {
IndexUrl: WxApiRoot + 'home/index', //首页数据接口 IndexUrl: WxApiRoot + 'home/index', //首页数据接口
AboutUrl: WxApiRoot + 'home/about', //介绍信息
CatalogList: WxApiRoot + 'catalog/index', //分类目录全部分类数据接口 CatalogList: WxApiRoot + 'catalog/index', //分类目录全部分类数据接口
CatalogCurrent: WxApiRoot + 'catalog/current', //分类目录当前分类数据接口 CatalogCurrent: WxApiRoot + 'catalog/current', //分类目录当前分类数据接口
...@@ -96,5 +98,4 @@ module.exports = { ...@@ -96,5 +98,4 @@ module.exports = {
UserIndex: WxApiRoot + 'user/index', //个人页面用户相关信息 UserIndex: WxApiRoot + 'user/index', //个人页面用户相关信息
IssueList: WxApiRoot + 'issue/list', //帮助信息 IssueList: WxApiRoot + 'issue/list', //帮助信息
}; };
\ No newline at end of file
// about.js const util = require('../../utils/util.js');
var app = getApp() const api = require('../../config/api.js');
var util = require("../../utils/util.js");
//获取应用实例
const app = getApp();
var api = require("../../config/api.js");
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
load_statue: true, name: 'litemall',
shopInfo: { address: 'https://github.com/linlinjava/litemall',
name: 'litemall', latitude: '31.201900',
address: 'https://github.com/linlinjava/litemall', longitude: '121.587839',
latitude: 31.201900, phone: '021-xxxx-xxxx',
longitude: 121.587839, qq: '705144434'
linkPhone: '021-xxxx-xxxx',
qqNumber: '738696120'
},
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { 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) { showLocation: function (e) {
var that = this var that = this
wx.openLocation({ wx.openLocation({
latitude: that.data.shopInfo.latitude, latitude: parseFloat(that.data.latitude),
longitude: that.data.shopInfo.longitude, longitude: parseFloat(that.data.longitude),
name: that.data.shopInfo.name, name: that.data.name,
address: that.data.shopInfo.address, address: that.data.address,
}) })
}, },
callPhone: function (e) { callPhone: function (e) {
var that = this var that = this
wx.makePhoneCall({ 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="container">
<view class="label">项目名称:</view>
<view class="about-item"> <view class="about-item">
<view class="item-left"> <view class="item-left">
<label>项目名称: </label> <text>{{name}}</text>
<text>{{shopInfo.name}}</text>
</view> </view>
</view> </view>
<view class="label">项目地址:</view>
<view class="about-item"> <view class="about-item">
<view class="item-left"> <view class="item-left">
<label>项目地址: </label> <text>{{address}}</text>
<text>{{shopInfo.address}}</text>
</view> </view>
<view class="item-right" bindtap="showLocation"> <view class="item-right" bindtap="showLocation">
<image src="/static/images/ico-addr.png" class="right-icon"></image> <image src="/static/images/ico-addr.png" class="right-icon"></image>
</view> </view>
</view> </view>
<view class="label">电话号码:</view>
<view class="about-item"> <view class="about-item">
<view class="item-left"> <view class="item-left">
<label>电话号码: </label> <text>{{phone}}</text>
<text>{{shopInfo.linkPhone}}</text>
</view> </view>
<view class="item-right" bindtap="callPhone"> <view class="item-right" bindtap="callPhone">
<image src="/static/images/telephone.png" class="right-icon"></image> <image src="/static/images/telephone.png" class="right-icon"></image>
</view> </view>
</view> </view>
<view class="label">QQ交流群: </view>
<view class="about-item"> <view class="about-item">
<view class="item-left"> <view class="item-left">
<label>QQ交流群: </label> <text>{{qq}}</text>
<text>{{shopInfo.qqNumber}}</text>
</view> </view>
<view class="item-right"> <view class="item-right">
<image src="/static/images/mobile.png" class="right-icon"></image> <image src="/static/images/mobile.png" class="right-icon"></image>
</view> </view>
</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> </view>
\ No newline at end of file
/* about.wxss */ /* about.wxss */
page{ .label {
height: 100%; font-size: 26rpx;
background-color: #F2f2f2; margin-left: 20rpx;
} padding: 10rpx 0;
.page-view{ }
height: 100%;
}
.banner-image{
width: 100%;
height: 350rpx;
background: #ee1;
margin-bottom: 30rpx;
border-bottom: solid #f2f2f2 0.5dp;
}
.about-item{ .about-item{
background: white; background: white;
...@@ -27,18 +19,18 @@ page{ ...@@ -27,18 +19,18 @@ page{
} }
.item-left{ .item-left{
font-size: 32rpx; font-size: 38rpx;
margin-left: 15rpx; margin-left: 40rpx;
margin-top: auto; margin-top: auto;
margin-bottom: auto; margin-bottom: auto;
} }
.item-right{ .item-right{
margin-right: 15rpx; margin-right: 15rpx;
margin-top: auto; margin-top: auto;
margin-bottom: auto; margin-bottom: auto;
} }
.right-icon{ .right-icon{
width: 40rpx; 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