Browse Source

个人模块功能完善:about页面添加,简单的腾讯地图调用以及拨打电话功能

usgeek 7 years ago
parent
commit
7423f63853

+ 2 - 1
litemall-wx/app.json

@@ -31,7 +31,8 @@
     "pages/shopping/checkout/checkout",
     "pages/shopping/address/address",
     "pages/shopping/addressAdd/addressAdd",
-    "pages/goods/goods"
+    "pages/goods/goods",
+	"pages/about/index"
   ],
   "window": {
     "backgroundTextStyle": "dark",

+ 49 - 0
litemall-wx/pages/about/index.js

@@ -0,0 +1,49 @@
+// index.js
+var app = getApp()
+var util = require("../../utils/util.js");
+
+
+var api = require("../../config/api.js");
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    load_statue: true,
+    shopInfo: {
+      name: 'litemall',
+      address: 'https://github.com/linlinjava/litemall',
+      latitude: 22.60,
+      longitude: 116.87,
+      linkPhone: '0755-xxxx-xxxx',
+      qqNumber: '738696120'
+    },
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    
+  },
+
+  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,
+    })
+  },
+  callPhone: function (e) {
+    var that = this
+    wx.makePhoneCall({
+      phoneNumber: that.data.shopInfo.linkPhone,
+    })
+  },
+  reLoad: function (e) {
+    this.loadShopInfo();
+  }
+})

+ 1 - 0
litemall-wx/pages/about/index.json

@@ -0,0 +1 @@
+{}

+ 43 - 0
litemall-wx/pages/about/index.wxml

@@ -0,0 +1,43 @@
+<view class="container">
+
+  <view class="about-item">
+
+    <view class="item-left">
+      <label>项目名称: </label>
+       <text>{{shopInfo.name}}</text> 
+    </view>
+
+  </view>
+
+  <view class="about-item">
+    <view class="item-left">
+      <label>项目地址: </label>
+       <text>{{shopInfo.address}}</text> 
+    </view>
+
+    <view class="item-right" bindtap="showLocation">
+      <image src="/static/images/ico-addr.png" class="right-icon"></image>
+    </view>
+  </view>
+
+  <view class="about-item">
+    <view class="item-left">
+      <label>电话号码:    </label>
+       <text>{{shopInfo.linkPhone}}</text> 
+    </view>
+    <view class="item-right" bindtap="callPhone">
+      <image src="/static/images/telephone.png" class="right-icon"></image>
+    </view>
+  </view>
+
+  <view class="about-item">
+    <view class="item-left">
+      <label>litemall交流群: </label>
+       <text>{{shopInfo.qqNumber}}</text> 
+    </view>
+    <view class="item-right">
+      <image src="/static/images/mobile.png" class="right-icon"></image>
+    </view>
+  </view>
+
+</view>

+ 44 - 0
litemall-wx/pages/about/index.wxss

@@ -0,0 +1,44 @@
+/* index.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;
+}
+
+.about-item{
+  background: white;
+  border-top: solid #f2f2f2 0.5rpx;
+  border-bottom: solid #f2f2f2 0.5rpx;
+  width: 100%;
+  height: 100rpx;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+}
+
+.item-left{
+  font-size: 32rpx;
+  margin-left: 15rpx;
+  margin-top: auto;
+  margin-bottom: auto;
+}
+.item-right{
+   
+  margin-right: 15rpx;
+  margin-top: auto;
+  margin-bottom: auto;
+}
+.right-icon{
+  width: 40rpx;
+   height: 40rpx;
+}