Authored by 姜敏

yoho币兼容问题修复,收货地址样式修复

@@ -57,7 +57,7 @@ const getNav = (id)=> { @@ -57,7 +57,7 @@ const getNav = (id)=> {
57 /** 57 /**
58 * 主界面 58 * 主界面
59 */ 59 */
60 -const index = (req, res,next) => { 60 +const index = (req, res, next) => {
61 let id = req.query.id || '11'; 61 let id = req.query.id || '11';
62 62
63 helpModel.getHelpDetail('81', 1, 15, '').then(result=> { 63 helpModel.getHelpDetail('81', 1, 15, '').then(result=> {
@@ -73,7 +73,7 @@ const index = (req, res,next) => { @@ -73,7 +73,7 @@ const index = (req, res,next) => {
73 } 73 }
74 ]; 74 ];
75 75
76 - if (!(typeof (getNav(id)) === "undefined")) { 76 + if (!(typeof (getNav(id)) === 'undefined')) {
77 nav = nav.concat(getNav(id)); 77 nav = nav.concat(getNav(id));
78 } 78 }
79 res.display('detail', { 79 res.display('detail', {
@@ -19,14 +19,14 @@ const currencyModel = require('../models/currency'); @@ -19,14 +19,14 @@ const currencyModel = require('../models/currency');
19 const getTime = (time, a)=> { 19 const getTime = (time, a)=> {
20 let newDate = new Date(time.getFullYear(), time.getMonth() + 1, time.getDate() - 30 * a); 20 let newDate = new Date(time.getFullYear(), time.getMonth() + 1, time.getDate() - 30 * a);
21 21
22 - return newDate.getFullYear() + "-" + newDate.getMonth() + "-" + newDate.getDate(); 22 + return newDate.getFullYear() + '-' + newDate.getMonth() + '-' + newDate.getDate();
23 }; 23 };
24 24
25 /** 25 /**
26 * yoho币页面加载 26 * yoho币页面加载
27 */ 27 */
28 const index = (req, res, next) => { 28 const index = (req, res, next) => {
29 - let uid = req.user.uid ; 29 + let uid = req.user.uid;
30 let page = parseInt(req.query.page, 10) || 1; 30 let page = parseInt(req.query.page, 10) || 1;
31 let queryType = parseInt(req.query.queryType, 10) || 0; 31 let queryType = parseInt(req.query.queryType, 10) || 0;
32 let beginTime = req.query.beginTime || getTime(new Date(), 3); 32 let beginTime = req.query.beginTime || getTime(new Date(), 3);
@@ -36,7 +36,7 @@ const index = (req, res, next) => { @@ -36,7 +36,7 @@ const index = (req, res, next) => {
36 36
37 currencyModel.getIndexData(uid, page, queryType, beginTime).then(result=> { 37 currencyModel.getIndexData(uid, page, queryType, beginTime).then(result=> {
38 result.list.tabs[queryType].isActive = true; 38 result.list.tabs[queryType].isActive = true;
39 - result.list.coinList.forEach(function (x) { 39 + result.list.coinList.forEach(function(x) {
40 x.date = x.date.replace(/\-/g, '.'); 40 x.date = x.date.replace(/\-/g, '.');
41 }); 41 });
42 result.list.selects[selectIndex > 2 ? 2 : selectIndex].isSelected = 'selected'; 42 result.list.selects[selectIndex > 2 ? 2 : selectIndex].isSelected = 'selected';
@@ -367,7 +367,7 @@ function getfilePath(req, res, next) { @@ -367,7 +367,7 @@ function getfilePath(req, res, next) {
367 367
368 req.filePath = filePath; 368 req.filePath = filePath;
369 req.pipe(uploadStream); 369 req.pipe(uploadStream);
370 - uploadStream.on('finish', function () { 370 + uploadStream.on('finish', function() {
371 next(); 371 next();
372 }); 372 });
373 } 373 }
@@ -25,7 +25,7 @@ require('yoho-jquery-placeholder'); @@ -25,7 +25,7 @@ require('yoho-jquery-placeholder');
25 25
26 $('[placeholder]').placeholder(); 26 $('[placeholder]').placeholder();
27 27
28 -$(function () { 28 +$(function() {
29 var address = cascadingAddress({el: '#address'}); 29 var address = cascadingAddress({el: '#address'});
30 30
31 /** 31 /**
@@ -33,7 +33,7 @@ $(function () { @@ -33,7 +33,7 @@ $(function () {
33 */ 33 */
34 var Bll = { 34 var Bll = {
35 // 获取输入框输入的值 35 // 获取输入框输入的值
36 - getInfo: function () { 36 + getInfo: function() {
37 37
38 return { 38 return {
39 id: $addressId.val(), 39 id: $addressId.val(),
@@ -45,7 +45,7 @@ $(function () { @@ -45,7 +45,7 @@ $(function () {
45 }, 45 },
46 46
47 // 清空输入框 47 // 清空输入框
48 - clearInput: function () { 48 + clearInput: function() {
49 $consignee.val(''); 49 $consignee.val('');
50 $address.val(''); 50 $address.val('');
51 $mobile.val(''); 51 $mobile.val('');
@@ -54,7 +54,7 @@ $(function () { @@ -54,7 +54,7 @@ $(function () {
54 }, 54 },
55 55
56 // 校验 56 // 校验
57 - check: function (info) { 57 + check: function(info) {
58 var flag = true; 58 var flag = true;
59 59
60 info.consignee === '' ? $consignee.next().show() : $consignee.next().hide(); 60 info.consignee === '' ? $consignee.next().show() : $consignee.next().hide();
@@ -72,7 +72,7 @@ $(function () { @@ -72,7 +72,7 @@ $(function () {
72 }, 72 },
73 73
74 // 拼接一条数据的html 74 // 拼接一条数据的html
75 - getHtml: function (info) { 75 + getHtml: function(info) {
76 var html = '<tr class="table-body">'; 76 var html = '<tr class="table-body">';
77 77
78 html += '<input type="hidden" id="tr_' + info.address_id + '" value="' + info.address_id + '">' + 78 html += '<input type="hidden" id="tr_' + info.address_id + '" value="' + info.address_id + '">' +
@@ -90,7 +90,7 @@ $(function () { @@ -90,7 +90,7 @@ $(function () {
90 }, 90 },
91 91
92 // 获取一条数据 92 // 获取一条数据
93 - setInfo: function (id, td) { 93 + setInfo: function(id, td) {
94 $addressId.val(id); 94 $addressId.val(id);
95 $consignee.val(td.eq(0).text()); 95 $consignee.val(td.eq(0).text());
96 $address.val(td.eq(2).text()); 96 $address.val(td.eq(2).text());
@@ -99,7 +99,7 @@ $(function () { @@ -99,7 +99,7 @@ $(function () {
99 }, 99 },
100 100
101 // 设置表格头部 101 // 设置表格头部
102 - setTableTile: function () { 102 + setTableTile: function() {
103 $('.table-title').text('已保存了' + currentLength + 103 $('.table-title').text('已保存了' + currentLength +
104 '条地址,还能保存' + leftLength + '条地址'); 104 '条地址,还能保存' + leftLength + '条地址');
105 } 105 }
@@ -107,7 +107,7 @@ $(function () { @@ -107,7 +107,7 @@ $(function () {
107 107
108 108
109 // 保存收货地址 109 // 保存收货地址
110 - $(document).on('click', '#save-address', function () { 110 + $(document).on('click', '#save-address', function() {
111 var info, 111 var info,
112 area, 112 area,
113 areaInfo; 113 areaInfo;
@@ -132,7 +132,7 @@ $(function () { @@ -132,7 +132,7 @@ $(function () {
132 url: '/me/address/add', 132 url: '/me/address/add',
133 dataType: 'json', 133 dataType: 'json',
134 data: info, 134 data: info,
135 - success: function (data) { 135 + success: function(data) {
136 var html; 136 var html;
137 137
138 if (data.code === 200) { 138 if (data.code === 200) {
@@ -154,7 +154,7 @@ $(function () { @@ -154,7 +154,7 @@ $(function () {
154 url: '/me/address/update', 154 url: '/me/address/update',
155 dataType: 'json', 155 dataType: 'json',
156 data: info, 156 data: info,
157 - success: function (data) { 157 + success: function(data) {
158 if (data.code === 200) { 158 if (data.code === 200) {
159 info.mobile = info.mobile.substring(0, 3) + '****' + info.mobile.substring(7, 11); 159 info.mobile = info.mobile.substring(0, 3) + '****' + info.mobile.substring(7, 11);
160 info.address_id = info.id; 160 info.address_id = info.id;
@@ -171,7 +171,7 @@ $(function () { @@ -171,7 +171,7 @@ $(function () {
171 }); 171 });
172 172
173 // 修改收货地址 173 // 修改收货地址
174 - $(document).on('click', '.update-address', function () { 174 + $(document).on('click', '.update-address', function() {
175 var id = $(this).data('id'); 175 var id = $(this).data('id');
176 var tr = $(this).parents('.table-body'); 176 var tr = $(this).parents('.table-body');
177 var td = tr.find('td'); 177 var td = tr.find('td');
@@ -185,13 +185,13 @@ $(function () { @@ -185,13 +185,13 @@ $(function () {
185 }); 185 });
186 186
187 // 删除收货地址 187 // 删除收货地址
188 - $(document).on('click', '.del-address', function () { 188 + $(document).on('click', '.del-address', function() {
189 var id = $(this).data('id'); 189 var id = $(this).data('id');
190 var tr = $(this).parents('.table-body'); 190 var tr = $(this).parents('.table-body');
191 191
192 var a = new _confirm({ 192 var a = new _confirm({
193 content: '您确定要删除收货地址吗?', 193 content: '您确定要删除收货地址吗?',
194 - cb: function () { 194 + cb: function() {
195 $.ajax({ 195 $.ajax({
196 type: 'POST', 196 type: 'POST',
197 url: '/me/address/del', 197 url: '/me/address/del',
@@ -199,7 +199,7 @@ $(function () { @@ -199,7 +199,7 @@ $(function () {
199 data: { 199 data: {
200 id: id 200 id: id
201 }, 201 },
202 - success: function () { 202 + success: function() {
203 currentLength--; 203 currentLength--;
204 leftLength++; 204 leftLength++;
205 tr.remove(); 205 tr.remove();
@@ -214,7 +214,7 @@ $(function () { @@ -214,7 +214,7 @@ $(function () {
214 }); 214 });
215 215
216 // 设置默认收货地址 216 // 设置默认收货地址
217 - $(document).on('click', '.set-default', function () { 217 + $(document).on('click', '.set-default', function() {
218 var tr = $(this).parents('.table-body'); 218 var tr = $(this).parents('.table-body');
219 var tbody = tr.parent(); 219 var tbody = tr.parent();
220 var id = $(this).data('id'); 220 var id = $(this).data('id');
@@ -227,7 +227,7 @@ $(function () { @@ -227,7 +227,7 @@ $(function () {
227 data: { 227 data: {
228 id: id 228 id: id
229 }, 229 },
230 - success: function () { 230 + success: function() {
231 $('.current-default').removeClass('current-default').text('设为默认'); 231 $('.current-default').removeClass('current-default').text('设为默认');
232 $(self).addClass('current-default').text('默认地址'); 232 $(self).addClass('current-default').text('默认地址');
233 tbody.find('.table-body').eq(0).before('<tr class=\'table-body\'>' + tr.html() + '</tr>'); 233 tbody.find('.table-body').eq(0).before('<tr class=\'table-body\'>' + tr.html() + '</tr>');
@@ -8,12 +8,14 @@ var type = 0; @@ -8,12 +8,14 @@ var type = 0;
8 var page = 1; 8 var page = 1;
9 var Bll = { 9 var Bll = {
10 // 获取路由中的请求参数 10 // 获取路由中的请求参数
11 - getQueryString: function () { 11 + getQueryString: function() {
12 var queryArr = location.search.substr(1).split('&'); 12 var queryArr = location.search.substr(1).split('&');
13 var query = {}; 13 var query = {};
  14 + var i;
  15 + var arr = [];
14 16
15 - for (var i = 0; i < queryArr.length; i++) {  
16 - var arr = queryArr[i].split('='); 17 + for (i = 0; i < queryArr.length; i++) {
  18 + arr = queryArr[i].split('=');
17 19
18 query[arr[0]] = arr[1]; 20 query[arr[0]] = arr[1];
19 } 21 }
@@ -24,15 +26,15 @@ var Bll = { @@ -24,15 +26,15 @@ var Bll = {
24 paying: 1, 26 paying: 1,
25 delivering: 2 27 delivering: 2
26 }, 28 },
27 - getDataList: function (type1, page1, beginTime1) { 29 + getDataList: function(type1, page1, beginTime1) {
28 var query = ['page=' + page1, 'queryType=' + type1, 'beginTime=' + beginTime1]; 30 var query = ['page=' + page1, 'queryType=' + type1, 'beginTime=' + beginTime1];
29 31
30 location.search = query.join('&'); 32 location.search = query.join('&');
31 }, 33 },
32 - getTime: function (time, a) { 34 + getTime: function(time, a) {
33 var newDate = new Date(time.getFullYear(), time.getMonth() + 1, time.getDate() - 30 * a); 35 var newDate = new Date(time.getFullYear(), time.getMonth() + 1, time.getDate() - 30 * a);
34 36
35 - return newDate.getFullYear() + "-" + newDate.getMonth() + "-" + newDate.getDate(); 37 + return newDate.getFullYear() + '-' + newDate.getMonth() + '-' + newDate.getDate();
36 } 38 }
37 }; 39 };
38 var beginTime = Bll.getTime(new Date(), 3); 40 var beginTime = Bll.getTime(new Date(), 3);
@@ -40,7 +42,7 @@ var beginTime = Bll.getTime(new Date(), 3); @@ -40,7 +42,7 @@ var beginTime = Bll.getTime(new Date(), 3);
40 require('./me'); 42 require('./me');
41 43
42 // tab切换 44 // tab切换
43 -$('.tabs li').on('click', function () { 45 +$('.tabs li').on('click', function() {
44 var $this = $(this); 46 var $this = $(this);
45 47
46 type = Bll.typeMap[$this.data('type')]; 48 type = Bll.typeMap[$this.data('type')];
@@ -56,7 +58,7 @@ $('.tabs li').on('click', function () { @@ -56,7 +58,7 @@ $('.tabs li').on('click', function () {
56 }); 58 });
57 59
58 // 时间控件切换 60 // 时间控件切换
59 -$('#begin-time').on('change', function () { 61 +$('#begin-time').on('change', function() {
60 var months = parseInt($(this).val(), 10); 62 var months = parseInt($(this).val(), 10);
61 63
62 type = Bll.getQueryString().queryType || 1; 64 type = Bll.getQueryString().queryType || 1;