Showing
8 changed files
with
70 additions
and
47 deletions
@@ -157,6 +157,7 @@ const _processBankCards = (list) => { | @@ -157,6 +157,7 @@ const _processBankCards = (list) => { | ||
157 | // data.cardNo += newCardNo[i - 1]; | 157 | // data.cardNo += newCardNo[i - 1]; |
158 | // } | 158 | // } |
159 | // } | 159 | // } |
160 | + data.url = '/home/installment/card-detail?cardIdNo=' + data.cardIdNo; | ||
160 | 161 | ||
161 | 162 | ||
162 | // 正则替换卡号,保留后4位 | 163 | // 正则替换卡号,保留后4位 |
@@ -170,19 +171,13 @@ const _processBankCards = (list) => { | @@ -170,19 +171,13 @@ const _processBankCards = (list) => { | ||
170 | }; | 171 | }; |
171 | 172 | ||
172 | // 银行卡详情数据处理 | 173 | // 银行卡详情数据处理 |
173 | -const _processCardDetail = (list, cardIdNo) => { | ||
174 | - let res = {}; | 174 | +const _processCardDetail = (list) => { |
175 | + list = list || {}; | ||
175 | 176 | ||
176 | - list = list || []; | ||
177 | - | ||
178 | - _.forEach(list, (item) => { | ||
179 | - if (item.cardIdNo === cardIdNo) { | ||
180 | - item.isMaster = item.masterType || 1; | ||
181 | - res = item; | ||
182 | - } | ||
183 | - }); | 177 | + list.isMaster = +list.masterType; |
178 | + list.cardNo = list.cardNo.replace(/\*/g, ''); | ||
184 | 179 | ||
185 | - return res; | 180 | + return list; |
186 | }; | 181 | }; |
187 | 182 | ||
188 | /** | 183 | /** |
@@ -507,32 +502,33 @@ const postAccount = (params) => { | @@ -507,32 +502,33 @@ const postAccount = (params) => { | ||
507 | // 获取银行卡详情 | 502 | // 获取银行卡详情 |
508 | const getCardDetail = (uid, cardIdNo) => { | 503 | const getCardDetail = (uid, cardIdNo) => { |
509 | return api.get('', { | 504 | return api.get('', { |
510 | - method: 'user.instalment.getBankCards', | ||
511 | - uid: uid | 505 | + method: 'user.instalment.getBankCardDetail', |
506 | + uid: uid, | ||
507 | + cardIdNo: cardIdNo | ||
512 | }, { | 508 | }, { |
513 | timeout: API_TIMEOUT, | 509 | timeout: API_TIMEOUT, |
514 | cache: true | 510 | cache: true |
515 | }).then((result) => { | 511 | }).then((result) => { |
516 | - result = { | ||
517 | - alg: 'SALT_MD5', | ||
518 | - code: 200, | ||
519 | - data: [ | ||
520 | - { | ||
521 | - id: '1', | ||
522 | - userName: '*三', | ||
523 | - cardNo: '0000', | ||
524 | - bankCode: 'ABC', | ||
525 | - bankName: '农业银行', | ||
526 | - mobile: '18021200000', | ||
527 | - cardIdNo: 'BK201610204789114', | ||
528 | - masterType: '1' | ||
529 | - } | ||
530 | - ], | ||
531 | - md5: '6d729d4b35f10fc73531210bd7ecff91', | ||
532 | - message: 'success' | ||
533 | - }; | 512 | + // result = { |
513 | + // alg: 'SALT_MD5', | ||
514 | + // code: 200, | ||
515 | + // data: [ | ||
516 | + // { | ||
517 | + // id: '1', | ||
518 | + // userName: '*三', | ||
519 | + // cardNo: '0000', | ||
520 | + // bankCode: 'ABC', | ||
521 | + // bankName: '农业银行', | ||
522 | + // mobile: '18021200000', | ||
523 | + // cardIdNo: 'BK201610204789114', | ||
524 | + // masterType: '1' | ||
525 | + // } | ||
526 | + // ], | ||
527 | + // md5: '6d729d4b35f10fc73531210bd7ecff91', | ||
528 | + // message: 'success' | ||
529 | + // }; | ||
534 | if (result && result.code === 200) { | 530 | if (result && result.code === 200) { |
535 | - return _processCardDetail(result.data, cardIdNo); | 531 | + return _processCardDetail(result.data); |
536 | } else { | 532 | } else { |
537 | logger.error('get getBankCards data return code is not 200'); | 533 | logger.error('get getBankCards data return code is not 200'); |
538 | return ''; | 534 | return ''; |
1 | <div class="bank-card-page"> | 1 | <div class="bank-card-page"> |
2 | - <ul class="bank-card-list"> | 2 | + <div class="bank-card-list"> |
3 | {{#accountList}} | 3 | {{#accountList}} |
4 | - <li class="card-bg-{{lowerCase bankCode}}"><span>{{cardNo}}</span></li> | 4 | + <a class="card-bg-{{lowerCase bankCode}} card-nav" href="{{url}}"><span>{{cardNo}}</span></a> |
5 | {{/accountList}} | 5 | {{/accountList}} |
6 | - </ul> | 6 | + </div> |
7 | </div> | 7 | </div> |
@@ -21,15 +21,15 @@ module.exports = { | @@ -21,15 +21,15 @@ module.exports = { | ||
21 | // liveApi: 'http://api.live.yoho.cn/', | 21 | // liveApi: 'http://api.live.yoho.cn/', |
22 | // singleApi: 'http://single.yoho.cn/' | 22 | // singleApi: 'http://single.yoho.cn/' |
23 | 23 | ||
24 | - api: 'http://api-test3.yohops.com:9999/', | ||
25 | - service: 'http://service-test3.yohops.com:9999/', | ||
26 | - liveApi: 'http://testapi.live.yohops.com:9999/', | ||
27 | - singleApi: 'http://api-test3.yohops.com:9999/' | 24 | + // api: 'http://api-test3.yohops.com:9999/', |
25 | + // service: 'http://service-test3.yohops.com:9999/', | ||
26 | + // liveApi: 'http://testapi.live.yohops.com:9999/', | ||
27 | + // singleApi: 'http://api-test3.yohops.com:9999/' | ||
28 | 28 | ||
29 | - // favApi: 'http://192.168.102.31:8092/brower', | ||
30 | - // api: 'http://192.168.102.205:8080/gateway/', | ||
31 | - // service: 'http://192.168.102.205:8080/gateway/', | ||
32 | - // search: 'http://192.168.102.216:8080/yohosearch/' | 29 | + favApi: 'http://192.168.102.31:8092/brower', |
30 | + api: 'http://192.168.102.205:8080/gateway/', | ||
31 | + service: 'http://192.168.102.205:8080/gateway/', | ||
32 | + search: 'http://192.168.102.216:8080/yohosearch/' | ||
33 | 33 | ||
34 | // api: 'http://api.yoho.yohoops.org/', | 34 | // api: 'http://api.yoho.yohoops.org/', |
35 | // service: 'http://service.yoho.yohoops.org/', | 35 | // service: 'http://service.yoho.yohoops.org/', |
@@ -15,6 +15,8 @@ var cardDetail = { | @@ -15,6 +15,8 @@ var cardDetail = { | ||
15 | 15 | ||
16 | self.cardIdNo = $('.card-detail').data('cardId'); | 16 | self.cardIdNo = $('.card-detail').data('cardId'); |
17 | 17 | ||
18 | + $('body').attr('ontouchstart', true); | ||
19 | + | ||
18 | if (window.queryString.setMaster) { | 20 | if (window.queryString.setMaster) { |
19 | tip.show('切换成功!'); | 21 | tip.show('切换成功!'); |
20 | } | 22 | } |
@@ -37,7 +39,7 @@ var cardDetail = { | @@ -37,7 +39,7 @@ var cardDetail = { | ||
37 | url: '/home/installment/setMasterCard', | 39 | url: '/home/installment/setMasterCard', |
38 | errorText: '切换失败', | 40 | errorText: '切换失败', |
39 | successAction: function() { | 41 | successAction: function() { |
40 | - window.location.href = '/home/installment/card-detail?setMaster=true'; | 42 | + window.location.href = '/home/installment/card-detail?cardIdNo=' + window.queryString.cardIdNo + '&setMaster=true'; |
41 | } | 43 | } |
42 | }); | 44 | }); |
43 | }); | 45 | }); |
@@ -43,7 +43,10 @@ var installment = { | @@ -43,7 +43,10 @@ var installment = { | ||
43 | 43 | ||
44 | if (self.cookieTab && window.queryString.refresh) { | 44 | if (self.cookieTab && window.queryString.refresh) { |
45 | self.$tab.eq(self.cookieTab).addClass('on').siblings().removeClass('on'); | 45 | self.$tab.eq(self.cookieTab).addClass('on').siblings().removeClass('on'); |
46 | - self.$installmentCont.hide().eq(self.cookieTab).show(); | 46 | + self.$installmentCont.hide().eq(self.cookieTab).fadeIn(); |
47 | + } else { | ||
48 | + self.$tab.eq(0).addClass('on').siblings().removeClass('on'); | ||
49 | + self.$installmentCont.hide().eq(0).fadeIn(); | ||
47 | } | 50 | } |
48 | 51 | ||
49 | // 已开通tab 切换 | 52 | // 已开通tab 切换 |
@@ -148,7 +151,7 @@ var installment = { | @@ -148,7 +151,7 @@ var installment = { | ||
148 | $tab: $('.detail-tab span'), | 151 | $tab: $('.detail-tab span'), |
149 | $isOpen: $('.is-open'), | 152 | $isOpen: $('.is-open'), |
150 | $installmentCont: $('.installment-cont'), | 153 | $installmentCont: $('.installment-cont'), |
151 | - cookieTab: window.cookie('installmentTab') + 0, | 154 | + cookieTab: +window.cookie('installmentTab'), |
152 | starIScroll: '' | 155 | starIScroll: '' |
153 | }); | 156 | }); |
154 | }, | 157 | }, |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | padding: 30px 30px 0; | 3 | padding: 30px 30px 0; |
4 | } | 4 | } |
5 | 5 | ||
6 | - li { | 6 | + .card-nav { |
7 | width: 100%; | 7 | width: 100%; |
8 | height: 200px; | 8 | height: 200px; |
9 | margin-bottom: 30px; | 9 | margin-bottom: 30px; |
@@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
11 | background: #000; | 11 | background: #000; |
12 | border-radius: 10px; | 12 | border-radius: 10px; |
13 | background-size: contain; | 13 | background-size: contain; |
14 | + display: block; | ||
14 | 15 | ||
15 | span { | 16 | span { |
16 | position: absolute; | 17 | position: absolute; |
@@ -25,42 +26,52 @@ | @@ -25,42 +26,52 @@ | ||
25 | background: resolve("home/bank-icons/bank-ABC.png") no-repeat; | 26 | background: resolve("home/bank-icons/bank-ABC.png") no-repeat; |
26 | background-size: contain; | 27 | background-size: contain; |
27 | } | 28 | } |
29 | + | ||
28 | .card-bg-boc { | 30 | .card-bg-boc { |
29 | background: resolve("home/bank-icons/bank-BOC.png") no-repeat; | 31 | background: resolve("home/bank-icons/bank-BOC.png") no-repeat; |
30 | background-size: contain; | 32 | background-size: contain; |
31 | } | 33 | } |
34 | + | ||
32 | .card-bg-ccb { | 35 | .card-bg-ccb { |
33 | background: resolve("home/bank-icons/bank-CCB.png") no-repeat; | 36 | background: resolve("home/bank-icons/bank-CCB.png") no-repeat; |
34 | background-size: contain; | 37 | background-size: contain; |
35 | } | 38 | } |
39 | + | ||
36 | .card-bg-cgb { | 40 | .card-bg-cgb { |
37 | background: resolve("home/bank-icons/bank-CGB.png") no-repeat; | 41 | background: resolve("home/bank-icons/bank-CGB.png") no-repeat; |
38 | background-size: contain; | 42 | background-size: contain; |
39 | } | 43 | } |
44 | + | ||
40 | .card-bg-cib { | 45 | .card-bg-cib { |
41 | background: resolve("home/bank-icons/bank-CIB.png") no-repeat; | 46 | background: resolve("home/bank-icons/bank-CIB.png") no-repeat; |
42 | background-size: contain; | 47 | background-size: contain; |
43 | } | 48 | } |
49 | + | ||
44 | .card-bg-citic { | 50 | .card-bg-citic { |
45 | background: resolve("home/bank-icons/bank-CITIC.png") no-repeat; | 51 | background: resolve("home/bank-icons/bank-CITIC.png") no-repeat; |
46 | background-size: contain; | 52 | background-size: contain; |
47 | } | 53 | } |
54 | + | ||
48 | .card-bg-cmbc { | 55 | .card-bg-cmbc { |
49 | background: resolve("home/bank-icons/bank-CMBC.png") no-repeat; | 56 | background: resolve("home/bank-icons/bank-CMBC.png") no-repeat; |
50 | background-size: contain; | 57 | background-size: contain; |
51 | } | 58 | } |
59 | + | ||
52 | .card-bg-ceb { | 60 | .card-bg-ceb { |
53 | background: resolve("home/bank-icons/bank-CEB.png") no-repeat; | 61 | background: resolve("home/bank-icons/bank-CEB.png") no-repeat; |
54 | background-size: contain; | 62 | background-size: contain; |
55 | } | 63 | } |
64 | + | ||
56 | .card-bg-icbc { | 65 | .card-bg-icbc { |
57 | background: resolve("home/bank-icons/bank-ICBC.png") no-repeat; | 66 | background: resolve("home/bank-icons/bank-ICBC.png") no-repeat; |
58 | background-size: contain; | 67 | background-size: contain; |
59 | } | 68 | } |
69 | + | ||
60 | .card-bg-payh { | 70 | .card-bg-payh { |
61 | background: resolve("home/bank-icons/bank-PAYH.png") no-repeat; | 71 | background: resolve("home/bank-icons/bank-PAYH.png") no-repeat; |
62 | background-size: contain; | 72 | background-size: contain; |
63 | } | 73 | } |
74 | + | ||
64 | .card-bg-psbc { | 75 | .card-bg-psbc { |
65 | background: resolve("home/bank-icons/bank-PSBC.png") no-repeat; | 76 | background: resolve("home/bank-icons/bank-PSBC.png") no-repeat; |
66 | background-size: contain; | 77 | background-size: contain; |
@@ -138,9 +138,18 @@ | @@ -138,9 +138,18 @@ | ||
138 | margin-right: 30px; | 138 | margin-right: 30px; |
139 | } | 139 | } |
140 | 140 | ||
141 | + .relieve-btn:active { | ||
142 | + background: #dedede; | ||
143 | + border: 1px solid #adadad; | ||
144 | + } | ||
145 | + | ||
141 | .change-btn { | 146 | .change-btn { |
142 | background: #444; | 147 | background: #444; |
143 | color: #fff; | 148 | color: #fff; |
144 | } | 149 | } |
150 | + | ||
151 | + .change-btn:active { | ||
152 | + background: #2b2b2b; | ||
153 | + } | ||
145 | } | 154 | } |
146 | } | 155 | } |
-
Please register or login to post a comment