Authored by 王水玲

有货分期

@@ -40,8 +40,7 @@ const _reviewStatus = (status) => { @@ -40,8 +40,7 @@ const _reviewStatus = (status) => {
40 } 40 }
41 }; 41 };
42 42
43 -const index = (req, res) => {  
44 - let query = req.query.query || ''; 43 +const index = (req, res, next) => {
45 let uid = req.user.uid || 3236556; 44 let uid = req.user.uid || 3236556;
46 45
47 Promise.all([installmentModel.getStauts(uid), installmentModel.getSearchIntallment()]).then((result) => { 46 Promise.all([installmentModel.getStauts(uid), installmentModel.getSearchIntallment()]).then((result) => {
@@ -50,45 +49,41 @@ const index = (req, res) => { @@ -50,45 +49,41 @@ const index = (req, res) => {
50 let openStatus = result[0]; 49 let openStatus = result[0];
51 50
52 if (openStatus === 0) { 51 if (openStatus === 0) {
53 - return {  
54 - bannerTop: {  
55 - data: [  
56 - {  
57 - url: '',  
58 - src: '//img11.static.yhbimg.com/yhb-img01/2016/07/29/11/0112d076e4fa0c53635ed93b118ee3f74e.jpg?imageView2/2/w/640/h/240/q/70' // eslint-disable-line  
59 - }  
60 - ]  
61 - },  
62 - notOpen: true,  
63 - installmentOnly: {  
64 - title: '分期专享',  
65 - goods: result[1]  
66 - }  
67 - }; 52 + return installmentModel.getResources().then(data => {
  53 + return {
  54 + bannerTop: {
  55 + data: [{
  56 + src: '//img10.static.yhbimg.com/yhb-img01/2016/08/03/11/0131193afdd030b09af40b93eeb1c33ae5.jpg?imageView2/2/w/640/h/240/q/70',
  57 + url: ''
  58 + }]
  59 + },
  60 + notOpen: true,
  61 + installmentOnly: {
  62 + title: '分期专享',
  63 + goods: result[1]
  64 + }
  65 + };
  66 + });
68 } else if (openStatus === 2) { 67 } else if (openStatus === 2) {
69 - if (query === 'usable') {  
70 - return installmentModel.getQueryCreditInfo(uid).then((data) => {  
71 - if (data.status === 2) {  
72 - data.replayStatus = '逾期';  
73 - } else if (data.status === 3) {  
74 - data.replayStatus = '不可用'; 68 + return Promise.all([installmentModel.getQueryCreditInfo(uid), installmentModel.getQueryAmtInfo(uid)]).then((data) => {
  69 + let params = _.assign({
  70 + isOverdue: false,
  71 + installmentOnly: {
  72 + title: '分期专享',
  73 + goods: result[1]
75 } 74 }
  75 + }, data[0], data[1]);
76 76
77 - return _.assign({  
78 - isUnable: true,  
79 - installmentOnly: {  
80 - title: '分期专享',  
81 - goods: result[1]  
82 - }  
83 - }, data);  
84 - });  
85 - } else {  
86 - return installmentModel.getQueryAmtInfo(uid).then((data) => {  
87 - return _.assign({  
88 - isRepay: true  
89 - }, data);  
90 - });  
91 - } 77 + // status: 1 正常 2 逾期 3 不可用 4 未开通
  78 + if (data[0].status === 2) {
  79 + params.replayStatus = '逾期';
  80 + params.isOverdue = true;
  81 + } else if (data[0].status === 3) {
  82 + params.replayStatus = '不可用';
  83 + }
  84 +
  85 + return params;
  86 + });
92 } else if (openStatus === 1) { 87 } else if (openStatus === 1) {
93 res.redirect('/home/installment/review?status=' + openStatus); 88 res.redirect('/home/installment/review?status=' + openStatus);
94 } else { 89 } else {
@@ -107,10 +102,10 @@ const index = (req, res) => { @@ -107,10 +102,10 @@ const index = (req, res) => {
107 page: 'installment', 102 page: 'installment',
108 title: '有货分期' 103 title: '有货分期'
109 }, result)); 104 }, result));
110 - }); 105 + }).catch(next);
111 }; 106 };
112 107
113 -const review = (req, res) => { 108 +const review = (req, res, next) => {
114 let openStatus = req.query.status || false; 109 let openStatus = req.query.status || false;
115 let uid = req.user.uid || 20000032; 110 let uid = req.user.uid || 20000032;
116 let data = { 111 let data = {
@@ -130,7 +125,7 @@ const review = (req, res) => { @@ -130,7 +125,7 @@ const review = (req, res) => {
130 return _reviewStatus(status); 125 return _reviewStatus(status);
131 }).then((params) => { 126 }).then((params) => {
132 res.render('installment/open-result', _.assign(data, params)); 127 res.render('installment/open-result', _.assign(data, params));
133 - }); 128 + }).catch(next);
134 } 129 }
135 }; 130 };
136 131
@@ -150,9 +145,30 @@ const verifyCode = (req, res, next) => { @@ -150,9 +145,30 @@ const verifyCode = (req, res, next) => {
150 }).catch(next); 145 }).catch(next);
151 }; 146 };
152 147
  148 +// 逾期未还款列表
  149 +const overdueList = (req, res, next) => {
  150 + let params = {
  151 + uid: req.user.uid || 0,
  152 + queryDays: -1,
  153 + pageNo: '1'
  154 + };
  155 + installmentModel.getQueryAmtList(params).then((result) => {
  156 + res.render('installment/repayment-list', {
  157 + repaymentList: result
  158 + });
  159 + });
  160 +};
  161 +
  162 +// // 7日待还款列表
  163 +const sevenDayList = (req, res, next) => {
  164 + res.send('1');
  165 +};
  166 +
153 module.exports = { 167 module.exports = {
154 index, 168 index,
155 review, 169 review,
156 startingService, 170 startingService,
157 - verifyCode 171 + verifyCode,
  172 + overdueList,
  173 + sevenDayList
158 }; 174 };
@@ -6,11 +6,34 @@ @@ -6,11 +6,34 @@
6 'use strict'; 6 'use strict';
7 const utils = '../../../utils'; 7 const utils = '../../../utils';
8 const productProcess = require(`${utils}/product-process`); 8 const productProcess = require(`${utils}/product-process`);
  9 +const resourcesProcess = require(`${utils}/resources-process`);
  10 +const _ = require('lodash');
9 const api = global.yoho.API; 11 const api = global.yoho.API;
  12 +const serviceAPI = global.yoho.ServiceAPI;
10 const logger = global.yoho.logger; 13 const logger = global.yoho.logger;
11 14
12 // const camelCase = global.yoho.camelCase; 15 // const camelCase = global.yoho.camelCase;
13 16
  17 +/**
  18 + * 获取资源位数据
  19 + * @param {[string]} page
  20 + * @return {[array]}
  21 + */
  22 +const getResources = (page, channel) => {
  23 + return serviceAPI.get('operations/api/v5/resource/get', {
  24 + content_code: '0876085ff46bed27f1a1eb6ee8b68987'
  25 + }, {
  26 + cache: true
  27 + }).then((result) => {
  28 + if (result && result.code === 200) {
  29 + return resourcesProcess(result.data);
  30 + } else {
  31 + logger.error('get resources data return code is not 200');
  32 + return [];
  33 + }
  34 + });
  35 +};
  36 +
14 37
15 // 获取分期开通状态 38 // 获取分期开通状态
16 const getStauts = (uid) => { 39 const getStauts = (uid) => {
@@ -22,7 +45,7 @@ const getStauts = (uid) => { @@ -22,7 +45,7 @@ const getStauts = (uid) => {
22 alg: 'SALT_MD5', 45 alg: 'SALT_MD5',
23 code: 200, 46 code: 200,
24 data: { 47 data: {
25 - status: 0 48 + status: 2
26 }, 49 },
27 md5: '6d729d4b35f10fc73531210bd7ecff91', 50 md5: '6d729d4b35f10fc73531210bd7ecff91',
28 message: 'success' 51 message: 'success'
@@ -30,7 +53,7 @@ const getStauts = (uid) => { @@ -30,7 +53,7 @@ const getStauts = (uid) => {
30 if (result && result.code === 200) { 53 if (result && result.code === 200) {
31 return result.data.status; 54 return result.data.status;
32 } else { 55 } else {
33 - logger.error('get installment open status return is not 200'); 56 + logger.error('get installment open status return code is not 200');
34 return ''; 57 return '';
35 } 58 }
36 }); 59 });
@@ -39,7 +62,7 @@ const getStauts = (uid) => { @@ -39,7 +62,7 @@ const getStauts = (uid) => {
39 // 获取用户可用额度信息 62 // 获取用户可用额度信息
40 const getQueryCreditInfo = (uid) => { 63 const getQueryCreditInfo = (uid) => {
41 return api.get('', { 64 return api.get('', {
42 - method: 'order.queryCreditInfo', 65 + method: 'app.order.queryCreditInfo',
43 uid: uid 66 uid: uid
44 }).then((result) => { 67 }).then((result) => {
45 result = { 68 result = {
@@ -53,10 +76,11 @@ const getQueryCreditInfo = (uid) => { @@ -53,10 +76,11 @@ const getQueryCreditInfo = (uid) => {
53 md5: 'c1d725306fb09dcbf504776d276521cb', 76 md5: 'c1d725306fb09dcbf504776d276521cb',
54 message: 'ok' 77 message: 'ok'
55 }; 78 };
  79 + console.log('11');
56 if (result && result.code === 200) { 80 if (result && result.code === 200) {
57 return result.data; 81 return result.data;
58 } else { 82 } else {
59 - logger.error('get user installment usable price info return is not 200'); 83 + logger.error('get user installment usable price info return code is not 200');
60 return ''; 84 return '';
61 } 85 }
62 }); 86 });
@@ -65,7 +89,7 @@ const getQueryCreditInfo = (uid) => { @@ -65,7 +89,7 @@ const getQueryCreditInfo = (uid) => {
65 // 获取用户待还款金额 89 // 获取用户待还款金额
66 const getQueryAmtInfo = (uid) => { 90 const getQueryAmtInfo = (uid) => {
67 return api.get('', { 91 return api.get('', {
68 - method: 'order.queryAmtInfo', 92 + method: 'app.order.queryAmtInfo',
69 uid: uid 93 uid: uid
70 }).then((result) => { 94 }).then((result) => {
71 result = { 95 result = {
@@ -84,143 +108,216 @@ const getQueryAmtInfo = (uid) => { @@ -84,143 +108,216 @@ const getQueryAmtInfo = (uid) => {
84 result.data.dayAmt = result.data._7daysAmt; 108 result.data.dayAmt = result.data._7daysAmt;
85 return result.data; 109 return result.data;
86 } else { 110 } else {
87 - logger.error('get user installment repay info return is not 200'); 111 + logger.error('get user installment repay info return code is not 200');
88 return ''; 112 return '';
89 } 113 }
90 }); 114 });
91 }; 115 };
92 116
93 -// 分期专享推荐商品  
94 -const getSearchIntallment = () => {  
95 - return api.post('', {  
96 - method: 'app.search.instalment',  
97 - limit: '50',  
98 - order: 's_t_desc'  
99 - }, { 117 +// 处理还款列表数据
  118 +const _processAmtList = (list) => {
  119 + let formatData = [];
  120 +
  121 + list = list || [];
  122 +
  123 + _.forEach(list, (data) => {
  124 + if (data.terms === 1) {
  125 + data.stage = data.terms;
  126 + } else {
  127 + data.stage = data.currTerm + '/' + data.terms;
  128 + }
  129 +
  130 + if (data.unExpireDays < 0) {
  131 + data.isOverdue = true;
  132 + }
  133 +
  134 + data.day = data.unExpireDays;
  135 + });
  136 +
  137 + return list;
  138 +};
  139 +
  140 +// 获取用户待还列表信息 queryDays -1:逾期待还;0:全部待还;7:七日待还;30:本月待还
  141 +const getQueryAmtList = (params) => {
  142 + return api.get('', _.assign({
  143 + method: 'app.order.queryAmtList',
  144 + pageSize: '20'
  145 + }, params), {
100 cache: true 146 cache: true
101 }).then((result) => { 147 }).then((result) => {
102 result = { 148 result = {
103 alg: 'SALT_MD5', 149 alg: 'SALT_MD5',
104 code: 200, 150 code: 200,
105 data: { 151 data: {
106 - product_list: [ 152 + amtList: [
107 { 153 {
108 - brand_domain: '5cm',  
109 - brand_id: 4,  
110 - brand_name: '5CM',  
111 - cn_alphabet: '5CMPeiShi5CXTIT0600S66',  
112 - default_images: 'http://img13.static.yhbimg.com/goodsimg/2016/02/21/07/026d569b2db7d9ce9339a79bcb3fe420f8.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',  
113 - edit_time: 1456119592,  
114 - gender: '1',  
115 - goods_list: [  
116 - {  
117 - color_code: '333333',  
118 - color_id: '2',  
119 - color_name: '黑色',  
120 - color_value: '',  
121 - cover_1: '',  
122 - cover_2: '',  
123 - goods_id: '476147',  
124 - images_url: 'http://img13.static.yhbimg.com/goodsimg/2016/02/21/07/026d569b2db7d9ce9339a79bcb3fe420f8.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',  
125 - is_default: 'N',  
126 - product_skc: '346699',  
127 - status: '1'  
128 - }  
129 - ],  
130 - is_advance: 'N',  
131 - is_discount: 'N',  
132 - is_limited: 'N',  
133 - is_new: 'Y',  
134 - is_outlets: 2,  
135 - is_promotion: 104,  
136 - is_soon_sold_out: 'N',  
137 - is_special: 'N',  
138 - market_price: 359,  
139 - max_sort_id: 8,  
140 - middle_sort_id: 66,  
141 - product_id: 373507,  
142 - product_name: '5CM 字母印花领带',  
143 - product_skn: 51206745,  
144 - sales_num: 0,  
145 - sales_phrase: '春潮新势力',  
146 - sales_price: 359,  
147 - shelve_time: 1457140500,  
148 - small_sort_id: 77,  
149 - status: 1,  
150 - stock_number: 25,  
151 - storage_num: 25,  
152 - tags: [  
153 - 'is_new'  
154 - ],  
155 - vip1_price: 341.05,  
156 - vip2_price: 323.1,  
157 - vip3_price: 315.92,  
158 - vip_discount_type: 1,  
159 - vip_price: 0 154 + billNo: 'x00001',
  155 + terms: 3,
  156 + currTerm: 1,
  157 + unExpireDays: -3,
  158 + billInfo: '三叶草运动休闲鞋',
  159 + currAmt: '845.00',
  160 + currNoFeeAmt: '840.00',
  161 + currFee: '5.00'
160 }, { 162 }, {
161 - brand_domain: '5cm',  
162 - brand_id: 4,  
163 - brand_name: '5CM',  
164 - cn_alphabet: '5CMPeiShi5CXTIT0603S66',  
165 - default_images: 'http://img12.static.yhbimg.com/goodsimg/2016/02/21/07/02d463c9f8945ad14f824e8ba35efb9555.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',  
166 - edit_time: 1456119581,  
167 - gender: '1',  
168 - goods_list: [  
169 - {  
170 - color_code: '333333',  
171 - color_id: '2',  
172 - color_name: '黑色',  
173 - color_value: '',  
174 - cover_1: '',  
175 - cover_2: '',  
176 - goods_id: '476153',  
177 - images_url: 'http://img12.static.yhbimg.com/goodsimg/2016/02/21/07/02d463c9f8945ad14f824e8ba35efb9555.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',  
178 - is_default: 'N',  
179 - product_skc: '346702',  
180 - status: '1'  
181 - }  
182 - ],  
183 - is_advance: 'N',  
184 - is_discount: 'N',  
185 - is_limited: 'N',  
186 - is_new: 'Y',  
187 - is_outlets: 2,  
188 - is_promotion: 104,  
189 - is_soon_sold_out: 'N',  
190 - is_special: 'N',  
191 - market_price: 359,  
192 - max_sort_id: 8,  
193 - middle_sort_id: 66,  
194 - product_id: 373513,  
195 - product_name: '5CM 字母印花领结',  
196 - product_skn: 51206748,  
197 - sales_num: 0,  
198 - sales_phrase: '春潮新势力',  
199 - sales_price: 359,  
200 - shelve_time: 1457140500,  
201 - small_sort_id: 77,  
202 - status: 1,  
203 - stock_number: 19,  
204 - storage_num: 19,  
205 - tags: [  
206 - 'is_new'  
207 - ],  
208 - vip1_price: 341.05,  
209 - vip2_price: 323.1,  
210 - vip3_price: 315.92,  
211 - vip_discount_type: 1,  
212 - vip_price: 0 163 + billNo: 'x00001',
  164 + terms: 3,
  165 + currTerm: 2,
  166 + unExpireDays: 10,
  167 + billInfo: '三叶草运动休闲鞋',
  168 + currAmt: '840.00',
  169 + currNoFeeAmt: '840.00',
  170 + currFee: '0.00'
213 } 171 }
214 ], 172 ],
215 - rec_id: '00f185af-936a-4053-97f8-1c802cb91e8b' 173 + pageNo: 1,
  174 + pageTotal: 1,
  175 + total: 2
216 }, 176 },
217 - md5: 'ace93d0f598db0bebec30234381c0cbf',  
218 - message: 'Product List.' 177 + md5: 'c1d725306fb09dcbf504776d276521cb',
  178 + message: 'ok'
219 }; 179 };
220 if (result && result.code === 200) { 180 if (result && result.code === 200) {
  181 + return _processAmtList(result.data.amtList);
  182 + } else {
  183 + logger.error('get queryAmtList data return code is not 200');
  184 + return '';
  185 + }
  186 + });
  187 +};
  188 +
  189 +// 分期专享推荐商品
  190 +const getSearchIntallment = () => {
  191 + return api.post('', {
  192 + // method: 'app.search.instalment',
  193 + method: 'app.search.newProduct',
  194 + limit: '50',
  195 + order: 's_t_desc'
  196 + }, {
  197 + cache: true
  198 + }).then((result) => {
  199 + // result = {
  200 + // alg: 'SALT_MD5',
  201 + // code: 200,
  202 + // data: {
  203 + // product_list: [
  204 + // {
  205 + // brand_domain: '5cm',
  206 + // brand_id: 4,
  207 + // brand_name: '5CM',
  208 + // cn_alphabet: '5CMPeiShi5CXTIT0600S66',
  209 + // default_images: 'http://img13.static.yhbimg.com/goodsimg/2016/02/21/07/026d569b2db7d9ce9339a79bcb3fe420f8.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
  210 + // edit_time: 1456119592,
  211 + // gender: '1',
  212 + // goods_list: [
  213 + // {
  214 + // color_code: '333333',
  215 + // color_id: '2',
  216 + // color_name: '黑色',
  217 + // color_value: '',
  218 + // cover_1: '',
  219 + // cover_2: '',
  220 + // goods_id: '476147',
  221 + // images_url: 'http://img13.static.yhbimg.com/goodsimg/2016/02/21/07/026d569b2db7d9ce9339a79bcb3fe420f8.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
  222 + // is_default: 'N',
  223 + // product_skc: '346699',
  224 + // status: '1'
  225 + // }
  226 + // ],
  227 + // is_advance: 'N',
  228 + // is_discount: 'N',
  229 + // is_limited: 'N',
  230 + // is_new: 'Y',
  231 + // is_outlets: 2,
  232 + // is_promotion: 104,
  233 + // is_soon_sold_out: 'N',
  234 + // is_special: 'N',
  235 + // market_price: 359,
  236 + // max_sort_id: 8,
  237 + // middle_sort_id: 66,
  238 + // product_id: 373507,
  239 + // product_name: '5CM 字母印花领带',
  240 + // product_skn: 51206745,
  241 + // sales_num: 0,
  242 + // sales_phrase: '春潮新势力',
  243 + // sales_price: 359,
  244 + // shelve_time: 1457140500,
  245 + // small_sort_id: 77,
  246 + // status: 1,
  247 + // stock_number: 25,
  248 + // storage_num: 25,
  249 + // tags: [
  250 + // 'is_new'
  251 + // ],
  252 + // vip1_price: 341.05,
  253 + // vip2_price: 323.1,
  254 + // vip3_price: 315.92,
  255 + // vip_discount_type: 1,
  256 + // vip_price: 0
  257 + // }, {
  258 + // brand_domain: '5cm',
  259 + // brand_id: 4,
  260 + // brand_name: '5CM',
  261 + // cn_alphabet: '5CMPeiShi5CXTIT0603S66',
  262 + // default_images: 'http://img12.static.yhbimg.com/goodsimg/2016/02/21/07/02d463c9f8945ad14f824e8ba35efb9555.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
  263 + // edit_time: 1456119581,
  264 + // gender: '1',
  265 + // goods_list: [
  266 + // {
  267 + // color_code: '333333',
  268 + // color_id: '2',
  269 + // color_name: '黑色',
  270 + // color_value: '',
  271 + // cover_1: '',
  272 + // cover_2: '',
  273 + // goods_id: '476153',
  274 + // images_url: 'http://img12.static.yhbimg.com/goodsimg/2016/02/21/07/02d463c9f8945ad14f824e8ba35efb9555.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
  275 + // is_default: 'N',
  276 + // product_skc: '346702',
  277 + // status: '1'
  278 + // }
  279 + // ],
  280 + // is_advance: 'N',
  281 + // is_discount: 'N',
  282 + // is_limited: 'N',
  283 + // is_new: 'Y',
  284 + // is_outlets: 2,
  285 + // is_promotion: 104,
  286 + // is_soon_sold_out: 'N',
  287 + // is_special: 'N',
  288 + // market_price: 359,
  289 + // max_sort_id: 8,
  290 + // middle_sort_id: 66,
  291 + // product_id: 373513,
  292 + // product_name: '5CM 字母印花领结',
  293 + // product_skn: 51206748,
  294 + // sales_num: 0,
  295 + // sales_phrase: '春潮新势力',
  296 + // sales_price: 359,
  297 + // shelve_time: 1457140500,
  298 + // small_sort_id: 77,
  299 + // status: 1,
  300 + // stock_number: 19,
  301 + // storage_num: 19,
  302 + // tags: [
  303 + // 'is_new'
  304 + // ],
  305 + // vip1_price: 341.05,
  306 + // vip2_price: 323.1,
  307 + // vip3_price: 315.92,
  308 + // vip_discount_type: 1,
  309 + // vip_price: 0
  310 + // }
  311 + // ],
  312 + // rec_id: '00f185af-936a-4053-97f8-1c802cb91e8b'
  313 + // },
  314 + // md5: 'ace93d0f598db0bebec30234381c0cbf',
  315 + // message: 'Product List.'
  316 + // };
  317 + if (result && result.code === 200) {
221 return productProcess.processProductList(result.data.product_list); 318 return productProcess.processProductList(result.data.product_list);
222 } else { 319 } else {
223 - logger.error('get instalment promote goods return is not 200'); 320 + logger.error('get instalment promote goods return code is not 200');
224 return ''; 321 return '';
225 } 322 }
226 }); 323 });
@@ -264,5 +361,7 @@ module.exports = { @@ -264,5 +361,7 @@ module.exports = {
264 getQueryAmtInfo, 361 getQueryAmtInfo,
265 getSearchIntallment, 362 getSearchIntallment,
266 sendVerifyCode, 363 sendVerifyCode,
267 - activateService 364 + activateService,
  365 + getResources,
  366 + getQueryAmtList
268 }; 367 };
@@ -17,4 +17,6 @@ router.get('/installment/index', installment.index);// 开通分期首页 @@ -17,4 +17,6 @@ router.get('/installment/index', installment.index);// 开通分期首页
17 router.get('/installment/review', installment.review); // 开通分期首页 17 router.get('/installment/review', installment.review); // 开通分期首页
18 router.get('/installment/starting-service', installment.startingService); // 分期付款开通 18 router.get('/installment/starting-service', installment.startingService); // 分期付款开通
19 router.get('/installment/starting-service/verify-code', installment.verifyCode); 19 router.get('/installment/starting-service/verify-code', installment.verifyCode);
  20 +router.get('/installment/overdue', installment.overdueList); // 逾期未还款列表
  21 +router.get('/installment/7daylist', installment.sevenDayList); // 7日待还款列表
20 module.exports = router; 22 module.exports = router;
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 </li> 19 </li>
20 </ul> 20 </ul>
21 21
22 - <div class="open-btn">立即开通</div> 22 + <a href="/home/installment/starting-service" class="open-btn">立即开通</a>
23 </div> 23 </div>
24 24
25 {{# installmentOnly}} 25 {{# installmentOnly}}
@@ -27,15 +27,17 @@ @@ -27,15 +27,17 @@
27 {{/ installmentOnly}} 27 {{/ installmentOnly}}
28 {{else}} 28 {{else}}
29 <div class="detail-tab"> 29 <div class="detail-tab">
30 - <a href="/home/installment/index?query=repay"><span class="{{#if isRepay}}on{{/if}}">待还款金额</span></a>  
31 - <a href="/home/installment/index?query=usable"><span class="{{#if isUnable}}on{{/if}}">可用额度</span></a> 30 + <span class="on is-repay">待还款金额</span>
  31 + <span class="is-usable">可用额度</span>
32 </div> 32 </div>
33 - {{#if isRepay}} 33 + <div class="repay installment-cont">
34 <div class="repay-area detail-bg"> 34 <div class="repay-area detail-bg">
35 <p class="detail-txt1">近7日代还款</p> 35 <p class="detail-txt1">近7日代还款</p>
36 <p class="detail-txt1">¥<span class="detail-txt2">{{round dayAmt}}</span></p> 36 <p class="detail-txt1">¥<span class="detail-txt2">{{round dayAmt}}</span></p>
37 - <p class="detail-txt3">您有¥{{round dayAmt}}已逾期3天,点击<a href="">查看详情</a></p>  
38 - <a href="" class="see-btn">明细</a> 37 + {{#if isOverdue}}
  38 + <p class="detail-txt3">您有¥{{round dayAmt}}已逾期,点击<a href="/home/installment/overdue">查看详情</a></p>
  39 + {{/if}}
  40 + <a href="/home/installment/7daylist" class="see-btn">明细</a>
39 </div> 41 </div>
40 <ul class="group-list"> 42 <ul class="group-list">
41 <li><a href="">本月待还金额:<div class="iconfont"><span class="list-r-txt">¥{{monthAmt}}</span> &#xe604;</div></a></li> 43 <li><a href="">本月待还金额:<div class="iconfont"><span class="list-r-txt">¥{{monthAmt}}</span> &#xe604;</div></a></li>
@@ -47,19 +49,18 @@ @@ -47,19 +49,18 @@
47 <ul class="group-list"> 49 <ul class="group-list">
48 <li><a href="">账户管理:<span class="iconfont">&#xe604;</span></a></li> 50 <li><a href="">账户管理:<span class="iconfont">&#xe604;</span></a></li>
49 </ul> 51 </ul>
50 - {{/if}}  
51 -  
52 - {{#if isUnable}} 52 + </div>
  53 + <div class="usable installment-cont">
53 <div class="usable-area detail-bg"> 54 <div class="usable-area detail-bg">
54 {{#replayStatus}}<div class="replay-status">{{.}}</div>{{/replayStatus}} 55 {{#replayStatus}}<div class="replay-status">{{.}}</div>{{/replayStatus}}
55 <p class="detail-txt1">可用额度</p> 56 <p class="detail-txt1">可用额度</p>
56 - <p class="detail-txt1">¥<span class="detail-txt2">{{round currCredit}}</span></p>  
57 - <p class="detail-txt1">总额度:¥{{round initCredit}}</p> 57 + <p class="detail-txt1">¥<span class="detail-txt2">{{round currCreditLimit}}</span></p>
  58 + <p class="detail-txt1">总额度:¥{{round initCreditLimit}}</p>
58 <a href="" class="terms">服务条款</a> 59 <a href="" class="terms">服务条款</a>
59 </div> 60 </div>
60 {{# installmentOnly}} 61 {{# installmentOnly}}
61 {{> installment/installment-only}} 62 {{> installment/installment-only}}
62 {{/ installmentOnly}} 63 {{/ installmentOnly}}
63 - {{/if}} 64 + </div>
64 {{/if}} 65 {{/if}}
65 </div> 66 </div>
  1 +<div class="repayment-list-page">
  2 + <ul class="repay-list">
  3 + {{#each repaymentList}}
  4 + <li>
  5 + <span></span>
  6 + <div class="cont">
  7 + <p>¥{{round currNoFeeAmt}}</p>
  8 + <p>【全{{stage}}期】{{billInfo}}</p>
  9 + </div>
  10 + <div class="list-right">
  11 + {{#if isOverdue}}
  12 + <div class="color-r">逾期{{day}}<span class="iconfont">&#xe639;</span></div>
  13 + {{else}}
  14 + 剩余{{day}}
  15 + {{/if}}
  16 + <span class="iconfont">&#xe604;</span>
  17 + </div>
  18 + </li>
  19 + {{/each}}
  20 + </ul>
  21 +</div>
@@ -15,8 +15,12 @@ module.exports = { @@ -15,8 +15,12 @@ module.exports = {
15 port: 6001, 15 port: 6001,
16 siteUrl: '//m.yohobuy.com', 16 siteUrl: '//m.yohobuy.com',
17 domains: { 17 domains: {
18 - api: 'http://devapi.yoho.cn:58078/',  
19 - service: 'http://devservice.yoho.cn:58077/' 18 + // api: 'http://devapi.yoho.cn:58078/',
  19 + // service: 'http://devservice.yoho.cn:58077/'
  20 + api: 'http://api.yoho.cn/',
  21 +
  22 + // service: 'http://service.yoho.cn/'
  23 + service: 'http://testservice.yoho.cn:28077'
20 }, 24 },
21 subDomains: { 25 subDomains: {
22 host: '.m.yohobuy.com', 26 host: '.m.yohobuy.com',
@@ -27,3 +27,8 @@ if ($('.installment-bg').length > 0) { @@ -27,3 +27,8 @@ if ($('.installment-bg').length > 0) {
27 background: '#efefef' 27 background: '#efefef'
28 }); 28 });
29 } 29 }
  30 +
  31 +$('.detail-tab span').on('click', function() {
  32 + $(this).addClass('on').siblings().removeClass('on');
  33 + $('.installment-cont').hide().eq($(this).index()).show();
  34 +});
1 @import "installment"; 1 @import "installment";
2 @import "starting-service"; 2 @import "starting-service";
3 - 3 +@import "repayment-list"
@@ -159,7 +159,7 @@ @@ -159,7 +159,7 @@
159 color: #fff; 159 color: #fff;
160 } 160 }
161 161
162 - a:first-child span { 162 + span:first-child {
163 border-right: 1px solid #fff; 163 border-right: 1px solid #fff;
164 } 164 }
165 } 165 }
@@ -182,7 +182,7 @@ @@ -182,7 +182,7 @@
182 182
183 .detail-txt3 { 183 .detail-txt3 {
184 color: #ce051d; 184 color: #ce051d;
185 - font-size: 14px; 185 + font-size: 22px;
186 186
187 a { 187 a {
188 color: #ce051d; 188 color: #ce051d;
@@ -236,6 +236,10 @@ @@ -236,6 +236,10 @@
236 height: 345px; 236 height: 345px;
237 } 237 }
238 238
  239 + .usable {
  240 + display: none;
  241 + }
  242 +
239 .usable-area { 243 .usable-area {
240 position: relative; 244 position: relative;
241 height: 510px; 245 height: 510px;
  1 +.repayment-list-page {
  2 + .repay-list li {
  3 + height: 120px;
  4 + background: #fff;
  5 +
  6 + .cont {
  7 + width: 370px;
  8 + overflow: hidden;
  9 + height: 120px;
  10 + float: left;
  11 + }
  12 +
  13 + .list-right {
  14 + float: right;
  15 + color: #b0b0b0;
  16 + }
  17 +
  18 + .color-r {
  19 + color: #d0021b;
  20 + }
  21 + }
  22 +}