Showing
9 changed files
with
223 additions
and
324 deletions
@@ -50,129 +50,90 @@ const _assignExpressInfo = (showLogistics, order) => { | @@ -50,129 +50,90 @@ const _assignExpressInfo = (showLogistics, order) => { | ||
50 | * @private | 50 | * @private |
51 | */ | 51 | */ |
52 | const _getOrderStatus = (order, showLogistics) => { | 52 | const _getOrderStatus = (order, showLogistics) => { |
53 | - let result = {}; | 53 | + let orderBtn = []; |
54 | 54 | ||
55 | - if (order.isCancel === 'Y') { | ||
56 | - return { | ||
57 | - canceled: true | ||
58 | - }; | 55 | + if (!order) { |
56 | + return {}; | ||
59 | } | 57 | } |
60 | 58 | ||
61 | - order.status = parseInt(order.status, 10); | ||
62 | - | ||
63 | - // 先判断订单付款方式,根据不同的付款方式计算订单状态。(注:货到付款没有待付款状态) | ||
64 | - // 支付方式为非货到付款时,计算订单状态。 | ||
65 | - if (parseInt(order.paymentType, 10) !== 2) { | ||
66 | - Object.assign(result, { | ||
67 | - isPayonline: true | 59 | + if (parseInt(order.attribute, 10) === 9) { |
60 | + /* 预售商品,不能进行任何操作 */ | ||
61 | + orderBtn.push({ | ||
62 | + isAdvance: true | ||
68 | }); | 63 | }); |
64 | + return {orderBtn: orderBtn}; | ||
65 | + } | ||
69 | 66 | ||
70 | - let isPayaly = order.paymentName === '' ? false : true; | ||
71 | - | ||
72 | - switch (order.status) { | ||
73 | - case 0: | 67 | + /* 倒计时时间 订单详情页倒计时不在同一级*/ |
68 | + if (order.counterFlag === 'Y' && parseInt(order.payLefttime, 10)) { | ||
69 | + orderBtn.push({ | ||
70 | + leftTimeTop: order.payLefttime * 1000 | ||
71 | + }); | ||
72 | + } | ||
74 | 73 | ||
75 | - /* 待付款 */ | ||
76 | - Object.assign(result, { | ||
77 | - unpaid: true, | ||
78 | - payUrl: helpers.urlFormat('/home/orders/paynew', {order_code: order.orderCode}) | 74 | + _.each(order.links, function(val) { |
75 | + switch (val) { | ||
76 | + case 'refundApply':// 申请退款 | ||
77 | + orderBtn.push({ | ||
78 | + refundApply: true | ||
79 | }); | 79 | }); |
80 | break; | 80 | break; |
81 | - case 1: | ||
82 | - case 2: | ||
83 | - case 3: | ||
84 | - | ||
85 | - /* 已付款状态不给查看物流 URL */ | ||
86 | - Object.assign(result, { | ||
87 | - unreceived: true, | ||
88 | - payAly: isPayaly | 81 | + case 'modifyAddress':// 修改收货地址 |
82 | + orderBtn.push({ | ||
83 | + modifyAddress: true, | ||
84 | + link: helpers.urlFormat('/home/orders/addressModify', { | ||
85 | + orderCode: order.orderCode, | ||
86 | + areaCode: _.get(order, 'delivery_address.area_code', ''), | ||
87 | + provinceAreaCode: order.isSupportChangeProvince !== 'Y' && | ||
88 | + _.get(order, 'delivery_address.province_area_code', '') || ''// 如果不允许修改省 | ||
89 | + }) | ||
89 | }); | 90 | }); |
90 | break; | 91 | break; |
91 | - case 4: | ||
92 | - case 5: | ||
93 | - | ||
94 | - /* 已发货状态,给查看物流或二维码URL */ | ||
95 | - Object.assign(result, { | ||
96 | - unreceived: true, | ||
97 | - payAly: isPayaly | 92 | + case 'buyNow':// 立即付款 |
93 | + orderBtn.push({ | ||
94 | + buyNow: true, | ||
95 | + link: helpers.urlFormat('/home/orders/paynew', {order_code: order.orderCode}), | ||
98 | }); | 96 | }); |
99 | - | ||
100 | - /* 是否门票 */ | ||
101 | - if (order.virtualType && parseInt(order.virtualType, 10) === 3) { | ||
102 | - Object.assign(result, { | ||
103 | - qrcode: helpers.urlFormat(`/home/QRcode/${order.orderCode}`) | ||
104 | - }); | ||
105 | - } else { | ||
106 | - Object.assign(result, _assignExpressInfo(showLogistics, order)); | ||
107 | - } | ||
108 | break; | 97 | break; |
109 | - case 6: | ||
110 | - | ||
111 | - /* 已成功订单,给查看物流或二维码URL */ | ||
112 | - Object.assign(result, { | ||
113 | - completed: true, | ||
114 | - payAly: isPayaly | 98 | + case 'closeOrder':// 取消订单 |
99 | + orderBtn.push({ | ||
100 | + closeOrder: true | ||
115 | }); | 101 | }); |
116 | - | ||
117 | - /* 是否门票 */ | ||
118 | - if (order.virtual_type && parseInt(order.virtual_type, 10) === 3) { | ||
119 | - Object.assign(result, { | ||
120 | - qrcode: helpers.urlFormat(`/home/QRcode/${order.orderCode}`) | ||
121 | - }); | ||
122 | - } else { | ||
123 | - Object.assign(result, _assignExpressInfo(showLogistics, order)); | ||
124 | - } | ||
125 | break; | 102 | break; |
126 | - default: | 103 | + case 'confirm':// 订单确认 |
127 | break; | 104 | break; |
128 | - } | ||
129 | - } else { | ||
130 | - Object.assign(result, { | ||
131 | - payAly: true, | ||
132 | - paymentName: (order.paymentName !== '') ? order.paymentName : '货到付款' | ||
133 | - }); | ||
134 | - | ||
135 | - /* 订单为货到付款订单时,计算订单状态。(货到付款没有待付款状态) */ | ||
136 | - switch (order.status) { | ||
137 | - case 0: | ||
138 | - | ||
139 | - /* 备货中 */ | ||
140 | - Object.assign(result, { | ||
141 | - unpaid: true | ||
142 | - }); | 105 | + case 'getExpress':// 查看物流 |
106 | + orderBtn.push(Object.assign( | ||
107 | + {getExpress: true}, | ||
108 | + _assignExpressInfo(showLogistics, order) | ||
109 | + )); | ||
143 | break; | 110 | break; |
144 | - case 1: | ||
145 | - case 2: | ||
146 | - case 3: | ||
147 | - | ||
148 | - /* 已付款状态不给查看物流URL */ | ||
149 | - Object.assign(result, { | ||
150 | - unreceived: true | 111 | + case 'shareOrder':// 晒单评价 |
112 | + break; | ||
113 | + case 'delOrder':// 删除订单 | ||
114 | + orderBtn.push({ | ||
115 | + delOrder: true, | ||
151 | }); | 116 | }); |
152 | break; | 117 | break; |
153 | - case 4: | ||
154 | - case 5: | ||
155 | - | ||
156 | - /* 待收货状态,给查看物流 url */ | ||
157 | - Object.assign(result, { | ||
158 | - unreceived: true | 118 | + case 'lookQrcode':// 查看二维码 |
119 | + orderBtn.push({ | ||
120 | + lookQrcode: true, | ||
121 | + link: helpers.urlFormat(`/home/QRcode/${order.orderCode}`), | ||
159 | }); | 122 | }); |
160 | - Object.assign(result, _assignExpressInfo(showLogistics, order)); | ||
161 | break; | 123 | break; |
162 | - case 6: | ||
163 | - | ||
164 | - /* 待收货状态,给查看物流 url */ | ||
165 | - Object.assign(result, { | ||
166 | - completed: true | 124 | + case 'afterService':// 售后服务 |
125 | + break; | ||
126 | + case 'readd':// 再次购买 | ||
127 | + orderBtn.push({ | ||
128 | + readd: true | ||
167 | }); | 129 | }); |
168 | - Object.assign(result, _assignExpressInfo(showLogistics, order)); | ||
169 | break; | 130 | break; |
170 | default: | 131 | default: |
171 | break; | 132 | break; |
172 | } | 133 | } |
173 | - } | 134 | + }); |
174 | 135 | ||
175 | - return result; | 136 | + return {orderBtn: orderBtn}; |
176 | }; | 137 | }; |
177 | 138 | ||
178 | 139 | ||
@@ -202,12 +163,6 @@ const orderDetailData = (uid, orderCode) => { | @@ -202,12 +163,6 @@ const orderDetailData = (uid, orderCode) => { | ||
202 | addressAll: orderDetail.area + orderDetail.address | 163 | addressAll: orderDetail.area + orderDetail.address |
203 | }); | 164 | }); |
204 | 165 | ||
205 | - if (orderDetail.counterFlag && orderDetail.counterFlag === 'Y') { | ||
206 | - orderDetail = _.assign(orderDetail, { | ||
207 | - leftTime: parseInt(orderDetail.payLefttime, 10) * 1000 | ||
208 | - }); | ||
209 | - } | ||
210 | - | ||
211 | _.forEach(orderDetail.orderGoods, function(data) { | 166 | _.forEach(orderDetail.orderGoods, function(data) { |
212 | let obj = {}; | 167 | let obj = {}; |
213 | let count = +data.buyNumber; | 168 | let count = +data.buyNumber; |
@@ -253,12 +208,6 @@ const orderDetailData = (uid, orderCode) => { | @@ -253,12 +208,6 @@ const orderDetailData = (uid, orderCode) => { | ||
253 | 208 | ||
254 | orderDetail.goods = goods; | 209 | orderDetail.goods = goods; |
255 | 210 | ||
256 | - if (orderDetail.paymentStatus === 'Y') { | ||
257 | - orderDetail = _.assign(orderDetail, { | ||
258 | - isPay: true | ||
259 | - }); | ||
260 | - } | ||
261 | - | ||
262 | // 判断是否可以修改地址 | 211 | // 判断是否可以修改地址 |
263 | if (orderDetail.canUpdateDeliveryAddress === 'Y' && orderDetail.isSupportChangeProvince === 'Y') { | 212 | if (orderDetail.canUpdateDeliveryAddress === 'Y' && orderDetail.isSupportChangeProvince === 'Y') { |
264 | orderDetail = _.assign(orderDetail, { | 213 | orderDetail = _.assign(orderDetail, { |
@@ -272,24 +221,6 @@ const orderDetailData = (uid, orderCode) => { | @@ -272,24 +221,6 @@ const orderDetailData = (uid, orderCode) => { | ||
272 | }); | 221 | }); |
273 | } | 222 | } |
274 | 223 | ||
275 | - // 判断是否有关联订单 | ||
276 | - if (orderDetail.relateOrderCode === 'Y') { | ||
277 | - orderDetail = _.assign(orderDetail, { | ||
278 | - relation: true | ||
279 | - }); | ||
280 | - } else { | ||
281 | - orderDetail = _.assign(orderDetail, { | ||
282 | - relation: false | ||
283 | - }); | ||
284 | - } | ||
285 | - | ||
286 | - // 定金预售 | ||
287 | - if (orderDetail.attribute * 1 === 9) { | ||
288 | - orderDetail = _.assign(orderDetail, { | ||
289 | - isDepositAdvance: true | ||
290 | - }); | ||
291 | - } | ||
292 | - | ||
293 | orderDetail = _.assign(orderDetail, { | 224 | orderDetail = _.assign(orderDetail, { |
294 | goodsAmount: orderDetail.paymentAmount, | 225 | goodsAmount: orderDetail.paymentAmount, |
295 | newUrl: helpers.urlFormat('/home/orders/addressModify', { | 226 | newUrl: helpers.urlFormat('/home/orders/addressModify', { |
@@ -308,18 +239,15 @@ const orderDetailData = (uid, orderCode) => { | @@ -308,18 +239,15 @@ const orderDetailData = (uid, orderCode) => { | ||
308 | } | 239 | } |
309 | 240 | ||
310 | // 为支付的拆单配送信息 | 241 | // 为支付的拆单配送信息 |
311 | - if (orderDetail.isMultiPackage && orderDetail.isMultiPackage === 'Y') { | ||
312 | - let jitInfo = { | ||
313 | - deliveryId: orderDetail.deliveryId, | ||
314 | - paymentType: orderDetail.paymentType, | ||
315 | - couponCode: orderDetail.couponCode, | ||
316 | - yohoCoin: orderDetail.yohoCoin, | ||
317 | - cartType: 'ordinary' | ||
318 | - }; | ||
319 | - | 242 | + if (orderDetail.isMultiPackage === 'Y') { |
320 | orderDetail = _.assign(orderDetail, { | 243 | orderDetail = _.assign(orderDetail, { |
321 | - isJit: true, | ||
322 | - jitDetailUrl: helpers.urlFormat('/cart/index/new/jitDetail', jitInfo) | 244 | + jitDetailUrl: helpers.urlFormat('/cart/index/new/jitDetail', { |
245 | + deliveryId: orderDetail.deliveryId, | ||
246 | + paymentType: orderDetail.paymentType, | ||
247 | + couponCode: orderDetail.couponCode, | ||
248 | + yohoCoin: orderDetail.yohoCoin, | ||
249 | + cartType: 'ordinary' | ||
250 | + }) | ||
323 | }); | 251 | }); |
324 | } | 252 | } |
325 | 253 | ||
@@ -327,15 +255,6 @@ const orderDetailData = (uid, orderCode) => { | @@ -327,15 +255,6 @@ const orderDetailData = (uid, orderCode) => { | ||
327 | orderDetail.invoice.type = (orderDetail.invoice.type + '' === '2'); | 255 | orderDetail.invoice.type = (orderDetail.invoice.type + '' === '2'); |
328 | } | 256 | } |
329 | 257 | ||
330 | - /* 申请退款 */ | ||
331 | - if (_.find(orderDetail.links, o => { | ||
332 | - return o === 'refundApply'; | ||
333 | - })) { | ||
334 | - Object.assign(orderDetail, { | ||
335 | - refundApply: true | ||
336 | - }); | ||
337 | - } | ||
338 | - | ||
339 | return orderDetail; | 258 | return orderDetail; |
340 | } else { | 259 | } else { |
341 | logger.error('detail info return no 200'); | 260 | logger.error('detail info return no 200'); |
@@ -21,8 +21,6 @@ | @@ -21,8 +21,6 @@ | ||
21 | <p class="address"> | 21 | <p class="address"> |
22 | {{addressAll}} | 22 | {{addressAll}} |
23 | </p> | 23 | </p> |
24 | - | ||
25 | - <div class="rest">其他地址<span class="iconfont icon-address"></span></div> | ||
26 | </div> | 24 | </div> |
27 | 25 | ||
28 | </section> | 26 | </section> |
@@ -36,8 +34,8 @@ | @@ -36,8 +34,8 @@ | ||
36 | <span class="sub-title">订单编号:{{orderCode}}</span> | 34 | <span class="sub-title">订单编号:{{orderCode}}</span> |
37 | <span >订单状态:{{statusStr}}</span> | 35 | <span >订单状态:{{statusStr}}</span> |
38 | <span>下单时间:<b class="createTime">{{createTime}}</b></span> | 36 | <span>下单时间:<b class="createTime">{{createTime}}</b></span> |
39 | - {{#if payAly}} | ||
40 | - <span>支付方式:{{paymentName}}</span> | 37 | + {{#if paymentName}} |
38 | + <span>支付方式:{{paymentName}}</span> | ||
41 | {{/if}} | 39 | {{/if}} |
42 | </p> | 40 | </p> |
43 | <a href="{{serviceUrl}}" target="_blank" class="iconfont icon-right"></a> | 41 | <a href="{{serviceUrl}}" target="_blank" class="iconfont icon-right"></a> |
@@ -59,11 +57,11 @@ | @@ -59,11 +57,11 @@ | ||
59 | </section> | 57 | </section> |
60 | 58 | ||
61 | <section class="goods block"> | 59 | <section class="goods block"> |
62 | - {{#if isJit}} | 60 | + |
63 | {{> jit-more}} | 61 | {{> jit-more}} |
64 | - {{/if}} | 62 | + |
65 | {{# goods}} | 63 | {{# goods}} |
66 | - {{> order/good}} | 64 | + {{> order/good}} |
67 | {{/ goods}} | 65 | {{/ goods}} |
68 | </section> | 66 | </section> |
69 | 67 | ||
@@ -108,65 +106,19 @@ | @@ -108,65 +106,19 @@ | ||
108 | </ul> | 106 | </ul> |
109 | {{/invoice}} | 107 | {{/invoice}} |
110 | 108 | ||
111 | - {{#if unpaid}} | ||
112 | - <div class="clock"> | ||
113 | - <ul class="count-down hide"> | ||
114 | - <li> | ||
115 | - <span class="iconfont count-down-icon"></span> | ||
116 | - </li> | ||
117 | - <li> | ||
118 | - <span class="hours">{{leftTime}}</span> | ||
119 | - </li> | ||
120 | - </ul> | ||
121 | - </div> | ||
122 | - {{/if}} | ||
123 | - | ||
124 | - <div class="opt block"> | ||
125 | - {{!-- 修改地址 --}} | ||
126 | - {{#if addressModify}} | ||
127 | - <a href="{{newUrl}}" class="btn">修改地址</a> | ||
128 | - {{/if}} | ||
129 | - {{#if isDepositAdvance}} | ||
130 | - <div class="order-opt"> | ||
131 | - <span class="order-opt-info">请到App完成订单相关操作</span> | 109 | + {{# orderBtn}} |
110 | + {{#if leftTimeTop}} | ||
111 | + <div class="clock"> | ||
112 | + <ul class="count-down hide"> | ||
113 | + <li><span class="iconfont count-down-icon"></span></li> | ||
114 | + <li><span class="hours">{{leftTimeTop}}</span></li> | ||
115 | + </ul> | ||
132 | </div> | 116 | </div> |
133 | - {{else}} | ||
134 | - {{#unless unreceived}} | ||
135 | - {{#unless unpaid}} | ||
136 | - <span class="btn btn-del">删除订单</span> | ||
137 | - {{#if isVirtual}} | ||
138 | - <!--虚拟商品--> | ||
139 | - {{else}} | ||
140 | - {{#unless useLimitCode}}<span class="btn btn-rebuy">再次购买</span>{{/unless}} | ||
141 | - {{/if}} | ||
142 | - {{/unless}} | ||
143 | - {{/unless}} | ||
144 | - | ||
145 | - {{#if unpaid}} | ||
146 | - <span class="btn btn-cancel">取消订单</span> | ||
147 | - {{#if payUrl}} | ||
148 | - <a class="btn btn-pay" href="{{payUrl}}">立即付款</a> | ||
149 | - {{/if}} | ||
150 | - {{/if}} | ||
151 | - | ||
152 | - {{#if logisticsUrl}} | ||
153 | - <a href="{{logisticsUrl}}"> | ||
154 | - <span class="btn btn-check-logistics">查看物流</span> | ||
155 | - </a> | ||
156 | - {{/if}} | ||
157 | - | ||
158 | - {{#if qrcode}} | ||
159 | - <a href="{{qrcode}}"> | ||
160 | - <span class="btn btn-check-logistics">查看二维码</span> | ||
161 | - </a> | ||
162 | - {{/if}} | ||
163 | - | ||
164 | - {{!-- 申请退款 --}} | ||
165 | - {{#if refundApply}} | ||
166 | - <span class="btn btn-refund">申请退款</span> | ||
167 | - {{/if}} | ||
168 | {{/if}} | 117 | {{/if}} |
169 | - </div> | 118 | + {{/orderBtn}} |
119 | + | ||
120 | + {{!--按钮组--}} | ||
121 | + {{> order/order-btns}} | ||
170 | </div> | 122 | </div> |
171 | 123 | ||
172 | <div class="reason-mask"> | 124 | <div class="reason-mask"> |
1 | -<section class="block more-jit"> | ||
2 | - <a href="{{jitDetailUrl}}"> | ||
3 | - <div class="more-jit"> | ||
4 | - <span>{{packageTitle}}</span> | ||
5 | - <span class="iconfont icon-right-arrow"></span> | ||
6 | - </div> | ||
7 | - </a> | ||
8 | -</section> | 1 | +{{#if jitDetailUrl}} |
2 | +<section class="block more-jit"> | ||
3 | + <a href="{{jitDetailUrl}}"> | ||
4 | + <div class="more-jit"> | ||
5 | + <span>{{packageTitle}}</span> | ||
6 | + <span class="iconfont icon-right-arrow"></span> | ||
7 | + </div> | ||
8 | + </a> | ||
9 | +</section> | ||
10 | +{{/if}} |
@@ -10,10 +10,15 @@ const isProduction = process.env.NODE_ENV === 'production'; | @@ -10,10 +10,15 @@ const isProduction = process.env.NODE_ENV === 'production'; | ||
10 | const isTest = process.env.NODE_ENV === 'test'; | 10 | const isTest = process.env.NODE_ENV === 'test'; |
11 | 11 | ||
12 | const domains = { | 12 | const domains = { |
13 | - api: 'http://api-test3.yohops.com:9999/', | ||
14 | - service: 'http://service-test3.yohops.com:9999/', | ||
15 | - liveApi: 'http://testapi.live.yohops.com:9999/', | ||
16 | - singleApi: 'http://api-test3.yohops.com:9999/', | 13 | + // api: 'http://api-test3.yohops.com:9999/', |
14 | + // service: 'http://service-test3.yohops.com:9999/', | ||
15 | + // liveApi: 'http://testapi.live.yohops.com:9999/', | ||
16 | + // singleApi: 'http://api-test3.yohops.com:9999/', | ||
17 | + | ||
18 | + api: 'http://api.yoho.yohoops.org/', | ||
19 | + service: 'http://service.yoho.yohoops.org/', | ||
20 | + liveApi: 'http://api.live.yoho.cn/', | ||
21 | + singleApi: 'http://single.yoho.cn/', | ||
17 | 22 | ||
18 | imSocket: 'ws://socket.yohobuy.com:10240', | 23 | imSocket: 'ws://socket.yohobuy.com:10240', |
19 | imCs: 'https://im.yohobuy.com/api', | 24 | imCs: 'https://im.yohobuy.com/api', |
doraemon/views/partial/order/order-btns.hbs
0 → 100644
1 | +<div class="order-opt"> | ||
2 | + {{# orderBtn}} | ||
3 | + {{#if leftTime}} | ||
4 | + <ul class="count-down hide"> | ||
5 | + <li><span class="iconfont count-down-icon"></span></li> | ||
6 | + <li><span class="hours">{{leftTime}}</span></li> | ||
7 | + </ul> | ||
8 | + {{else if isAdvance}} | ||
9 | + <span class="order-opt-info">*定金预售订单只能在APP端操作</span> | ||
10 | + {{else if refundApply}} | ||
11 | + <span class="btn refund">申请退款</span> | ||
12 | + {{else if modifyAddress}} | ||
13 | + <a class="btn modify-address" href="{{link}}"> | ||
14 | + <span>修改地址</span> | ||
15 | + </a> | ||
16 | + {{else if buyNow}} | ||
17 | + <a class="locHref" href="{{link}}"> | ||
18 | + <span class="btn pay">立即付款</span> | ||
19 | + </a> | ||
20 | + {{else if closeOrder}} | ||
21 | + <span class="btn cancel">取消订单</span> | ||
22 | + {{else if confirm}} | ||
23 | + | ||
24 | + {{else if getExpress}} | ||
25 | + <a class="locHref" href="{{logisticsUrl}}"> | ||
26 | + <span class="btn check-logistics">查看物流</span> | ||
27 | + </a> | ||
28 | + {{else if shareOrder}} | ||
29 | + | ||
30 | + {{else if delOrder}} | ||
31 | + <span class="btn del">删除订单</span> | ||
32 | + {{else if lookQrcode}} | ||
33 | + <a class="locHref" href="{{link}}"> | ||
34 | + <span class="btn check-logistics">查看二维码</span> | ||
35 | + </a> | ||
36 | + {{else if afterService}} | ||
37 | + | ||
38 | + {{else if readd}} | ||
39 | + <span class="btn rebuy">再次购买</span> | ||
40 | + {{/if}} | ||
41 | + {{/orderBtn}} | ||
42 | +</div> |
@@ -13,46 +13,6 @@ | @@ -13,46 +13,6 @@ | ||
13 | {{#shippingCost}}(含运费¥{{.}}){{/shippingCost}} | 13 | {{#shippingCost}}(含运费¥{{.}}){{/shippingCost}} |
14 | </footer> | 14 | </footer> |
15 | 15 | ||
16 | - <div class="order-opt"> | ||
17 | - {{# orderBtn}} | ||
18 | - {{#if leftTime}} | ||
19 | - <ul class="count-down hide"> | ||
20 | - <li><span class="iconfont count-down-icon"></span></li> | ||
21 | - <li><span class="hours">{{leftTime}}</span></li> | ||
22 | - </ul> | ||
23 | - {{else if isAdvance}} | ||
24 | - <span class="order-opt-info">*定金预售订单只能在APP端操作</span> | ||
25 | - {{else if refundApply}} | ||
26 | - <span class="btn refund">申请退款</span> | ||
27 | - {{else if modifyAddress}} | ||
28 | - <a class="btn" href="{{link}}"> | ||
29 | - <span>修改地址</span> | ||
30 | - </a> | ||
31 | - {{else if buyNow}} | ||
32 | - <a class="locHref" href="{{link}}"> | ||
33 | - <span class="btn pay">立即付款</span> | ||
34 | - </a> | ||
35 | - {{else if closeOrder}} | ||
36 | - <span class="btn cancel">取消订单</span> | ||
37 | - {{else if confirm}} | ||
38 | - | ||
39 | - {{else if getExpress}} | ||
40 | - <a class="locHref" href="{{logisticsUrl}}"> | ||
41 | - <span class="btn check-logistics">查看物流</span> | ||
42 | - </a> | ||
43 | - {{else if shareOrder}} | ||
44 | - | ||
45 | - {{else if delOrder}} | ||
46 | - <span class="btn del">删除订单</span> | ||
47 | - {{else if lookQrcode}} | ||
48 | - <a class="locHref" href="{{link}}"> | ||
49 | - <span class="btn check-logistics">查看二维码</span> | ||
50 | - </a> | ||
51 | - {{else if afterService}} | ||
52 | - | ||
53 | - {{else if readd}} | ||
54 | - <span class="btn rebuy">再次购买</span> | ||
55 | - {{/if}} | ||
56 | - {{/orderBtn}} | ||
57 | - </div> | 16 | + {{!--按钮组--}} |
17 | + {{> order/order-btns}} | ||
58 | </div> | 18 | </div> |
@@ -14,7 +14,6 @@ var $ = require('yoho-jquery'), | @@ -14,7 +14,6 @@ var $ = require('yoho-jquery'), | ||
14 | var orderId = $('#order-detail').data('id'), | 14 | var orderId = $('#order-detail').data('id'), |
15 | $countDownHours = $('.hours'), | 15 | $countDownHours = $('.hours'), |
16 | $countdownContainer = $('.count-down'), | 16 | $countdownContainer = $('.count-down'), |
17 | - $ownerInfo = $('.owner-info'), | ||
18 | $reaMask = $('.reason-mask'), | 17 | $reaMask = $('.reason-mask'), |
19 | $refundReaMask = $('.refund-reason-mask'), | 18 | $refundReaMask = $('.refund-reason-mask'), |
20 | reasonSwiper, | 19 | reasonSwiper, |
@@ -22,8 +21,8 @@ var orderId = $('#order-detail').data('id'), | @@ -22,8 +21,8 @@ var orderId = $('#order-detail').data('id'), | ||
22 | optHammer, | 21 | optHammer, |
23 | $createTime = new Date($('.createTime').text() * 1000); | 22 | $createTime = new Date($('.createTime').text() * 1000); |
24 | 23 | ||
25 | -var $sureClose = $('.btn-cancel'); // 取消订单按钮 | ||
26 | -var $sureRefund = $('.btn-refund'); // 申请退款按钮 | 24 | +var $sureClose = $('.order-opt').find('.cancel'); // 取消订单按钮 |
25 | +var $sureRefund = $('.order-opt').find('.refund'); // 申请退款按钮 | ||
27 | 26 | ||
28 | 27 | ||
29 | require('home/order-detail-index.page.css'); | 28 | require('home/order-detail-index.page.css'); |
@@ -87,11 +86,11 @@ function downCount(options) { | @@ -87,11 +86,11 @@ function downCount(options) { | ||
87 | downCount($countDownHours.text()); | 86 | downCount($countDownHours.text()); |
88 | 87 | ||
89 | // 订单删除 | 88 | // 订单删除 |
90 | -optHammer = new Hammer(document.getElementsByClassName('opt')[0]); | 89 | +optHammer = new Hammer(document.getElementsByClassName('order-opt')[0]); |
91 | optHammer.on('tap', function(e) { | 90 | optHammer.on('tap', function(e) { |
92 | var $cur = $(e.target); | 91 | var $cur = $(e.target); |
93 | 92 | ||
94 | - if ($cur.hasClass('btn-del')) { | 93 | + if ($cur.hasClass('del')) { |
95 | 94 | ||
96 | // 删除订单 | 95 | // 删除订单 |
97 | dialog.showDialog({ | 96 | dialog.showDialog({ |
@@ -122,9 +121,9 @@ optHammer.on('tap', function(e) { | @@ -122,9 +121,9 @@ optHammer.on('tap', function(e) { | ||
122 | tip.show('网络错误'); | 121 | tip.show('网络错误'); |
123 | }); | 122 | }); |
124 | }); | 123 | }); |
125 | - } else if ($cur.hasClass('btn-cancel')) { | 124 | + } else if ($cur.hasClass('cancel')) { |
126 | // $reaMask.css('visibility', 'visible'); | 125 | // $reaMask.css('visibility', 'visible'); |
127 | - } else if ($cur.hasClass('btn-refund')) { | 126 | + } else if ($cur.hasClass('refund')) { |
128 | // $refundReaMask.css('visibility', 'visible'); | 127 | // $refundReaMask.css('visibility', 'visible'); |
129 | 128 | ||
130 | /** | 129 | /** |
@@ -139,7 +138,7 @@ optHammer.on('tap', function(e) { | @@ -139,7 +138,7 @@ optHammer.on('tap', function(e) { | ||
139 | }) | 138 | }) |
140 | }, true); | 139 | }, true); |
141 | } | 140 | } |
142 | - } else if ($cur.hasClass('btn-rebuy')) { | 141 | + } else if ($cur.hasClass('rebuy')) { |
143 | $.ajax({ | 142 | $.ajax({ |
144 | type: 'GET', | 143 | type: 'GET', |
145 | url: '/home/readd', | 144 | url: '/home/readd', |
@@ -154,15 +153,7 @@ optHammer.on('tap', function(e) { | @@ -154,15 +153,7 @@ optHammer.on('tap', function(e) { | ||
154 | tip.show(res.message); | 153 | tip.show(res.message); |
155 | } | 154 | } |
156 | }); | 155 | }); |
157 | - } | ||
158 | -}); | ||
159 | - | ||
160 | -if ($ownerInfo.data('changeable') === true) { | ||
161 | - $ownerInfo.find('.rest').show(); | ||
162 | - $ownerInfo.on('touchend', function() { | ||
163 | - /** | ||
164 | - * 埋点 | ||
165 | - */ | 156 | + } else if ($cur.hasClass('modify-address')) { |
166 | if (window._yas && window._yas.sendCustomInfo) { | 157 | if (window._yas && window._yas.sendCustomInfo) { |
167 | window._yas.sendCustomInfo({ | 158 | window._yas.sendCustomInfo({ |
168 | op: 'YB_ORDER_MODIFY_ADDRESS_C', | 159 | op: 'YB_ORDER_MODIFY_ADDRESS_C', |
@@ -172,10 +163,9 @@ if ($ownerInfo.data('changeable') === true) { | @@ -172,10 +163,9 @@ if ($ownerInfo.data('changeable') === true) { | ||
172 | }) | 163 | }) |
173 | }, true); | 164 | }, true); |
174 | } | 165 | } |
175 | - | ||
176 | - location.href = $ownerInfo.data('url'); | ||
177 | - }); | ||
178 | -} | 166 | + return true; |
167 | + } | ||
168 | +}); | ||
179 | 169 | ||
180 | $(function() { | 170 | $(function() { |
181 | reasonSwiper = new Swiper('.box-main', { | 171 | reasonSwiper = new Swiper('.box-main', { |
@@ -101,20 +101,6 @@ | @@ -101,20 +101,6 @@ | ||
101 | margin-top: 10px; | 101 | margin-top: 10px; |
102 | } | 102 | } |
103 | 103 | ||
104 | - .rest { | ||
105 | - display: none; | ||
106 | - position: relative; | ||
107 | - width: 100%; | ||
108 | - text-align: right; | ||
109 | - color: #f00; | ||
110 | - font-size: 24px; | ||
111 | - | ||
112 | - .icon-address { | ||
113 | - position: static; | ||
114 | - font-size: 24px; | ||
115 | - } | ||
116 | - } | ||
117 | - | ||
118 | .order-status { | 104 | .order-status { |
119 | margin: 20px 0; | 105 | margin: 20px 0; |
120 | border-top: 1px solid #e0e0e0; | 106 | border-top: 1px solid #e0e0e0; |
@@ -172,15 +158,6 @@ | @@ -172,15 +158,6 @@ | ||
172 | } | 158 | } |
173 | } | 159 | } |
174 | 160 | ||
175 | - .opt { | ||
176 | - text-align: right; | ||
177 | - border-top: 1px solid #e0e0e0; | ||
178 | - } | ||
179 | - | ||
180 | - .order-opt-info { | ||
181 | - color: #b6b6b6; | ||
182 | - } | ||
183 | - | ||
184 | .btn { | 161 | .btn { |
185 | display: inline-block; | 162 | display: inline-block; |
186 | box-sizing: border-box; | 163 | box-sizing: border-box; |
@@ -193,14 +170,6 @@ | @@ -193,14 +170,6 @@ | ||
193 | border: 1px solid #000; | 170 | border: 1px solid #000; |
194 | } | 171 | } |
195 | 172 | ||
196 | - .btn-pay { | ||
197 | - color: #fff; | ||
198 | - border: none; | ||
199 | - background: #d0021b; | ||
200 | - margin-left: 10px; | ||
201 | - font-size: 24px; | ||
202 | - } | ||
203 | - | ||
204 | .clock { | 173 | .clock { |
205 | width: 100%; | 174 | width: 100%; |
206 | height: 52px; | 175 | height: 52px; |
@@ -374,4 +343,66 @@ | @@ -374,4 +343,66 @@ | ||
374 | float: right; | 343 | float: right; |
375 | } | 344 | } |
376 | } | 345 | } |
346 | + | ||
347 | + .order-opt { | ||
348 | + padding: 20px 0; | ||
349 | + padding-right: 20px; | ||
350 | + border-top: 1px solid #e0e0e0; | ||
351 | + text-align: right; | ||
352 | + background-color: #fff; | ||
353 | + | ||
354 | + .btn { | ||
355 | + display: inline-block; | ||
356 | + box-sizing: border-box; | ||
357 | + height: 60px; | ||
358 | + line-height: 60px; | ||
359 | + width: 140px; | ||
360 | + font-size: 24px; | ||
361 | + text-align: center; | ||
362 | + border: 1px solid #000; | ||
363 | + border-radius: 5PX; | ||
364 | + margin-left: 15px; | ||
365 | + margin-top: 5px; | ||
366 | + } | ||
367 | + | ||
368 | + .pay { | ||
369 | + background: #d0021b; | ||
370 | + color: #fff; | ||
371 | + border: none; | ||
372 | + } | ||
373 | + | ||
374 | + .count-down { | ||
375 | + list-style: none; | ||
376 | + padding: 0; | ||
377 | + display: inline-block; | ||
378 | + text-align: right; | ||
379 | + font-size: 24px; | ||
380 | + color: #b0b0b0; | ||
381 | + float: left; | ||
382 | + margin-left: 30px; | ||
383 | + margin-top: 20px; | ||
384 | + | ||
385 | + .count-down-icon { | ||
386 | + margin-top: -8px; | ||
387 | + font-size: 30px; | ||
388 | + } | ||
389 | + | ||
390 | + &.hide { | ||
391 | + display: none; | ||
392 | + } | ||
393 | + | ||
394 | + li { | ||
395 | + display: inline-block; | ||
396 | + } | ||
397 | + | ||
398 | + li span { | ||
399 | + font-size: 24px; | ||
400 | + line-height: 24px; | ||
401 | + } | ||
402 | + } | ||
403 | + | ||
404 | + .order-opt-info { | ||
405 | + color: #b6b6b6; | ||
406 | + } | ||
407 | + } | ||
377 | } | 408 | } |
@@ -111,10 +111,11 @@ | @@ -111,10 +111,11 @@ | ||
111 | } | 111 | } |
112 | 112 | ||
113 | .order-opt { | 113 | .order-opt { |
114 | - padding: 30px 0; | ||
115 | - padding-right: 30px; | 114 | + padding: 20px 0; |
115 | + padding-right: 20px; | ||
116 | border-top: 1px solid #e0e0e0; | 116 | border-top: 1px solid #e0e0e0; |
117 | text-align: right; | 117 | text-align: right; |
118 | + overflow: hidden; | ||
118 | 119 | ||
119 | .btn { | 120 | .btn { |
120 | display: inline-block; | 121 | display: inline-block; |
@@ -126,13 +127,14 @@ | @@ -126,13 +127,14 @@ | ||
126 | text-align: center; | 127 | text-align: center; |
127 | border: 1px solid #000; | 128 | border: 1px solid #000; |
128 | border-radius: 5PX; | 129 | border-radius: 5PX; |
130 | + margin-left: 15px; | ||
131 | + margin-top: 5px; | ||
129 | } | 132 | } |
130 | 133 | ||
131 | .pay { | 134 | .pay { |
132 | background: #d0021b; | 135 | background: #d0021b; |
133 | color: #fff; | 136 | color: #fff; |
134 | border: none; | 137 | border: none; |
135 | - margin-left: 20px; | ||
136 | } | 138 | } |
137 | 139 | ||
138 | .count-down { | 140 | .count-down { |
@@ -165,10 +167,6 @@ | @@ -165,10 +167,6 @@ | ||
165 | } | 167 | } |
166 | } | 168 | } |
167 | 169 | ||
168 | - .rebuy { | ||
169 | - margin-left: 20px; | ||
170 | - } | ||
171 | - | ||
172 | .order-opt-info { | 170 | .order-opt-info { |
173 | color: #b6b6b6; | 171 | color: #b6b6b6; |
174 | } | 172 | } |
-
Please register or login to post a comment