From 050b9403ec37609d9c60c9397984eb461593e64a Mon Sep 17 00:00:00 2001 From: Kiyan Date: Thu, 4 May 2017 15:47:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=BA=97=E8=AF=A6=E6=83=85-=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=20=E5=95=86=E5=BA=97=E8=AF=A6=E6=83=85-=E5=95=86?= =?UTF-8?q?=E5=AE=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/app.json | 2 +- app/app.wxss | 6 -- app/pages/shop/show.js | 100 ++++++++++++++++++++++--- app/pages/shop/show.wxml | 121 ++++++++++++++++++++++++++---- app/pages/shop/show.wxss | 138 ++++++++++++++++++++++++++++++++++- app/templates/star-rate.wxml | 2 +- app/templates/star-rate.wxss | 6 +- app/utils/util.js | 13 ++++ 8 files changed, 350 insertions(+), 38 deletions(-) diff --git a/app/app.json b/app/app.json index c0e8771..d88add6 100644 --- a/app/app.json +++ b/app/app.json @@ -1,5 +1,6 @@ { "pages": [ + "pages/shop/show", "pages/order/show", "pages/order/quasi", "pages/order/list", @@ -7,7 +8,6 @@ "pages/address/list", "pages/address/add", "pages/address/select", - "pages/shop/show", "pages/mine/mine", "pages/index/address", "pages/shop/category", diff --git a/app/app.wxss b/app/app.wxss index 9ead761..4303ccf 100644 --- a/app/app.wxss +++ b/app/app.wxss @@ -90,10 +90,4 @@ button[type="primary"][disabled] { padding: 0 15px; } -.weui-navbar__item.weui-bar__item_on { - color: #ff5801; -} -.weui-navbar__slider { - background-color: #ff5801; -} \ No newline at end of file diff --git a/app/pages/shop/show.js b/app/pages/shop/show.js index 7216749..c28a839 100644 --- a/app/pages/shop/show.js +++ b/app/pages/shop/show.js @@ -1,6 +1,7 @@ // pages/shop/show.js -var sliderWidth = 96; +import {makePhoneCall} from '../../utils/util' + var initOrder = { totalNum: 0, totalPrice: 0, @@ -12,10 +13,8 @@ var initOrder = { Page({ data: { - tabs: ["商品", "评价"], - activeIndex: 0, - sliderOffset: 0, - sliderLeft: 0, + tabs: ["商品", "评价", "商家"], + activeIndex: 2, activeMenuIndex: 0, showCart: false, @@ -24,6 +23,78 @@ Page({ order: initOrder, + review: { + "list": [ + { + "order_id": "1272", + "user_id": "4", + "seller_id": "1", + "service": "5", + "reach_time": "0", + "quality": "5", + "content": "", + "pic_url": null, + "time": "1488951898", + "nick": "te***", + "head_pic": null + }, + { + "order_id": "1271", + "user_id": "4", + "seller_id": "1", + "service": "5", + "reach_time": "0", + "quality": "5", + "content": "123455", + "pic_url": null, + "time": "1488944987", + "nick": "te***", + "head_pic": null + }, + { + "order_id": "1270", + "user_id": "4", + "seller_id": "1", + "service": "4", + "reach_time": "0", + "quality": "4", + "content": "hoohoo", + "pic_url": null, + "time": "1488944700", + "nick": "te***", + "head_pic": null + }, + { + "order_id": "1267", + "user_id": "4", + "seller_id": "1", + "service": "5", + "reach_time": "0", + "quality": "5", + "content": "hoho", + "pic_url": null, + "time": "1488936939", + "nick": "te***", + "head_pic": null + }, + { + "order_id": "1266", + "user_id": "5", + "seller_id": "1", + "service": "5", + "reach_time": "0", + "quality": "5", + "content": "", + "pic_url": "", + "time": "1488863802", + "nick": "te***", + "head_pic": null + } + ], + "count": 10, + "page": 0 + }, + info: { "seller_id": "2", "seller_name": "鲜极道", @@ -44,9 +115,9 @@ Page({ "reserve_day": "0", "min_price": "5", "sales": "74", - "service": "0.0", - "quality": "0.0", - "overall": "0.0", + "service": "4.2", + "quality": "3.5", + "overall": "4.5", "distance": "20434", "delivery_fee": 45, "favorite": "0", @@ -554,7 +625,6 @@ Page({ }, onLoad: function (options) { // 页面初始化 options为页面跳转所带来的参数 - this.initTab() }, onReady: function () { // 页面渲染完成 @@ -582,10 +652,16 @@ Page({ }, tabClick: function (e) { this.setData({ - sliderOffset: e.currentTarget.offsetLeft, activeIndex: e.currentTarget.id }); }, + + swiperChange(e) { + var {current} = e.detail + this.setData({ + activeIndex: current + }) + }, menuClick: function (e) { this.setData({ activeMenuIndex: e.currentTarget.id @@ -773,5 +849,9 @@ Page({ this.setData({ activeSubGoods }) + }, + onPhoneTap(e) { + var {phone} = e.currentTarget.dataset + makePhoneCall(phone) } }) \ No newline at end of file diff --git a/app/pages/shop/show.wxml b/app/pages/shop/show.wxml index c1319e2..c59863d 100644 --- a/app/pages/shop/show.wxml +++ b/app/pages/shop/show.wxml @@ -1,3 +1,4 @@ + @@ -6,22 +7,22 @@ - + - + {{info.seller_name}} - {{info.min_price}}元起送 | {{info.delivery_fee}}元配送费 | {{info.reach_time}}分钟到达 + {{info.min_price}}元起送 | {{info.reach_time}}分钟 | 距离{{info.distance / 1000}}km 公告: {{info.notice}} - + @@ -38,15 +39,12 @@ - - - {{item}} - - - + + {{item}} + - -