Merge branch 'feature/brand' of git.yoho.cn:fe/yohoblk-wap into feature/brand
Showing
5 changed files
with
80 additions
and
16 deletions
@@ -128,13 +128,23 @@ const order = { | @@ -128,13 +128,23 @@ const order = { | ||
128 | 128 | ||
129 | // 订单-物流 | 129 | // 订单-物流 |
130 | logistic: (req, res) => { | 130 | logistic: (req, res) => { |
131 | - let orderCode = req.query.orderCode; | 131 | + let orderCode = req.query.order_code || ''; |
132 | 132 | ||
133 | res.render('order-logistic', { | 133 | res.render('order-logistic', { |
134 | module: 'home', | 134 | module: 'home', |
135 | page: 'order-logistic', | 135 | page: 'order-logistic', |
136 | orderCode: orderCode | 136 | orderCode: orderCode |
137 | }); | 137 | }); |
138 | + }, | ||
139 | + | ||
140 | + // API- 订单-物流 | ||
141 | + getOrderLogisticdate: (req, res) => { | ||
142 | + orderModel.getOrderLogisticdate({ | ||
143 | + uid: req.user.uid, | ||
144 | + order_code: req.query.orderCode | ||
145 | + }).then(result => { | ||
146 | + res.json(result); | ||
147 | + }); | ||
138 | } | 148 | } |
139 | }; | 149 | }; |
140 | 150 |
@@ -7,8 +7,9 @@ | @@ -7,8 +7,9 @@ | ||
7 | 7 | ||
8 | const api = global.yoho.API; | 8 | const api = global.yoho.API; |
9 | 9 | ||
10 | -//const serviceAPI = global.yoho.ServiceAPI; | 10 | +// const serviceAPI = global.yoho.ServiceAPI; |
11 | const camelCase = global.yoho.camelCase; | 11 | const camelCase = global.yoho.camelCase; |
12 | +const _ = require('lodash'); | ||
12 | 13 | ||
13 | /** | 14 | /** |
14 | * 获取订单列表数据 | 15 | * 获取订单列表数据 |
@@ -89,3 +90,27 @@ exports.deleteOrder = (orderCode, uid) => { | @@ -89,3 +90,27 @@ exports.deleteOrder = (orderCode, uid) => { | ||
89 | return result; | 90 | return result; |
90 | }); | 91 | }); |
91 | }; | 92 | }; |
93 | + | ||
94 | +/** | ||
95 | + * 查看订单物流详情 | ||
96 | + * @param {[int]} order_code 订单号 | ||
97 | + * @param {[int]} uid 用户uid | ||
98 | + * @return {[array]} | ||
99 | + */ | ||
100 | +exports.getOrderLogisticdate = (params) => { | ||
101 | + | ||
102 | + if (_.isEmpty(params) || _.isEmpty(params.uid)) { | ||
103 | + return []; | ||
104 | + } | ||
105 | + | ||
106 | + return api.get('', Object.assign({ | ||
107 | + method: 'app.express.li' | ||
108 | + }, params)).then(result => { | ||
109 | + | ||
110 | + if (result.code === 200) { | ||
111 | + return result.data; | ||
112 | + } | ||
113 | + | ||
114 | + return []; | ||
115 | + }); | ||
116 | +}; |
@@ -48,6 +48,7 @@ router.post('/save-logistics', refund.saveLogistics); // 退换货 - 添加寄 | @@ -48,6 +48,7 @@ router.post('/save-logistics', refund.saveLogistics); // 退换货 - 添加寄 | ||
48 | router.get('/about-us', home.aboutUs); // 个人中心 - 关于我们 | 48 | router.get('/about-us', home.aboutUs); // 个人中心 - 关于我们 |
49 | 49 | ||
50 | 50 | ||
51 | -router.get('/logistic', order.logistic); // 个人中心 - 订单物流详情 | 51 | +router.get('/logistic', order.logistic); // 个人中心 - 订单物流详情页面 |
52 | +router.get('/get-order-logistic-date', order.getOrderLogisticdate); // 个人中心 - 订单物流详情数据 | ||
52 | 53 | ||
53 | module.exports = router; | 54 | module.exports = router; |
@@ -2,40 +2,39 @@ | @@ -2,40 +2,39 @@ | ||
2 | <div class="logistic-page yoho-page"> | 2 | <div class="logistic-page yoho-page"> |
3 | <div class="overview"> | 3 | <div class="overview"> |
4 | <div class="left" > | 4 | <div class="left" > |
5 | - <a href="{{logisticUrl}}"><img class="icon" src="{{logisticImg}}" /></a> | 5 | + <a href="{{logisticDate.url}}"><img class="icon" src="{{logisticDate.logo}}" /></a> |
6 | </div> | 6 | </div> |
7 | <div class="right"> | 7 | <div class="right"> |
8 | <div> | 8 | <div> |
9 | <span class='info'>物流公司:</span> | 9 | <span class='info'>物流公司:</span> |
10 | - <span >{{logisticCompany}}</span> | 10 | + <span >{{logisticDate.caption}}</span> |
11 | </div> | 11 | </div> |
12 | <div> | 12 | <div> |
13 | <span class='info'>快递单号:</span> | 13 | <span class='info'>快递单号:</span> |
14 | - <span>{{logisticNumber}}</span> | 14 | + <span>{{logisticDate.express_number}}</span> |
15 | </div> | 15 | </div> |
16 | </div> | 16 | </div> |
17 | - </div> | 17 | + </div><!--end overview--> |
18 | 18 | ||
19 | <div class="title"> | 19 | <div class="title"> |
20 | <span>物流详情</span> | 20 | <span>物流详情</span> |
21 | </div> | 21 | </div> |
22 | 22 | ||
23 | <div class="detail"> | 23 | <div class="detail"> |
24 | - {{# logisticDetail}} | ||
25 | - <div class="timeline-box "> | 24 | + <div class="timeline-box" v-for="(index, detail) in logisticDate.express_detail"> |
26 | <span class="timeline-node"></span> | 25 | <span class="timeline-node"></span> |
27 | <div class="timeline-info"> | 26 | <div class="timeline-info"> |
28 | <div class="timeline-info-row"> | 27 | <div class="timeline-info-row"> |
29 | - {{status}} | 28 | + {{detail.accept_address}} |
30 | </div> | 29 | </div> |
31 | <div class="timeline-info-row"> | 30 | <div class="timeline-info-row"> |
32 | - {{date}} | 31 | + {{detail.acceptTime}} |
33 | </div> | 32 | </div> |
34 | </div> | 33 | </div> |
35 | </div> | 34 | </div> |
36 | - {{/ logisticDetail}} | ||
37 | - </div> | ||
38 | -</div> | 35 | + </div><!--end detail--> |
36 | + | ||
37 | +</div><!--end logistic-page--> | ||
39 | </template> | 38 | </template> |
40 | 39 | ||
41 | <style> | 40 | <style> |
@@ -156,7 +155,36 @@ $border_color_light: #eee; | @@ -156,7 +155,36 @@ $border_color_light: #eee; | ||
156 | 155 | ||
157 | 156 | ||
158 | <script> | 157 | <script> |
159 | - | 158 | + const $ = require('yoho-jquery'); |
159 | + const tip = require('common/tip'); | ||
160 | + | ||
161 | + module.exports = { | ||
162 | + props: [], | ||
163 | + data() { | ||
164 | + return { | ||
165 | + logisticDate: [] | ||
166 | + }; | ||
167 | + }, | ||
168 | + methods: { | ||
169 | + getLogisticDate() { | ||
170 | + let data = { | ||
171 | + orderCode: '1609827614' | ||
172 | + }; | ||
173 | + | ||
174 | + $.ajax({ | ||
175 | + url: '/home/get-order-logistic-date', | ||
176 | + data: data | ||
177 | + }).then(result => { | ||
178 | + this.logisticDate = result; | ||
179 | + }).fail(() => { | ||
180 | + tip('网络错误'); | ||
181 | + }); | ||
182 | + } | ||
183 | + }, | ||
184 | + created() { | ||
185 | + this.getLogisticDate(); | ||
186 | + } | ||
187 | + }; | ||
160 | </script> | 188 | </script> |
161 | 189 | ||
162 | 190 |
-
Please register or login to post a comment