Merge branch 'develop' of git.yoho.cn:fe/yoho-brand-shop into develop
Showing
10 changed files
with
41 additions
and
12 deletions
@@ -4,12 +4,21 @@ Component({ | @@ -4,12 +4,21 @@ Component({ | ||
4 | properties: { | 4 | properties: { |
5 | item: { | 5 | item: { |
6 | type: Object, | 6 | type: Object, |
7 | - value: {} | 7 | + value: {}, |
8 | + observer: '_itemChange' | ||
8 | } | 9 | } |
9 | }, | 10 | }, |
11 | + data: { | ||
12 | + showMarketPrice: false | ||
13 | + }, | ||
10 | methods: { | 14 | methods: { |
11 | goDetail: function () { | 15 | goDetail: function () { |
12 | router.go('productDetail', {productSkn: this.properties.item.skn}); | 16 | router.go('productDetail', {productSkn: this.properties.item.skn}); |
17 | + }, | ||
18 | + _itemChange: function (item) { | ||
19 | + this.setData({ | ||
20 | + showMarketPrice: +item.marketPrice > 0 && +item.marketPrice > +item.salesPrice | ||
21 | + }); | ||
13 | } | 22 | } |
14 | } | 23 | } |
15 | }); | 24 | }); |
@@ -4,8 +4,9 @@ | @@ -4,8 +4,9 @@ | ||
4 | <view class="item-detail"> | 4 | <view class="item-detail"> |
5 | <text class="item-title">{{item.productName}}</text> | 5 | <text class="item-title">{{item.productName}}</text> |
6 | <view class="item-price"> | 6 | <view class="item-price"> |
7 | - <text class="price1" style="color:{{item.showOriginPrice ? '#d0021b' : '#444444'}}">¥{{helper.round(item.salePriceStr)}}</text> | ||
8 | - <text class="price2" wx:if="{{item.showOriginPrice}}">¥{{helper.round(item.originPriceStr)}}</text> | 7 | + <view class="price price1 {{showMarketPrice ? 'before-market-price' : ''}}"> |
8 | + ¥{{helper.round(item.salesPrice)}}</view> | ||
9 | + <view class="price price2" wx:if="{{showMarketPrice}}">¥{{helper.round(item.marketPrice)}}</view> | ||
9 | </view> | 10 | </view> |
10 | </view> | 11 | </view> |
11 | </view> | 12 | </view> |
@@ -17,11 +17,19 @@ | @@ -17,11 +17,19 @@ | ||
17 | color: #444; | 17 | color: #444; |
18 | width: 322rpx; | 18 | width: 322rpx; |
19 | max-width: 322rpx; | 19 | max-width: 322rpx; |
20 | - letter-spacing: 0.28px; | 20 | + letter-spacing: 0.28rpx; |
21 | +} | ||
22 | + | ||
23 | +.item-price .price { | ||
24 | + display: inline-block; | ||
25 | +} | ||
26 | + | ||
27 | +.price1.before-market-price { | ||
28 | + color: #d0021b!important; | ||
21 | } | 29 | } |
22 | 30 | ||
23 | .product-item .item-price .price2 { | 31 | .product-item .item-price .price2 { |
24 | - color: #444; | 32 | + color: #b0b0b0; |
25 | margin-left: 10rpx; | 33 | margin-left: 10rpx; |
26 | text-decoration: line-through; | 34 | text-decoration: line-through; |
27 | } | 35 | } |
@@ -73,7 +73,8 @@ Page({ | @@ -73,7 +73,8 @@ Page({ | ||
73 | if (res.code === 200) { | 73 | if (res.code === 200) { |
74 | const keyAdapter = { | 74 | const keyAdapter = { |
75 | skn: 'product_skn', | 75 | skn: 'product_skn', |
76 | - salePriceStr: 'sales_price', | 76 | + salesPrice: 'sales_price', |
77 | + marketPrice: 'market_price', | ||
77 | productName: 'product_name', | 78 | productName: 'product_name', |
78 | defaultImages: 'default_images' | 79 | defaultImages: 'default_images' |
79 | }; | 80 | }; |
@@ -122,6 +122,7 @@ Page({ | @@ -122,6 +122,7 @@ Page({ | ||
122 | limit: 50 | 122 | limit: 50 |
123 | }; | 123 | }; |
124 | 124 | ||
125 | + wx.showLoading({title: '加载中'}); | ||
125 | orderModel.getOrders(params) | 126 | orderModel.getOrders(params) |
126 | .then(res => { | 127 | .then(res => { |
127 | if (res.code === 200) { | 128 | if (res.code === 200) { |
@@ -133,7 +134,10 @@ Page({ | @@ -133,7 +134,10 @@ Page({ | ||
133 | ordersList: orders, | 134 | ordersList: orders, |
134 | showEmptyContainer: res.data.order_list == 0 | 135 | showEmptyContainer: res.data.order_list == 0 |
135 | }); | 136 | }); |
137 | + wx.hideLoading(); | ||
136 | } | 138 | } |
139 | + }).catch(() => { | ||
140 | + wx.hideLoading(); | ||
137 | }); | 141 | }); |
138 | }, | 142 | }, |
139 | loadRefundReason() { | 143 | loadRefundReason() { |
@@ -117,7 +117,8 @@ Page({ | @@ -117,7 +117,8 @@ Page({ | ||
117 | if (res.code === 200) { | 117 | if (res.code === 200) { |
118 | const keyAdapter = { | 118 | const keyAdapter = { |
119 | skn: 'product_skn', | 119 | skn: 'product_skn', |
120 | - salePriceStr: 'sales_price', | 120 | + salesPrice: 'sales_price', |
121 | + marketPrice: 'market_price', | ||
121 | productName: 'product_name', | 122 | productName: 'product_name', |
122 | defaultImages: 'default_images' | 123 | defaultImages: 'default_images' |
123 | }; | 124 | }; |
@@ -174,7 +174,8 @@ Page({ | @@ -174,7 +174,8 @@ Page({ | ||
174 | if (res.code === 200) { | 174 | if (res.code === 200) { |
175 | const keyAdapter = { | 175 | const keyAdapter = { |
176 | skn: 'product_skn', | 176 | skn: 'product_skn', |
177 | - salePriceStr: 'sales_price', | 177 | + salesPrice: 'sales_price', |
178 | + marketPrice: 'market_price', | ||
178 | productName: 'product_name', | 179 | productName: 'product_name', |
179 | defaultImages: 'default_images' | 180 | defaultImages: 'default_images' |
180 | }; | 181 | }; |
@@ -202,7 +203,8 @@ Page({ | @@ -202,7 +203,8 @@ Page({ | ||
202 | if (res.code === 200) { | 203 | if (res.code === 200) { |
203 | const keyAdapter = { | 204 | const keyAdapter = { |
204 | skn: 'product_skn', | 205 | skn: 'product_skn', |
205 | - salePriceStr: 'sales_price', | 206 | + salesPrice: 'sales_price', |
207 | + marketPrice: 'market_price', | ||
206 | productName: 'product_name', | 208 | productName: 'product_name', |
207 | defaultImages: 'default_images' | 209 | defaultImages: 'default_images' |
208 | }; | 210 | }; |
@@ -70,7 +70,8 @@ Page({ | @@ -70,7 +70,8 @@ Page({ | ||
70 | if (res.code === 200) { | 70 | if (res.code === 200) { |
71 | const keyAdapter = { | 71 | const keyAdapter = { |
72 | skn: 'product_skn', | 72 | skn: 'product_skn', |
73 | - salePriceStr: 'sales_price', | 73 | + salesPrice: 'sales_price', |
74 | + marketPrice: 'market_price', | ||
74 | productName: 'product_name', | 75 | productName: 'product_name', |
75 | defaultImages: 'default_images' | 76 | defaultImages: 'default_images' |
76 | }; | 77 | }; |
@@ -100,7 +100,8 @@ Page({ | @@ -100,7 +100,8 @@ Page({ | ||
100 | if (res.code === 200) { | 100 | if (res.code === 200) { |
101 | const keyAdapter = { | 101 | const keyAdapter = { |
102 | skn: 'product_skn', | 102 | skn: 'product_skn', |
103 | - salePriceStr: 'sales_price', | 103 | + salesPrice: 'sales_price', |
104 | + marketPrice: 'market_price', | ||
104 | productName: 'product_name', | 105 | productName: 'product_name', |
105 | defaultImages: 'default_images' | 106 | defaultImages: 'default_images' |
106 | }; | 107 | }; |
@@ -97,7 +97,8 @@ Page({ | @@ -97,7 +97,8 @@ Page({ | ||
97 | if (res.code === 200) { | 97 | if (res.code === 200) { |
98 | const keyAdapter = { | 98 | const keyAdapter = { |
99 | skn: 'product_skn', | 99 | skn: 'product_skn', |
100 | - salePriceStr: 'sales_price', | 100 | + salesPrice: 'sales_price', |
101 | + marketPrice: 'market_price', | ||
101 | productName: 'product_name', | 102 | productName: 'product_name', |
102 | defaultImages: 'default_images' | 103 | defaultImages: 'default_images' |
103 | }; | 104 | }; |
-
Please register or login to post a comment