Authored by zhangxiaoru

me

1 - /**  
2 - * [个人中心]收货地址 1 +/**
3 * @author: jiangmin 2 * @author: jiangmin
4 * @date: 2016/07/05 3 * @date: 2016/07/05
5 */ 4 */
@@ -24,8 +23,8 @@ const index = (req, res, next) => { @@ -24,8 +23,8 @@ const index = (req, res, next) => {
24 let uid = req.user.uid; 23 let uid = req.user.uid;
25 24
26 Promise.all([addressModel.getAddressDataAsync(uid, 20), mcHandler.getMeThumb()]).then(result => { 25 Promise.all([addressModel.getAddressDataAsync(uid, 20), mcHandler.getMeThumb()]).then(result => {
27 - let resultData = result[0].data ? result[0].data : result[0];  
28 - let length = resultData.length ? (resultData.length > 7 ? 7 : resultData.length) : 0; 26 + let resultData = result[0].data ? result[0].data : [];
  27 + let length = resultData.length > 7 ? 7 : resultData.length;
29 let reg = /(\d{3})\d{4}(\d{4})/; 28 let reg = /(\d{3})\d{4}(\d{4})/;
30 let thumb = result[1]; 29 let thumb = result[1];
31 30
@@ -49,7 +48,7 @@ const index = (req, res, next) => { @@ -49,7 +48,7 @@ const index = (req, res, next) => {
49 data: resultData 48 data: resultData
50 } 49 }
51 }); 50 });
52 - }); 51 + }).catch(next);
53 }; 52 };
54 53
55 const getAddressList = (req, res, next) => { 54 const getAddressList = (req, res, next) => {
@@ -81,7 +81,7 @@ const index = (req, res, next) => { @@ -81,7 +81,7 @@ const index = (req, res, next) => {
81 total: result[0].list.total ? result[0].list.total : 0 81 total: result[0].list.total ? result[0].list.total : 0
82 } 82 }
83 }); 83 });
84 - }); 84 + }).catch(next);
85 }; 85 };
86 86
87 87
@@ -53,7 +53,7 @@ const refund = (req, res, next) => { @@ -53,7 +53,7 @@ const refund = (req, res, next) => {
53 Promise.all([returns.getRefundGoodsData(code, uid), mcHandler.getMeThumb()]).then(result => { 53 Promise.all([returns.getRefundGoodsData(code, uid), mcHandler.getMeThumb()]).then(result => {
54 let refundGoods = result[0]; 54 let refundGoods = result[0];
55 let thumb = result[1]; 55 let thumb = result[1];
56 - 56 +
57 res.display('index', { 57 res.display('index', {
58 page: 'refund', 58 page: 'refund',
59 content: Object.assign({ 59 content: Object.assign({
@@ -100,7 +100,7 @@ const refundDetail = (req, res, next) => { @@ -100,7 +100,7 @@ const refundDetail = (req, res, next) => {
100 } 100 }
101 101
102 Promise.all([returns.getRefundDetailData(applyId, uid), mcHandler.getMeThumb()]).then(result => { 102 Promise.all([returns.getRefundDetailData(applyId, uid), mcHandler.getMeThumb()]).then(result => {
103 - let refundDetail = result[0]; 103 + let refundDetailData = result[0];
104 let thumb = result[1]; 104 let thumb = result[1];
105 105
106 res.display('index', { 106 res.display('index', {
@@ -109,7 +109,7 @@ const refundDetail = (req, res, next) => { @@ -109,7 +109,7 @@ const refundDetail = (req, res, next) => {
109 nav: mcHandler.getMeCrumb('我的退/换货'), 109 nav: mcHandler.getMeCrumb('我的退/换货'),
110 navigation: mcHandler.getSideMenu('我的退/换货'), 110 navigation: mcHandler.getSideMenu('我的退/换货'),
111 banner: thumb 111 banner: thumb
112 - }, refundDetail) 112 + }, refundDetailData)
113 }); 113 });
114 }).catch(next); 114 }).catch(next);
115 }; 115 };
@@ -122,7 +122,7 @@ const exchange = (req, res, next) => { @@ -122,7 +122,7 @@ const exchange = (req, res, next) => {
122 const uid = req.user.uid; 122 const uid = req.user.uid;
123 123
124 Promise.all([returns.getChangeGoodsList(code, uid), mcHandler.getMeThumb()]).then(result => { 124 Promise.all([returns.getChangeGoodsList(code, uid), mcHandler.getMeThumb()]).then(result => {
125 - let exchange = result[0]; 125 + let exchangeData = result[0];
126 let thumb = result[1]; 126 let thumb = result[1];
127 127
128 res.display('index', { 128 res.display('index', {
@@ -132,7 +132,7 @@ const exchange = (req, res, next) => { @@ -132,7 +132,7 @@ const exchange = (req, res, next) => {
132 nav: mcHandler.getMeCrumb('我的退/换货'), 132 nav: mcHandler.getMeCrumb('我的退/换货'),
133 navigation: mcHandler.getSideMenu('我的退/换货'), 133 navigation: mcHandler.getSideMenu('我的退/换货'),
134 banner: thumb 134 banner: thumb
135 - }, exchange) 135 + }, exchangeData)
136 }); 136 });
137 }).catch(next); 137 }).catch(next);
138 }; 138 };
@@ -105,7 +105,7 @@ const index = (req, res, next) => { @@ -105,7 +105,7 @@ const index = (req, res, next) => {
105 x.isSelected = 'selected'; 105 x.isSelected = 'selected';
106 } 106 }
107 }); 107 });
108 - } 108 + }
109 109
110 res.display('index', { 110 res.display('index', {
111 module: 'me', 111 module: 'me',
@@ -120,7 +120,7 @@ const index = (req, res, next) => { @@ -120,7 +120,7 @@ const index = (req, res, next) => {
120 userInfo: result[0] 120 userInfo: result[0]
121 } 121 }
122 }); 122 });
123 - }); 123 + }).catch(next);
124 }; 124 };
125 125
126 /** 126 /**
@@ -17,8 +17,6 @@ var validate = require('./order/validation'); @@ -17,8 +17,6 @@ var validate = require('./order/validation');
17 var imgBoxTpl = require('../../tpl/me/thumbnail.hbs'); 17 var imgBoxTpl = require('../../tpl/me/thumbnail.hbs');
18 var changeTypeTpl = require('../../tpl/me/change-type.hbs'); 18 var changeTypeTpl = require('../../tpl/me/change-type.hbs');
19 19
20 -lazyLoad($('.banner-img'));  
21 -  
22 var validateMap = { 20 var validateMap = {
23 user: { 21 user: {
24 sl: '#user', 22 sl: '#user',
@@ -45,6 +43,8 @@ var validateMap = { @@ -45,6 +43,8 @@ var validateMap = {
45 } 43 }
46 }; 44 };
47 45
  46 +lazyLoad($('.banner-img'));
  47 +
48 // 添加.check方法 48 // 添加.check方法
49 require('../plugins/check'); 49 require('../plugins/check');
50 50
@@ -25,13 +25,13 @@ require('yoho-jquery-dotdotdot'); @@ -25,13 +25,13 @@ require('yoho-jquery-dotdotdot');
25 require('../common/header'); // header 25 require('../common/header'); // header
26 require('../common/return-top'); // return-top 26 require('../common/return-top'); // return-top
27 27
  28 +lazyload($('.banner-img'));
  29 +
28 // dot 30 // dot
29 $('.goods-item .title').dotdotdot({ 31 $('.goods-item .title').dotdotdot({
30 wrap: 'letter' 32 wrap: 'letter'
31 }); 33 });
32 34
33 -lazyLoad($('img.banner-img'));  
34 -  
35 function cancelRefundApply() { 35 function cancelRefundApply() {
36 $.ajax({ 36 $.ajax({
37 type: 'POST', 37 type: 'POST',
@@ -26,7 +26,7 @@ var imgBoxTpl = require('../../tpl/me/thumbnail.hbs'); @@ -26,7 +26,7 @@ var imgBoxTpl = require('../../tpl/me/thumbnail.hbs');
26 26
27 var checked; 27 var checked;
28 28
29 -lazyLoad($('.banner-img')); 29 +lazyload($('.banner-img'));
30 30
31 $('.blk-footer .return-top').remove(); // 移除通用的返回顶部组件 31 $('.blk-footer .return-top').remove(); // 移除通用的返回顶部组件
32 32