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}}
+
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/pages/shop/show.wxss b/app/pages/shop/show.wxss
index 6562497..13525fd 100644
--- a/app/pages/shop/show.wxss
+++ b/app/pages/shop/show.wxss
@@ -1,4 +1,5 @@
/* pages/shop/show.wxss */
+@import '/templates/star-rate.wxss';
@import './templates/goods-actions.wxss';
@import './templates/cart-box.wxss';
@import './templates/sub-goods.wxss';
@@ -30,9 +31,6 @@
border-radius: 50%;
}
-.weui-cell__ft_in-access::after {
- border-color: #fff;
-}
.promotion {
position: relative;
@@ -79,6 +77,26 @@
height: 100%;
}
+
+/* navbar */
+.weui-navbar__item {
+ position: relative;
+ color: #999;
+}
+
+.weui-navbar__item.weui-bar__item_on {
+ color: #000;
+ font-weight: 400;
+}
+.weui-bar__item_on::after {
+ content: '';
+ position: absolute;
+ left: 10%;
+ bottom: -1rpx;
+ width: 80%;
+ border-bottom: 5rpx solid #ff5801;
+}
+
/* menu-tab */
.menu-tab {
@@ -213,4 +231,118 @@
.menu-cart__price {
color: #ff5801;
font-size: 1.2em;
+}
+
+/* weui-tab__content_review */
+.weui-tab__content {
+ overflow: auto;
+}
+.weui-tab__content_review {
+ background-color: #f8f8f8;
+}
+
+.shop-rate {
+ display: flex;
+ padding: 10px;
+ align-items: center;
+ justify-content: center;
+ text-align: center;
+ background-color: #fff;
+}
+
+.shop-rate__overall {
+ flex: 2;
+ border-right: 1rpx solid #e8e8e8;
+}
+
+.shop-rate__overall-num {
+ font-size: 2em;
+ color: #ff5801;
+}
+.shop-rate__score {
+ flex: 3;
+
+}
+
+.shop-rate__score-item {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.shop-rate__score-item-label {
+ margin-right: 5px;
+}
+.shop-rate__score-item-num {
+ margin-left: 5px;
+ color: #ff5801;
+}
+
+/*shop-review*/
+.shop-review {
+ margin-top: 10px;
+ background-color: #fff;
+}
+.review-item {
+ display: flex;
+ padding: 5px 8px;
+}
+.review-item:not(:last-child) {
+ border-bottom: 1rpx solid #e8e8e8;
+}
+
+.review-item__head-img {
+ margin-right: 10px;
+ height: 50px;
+ width: 50px;
+ border: 1rpx solid #e8e8e8;
+ border-radius: 50%;
+}
+.review-item__content {
+ flex: 1;
+}
+
+.review-item__hd {
+ position: relative;
+}
+
+.review-item__reach-time {
+ margin-left: 5px;
+}
+.review-item__add-time {
+ position: absolute;
+ right: 8px;
+ top: 5px;
+ color: #999;
+ font-size: 0.8em;
+}
+
+.review-item__bd {
+ padding: 5px 0;
+}
+
+/*weui-tab__content_info*/
+.weui-tab__content_info {
+ background-color: #f8f8f8;
+}
+
+.weui-cell__hd_info {
+ min-width: 5em;
+ color: #999;
+}
+
+.info__promotion-img {
+ margin:-2px 5px 0 0;
+ height: 18px;
+ width: 18px;
+ vertical-align: middle;
+}
+
+.info__promotion-list {
+ font-size: 14px;
+}
+
+.info__phone-icon {
+ height: 20px;
+ width: 20px;
+ vertical-align: middle;
}
\ No newline at end of file
diff --git a/app/templates/star-rate.wxml b/app/templates/star-rate.wxml
index 6df3d82..6f888c8 100644
--- a/app/templates/star-rate.wxml
+++ b/app/templates/star-rate.wxml
@@ -1,5 +1,5 @@
-
+
★
\ No newline at end of file
diff --git a/app/templates/star-rate.wxss b/app/templates/star-rate.wxss
index 60a589e..221b2a0 100644
--- a/app/templates/star-rate.wxss
+++ b/app/templates/star-rate.wxss
@@ -1,9 +1,13 @@
.star-rate {
display: flex;
- font-size: 16px;
+ font-size: 14px;
color: #999;
}
+.star-rate_mini {
+ font-size: 0.8em;
+}
+
.star-rate__item_active {
color: #ffd700;
}
\ No newline at end of file
diff --git a/app/utils/util.js b/app/utils/util.js
index dfc8ca1..fa32f08 100644
--- a/app/utils/util.js
+++ b/app/utils/util.js
@@ -146,6 +146,19 @@ export function confirm(options) {
})
}
+// 拨打电话
+export function makePhoneCall(phoneNum) {
+ confirm({
+ content: `是否拨打电话 ${phoneNum}`,
+ confirmText: '拨打',
+ ok() {
+ wx.makePhoneCall({
+ phoneNumber: phoneNum,
+ })
+ }
+ })
+}
+
// 加载提示
export function showLoading() {
wx.showToast({