Showing
11 changed files
with
107 additions
and
79 deletions
@@ -9,29 +9,29 @@ | @@ -9,29 +9,29 @@ | ||
9 | const headerModel = require('../../../doraemon/models/header'); // 头部model | 9 | const headerModel = require('../../../doraemon/models/header'); // 头部model |
10 | const orderDetailModel = require('../models/orderDetail'); | 10 | const orderDetailModel = require('../models/orderDetail'); |
11 | 11 | ||
12 | -let orderDetail = (req, res, next) => { | ||
13 | - let headerData = headerModel.setNav({ | ||
14 | - navTitle: '订单详情' | ||
15 | - }); | ||
16 | - | ||
17 | - let responseData = { | ||
18 | - module: 'home', | ||
19 | - page: 'order-detail', | ||
20 | - title: 'Yoho!Buy 有货', | ||
21 | - pageHeader: headerData, | ||
22 | - pageFooter: true | ||
23 | - }; | ||
24 | - | ||
25 | - orderDetailModel.orderDetail({ | ||
26 | - uid: req.user.uid || 8039759, // TODO 待删除 | ||
27 | - order_code: req.query.order_code | ||
28 | - }).then(result => { | ||
29 | - if (result) { | ||
30 | - res.render('orderDetail', Object.assign(responseData, | ||
31 | - { | ||
32 | - orderDetail: result | ||
33 | - })); | ||
34 | - } | 12 | +const orderDetail = (req, res, next) => { |
13 | + let uid = 8039759; | ||
14 | + let orderCode = req.query.order_code || 1612441404; | ||
15 | + | ||
16 | + orderDetailModel.orderDetail(uid, orderCode).then(result => { | ||
17 | + | ||
18 | + res.render('orderDetail', { | ||
19 | + module: 'home', | ||
20 | + page: 'order-detail', | ||
21 | + pageHeader: headerModel.setNav({ | ||
22 | + navTitle: '订单详情' | ||
23 | + }), | ||
24 | + title: '订单详情', | ||
25 | + pageFooter: true, | ||
26 | + orderDetail: result | ||
27 | + | ||
28 | + // orderDetail: { | ||
29 | + // // isVirtual: false, | ||
30 | + // mobile: '1578934349', | ||
31 | + // orderNum: '113232435', | ||
32 | + // orderStatus: 'quxiao' | ||
33 | + // } | ||
34 | + }); | ||
35 | }).catch(next); | 35 | }).catch(next); |
36 | 36 | ||
37 | }; | 37 | }; |
@@ -3,53 +3,34 @@ | @@ -3,53 +3,34 @@ | ||
3 | 3 | ||
4 | const api = global.yoho.API; | 4 | const api = global.yoho.API; |
5 | const _ = require('lodash'); | 5 | const _ = require('lodash'); |
6 | +const config = global.yoho.config; | ||
7 | +const helpers = global.yoho.helpers; | ||
8 | +const camelCase = global.yoho.camelCase; | ||
6 | 9 | ||
7 | -const orderDetail = (params) => { | 10 | +const orderDetail = (uid, orderCode) => { |
8 | let finalResult = {}; | 11 | let finalResult = {}; |
9 | 12 | ||
10 | - return api.get('', _.assign({ | ||
11 | - method: 'app.SpaceOrders.detail' | ||
12 | - }, params), {code: 200}).then((result) => { | ||
13 | - if (result.data) { | ||
14 | - Object.assign(finalResult, { | ||
15 | - virtual_type: result.data.virtual_type, | ||
16 | - phoneNum: result.data.mobile, | ||
17 | - orderStatus: result.data.status_str, | ||
18 | - orderNum: result.data.order_code, | ||
19 | - orderTime: result.data.create_time, | ||
20 | - isPay: result.data.payment_status === 'Y', | ||
21 | - relation: result.data.relate_order_code === 'Y' ? 'true' : 'false', | ||
22 | - name: result.data.user_name, | ||
23 | - | ||
24 | - isVirtual: false, | ||
25 | - mobile: '15999999999', | ||
26 | - address: result.data.address, | ||
27 | - logisticsUrl: '#', | ||
28 | - logisticsCompany: '顺丰', | ||
29 | - logisticsNum: '111111', | ||
30 | - yohoCoin: result.data.yoho_give_coin, | ||
31 | - | ||
32 | - invoice: [{ | ||
33 | - title: '有货', | ||
34 | - contentValue: '有货', | ||
35 | - pdfUrl: '#' | ||
36 | - }, { | ||
37 | - title: '有货', | ||
38 | - contentValue: '有货', | ||
39 | - pdfUrl: '#' | ||
40 | - }], | ||
41 | - orderBalance: [{ | ||
42 | - promotion: '商品总金额', | ||
43 | - account: '100.00' | ||
44 | - }, { | ||
45 | - promotion: '运费', | ||
46 | - account: '10.00' | ||
47 | - }], | ||
48 | - price: result.data.amount | ||
49 | - }); | ||
50 | - } | ||
51 | - | ||
52 | - return finalResult; | 13 | + return api.get('', { |
14 | + method: 'app.SpaceOrders.detail', | ||
15 | + uid: uid, | ||
16 | + order_code: orderCode | ||
17 | + }).then((result) => { | ||
18 | + let orderDetail = camelCase(result.data); | ||
19 | + console.log(result); | ||
20 | + | ||
21 | + // if(orderDetail.virtualType && orderDetail.virtualType === 3) { | ||
22 | + // orderDetail = _.assign(orderDetail, { | ||
23 | + // isVirtual: true, | ||
24 | + // mobile: result.data.mobile | ||
25 | + // }) | ||
26 | + // } | ||
27 | + | ||
28 | + // orderDetail = _.assign(orderDetail, { | ||
29 | + // addressAll: orderDetail.area + orderDetail.address | ||
30 | + // // createTime: date('Y-m-d H:i:s', orderDetail.createTime) | ||
31 | + // }) | ||
32 | + | ||
33 | + return orderDetail; | ||
53 | }); | 34 | }); |
54 | }; | 35 | }; |
55 | 36 |
@@ -14,12 +14,12 @@ | @@ -14,12 +14,12 @@ | ||
14 | 14 | ||
15 | <div class="beside-icon"> | 15 | <div class="beside-icon"> |
16 | <p class="name-phone"> | 16 | <p class="name-phone"> |
17 | - {{name}} | ||
18 | - <span>{{phoneNum}}</span> | 17 | + {{userName}} |
18 | + <span>{{mobile}}</span> | ||
19 | </p> | 19 | </p> |
20 | 20 | ||
21 | <p class="address"> | 21 | <p class="address"> |
22 | - {{address}} | 22 | + {{addressAll}} |
23 | </p> | 23 | </p> |
24 | 24 | ||
25 | <div class="rest">其他地址<span class="iconfont iconAddress"></span></div> | 25 | <div class="rest">其他地址<span class="iconfont iconAddress"></span></div> |
@@ -33,9 +33,9 @@ | @@ -33,9 +33,9 @@ | ||
33 | <span class="iconfont"></span> | 33 | <span class="iconfont"></span> |
34 | 34 | ||
35 | <p class="beside-icon sub-content"> | 35 | <p class="beside-icon sub-content"> |
36 | - <span class="sub-title">订单编号:{{orderNum}}</span> | ||
37 | - <span >订单状态:{{orderStatus}}</span> | ||
38 | - <span>下单时间:{{orderTime}}</span> | 36 | + <span class="sub-title">订单编号:{{orderCode}}</span> |
37 | + <span >订单状态:{{statusStr}}</span> | ||
38 | + <span>下单时间:{{createTime}}</span> | ||
39 | </p> | 39 | </p> |
40 | </div> | 40 | </div> |
41 | {{#if logisticsUrl}} | 41 | {{#if logisticsUrl}} |
@@ -561,6 +561,34 @@ let _getPromotionInfo = (skn) => { | @@ -561,6 +561,34 @@ let _getPromotionInfo = (skn) => { | ||
561 | }); | 561 | }); |
562 | }; | 562 | }; |
563 | 563 | ||
564 | +let _getRefundExchange = (skn) => { | ||
565 | + | ||
566 | + return api.get('', { | ||
567 | + method: 'app.product.refundExchange', | ||
568 | + product_skn: _.toString(skn) | ||
569 | + }).then((result) => { | ||
570 | + // result ={ | ||
571 | + // "alg": "SALT_MD5", | ||
572 | + // "code": 200, | ||
573 | + // "data": { | ||
574 | + // "51292714": "Y", //N表示没有限制,Y表示是特殊商品有限制 | ||
575 | + // }, | ||
576 | + // "md5": "a849be68446129c27c16baaf53ada78e", | ||
577 | + // "message": "RefundExchange List." | ||
578 | + // } | ||
579 | + if (result.code === 200) { | ||
580 | + let limit; | ||
581 | + let productSkn = _.toString(skn); | ||
582 | + | ||
583 | + if (result.data[productSkn] === 'Y') { | ||
584 | + limit = true; | ||
585 | + } | ||
586 | + return limit; | ||
587 | + } | ||
588 | + return {}; | ||
589 | + }); | ||
590 | +}; | ||
591 | + | ||
564 | let getProductData = (data) => { | 592 | let getProductData = (data) => { |
565 | let finalResult; | 593 | let finalResult; |
566 | let params = { | 594 | let params = { |
@@ -578,12 +606,18 @@ let getProductData = (data) => { | @@ -578,12 +606,18 @@ let getProductData = (data) => { | ||
578 | return api.get('', params, { | 606 | return api.get('', params, { |
579 | cache: false | 607 | cache: false |
580 | }).then(result => { | 608 | }).then(result => { |
581 | - return Promise.all([_getShopsInfo(result.brandId), _getPromotionInfo(result.erpProductId)]).then((info) => { | 609 | + |
610 | + return Promise.all([_getShopsInfo(result.brandId), _getPromotionInfo(result.erpProductId), _getRefundExchange(result.productPriceBo.productSkn)]).then((info) => { | ||
582 | result.promotionBoList = info[1]; | 611 | result.promotionBoList = info[1]; |
583 | 612 | ||
584 | finalResult = _detailDataPkg(result, data.uid, data.vipLevel, data.ua); | 613 | finalResult = _detailDataPkg(result, data.uid, data.vipLevel, data.ua); |
585 | finalResult.enterStore = info[0]; | 614 | finalResult.enterStore = info[0]; |
586 | 615 | ||
616 | + finalResult.limit = info[2]; | ||
617 | + | ||
618 | + // console.log(info[2]) | ||
619 | + | ||
620 | + // console.log(finalResult) | ||
587 | return finalResult; | 621 | return finalResult; |
588 | }); | 622 | }); |
589 | 623 |
@@ -126,7 +126,7 @@ | @@ -126,7 +126,7 @@ | ||
126 | </div> | 126 | </div> |
127 | {{/ enterStore}} | 127 | {{/ enterStore}} |
128 | 128 | ||
129 | - <div id="productDesc"> </div> | 129 | + <div id="productDesc" {{#if limit}}class="limit"{{/if}}> </div> |
130 | {{> detail/recommend-for-you}} | 130 | {{> detail/recommend-for-you}} |
131 | {{> cart/chose-panel}} | 131 | {{> cart/chose-panel}} |
132 | 132 |
public/img/product/limit.png
0 → 100644

25.2 KB
@@ -102,6 +102,10 @@ function search() { | @@ -102,6 +102,10 @@ function search() { | ||
102 | searching = false; | 102 | searching = false; |
103 | end = true; | 103 | end = true; |
104 | loading.hideLoadingMask(); | 104 | loading.hideLoadingMask(); |
105 | + | ||
106 | + if ($('#productDesc').hasClass('limit')) { | ||
107 | + $('#productDesc').find('.service').removeClass('service').addClass('limit-service'); | ||
108 | + } | ||
105 | }, | 109 | }, |
106 | error: function() { | 110 | error: function() { |
107 | tip.show('网络断开连接了~'); | 111 | tip.show('网络断开连接了~'); |
@@ -121,3 +125,5 @@ function scrollHandler() { | @@ -121,3 +125,5 @@ function scrollHandler() { | ||
121 | $(window).scroll(function() { | 125 | $(window).scroll(function() { |
122 | window.requestAnimationFrame(scrollHandler); | 126 | window.requestAnimationFrame(scrollHandler); |
123 | }); | 127 | }); |
128 | + | ||
129 | + |
@@ -4,13 +4,21 @@ | @@ -4,13 +4,21 @@ | ||
4 | padding-bottom: 20px; | 4 | padding-bottom: 20px; |
5 | 5 | ||
6 | .service { | 6 | .service { |
7 | - margin-left: 50px; | ||
8 | - width: 494px; | 7 | + /*margin-left: 50px; |
8 | + width: 494px;*/ | ||
9 | height: 28px; | 9 | height: 28px; |
10 | background: resolve('product/service.png') no-repeat; | 10 | background: resolve('product/service.png') no-repeat; |
11 | background-size: cover; | 11 | background-size: cover; |
12 | } | 12 | } |
13 | 13 | ||
14 | + .limit-service { | ||
15 | + /*margin-left: 50px; | ||
16 | + width: 494px;*/ | ||
17 | + height: 28px; | ||
18 | + background: resolve('product/limit.png') no-repeat; | ||
19 | + background-size: cover; | ||
20 | + } | ||
21 | + | ||
14 | .detail { | 22 | .detail { |
15 | margin-bottom: 1px; | 23 | margin-bottom: 1px; |
16 | } | 24 | } |
-
Please register or login to post a comment