Authored by yyq

Merge branch 'release/1.0' of git.yoho.cn:fe/yoho-blk into release/1.0

{{# classicBrands}}
<div class="brand-img-box {{#if right}}right{{/if}} {{#if bottomSpace}}mb10{{/if}}">
<a href="{{url}}">
<a href="{{url}}" target="_blank">
{{# big}}
<img class="big-img lazy-img" data-original="{{image src 565 340}}" alt="big-img">
{{/ big}}
... ...
... ... @@ -43,6 +43,7 @@ const btnMap = {
classStr: 'btn white cancel-btn mr'
},
{
isEditBtn: true,
name: '修改订单',
classStr: 'btn white edit-btn'
}
... ... @@ -518,6 +519,12 @@ const getOrderDetail = (uid, code) => {
}
});
if (detail.canUpdateDeliveryAddress === 'N') {
_.remove(detail.btns, btn => {
return btn.isEditBtn;
});
}
if (parseInt(detail.paymentType, 10) === 2 &&
(statusMap[st].valueStr === '备货中' ||
detail.statusStr === '备货中')) {
... ...
... ... @@ -87,15 +87,24 @@ const helpers = {
* 男女条件
* @returns {*[]}
*/
genders() {
return [
{
name: '男士',
value: '1,3'
}, {
name: '女士',
value: '2,3'
}];
genders(gender) {
if (gender) {
return Object.keys(gender).map(g => {
return {
name: gender[g],
value: g
};
});
} else {
return [
{
name: '男士',
value: '1,3'
}, {
name: '女士',
value: '2,3'
}];
}
},
/**
... ... @@ -216,7 +225,7 @@ const helpers = {
filterHandle(filter, q) {
let priceRange = filter.priceRange;
let sizeInfo = filter.size;
let genders = this.genders();
let genders = this.genders(filter.gender);
let brands = filter.brand;
let colors = this.colorConvert(filter.color);
let sorts = filter.groupSort;
... ... @@ -234,20 +243,20 @@ const helpers = {
});
if (sorts) {
// singleSort = true;
//
// if (sorts[0].sub && sorts[0].sub.length === 1) {
// sorts[0].sub[0].checked = true;
// }
//
// if (q.misort) {
// sorts[0].sub.forEach(s => {
// s.checked = s.categoryId === q.misort;
// });
// }
//
// sorts = sorts[0].sub;
// } else if (sorts && sorts.length > 1) {
// singleSort = true;
//
// if (sorts[0].sub && sorts[0].sub.length === 1) {
// sorts[0].sub[0].checked = true;
// }
//
// if (q.misort) {
// sorts[0].sub.forEach(s => {
// s.checked = s.categoryId === q.misort;
// });
// }
//
// sorts = sorts[0].sub;
// } else if (sorts && sorts.length > 1) {
_.forEach(sorts, s => {
s.sub.unshift({
... ...
... ... @@ -74,7 +74,7 @@
<div class="brand-list nano">
<div class="nano-content">
{{#each brandData}}
<div class="input-radio {{#if checked}}default-check{{/if}}" data-value="{{id}}">
<div class="input-radio {{#if checked}}default-check{{/if}}" data-value="{{id}}" data-word="{{brandAlif}}">
{{> icon/radio}}
{{#if brandNameEn}}
<label>{{brandNameEn}}</label>
... ...
... ... @@ -85,7 +85,7 @@ const callback = (req, res) => {
cost: data.pay,
orderNum: data.orderCode,
onlineCost: data.pay,
orderHref: helpers.urlFormat('/me/order/detail', {code: data.orderCode}),
orderHref: helpers.urlFormat('/me/order/detail', {orderCode: data.orderCode}),
walkHref: helpers.urlFormat('/')
}
});
... ...
... ... @@ -338,16 +338,18 @@ var YohoListPage = {
},
filterBrand: function(letter) {
$('.yoho-product-list .brand-list .input-radio').each(function() {
if (letter === '0-9') {
var first = $('label', this).text().toLowerCase().charAt(0); // eslint-disable-line
var first = $(this).data('word').toString(); // eslint-disable-line
first = first.toLowerCase();
if (letter === '0-9') {
console.log(first);
if ((first >= 'a' && first <= 'z') || (first >= 'A' && first <= 'Z')) {
$(this).hide();
} else {
$(this).show();
}
} else {
if ($('label', this).text().toLowerCase().indexOf(letter) === 0) {
if (!letter || first === letter) {
$(this).show();
} else {
$(this).hide();
... ...
... ... @@ -22,7 +22,19 @@ var removedProsInfo = [];
var removedGoodsTpl = require('../../../tpl/shopping/removed-goods.hbs');
var editTpl = require('../../../tpl/shopping/edit-color-size.hbs');
var Cart = {
var Cart;
require('yoho-jquery-dotdotdot');
function dotName() {
// product name dotdotdot
$('.pro-name a').dotdotdot({
wrap: 'letter'
});
}
Cart = {
/*
* 添加到购物车
* @function [addToCart]
... ... @@ -111,6 +123,8 @@ var Cart = {
success: function(res) {
Util.refreshCart(res, function() {
Stepper.init();
dotName();
if (callback) {
return callback();
}
... ... @@ -134,6 +148,7 @@ var Cart = {
if (res.code === 200) {
Util.refreshCart(res, function() {
Stepper.init();
dotName();
});
} else {
new _alert(res.message).show();
... ... @@ -204,6 +219,7 @@ var Cart = {
success: function(res) {
Util.refreshCart(res, function() {
Stepper.init();
dotName();
// 显示或者更新删除商品模块
Cart.showRemovedProducts(products, extraInfos);
... ... @@ -298,6 +314,8 @@ var Cart = {
success: function(res) {
Util.refreshCart(res, function() {
Stepper.init();
dotName();
if (callback) {
return callback();
}
... ... @@ -316,6 +334,7 @@ var Cart = {
success: function(res) {
Util.refreshCart(res, function() {
Stepper.init();
dotName();
});
}
});
... ... @@ -445,6 +464,9 @@ var Cart = {
},
fail: function() {
new _alert('此商品无法编辑颜色和尺寸').show();
},
complete: function() {
setEditable();
}
});
... ... @@ -471,11 +493,6 @@ var Cart = {
}
};
require('yoho-jquery-dotdotdot');
// product name dotdotdot
$('.pro-name a').dotdotdot({
wrap: 'letter'
});
dotName();
module.exports = Cart;
... ...