From a0aaae792a34b911cf8a7c5cf2c65d349bb226bd Mon Sep 17 00:00:00 2001 From: hurui Date: Thu, 26 Sep 2019 18:37:55 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=85=B3=E4=BA=8E=E6=88=91=E4=BB=AC][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E6=98=BE=E7=A4=BA=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E8=90=A5=E4=B8=9A=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index/user.js | 21 ++++++++++++++++++++- index/user.wxml | 2 +- index/user.wxss | 3 ++- pages/mallInfo/mallInfo.js | 32 ++++++++++++++++---------------- pages/mallInfo/mallInfo.wxml | 8 ++++---- utils/imgurl.js | 5 ++--- 6 files changed, 45 insertions(+), 26 deletions(-) diff --git a/index/user.js b/index/user.js index 02fcb77..e2c821a 100644 --- a/index/user.js +++ b/index/user.js @@ -11,6 +11,7 @@ Page({ * 页面的初始数据 */ data: { + aboutShow:false, navigationBarHeight, ifStoreApp:ifStoreApp, aboutUs: imgurl.aboutUs.url, @@ -228,6 +229,23 @@ Page({ }) //暂时注释 // that.getrun(); + + + //查询关于我们 + Http.get({ + url: config.api.getMallInfo, + data: {} + }).then(res => { + console.log(res) + if (res && res.data.businessHours) { + that.setData({ + aboutShow: true + }) + } + }) + .catch(err => { + }) + }, //适配不同屏幕大小的canvas setCanvasSize: function() { @@ -246,5 +264,6 @@ Page({ console.log("获取设备信息失败" + e); } return size; - } + }, + }); diff --git a/index/user.wxml b/index/user.wxml index 0c1bf4e..d0b63d0 100644 --- a/index/user.wxml +++ b/index/user.wxml @@ -1,7 +1,7 @@ - + 关于我们 diff --git a/index/user.wxss b/index/user.wxss index 58faa42..33e826f 100644 --- a/index/user.wxss +++ b/index/user.wxss @@ -423,7 +423,8 @@ page{ line-height: 40rpx; } .aboutUs text { - line-height: 60rpx; + margin-left: 10rpx; + line-height: 55rpx; font-size: 28rpx; color: #888; } \ No newline at end of file diff --git a/pages/mallInfo/mallInfo.js b/pages/mallInfo/mallInfo.js index 4bc77c8..7639de7 100644 --- a/pages/mallInfo/mallInfo.js +++ b/pages/mallInfo/mallInfo.js @@ -34,22 +34,22 @@ Page({ url: config.api.getMallInfo, }) .then(res => { - console.log(res) - let businessHours = JSON.parse(res.data.businessHours) - businessHours.map((item,index)=>{ - item.weekName = [that.data.dateArr.filter(e => e.value == item.week[0])[0].name ,that.data.dateArr.filter(e => e.value == item.week[1])[0].name], - item.time = [util.convertUTCTimeToLocalTime(item.time[0]), util.convertUTCTimeToLocalTime(item.time[1])] - console.log(item.time) - }) - console.log(businessHours,222) - that.setData({ - name: res.data.name, - servicePhone: res.data.servicePhone, - img: res.data.img, - introduction: res.data.introduction, - park_place_number: res.data.park_place_number, - businessHoursH: businessHours, - }) + if (res.data.businessHours){ + let businessHours = JSON.parse(res.data.businessHours) + businessHours.map((item, index) => { + item.weekName = [that.data.dateArr.filter(e => e.value == item.week[0])[0].name, that.data.dateArr.filter(e => e.value == item.week[1])[0].name].toString().replace(/\,/g, ' -- '), + item.time = [util.convertUTCTimeToLocalTime(item.time[0]), util.convertUTCTimeToLocalTime(item.time[1])].toString().replace(/\,/g, ' -') + }) + console.log(businessHours, 222) + that.setData({ + name: res.data.name, + servicePhone: res.data.servicePhone, + img: res.data.img, + introduction: res.data.introduction, + parkPlaceNumber: res.data.parkPlaceNumber, + businessHoursH: businessHours, + }) + } }) .catch(err => { wx.showModal({ diff --git a/pages/mallInfo/mallInfo.wxml b/pages/mallInfo/mallInfo.wxml index 0930435..f9a0b51 100644 --- a/pages/mallInfo/mallInfo.wxml +++ b/pages/mallInfo/mallInfo.wxml @@ -1,6 +1,6 @@ - + @@ -12,13 +12,13 @@ 营业时间 : - {{item.time}}({{item.weekName}}) + {{item.time}}({{item.weekName}}) - + 停车位 : - {{park_place_number}} + {{parkPlaceNumber}} 热线电话 : diff --git a/utils/imgurl.js b/utils/imgurl.js index b6ba473..ed4c66f 100644 --- a/utils/imgurl.js +++ b/utils/imgurl.js @@ -718,8 +718,7 @@ module.exports = { 'name': '' }, "aboutUs":{ - 'url': baseUrl + "aboutUs1.png", + 'url': baseUrl + "we.png", 'name': '' - } - + }, } \ No newline at end of file