Authored by 陈峰

Merge branch 'gray' into 'master'

Gray



See merge request !194
... ... @@ -241,7 +241,9 @@ const formatCartGoods = (cartGoods, isAdvanceCart, inValid, isOffShelves, analys
* 购物车统计
*/
const formatShoppingCartData = (sc) => {
if (!sc) {
return {};
}
return {
discountAmount: sc.discount_amount, // 活动价
fastShoppingCost: sc.fast_shopping_cost,
... ...
... ... @@ -34,7 +34,7 @@ module.exports = class extends global.yoho.BaseModel {
if (info) {
Object.assign(resData, {
yoho_coin: info.yoho_coin.toFixed(2),
yoho_coin: info.yoho_coin ? info.yoho_coin.toFixed(2) : 0,
use_yoho_coin: info.use_yoho_coin,
total_yoho_coin_num: info.total_yoho_coin_num,
yoho_coin_pay_rule: info.yoho_coin_pay_rule,
... ...
... ... @@ -190,7 +190,7 @@ module.exports = class favorite extends global.yoho.BaseModel {
page = page > pageTotal ? pageTotal : page;
result.goods = that.getGoodsInfo(productList, page, limit);
result.pager = pager(total, Object.assign(query, {hasCheckAll: true}));
result.pager = pager(total, Object.assign({}, query, {hasCheckAll: true}));
return result;
})();
... ...
... ... @@ -311,7 +311,7 @@ module.exports = class extends global.yoho.BaseModel {
],
certifiedName: +isStudent ? '学生身份已验证' : '身份验证',
certifiedUrl: helpers.urlFormat('/product/students/'),
latestOrders: Object.assign(indexData.recentOrder, {cancelReason: indexData.reason})
latestOrders: Object.assign({}, indexData.recentOrder, {cancelReason: indexData.reason})
},
banner: indexData.footerBanner
}
... ...
... ... @@ -822,7 +822,7 @@ module.exports = class extends global.yoho.BaseModel {
detail.orderInfo = {
receiver: orderDetail.user_name,
address: orderDetail.area + orderDetail.address,
phone: _.fill(orderDetail.mobile.split(''), '*', 3, 4).join('') +
phone: _.fill((orderDetail.mobile ? orderDetail.mobile.split('') : ''), '*', 3, 4).join('') +
(orderDetail.phone ? ',' + _.fill(orderDetail.phone.split(''), '*', 3, 5).join('') : '')
};
... ...
... ... @@ -1007,7 +1007,7 @@ function _getCoupon(coupons) {
let pickProp = Fn.pick(['couponName', 'amount', 'couponId', 'acquireStatus', 'rule4ShortName']);
let encodeId = Fn.update('couponId', (cid) => crypto.encryption(null, cid + ''));
let replace = Fn.update('rule4ShortName', (r) => r.replace(/¥/g, '));
let replace = Fn.update('rule4ShortName', (r) => (r ? r.replace(/¥/g, '¥') : ''));
return Fn.map(Fn.pipe(pickProp, encodeId, replace))(couponList);
}
... ...
... ... @@ -209,7 +209,7 @@ class FilterTools {
const condition = {};
if (k === 'price') {
if (filter.priceRange[params.price]) {
if (filter.priceRange && filter.priceRange[params.price]) {
condition.name = filter.priceRange[params.price].replace('¥', '¥');
} else {
const prices = _.split(params.price, ',');
... ...