Merge branch 'feature/brand' of git.yoho.cn:fe/yohoblk-wap into feature/brand
Showing
3 changed files
with
22 additions
and
9 deletions
@@ -128,19 +128,18 @@ const order = { | @@ -128,19 +128,18 @@ const order = { | ||
128 | 128 | ||
129 | // 订单-物流 | 129 | // 订单-物流 |
130 | logistic: (req, res) => { | 130 | logistic: (req, res) => { |
131 | - let orderCode = req.query.order_code || ''; | ||
132 | - | ||
133 | res.render('order-logistic', { | 131 | res.render('order-logistic', { |
134 | module: 'home', | 132 | module: 'home', |
135 | page: 'order-logistic', | 133 | page: 'order-logistic', |
136 | - orderCode: orderCode | 134 | + title: '物流详情' |
137 | }); | 135 | }); |
138 | }, | 136 | }, |
139 | 137 | ||
140 | // API- 订单-物流 | 138 | // API- 订单-物流 |
141 | getOrderLogisticdate: (req, res) => { | 139 | getOrderLogisticdate: (req, res) => { |
142 | orderModel.getOrderLogisticdate({ | 140 | orderModel.getOrderLogisticdate({ |
143 | - uid: req.user.uid, | 141 | + uid: req.user.uid || '', |
142 | + type: req.query.type || '', | ||
144 | order_code: req.query.orderCode | 143 | order_code: req.query.orderCode |
145 | }).then(result => { | 144 | }).then(result => { |
146 | res.json(result); | 145 | res.json(result); |
@@ -95,16 +95,22 @@ exports.deleteOrder = (orderCode, uid) => { | @@ -95,16 +95,22 @@ exports.deleteOrder = (orderCode, uid) => { | ||
95 | * 查看订单物流详情 | 95 | * 查看订单物流详情 |
96 | * @param {[int]} order_code 订单号 | 96 | * @param {[int]} order_code 订单号 |
97 | * @param {[int]} uid 用户uid | 97 | * @param {[int]} uid 用户uid |
98 | + * @param {[string]} type 退换货物流(退货:refund,换货:change) | ||
98 | * @return {[array]} | 99 | * @return {[array]} |
99 | */ | 100 | */ |
100 | exports.getOrderLogisticdate = (params) => { | 101 | exports.getOrderLogisticdate = (params) => { |
102 | + let method; | ||
101 | 103 | ||
102 | - if (_.isEmpty(params) || _.isEmpty(params.uid)) { | 104 | + if (_.isEmpty(params.order_code)) { |
103 | return []; | 105 | return []; |
104 | } | 106 | } |
105 | 107 | ||
108 | + // getNewExpress:退换货物流,li:订单物流 | ||
109 | + method = _.indexOf(['refund', 'change'], params.type) >= 0 ? | ||
110 | + 'app.express.getNewExpress' : 'app.express.li'; | ||
111 | + | ||
106 | return api.get('', Object.assign({ | 112 | return api.get('', Object.assign({ |
107 | - method: 'app.express.li' | 113 | + method: method |
108 | }, params)).then(result => { | 114 | }, params)).then(result => { |
109 | 115 | ||
110 | if (result.code === 200) { | 116 | if (result.code === 200) { |
@@ -2,7 +2,9 @@ | @@ -2,7 +2,9 @@ | ||
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="{{logisticDate.url}}"><img class="icon" src="{{logisticDate.logo}}" /></a> | 5 | + <a href="{{logisticDate.url}}"> |
6 | + <img class="icon" v-bind:src="logo" /> | ||
7 | + </a> | ||
6 | </div> | 8 | </div> |
7 | <div class="right"> | 9 | <div class="right"> |
8 | <div> | 10 | <div> |
@@ -156,19 +158,22 @@ $border_color_light: #eee; | @@ -156,19 +158,22 @@ $border_color_light: #eee; | ||
156 | 158 | ||
157 | <script> | 159 | <script> |
158 | const $ = require('yoho-jquery'); | 160 | const $ = require('yoho-jquery'); |
161 | + const qs = require('yoho-qs'); | ||
159 | const tip = require('common/tip'); | 162 | const tip = require('common/tip'); |
160 | 163 | ||
161 | module.exports = { | 164 | module.exports = { |
162 | props: [], | 165 | props: [], |
163 | data() { | 166 | data() { |
164 | return { | 167 | return { |
165 | - logisticDate: [] | 168 | + logisticDate: [], |
169 | + logo: '' | ||
166 | }; | 170 | }; |
167 | }, | 171 | }, |
168 | methods: { | 172 | methods: { |
169 | getLogisticDate() { | 173 | getLogisticDate() { |
170 | let data = { | 174 | let data = { |
171 | - orderCode: '1609827614' | 175 | + orderCode: qs.order_code || '', |
176 | + type: qs.type || '', | ||
172 | }; | 177 | }; |
173 | 178 | ||
174 | $.ajax({ | 179 | $.ajax({ |
@@ -176,6 +181,9 @@ $border_color_light: #eee; | @@ -176,6 +181,9 @@ $border_color_light: #eee; | ||
176 | data: data | 181 | data: data |
177 | }).then(result => { | 182 | }).then(result => { |
178 | this.logisticDate = result; | 183 | this.logisticDate = result; |
184 | + if (result && result.logo) { | ||
185 | + this.logo = result.logo; | ||
186 | + } | ||
179 | }).fail(() => { | 187 | }).fail(() => { |
180 | tip('网络错误'); | 188 | tip('网络错误'); |
181 | }); | 189 | }); |
-
Please register or login to post a comment