Authored by 姜敏

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

... ... @@ -57,7 +57,7 @@ const getNav = (id)=> {
/**
* 主界面
*/
const index = (req, res,next) => {
const index = (req, res, next) => {
let id = req.query.id || '11';
helpModel.getHelpDetail('81', 1, 15, '').then(result=> {
... ... @@ -73,7 +73,7 @@ const index = (req, res,next) => {
}
];
if (!(typeof (getNav(id)) === "undefined")) {
if (!(typeof (getNav(id)) === 'undefined')) {
nav = nav.concat(getNav(id));
}
res.display('detail', {
... ...
... ... @@ -19,14 +19,14 @@ const currencyModel = require('../models/currency');
const getTime = (time, a)=> {
let newDate = new Date(time.getFullYear(), time.getMonth() + 1, time.getDate() - 30 * a);
return newDate.getFullYear() + "-" + newDate.getMonth() + "-" + newDate.getDate();
return newDate.getFullYear() + '-' + newDate.getMonth() + '-' + newDate.getDate();
};
/**
* yoho币页面加载
*/
const index = (req, res, next) => {
let uid = req.user.uid ;
let uid = req.user.uid;
let page = parseInt(req.query.page, 10) || 1;
let queryType = parseInt(req.query.queryType, 10) || 0;
let beginTime = req.query.beginTime || getTime(new Date(), 3);
... ... @@ -36,7 +36,7 @@ const index = (req, res, next) => {
currencyModel.getIndexData(uid, page, queryType, beginTime).then(result=> {
result.list.tabs[queryType].isActive = true;
result.list.coinList.forEach(function (x) {
result.list.coinList.forEach(function(x) {
x.date = x.date.replace(/\-/g, '.');
});
result.list.selects[selectIndex > 2 ? 2 : selectIndex].isSelected = 'selected';
... ...
... ... @@ -367,7 +367,7 @@ function getfilePath(req, res, next) {
req.filePath = filePath;
req.pipe(uploadStream);
uploadStream.on('finish', function () {
uploadStream.on('finish', function() {
next();
});
}
... ...
... ... @@ -25,7 +25,7 @@ require('yoho-jquery-placeholder');
$('[placeholder]').placeholder();
$(function () {
$(function() {
var address = cascadingAddress({el: '#address'});
/**
... ... @@ -33,7 +33,7 @@ $(function () {
*/
var Bll = {
// 获取输入框输入的值
getInfo: function () {
getInfo: function() {
return {
id: $addressId.val(),
... ... @@ -45,7 +45,7 @@ $(function () {
},
// 清空输入框
clearInput: function () {
clearInput: function() {
$consignee.val('');
$address.val('');
$mobile.val('');
... ... @@ -54,7 +54,7 @@ $(function () {
},
// 校验
check: function (info) {
check: function(info) {
var flag = true;
info.consignee === '' ? $consignee.next().show() : $consignee.next().hide();
... ... @@ -72,7 +72,7 @@ $(function () {
},
// 拼接一条数据的html
getHtml: function (info) {
getHtml: function(info) {
var html = '<tr class="table-body">';
html += '<input type="hidden" id="tr_' + info.address_id + '" value="' + info.address_id + '">' +
... ... @@ -90,7 +90,7 @@ $(function () {
},
// 获取一条数据
setInfo: function (id, td) {
setInfo: function(id, td) {
$addressId.val(id);
$consignee.val(td.eq(0).text());
$address.val(td.eq(2).text());
... ... @@ -99,7 +99,7 @@ $(function () {
},
// 设置表格头部
setTableTile: function () {
setTableTile: function() {
$('.table-title').text('已保存了' + currentLength +
'条地址,还能保存' + leftLength + '条地址');
}
... ... @@ -107,7 +107,7 @@ $(function () {
// 保存收货地址
$(document).on('click', '#save-address', function () {
$(document).on('click', '#save-address', function() {
var info,
area,
areaInfo;
... ... @@ -132,7 +132,7 @@ $(function () {
url: '/me/address/add',
dataType: 'json',
data: info,
success: function (data) {
success: function(data) {
var html;
if (data.code === 200) {
... ... @@ -154,7 +154,7 @@ $(function () {
url: '/me/address/update',
dataType: 'json',
data: info,
success: function (data) {
success: function(data) {
if (data.code === 200) {
info.mobile = info.mobile.substring(0, 3) + '****' + info.mobile.substring(7, 11);
info.address_id = info.id;
... ... @@ -171,7 +171,7 @@ $(function () {
});
// 修改收货地址
$(document).on('click', '.update-address', function () {
$(document).on('click', '.update-address', function() {
var id = $(this).data('id');
var tr = $(this).parents('.table-body');
var td = tr.find('td');
... ... @@ -185,13 +185,13 @@ $(function () {
});
// 删除收货地址
$(document).on('click', '.del-address', function () {
$(document).on('click', '.del-address', function() {
var id = $(this).data('id');
var tr = $(this).parents('.table-body');
var a = new _confirm({
content: '您确定要删除收货地址吗?',
cb: function () {
cb: function() {
$.ajax({
type: 'POST',
url: '/me/address/del',
... ... @@ -199,7 +199,7 @@ $(function () {
data: {
id: id
},
success: function () {
success: function() {
currentLength--;
leftLength++;
tr.remove();
... ... @@ -214,7 +214,7 @@ $(function () {
});
// 设置默认收货地址
$(document).on('click', '.set-default', function () {
$(document).on('click', '.set-default', function() {
var tr = $(this).parents('.table-body');
var tbody = tr.parent();
var id = $(this).data('id');
... ... @@ -227,7 +227,7 @@ $(function () {
data: {
id: id
},
success: function () {
success: function() {
$('.current-default').removeClass('current-default').text('设为默认');
$(self).addClass('current-default').text('默认地址');
tbody.find('.table-body').eq(0).before('<tr class=\'table-body\'>' + tr.html() + '</tr>');
... ...
... ... @@ -8,12 +8,14 @@ var type = 0;
var page = 1;
var Bll = {
// 获取路由中的请求参数
getQueryString: function () {
getQueryString: function() {
var queryArr = location.search.substr(1).split('&');
var query = {};
var i;
var arr = [];
for (var i = 0; i < queryArr.length; i++) {
var arr = queryArr[i].split('=');
for (i = 0; i < queryArr.length; i++) {
arr = queryArr[i].split('=');
query[arr[0]] = arr[1];
}
... ... @@ -24,15 +26,15 @@ var Bll = {
paying: 1,
delivering: 2
},
getDataList: function (type1, page1, beginTime1) {
getDataList: function(type1, page1, beginTime1) {
var query = ['page=' + page1, 'queryType=' + type1, 'beginTime=' + beginTime1];
location.search = query.join('&');
},
getTime: function (time, a) {
getTime: function(time, a) {
var newDate = new Date(time.getFullYear(), time.getMonth() + 1, time.getDate() - 30 * a);
return newDate.getFullYear() + "-" + newDate.getMonth() + "-" + newDate.getDate();
return newDate.getFullYear() + '-' + newDate.getMonth() + '-' + newDate.getDate();
}
};
var beginTime = Bll.getTime(new Date(), 3);
... ... @@ -40,7 +42,7 @@ var beginTime = Bll.getTime(new Date(), 3);
require('./me');
// tab切换
$('.tabs li').on('click', function () {
$('.tabs li').on('click', function() {
var $this = $(this);
type = Bll.typeMap[$this.data('type')];
... ... @@ -56,7 +58,7 @@ $('.tabs li').on('click', function () {
});
// 时间控件切换
$('#begin-time').on('change', function () {
$('#begin-time').on('change', function() {
var months = parseInt($(this).val(), 10);
type = Bll.getQueryString().queryType || 1;
... ...