Authored by xuqi

Merge remote-tracking branch 'origin/develop' into release/1.0

Conflicts:
	apps/me/router.js
@@ -58,7 +58,9 @@ const getOrderList = (req, res) => { @@ -58,7 +58,9 @@ const getOrderList = (req, res) => {
58 page: 'order', 58 page: 'order',
59 isMe: true, 59 isMe: true,
60 orderList: result.order.orderList, 60 orderList: result.order.orderList,
61 - paginationOpts: result.order.paginationOpts 61 + paginationOpts: result.order.paginationOpts,
  62 + emptyMsg: result.order.emptyMsg,
  63 + showEmptyEn: result.order.showEmptyEn
62 }); 64 });
63 }); 65 });
64 }; 66 };
@@ -79,9 +81,9 @@ const getOrderTotal = (req, res) => { @@ -79,9 +81,9 @@ const getOrderTotal = (req, res) => {
79 81
80 const cancelOrder = (req, res) => { 82 const cancelOrder = (req, res) => {
81 const uid = req.user.uid || '10931021'; 83 const uid = req.user.uid || '10931021';
82 - const code = req.query.orderCode; 84 + const data = req.query;
83 85
84 - orderModel.cancelOrder(uid, code).then(result => { 86 + orderModel.cancelOrder(uid, data).then(result => {
85 res.json(result); 87 res.json(result);
86 }); 88 });
87 }; 89 };
@@ -121,14 +123,24 @@ const editOrder = (req, res) => { @@ -121,14 +123,24 @@ const editOrder = (req, res) => {
121 }); 123 });
122 }; 124 };
123 125
  126 +const reAdd = (req, res) => {
  127 + const uid = req.user.uid || '10931021';
  128 + const code = req.query.orderCode;
  129 +
  130 + orderModel.reAddCart(uid, code).then(result => {
  131 + res.json(result);
  132 + });
  133 +};
  134 +
124 module.exports = { 135 module.exports = {
125 - index: index,  
126 - detail: detail,  
127 - getOrderList: getOrderList,  
128 - getOrderTotal: getOrderTotal,  
129 - cancelOrder: cancelOrder,  
130 - deleteOrder: deleteOrder,  
131 - editOrder: editOrder,  
132 - getExpressInfo: getExpressInfo,  
133 - getCancelOrderReason: getCancelOrderReason 136 + index,
  137 + detail,
  138 + getOrderList,
  139 + getOrderTotal,
  140 + cancelOrder,
  141 + deleteOrder,
  142 + editOrder,
  143 + getExpressInfo,
  144 + getCancelOrderReason,
  145 + reAdd
134 }; 146 };
@@ -11,7 +11,7 @@ const _ = require('lodash'); @@ -11,7 +11,7 @@ const _ = require('lodash');
11 11
12 12
13 const index = (req, res, next) => { 13 const index = (req, res, next) => {
14 - const uid = global.yoho.uid || '8050560'; 14 + const uid = global.yoho.uid || '8050882';
15 const page = req.query.page; 15 const page = req.query.page;
16 16
17 returns.getUserReturn(uid, page).then(result => { 17 returns.getUserReturn(uid, page).then(result => {
@@ -32,7 +32,7 @@ const detail = (req, res, next) => { @@ -32,7 +32,7 @@ const detail = (req, res, next) => {
32 }; 32 };
33 33
34 const refund = (req, res, next) => { 34 const refund = (req, res, next) => {
35 - let uid = req.user.uid || '8050560'; 35 + let uid = req.user.uid || '8050882';
36 let code = parseInt(req.params.orderCode, 10) || '160192757'; 36 let code = parseInt(req.params.orderCode, 10) || '160192757';
37 37
38 if (!uid || !code) { 38 if (!uid || !code) {
@@ -41,7 +41,7 @@ const refund = (req, res, next) => { @@ -41,7 +41,7 @@ const refund = (req, res, next) => {
41 41
42 returns.getRefundGoodsData(code, uid).then(result => { 42 returns.getRefundGoodsData(code, uid).then(result => {
43 res.display('index', { 43 res.display('index', {
44 - page: 'returns-refund', 44 + page: 'refund',
45 content: result 45 content: result
46 }); 46 });
47 }).catch(next); 47 }).catch(next);
@@ -68,7 +68,7 @@ const refundApply = (req, res, next) => { @@ -68,7 +68,7 @@ const refundApply = (req, res, next) => {
68 68
69 const refundDetail = (req, res, next) => { 69 const refundDetail = (req, res, next) => {
70 let applyId = parseInt(req.params.applyId, 10) || '429528', 70 let applyId = parseInt(req.params.applyId, 10) || '429528',
71 - uid = req.user.uid || '8050560'; 71 + uid = req.user.uid || '8050882';
72 72
73 if (!uid || !applyId) { 73 if (!uid || !applyId) {
74 return next(); 74 return next();
@@ -76,7 +76,7 @@ const refundDetail = (req, res, next) => { @@ -76,7 +76,7 @@ const refundDetail = (req, res, next) => {
76 76
77 returns.getRefundDetailData(applyId, uid).then(result => { 77 returns.getRefundDetailData(applyId, uid).then(result => {
78 res.display('index', { 78 res.display('index', {
79 - page: 'returns-refund', 79 + page: 'refund-detail',
80 content: result 80 content: result
81 }); 81 });
82 }).catch(next); 82 }).catch(next);
@@ -84,11 +84,11 @@ const refundDetail = (req, res, next) => { @@ -84,11 +84,11 @@ const refundDetail = (req, res, next) => {
84 84
85 const exchange = (req, res, next) => { 85 const exchange = (req, res, next) => {
86 const code = req.params.orderCode; 86 const code = req.params.orderCode;
87 - const uid = req.user.uid || '8050560'; 87 + const uid = req.user.uid || '8050882';
88 88
89 returns.getChangeGoodsList(code, uid).then(result => { 89 returns.getChangeGoodsList(code, uid).then(result => {
90 res.display('index', { 90 res.display('index', {
91 - page: 'returns-change', 91 + page: 'exchange',
92 isMe: true, 92 isMe: true,
93 content: Object.assign({ 93 content: Object.assign({
94 nav: mcHandler.getMeCrumb('我的退/换货'), 94 nav: mcHandler.getMeCrumb('我的退/换货'),
@@ -109,7 +109,7 @@ const getProductInfo = (req, res, next) => { @@ -109,7 +109,7 @@ const getProductInfo = (req, res, next) => {
109 }; 109 };
110 110
111 const detailExchange = (req, res) => { 111 const detailExchange = (req, res) => {
112 - // const uid = global.yoho.uid || '8050560'; 112 + // const uid = global.yoho.uid || '8050882';
113 // const page = req.query.page; 113 // const page = req.query.page;
114 114
115 res.display('index', { 115 res.display('index', {
@@ -134,7 +134,6 @@ const bindMobile = (req, res, next) => { @@ -134,7 +134,6 @@ const bindMobile = (req, res, next) => {
134 info.checkCode = settingModel.cipheriv(info.uid + '.completeverify'); 134 info.checkCode = settingModel.cipheriv(info.uid + '.completeverify');
135 135
136 // info.checkCode = settingModel.cipheriv("20000190" + ".completeverify"); 136 // info.checkCode = settingModel.cipheriv("20000190" + ".completeverify");
137 - console.log('info.checkCode:', info.checkCode);  
138 res.display('index', { 137 res.display('index', {
139 module: 'me', 138 module: 'me',
140 page: 'setting', 139 page: 'setting',
@@ -225,7 +224,7 @@ const edit = (req, res)=> { @@ -225,7 +224,7 @@ const edit = (req, res)=> {
225 let code = settingModel.decipheriv(req.query.checkCode.split(' ').join('+')); 224 let code = settingModel.decipheriv(req.query.checkCode.split(' ').join('+'));
226 let codes = code.split('.'); 225 let codes = code.split('.');
227 226
228 - if (codes[0] === req.user.uid && codes[1] === 'completeverify') { 227 + if (parseInt(codes[0], 10) === req.user.uid && codes[1] === 'completeverify') {
229 // if (codes[0] === "20000190" && codes[1] === "completeverify") { 228 // if (codes[0] === "20000190" && codes[1] === "completeverify") {
230 let result = { 229 let result = {
231 title: _getTitle(type).typeName, 230 title: _getTitle(type).typeName,
@@ -267,7 +266,7 @@ const success = (req, res)=> { @@ -267,7 +266,7 @@ const success = (req, res)=> {
267 let code = settingModel.decipheriv(req.query.checkCode.split(' ').join('+')); 266 let code = settingModel.decipheriv(req.query.checkCode.split(' ').join('+'));
268 let codes = code.split('.'); 267 let codes = code.split('.');
269 268
270 - if (codes[0] === req.user.uid && codes[1] === 'completeoperate') { 269 + if (parseInt(codes[0], 10) === req.user.uid && codes[1] === 'completeoperate') {
271 // if (codes[0] === "20000190" && codes[1] === "completeoperate") { 270 // if (codes[0] === "20000190" && codes[1] === "completeoperate") {
272 let result = { 271 let result = {
273 title: _getTitle(type).typeName, 272 title: _getTitle(type).typeName,
@@ -4,6 +4,8 @@ const api = global.yoho.API; @@ -4,6 +4,8 @@ const api = global.yoho.API;
4 const camelCase = global.yoho.camelCase; 4 const camelCase = global.yoho.camelCase;
5 const moment = require('moment'); 5 const moment = require('moment');
6 6
  7 +const helpers = global.yoho.helpers;
  8 +
7 const _ = require('lodash'); 9 const _ = require('lodash');
8 10
9 const pageSize = 10; 11 const pageSize = 10;
@@ -262,6 +264,12 @@ const _getUserOrder = (uid, type, page) => { @@ -262,6 +264,12 @@ const _getUserOrder = (uid, type, page) => {
262 item.statusStr = statusMap[st].valueStr; 264 item.statusStr = statusMap[st].valueStr;
263 } 265 }
264 266
  267 + item.payUrl = helpers.urlFormat('/shopping/pay/online', {
  268 + code: item.orderCode
  269 + });
  270 +
  271 + item.refundUrl = helpers.urlFormat('/me/return/refund/' + item.orderCode);
  272 + item.exchangeUrl = helpers.urlFormat('/me/return/exchange/' + item.orderCode);
265 }); 273 });
266 274
267 return { 275 return {
@@ -470,12 +478,12 @@ const reAddCart = (uid, code) => { @@ -470,12 +478,12 @@ const reAddCart = (uid, code) => {
470 }; 478 };
471 479
472 module.exports = { 480 module.exports = {
473 - getOrderData: getOrderData,  
474 - getOrderDetail: getOrderDetail,  
475 - cancelOrder: cancelOrder,  
476 - getCancelOrderReason: getCancelOrderReason,  
477 - deleteOrder: deleteOrder,  
478 - editOrder: editOrder,  
479 - getExpressInfo: getExpressInfo, 481 + getOrderData,
  482 + getOrderDetail,
  483 + cancelOrder,
  484 + getCancelOrderReason,
  485 + deleteOrder,
  486 + editOrder,
  487 + getExpressInfo,
480 reAddCart: reAddCart 488 reAddCart: reAddCart
481 }; 489 };
@@ -111,7 +111,7 @@ const _setDefaultStatus = (type) => { @@ -111,7 +111,7 @@ const _setDefaultStatus = (type) => {
111 }; 111 };
112 112
113 return resData; 113 return resData;
114 -} 114 +};
115 115
116 const _setReturnStatus = (list, half) => { 116 const _setReturnStatus = (list, half) => {
117 let resData = {}; 117 let resData = {};
@@ -188,7 +188,9 @@ const _setRefundGoodList = (data) => { @@ -188,7 +188,9 @@ const _setRefundGoodList = (data) => {
188 }; 188 };
189 189
190 const _setRefundDetailData = (data) => { 190 const _setRefundDetailData = (data) => {
191 - let resData = {}; 191 + let resData = {
  192 + id: data.id || 0
  193 + };
192 194
193 switch (data.status) { 195 switch (data.status) {
194 case 10: 196 case 10:
@@ -210,6 +212,27 @@ const _setRefundDetailData = (data) => { @@ -210,6 +212,27 @@ const _setRefundDetailData = (data) => {
210 break; 212 break;
211 } 213 }
212 214
  215 + let goods = [];
  216 +
  217 + _.forEach(data.goods_list, value => {
  218 + let cnAlphabet = value.cn_alphabet ? value.cn_alphabet : '';
  219 +
  220 + goods.push({
  221 + href: helpers.urlFormat(`/product/pro_${value.product_id}_${value.goods_id}/${cnAlphabet}.html`),
  222 + img: value.goods_image,
  223 + name: value.product_name,
  224 + size: value.size_name,
  225 + color: value.color_name,
  226 + num: 1, // 接口目前不支持
  227 + reason: value.reason_name || '--',
  228 + price: value.sales_price,
  229 + remark: value.remark,
  230 + evidence: value.evidence_images
  231 + });
  232 + });
  233 +
  234 + resData.goods = goods;
  235 +
213 return resData; 236 return resData;
214 }; 237 };
215 238
@@ -239,18 +262,19 @@ const getRefundDetailData = (applyId, uid) => { @@ -239,18 +262,19 @@ const getRefundDetailData = (applyId, uid) => {
239 return returnsAPI.getRefundDetailAsync(applyId, uid).then(result => { 262 return returnsAPI.getRefundDetailAsync(applyId, uid).then(result => {
240 let resData = {}; 263 let resData = {};
241 264
242 - Object.assign(resData, _setSideMenu('我的退/换货'));  
243 resData = { 265 resData = {
244 title: '退货申请', 266 title: '退货申请',
245 refundDetail: {} 267 refundDetail: {}
246 }; 268 };
  269 + Object.assign(resData, _setSideMenu('我的退/换货'));
247 270
248 if (result.data) { 271 if (result.data) {
249 - // console.log(_setRefundDetailData(result.data)); 272 + let data = result.data;
250 273
251 - Object.assign(resData.refundDetail, _setReturnStatus(result.data.statusList)); 274 + // console.log(_setRefundDetailData(result.data));
  275 + Object.assign(resData.refundDetail, _setReturnStatus(data.statusList, !data.status));
252 276
253 - Object.assign(resData.refundDetail, _setRefundDetailData(result.data)); 277 + Object.assign(resData.refundDetail, _setRefundDetailData(data));
254 } 278 }
255 279
256 return {returns: resData}; 280 return {returns: resData};
@@ -310,7 +334,6 @@ const getChangeGoodsList = (orderCode, uid) => { @@ -310,7 +334,6 @@ const getChangeGoodsList = (orderCode, uid) => {
310 334
311 // good.buyNumber = good.num; 335 // good.buyNumber = good.num;
312 good.buyNumber = 1; 336 good.buyNumber = 1;
313 - data.goodsList[2].colorId = 1;  
314 }); 337 });
315 } 338 }
316 339
@@ -31,7 +31,7 @@ router.get('/cancelOrder', order.cancelOrder); @@ -31,7 +31,7 @@ router.get('/cancelOrder', order.cancelOrder);
31 router.get('/getCancelOrderReason', order.getCancelOrderReason); 31 router.get('/getCancelOrderReason', order.getCancelOrderReason);
32 router.get('/getExpressInfo', order.getExpressInfo); 32 router.get('/getExpressInfo', order.getExpressInfo);
33 router.get('/editOrder', order.editOrder); 33 router.get('/editOrder', order.editOrder);
34 -//router.get('/reAdd', order.reAddCart); 34 +router.get('/reAdd', order.reAdd);
35 35
36 // 退换货 36 // 退换货
37 router.get('/return', returns.index); 37 router.get('/return', returns.index);
@@ -3,7 +3,6 @@ @@ -3,7 +3,6 @@
3 {{#orderList}} 3 {{#orderList}}
4 <div class="order" data-code="{{orderCode}}"> 4 <div class="order" data-code="{{orderCode}}">
5 {{> order/order-header}} 5 {{> order/order-header}}
6 -  
7 <div class="table-body"> 6 <div class="table-body">
8 {{> order/goods-box}} 7 {{> order/goods-box}}
9 <div class="common-column special-border"> 8 <div class="common-column special-border">
@@ -21,15 +20,19 @@ @@ -21,15 +20,19 @@
21 <div class="pay-operation"> 20 <div class="pay-operation">
22 {{#if isOnlinePaid}} 21 {{#if isOnlinePaid}}
23 <span class="iconfont">&#xe606;</span><p class="left-time" data-left="{{payLefttime}}"></p> 22 <span class="iconfont">&#xe606;</span><p class="left-time" data-left="{{payLefttime}}"></p>
  23 + <a href="{{payUrl}}">
24 <span class="btn red">立即付款</span> 24 <span class="btn red">立即付款</span>
  25 + </a>
25 {{/if}} 26 {{/if}}
26 <p class="subtext cancel">取消订单</p> 27 <p class="subtext cancel">取消订单</p>
27 </div> 28 </div>
28 {{/if}} 29 {{/if}}
29 {{#if showEditOption}} 30 {{#if showEditOption}}
30 <p class="subtext">评价晒单</p> 31 <p class="subtext">评价晒单</p>
31 - <p class="subtext">申请退货</p>  
32 - <a href="/me/return/exchange/{{orderCode}}"> 32 + <a href="{{refundUrl}}">
  33 + <p class="subtext">申请退货</p>
  34 + </a>
  35 + <a href="{{exchangeUrl}}">
33 <p class="subtext">申请换货</p> 36 <p class="subtext">申请换货</p>
34 </a> 37 </a>
35 <p class="subtext delete">删除订单</p> 38 <p class="subtext delete">删除订单</p>
1 {{# refundDetail}} 1 {{# refundDetail}}
2 - <div class="refund-datail-wrap"> 2 + <div class="refund-datail-wrap" data-id="{{id}}">
3 {{> returns/returns-status}} 3 {{> returns/returns-status}}
4 4
5 {{# orderReview}} 5 {{# orderReview}}
6 <div class="top-tip"> 6 <div class="top-tip">
7 - {{#if pass}}  
8 - <p class="tip-status">  
9 - <span class="iconfont blue">&#xe618;</span>  
10 - <span class="blue">退货申请已通过</span>  
11 - </p>  
12 - {{^}}  
13 - <p class="tip-status">  
14 - <span class="iconfont blue">&#xe618;</span>  
15 - <span class="blue">退货申请审核中</span>  
16 - </p>  
17 - {{/if}} 7 + {{#if pass}}
  8 + <p class="tip-status">
  9 + <span class="iconfont blue">&#xe60f;</span>
  10 + <span class="blue">退货申请已通过</span>
  11 + </p>
  12 + {{^}}
  13 + <p class="tip-status">
  14 + <span class="iconfont blue">&#xe618;</span>
  15 + <span class="blue">退货申请审核中</span>
  16 + </p>
  17 + {{/if}}
18 <p class="tip-text"> 18 <p class="tip-text">
19 请将商品连同吊牌、包装、发货单(如无发货单,您可找张白纸上注明订单编号,收货人姓名及手机号码)、发票(如有)、 赠品(如有)一并寄回,如有 遗漏将影响您的退换货进度,敬请谅解<br> 19 请将商品连同吊牌、包装、发货单(如无发货单,您可找张白纸上注明订单编号,收货人姓名及手机号码)、发票(如有)、 赠品(如有)一并寄回,如有 遗漏将影响您的退换货进度,敬请谅解<br>
20 非我司原因的退换货,寄回运费由您承担。商品客观问题的退换货,请您先行垫付运费,邮费会在退款中补贴给您, 20 非我司原因的退换货,寄回运费由您承担。商品客观问题的退换货,请您先行垫付运费,邮费会在退款中补贴给您,
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 {{# backStorage}} 31 {{# backStorage}}
32 <div class="storage-tip top-tip"> 32 <div class="storage-tip top-tip">
33 <p class="tip-status"> 33 <p class="tip-status">
34 - <span class="iconfont blue">&#xe618;</span> 34 + <span class="iconfont blue">&#xe60f;</span>
35 <span class="blue">您寄回的商品已收到</span> 35 <span class="blue">您寄回的商品已收到</span>
36 </p> 36 </p>
37 <p> 37 <p>
@@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
44 {{# refundSure}} 44 {{# refundSure}}
45 <div class="success-tip top-tip"> 45 <div class="success-tip top-tip">
46 <p class="tip-status"> 46 <p class="tip-status">
47 - <span class="iconfont blue">&#xe618;</span> 47 + <span class="iconfont blue">&#xe60f;</span>
48 <span class="blue">退款完成</span> 48 <span class="blue">退款完成</span>
49 </p> 49 </p>
50 <p>退款方式:<em>由于银行内部处理流程的差异,储蓄卡需要3-7个工作日到账,信用卡需要7-15个工作日到账</em></p> 50 <p>退款方式:<em>由于银行内部处理流程的差异,储蓄卡需要3-7个工作日到账,信用卡需要7-15个工作日到账</em></p>
@@ -103,12 +103,27 @@ @@ -103,12 +103,27 @@
103 <p>颜色:{{color}}&nbsp;尺码:{{size}}</p> 103 <p>颜色:{{color}}&nbsp;尺码:{{size}}</p>
104 <p>×{{num}}</p> 104 <p>×{{num}}</p>
105 </div> 105 </div>
106 - <div class="reason">dsa{{reason}}</div>  
107 - <div class="num">dasd{{num}}</div>  
108 - <dl class="special-info hide">  
109 - <dd>问题描述:</dd>  
110 - <dd>照片凭证:</dd>  
111 - </dl> 106 + <div class="reason">{{reason}}</div>
  107 + <div class="num">{{num}}</div>
  108 + {{#if remark}}
  109 + <dl class="special-info">
  110 + <dd class="remark">
  111 + <label>问题描述:</label>
  112 + {{remark}}
  113 + </dd>
  114 +
  115 + {{#if evidence}}
  116 + <dd>
  117 + <label>照片凭证:</label>
  118 + {{# evidence}}
  119 + <div class="evidence-img">
  120 + <img class="lazy" data-original="{{image . 70 90}}">
  121 + </div>
  122 + {{/ evidence}}
  123 + </dd>
  124 + {{/if}}
  125 + </dl>
  126 + {{/if}}
112 </div> 127 </div>
113 {{/ goods}} 128 {{/ goods}}
114 </div> 129 </div>
1 {{# refund}} 1 {{# refund}}
2 - {{> returns/returns-status}} 2 + <div class="refund-wrap">
  3 + {{> returns/returns-status}}
3 4
4 - <h4 class="third-title">选择退货商品</h4>  
5 - <div class="refund-goods clearfix" {{# speclialReason}} data-{{id}}="{{@index}}"{{/ speclialReason}}>  
6 - <input id="order-code" type="hidden" value="{{orderCode}}">  
7 - <ul class="goods-header">  
8 - <li class="info">商品信息</li>  
9 - <li class="reason">退货原因</li>  
10 - <li class="num">退货数量</li>  
11 - <li class="price">单价</li>  
12 - </ul> 5 + <h4 class="third-title">选择退货商品</h4>
  6 + <div class="refund-goods clearfix" {{# speclialReason}} data-{{id}}="{{@index}}"{{/ speclialReason}}>
  7 + <input id="order-code" type="hidden" value="{{orderCode}}">
  8 + <ul class="goods-header">
  9 + <li class="info">商品信息</li>
  10 + <li class="reason">退货原因</li>
  11 + <li class="num">退货数量</li>
  12 + <li class="price">单价</li>
  13 + </ul>
13 14
14 - {{# goods}}  
15 - <div class="goods-item clearfix">  
16 - <div class="check" data-skn="{{skn}}" data-skc="{{skc}}" data-sku="{{sku}}" data-price="{{price}}" data-type="{{typeId}}">{{> icon/checkbox}}</div>  
17 - <div class="img">  
18 - <img class="lazy" data-original="{{image img 70 90}}"> 15 + {{# goods}}
  16 + <div class="goods-item clearfix">
  17 + <div class="check" data-skn="{{skn}}" data-skc="{{skc}}" data-sku="{{sku}}" data-price="{{price}}" data-type="{{typeId}}">{{> icon/checkbox}}</div>
  18 + <div class="img">
  19 + <img class="lazy" data-original="{{image img 70 90}}">
  20 + </div>
  21 + <div class="info">
  22 + <p>{{name}}</p>
  23 + <p>颜色:{{color}}&nbsp;尺码:{{size}}</p>
  24 + <p>×{{num}}</p>
  25 + </div>
  26 + <div class="reason">
  27 + <select class="refund-reason">
  28 + <option>选择退款原因</option>
  29 + {{# reasonList}}
  30 + <option value="{{id}}">{{name}}</option>
  31 + {{/ reasonList}}
  32 + </select>
  33 + </div>
  34 + <div class="num">
  35 + <span class="iconfont">&#xe621;</span>
  36 + <input type="text" value="{{num}}" readonly="readonly">
  37 + <span class="iconfont">&#xe61f;</span>
  38 + </div>
  39 + <div class="price">¥{{round price 2}}</div>
  40 + {{> returns/special-reason}}
19 </div> 41 </div>
20 - <div class="info">  
21 - <p>{{name}}</p>  
22 - <p>颜色:{{color}}&nbsp;尺码:{{size}}</p>  
23 - <p>×{{num}}</p>  
24 - </div>  
25 - <div class="reason">  
26 - <select class="refund-reason">  
27 - <option>选择退款原因</option>  
28 - {{# reasonList}}  
29 - <option value="{{id}}">{{name}}</option>  
30 - {{/ reasonList}}  
31 - </select>  
32 - </div>  
33 - <div class="num">  
34 - <span class="iconfont">&#xe621;</span>  
35 - <input type="text" value="{{num}}" readonly="readonly">  
36 - <span class="iconfont">&#xe61f;</span>  
37 - </div>  
38 - <div class="price">¥{{round price 2}}</div>  
39 - {{> returns/special-reason}}  
40 - </div>  
41 - {{/ goods}}  
42 - </div> 42 + {{/ goods}}
  43 + </div>
43 44
44 - <h4 class="third-title">退款方式</h4> 45 + <h4 class="third-title">退款方式</h4>
45 46
46 - <div class="refund-type">  
47 - <div>  
48 - <label class="type-item ali-item cur" title="支付宝"></label>  
49 - <label class="type-item union-item" title="银行卡"></label> 47 + <div class="refund-type">
  48 + <div>
  49 + <label class="type-item ali-item cur" title="支付宝"></label>
  50 + <label class="type-item union-item" title="银行卡"></label>
  51 + </div>
  52 + <dl class="alipay">
  53 + <dd>账号:<input type="text" class="name" placeholder="收款人支付宝账号"></dd>
  54 + <dd>姓名:<input type="text" class="account" placeholder="姓名"></dd>
  55 + </dl>
  56 + <dl class="unionpay hide">
  57 + <dd>
  58 + 银行:
  59 + <select class="bank">
  60 + <option>中国银行</option>
  61 + <option>中国农业银行</option>
  62 + <option>中国工商银行</option>
  63 + <option>中国建设银行</option>
  64 + </select>
  65 + <input type="text" placeholder="开户支行">
  66 + <span class="blue" class="area">例:江苏省南京市奥体支行</span>
  67 + </dd>
  68 + <dd>账号:<input type="text" class="account" placeholder="收款人银行卡号"></dd>
  69 + <dd>姓名:<input type="text" class="name" placeholder="姓名"></dd>
  70 + </dl>
  71 + </div>
  72 + <div class="opt-btn">
  73 + <span class="apply-tip blue hide">请填写完整</span>
  74 + <div id="apply-btn" class="btn disable">提交申请</div>
50 </div> 75 </div>
51 - <dl class="alipay">  
52 - <dd>账号:<input type="text" class="name" placeholder="收款人支付宝账号"></dd>  
53 - <dd>姓名:<input type="text" class="account" placeholder="姓名"></dd>  
54 - </dl>  
55 - <dl class="unionpay hide">  
56 - <dd>  
57 - 银行:  
58 - <select class="bank">  
59 - <option>中国银行</option>  
60 - <option>中国农业银行</option>  
61 - <option>中国工商银行</option>  
62 - <option>中国建设银行</option>  
63 - </select>  
64 - <input type="text" placeholder="开户支行">  
65 - <span class="blue" class="area">例:江苏省南京市奥体支行</span>  
66 - </dd>  
67 - <dd>账号:<input type="text" class="account" placeholder="收款人银行卡号"></dd>  
68 - <dd>姓名:<input type="text" class="name" placeholder="姓名"></dd>  
69 - </dl>  
70 - </div>  
71 - <div class="opt-btn">  
72 - <span class="apply-tip blue hide">请填写完整</span>  
73 - <div id="apply-btn" class="btn disable">提交申请</div>  
74 </div> 76 </div>
75 {{/ refund}} 77 {{/ refund}}
@@ -76,16 +76,26 @@ var sizeTpl = require('../../tpl/me/size-list.hbs'); @@ -76,16 +76,26 @@ var sizeTpl = require('../../tpl/me/size-list.hbs');
76 76
77 function setActive($item) { 77 function setActive($item) {
78 var color = $item.find('.color-text').data('color'); 78 var color = $item.find('.color-text').data('color');
  79 + var size = $item.find('.size-text').data('size');
79 80
80 - // var size = $item.find('.size-text').data('size');  
81 var $colorList = $item.find('.color-list'); 81 var $colorList = $item.find('.color-list');
  82 + var $sizeList = $item.find('.size-list');
82 83
83 - console.log(color);  
84 $colorList.find('.img-box').each(function(i, box) { 84 $colorList.find('.img-box').each(function(i, box) {
85 var $box = $(box); 85 var $box = $(box);
86 86
87 if ($box.find('img').data('color') === color) { 87 if ($box.find('img').data('color') === color) {
88 - $box.find('.img-box').eq(i).addClass('active'); 88 + $colorList.find('.img-box').eq(i).addClass('active');
  89 +
  90 + return false;
  91 + }
  92 + });
  93 +
  94 + $sizeList.find('span').each(function(i, s) {
  95 + var $size = $(s);
  96 +
  97 + if ($size.data('size') === size) {
  98 + $sizeList.find('span').eq(i).addClass('active');
89 } 99 }
90 }); 100 });
91 } 101 }
@@ -180,7 +190,6 @@ function getProductInfo() { @@ -180,7 +190,6 @@ function getProductInfo() {
180 productSkn: skn 190 productSkn: skn
181 } 191 }
182 }).done(function(result) { 192 }).done(function(result) {
183 - console.log(result);  
184 if (result.code === 200) { 193 if (result.code === 200) {
185 renderList(result.data); 194 renderList(result.data);
186 initSizeId(); 195 initSizeId();
@@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
6 6
7 var dialog = require('../plugins/dialog'); 7 var dialog = require('../plugins/dialog');
8 var _dialog = dialog.Dialog; 8 var _dialog = dialog.Dialog;
  9 +var _alert = dialog.Alert;
9 10
10 var expressTpl = require('../../tpl/me/express.hbs'); 11 var expressTpl = require('../../tpl/me/express.hbs');
11 12
@@ -170,14 +171,19 @@ function deleteOrder(code) { @@ -170,14 +171,19 @@ function deleteOrder(code) {
170 data: { 171 data: {
171 orderCode: code 172 orderCode: code
172 } 173 }
173 - }).done(function() { 174 + }).done(function(result) {
174 var type = getCurrentTabType(); 175 var type = getCurrentTabType();
175 var page = getCurrentPage(); 176 var page = getCurrentPage();
176 177
177 - type = typeMap[type];  
178 - getOrderList(type, page); 178 + if (result && result.code === 200) {
  179 + type = typeMap[type];
  180 + getOrderList(type, page);
  181 + } else {
  182 + new _alert('<h1>出错了!请重试!</h1>').show();
  183 + }
179 }).fail(function(err) { 184 }).fail(function(err) {
180 console.log(err); 185 console.log(err);
  186 + new _alert('<h1>网络异常!</h1>').show();
181 }); 187 });
182 } 188 }
183 189
1 var dialog = require('../../plugins/dialog'); 1 var dialog = require('../../plugins/dialog');
2 var _dialog = dialog.Dialog; 2 var _dialog = dialog.Dialog;
  3 +var _alert = dialog.Alert;
3 4
4 // 添加.check方法 5 // 添加.check方法
5 require('../../plugins/check'); 6 require('../../plugins/check');
@@ -37,26 +38,33 @@ function cancelOrder(code, onCancel) { @@ -37,26 +38,33 @@ function cancelOrder(code, onCancel) {
37 reasonId: reasonId, 38 reasonId: reasonId,
38 reason: reason 39 reason: reason
39 } 40 }
40 - }).done(function() {  
41 - var tip = new _dialog({  
42 - className: 'order-dialog alert',  
43 - content: '<h1>订单修改</h1>' +  
44 - '<span>您已成功取消了该订单</span>',  
45 - closeCb: onCancel,  
46 - btns: [  
47 - {  
48 - id: 'cancel-complete',  
49 - btnClass: ['confirm'],  
50 - name: '确定',  
51 - cb: function() {  
52 - tip.close(onCancel); 41 + }).done(function(result) {
  42 + var tip;
  43 +
  44 + if (result && result.code === 200) {
  45 + tip = new _dialog({
  46 + className: 'order-dialog alert',
  47 + content: '<h1>订单修改</h1>' +
  48 + '<span>您已成功取消了该订单</span>',
  49 + closeCb: onCancel,
  50 + btns: [
  51 + {
  52 + id: 'cancel-complete',
  53 + btnClass: ['confirm'],
  54 + name: '确定',
  55 + cb: function() {
  56 + tip.close(onCancel);
  57 + }
53 } 58 }
54 - }  
55 - ]  
56 - }).show(); 59 + ]
  60 + }).show();
  61 + } else {
  62 + new _alert('<h1>出错了!修改失败!</h1>').show();
  63 + }
57 64
58 }).fail(function(err) { 65 }).fail(function(err) {
59 console.log(err); 66 console.log(err);
  67 + new _alert('<h1>出错了!修改失败!</h1>').show();
60 }); 68 });
61 } 69 }
62 70
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 top: 36px; 37 top: 36px;
38 z-index: 1; 38 z-index: 1;
39 display: none; 39 display: none;
40 - width: 310px; 40 + width: 410px;
41 41
42 li { 42 li {
43 float: left; 43 float: left;
@@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
63 .dist-name { 63 .dist-name {
64 font-size: 12px; 64 font-size: 12px;
65 display: inline-block; 65 display: inline-block;
66 - width: 50px; 66 + width: 75px;
67 padding: 3px; 67 padding: 3px;
68 text-overflow: ellipsis; 68 text-overflow: ellipsis;
69 white-space: nowrap; 69 white-space: nowrap;
@@ -99,14 +99,14 @@ @@ -99,14 +99,14 @@
99 font-size: 12px; 99 font-size: 12px;
100 } 100 }
101 } 101 }
  102 +}
102 103
103 - /* 表单必填项提示符 */  
104 - .asterisk {  
105 - position: relative;  
106 - top: 2px;  
107 - margin-right: 5px;  
108 - color: #c71814 !important;  
109 - } 104 +/* 表单必填项提示符 */
  105 +.asterisk {
  106 + position: relative;
  107 + top: 2px;
  108 + margin-right: 5px;
  109 + color: #c71814 !important;
110 } 110 }
111 111
112 @import "address"; 112 @import "address";
@@ -115,5 +115,4 @@ @@ -115,5 +115,4 @@
115 @import "currency"; 115 @import "currency";
116 @import "setting/index"; 116 @import "setting/index";
117 @import "favorite/index"; 117 @import "favorite/index";
118 -@import "returns";  
119 @import "exchange"; 118 @import "exchange";
@@ -72,7 +72,7 @@ @@ -72,7 +72,7 @@
72 position: relative; 72 position: relative;
73 73
74 .time { 74 .time {
75 - width: 330px; 75 + width: 340px;
76 height: 42px; 76 height: 42px;
77 margin-top: -$space; 77 margin-top: -$space;
78 font-size: $smallSize; 78 font-size: $smallSize;
1 .returns-wrap { 1 .returns-wrap {
  2 + font-size: 14px;
  3 +
2 .returns-status { 4 .returns-status {
3 padding: 30px 0 80px; 5 padding: 30px 0 80px;
4 6
@@ -49,8 +51,106 @@ @@ -49,8 +51,106 @@
49 } 51 }
50 } 52 }
51 } 53 }
  54 +
  55 + .third-title {
  56 + font-size: 16px;
  57 + font-weight: bold;
  58 + padding-bottom: 20px;
  59 + }
  60 +
  61 + .special-reason {
  62 + padding-top: 20px;
  63 + display: none;
  64 +
  65 + .left-title {
  66 + width: 150px;
  67 + padding-left: 54px;
  68 +
  69 + .red {
  70 + color: #d93549;
  71 + margin-right: 3px;
  72 + }
  73 + }
  74 +
  75 + .right-content {
  76 + width: 570px;
  77 + }
  78 +
  79 + .mark-text {
  80 + width: 570px;
  81 + height: 120px;
  82 + resize: none;
  83 + border-color: #eee;
  84 + }
  85 +
  86 + .img-wrap,
  87 + .img-upload {
  88 + width: 60px;
  89 + height: 60px;
  90 + border: 1px dashed #eee;
  91 + float: left;
  92 + margin-right: 10px;
  93 + }
  94 +
  95 + .img-upload {
  96 + line-height: 60px;
  97 + text-align: center;
  98 + color: #dfdfdf;
  99 + cursor: pointer;
  100 +
  101 + .iconfont {
  102 + font-size: 34px;
  103 + }
  104 + }
  105 +
  106 + .img-wrap {
  107 + position: relative;
  108 + }
  109 +
  110 + .img-wrap:hover .img-opt {
  111 + display: block;
  112 + }
  113 +
  114 + .img-opt {
  115 + width: 100%;
  116 + height: 20px;
  117 + line-height: 20px;
  118 + background: #555;
  119 + font-size: 12px;
  120 + color: #fff;
  121 + opacity: 0.7;
  122 + position: absolute;
  123 + text-align: center;
  124 + display: none;
  125 +
  126 + > * {
  127 + display: inline-block;
  128 + cursor: pointer;
  129 + }
  130 + }
  131 + }
  132 +
  133 + .opt-btn {
  134 + padding-top: 40px;
  135 + line-height: 40px;
  136 + text-align: right;
  137 +
  138 + .blue {
  139 + margin-right: 10px;
  140 + font-size: 12px;
  141 + }
  142 +
  143 + .btn {
  144 + width: 130px;
  145 + height: 40px;
  146 + line-height: 40px;
  147 + font-size: 16px;
  148 + display: inline-block;
  149 + }
  150 + }
52 } 151 }
53 152
54 @import "list"; 153 @import "list";
55 @import "change"; 154 @import "change";
  155 +@import "refund";
56 @import "refund-detail"; 156 @import "refund-detail";
@@ -110,14 +110,32 @@ @@ -110,14 +110,32 @@
110 .info { 110 .info {
111 width: 284px; 111 width: 284px;
112 text-align: left; 112 text-align: left;
  113 + line-height: 2;
  114 + }
  115 +
  116 + .reason,
  117 + .num {
  118 + line-height: 90px;
113 } 119 }
114 120
115 .special-info { 121 .special-info {
116 width: 100%; 122 width: 100%;
117 height: auto; 123 height: auto;
  124 + padding-left: 15px;
118 padding-top: 30px; 125 padding-top: 30px;
119 text-align: left; 126 text-align: left;
120 } 127 }
  128 +
  129 + .remark {
  130 + padding-bottom: 15px;
  131 + }
  132 +
  133 + .evidence-img {
  134 + width: 70px;
  135 + height: 90px;
  136 + display: inline-block;
  137 + vertical-align: top;
  138 + }
121 } 139 }
122 } 140 }
123 } 141 }
1 -.returns-wrap {  
2 - font-size: 14px;  
3 -  
4 - .third-title {  
5 - font-size: 16px;  
6 - font-weight: bold;  
7 - padding-bottom: 20px;  
8 - }  
9 -  
10 - .special-reason {  
11 - padding-top: 20px;  
12 - display: none;  
13 -  
14 - .left-title {  
15 - width: 150px;  
16 - padding-left: 54px;  
17 -  
18 - .red {  
19 - color: #d93549;  
20 - margin-right: 3px;  
21 - }  
22 - }  
23 -  
24 - .right-content {  
25 - width: 570px;  
26 - }  
27 -  
28 - .mark-text {  
29 - width: 570px;  
30 - height: 120px;  
31 - resize: none;  
32 - border-color: #eee;  
33 - }  
34 -  
35 - .img-wrap,  
36 - .img-upload {  
37 - width: 60px;  
38 - height: 60px;  
39 - border: 1px dashed #eee;  
40 - float: left;  
41 - margin-right: 10px;  
42 - }  
43 -  
44 - .img-upload {  
45 - line-height: 60px;  
46 - text-align: center;  
47 - color: #dfdfdf;  
48 - cursor: pointer;  
49 -  
50 - .iconfont {  
51 - font-size: 34px;  
52 - }  
53 - }  
54 -  
55 - .img-wrap {  
56 - position: relative;  
57 - }  
58 -  
59 - .img-wrap:hover .img-opt {  
60 - display: block;  
61 - }  
62 -  
63 - .img-opt {  
64 - width: 100%;  
65 - height: 20px;  
66 - line-height: 20px;  
67 - background: #555;  
68 - font-size: 12px;  
69 - color: #fff;  
70 - opacity: 0.7;  
71 - position: absolute;  
72 - text-align: center;  
73 - display: none;  
74 -  
75 - > * {  
76 - display: inline-block;  
77 - cursor: pointer;  
78 - }  
79 - }  
80 - }  
81 -  
82 - .opt-btn {  
83 - padding-top: 40px;  
84 - line-height: 40px;  
85 - text-align: right;  
86 -  
87 - .blue {  
88 - margin-right: 10px;  
89 - font-size: 12px;  
90 - }  
91 -  
92 - .btn {  
93 - width: 130px;  
94 - height: 40px;  
95 - line-height: 40px;  
96 - font-size: 16px;  
97 - display: inline-block;  
98 - }  
99 - }  
100 - 1 +.refund-wrap {
101 .refund-goods { 2 .refund-goods {
102 margin-bottom: 40px; 3 margin-bottom: 40px;
103 4