Authored by yyq

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

... ... @@ -54,7 +54,7 @@ const list = {
queryParams: q
};
res.display('list', _.assign(retData, {
products: DataHelper.handleProductList(data.productList),
products: DataHelper.handleProductList(data.productList, q),
order: q.order
}));
} else {
... ... @@ -108,7 +108,7 @@ const list = {
queryParams: q
};
res.display('newList', _.assign(retData, {
products: DataHelper.handleProductList(data.productList),
products: DataHelper.handleProductList(data.productList, q),
order: q.order
}));
} else {
... ...
... ... @@ -60,7 +60,7 @@ const Query = {
queryParams: q
};
res.display('list', _.assign(retData, {
products: DataHelper.handleProductList(data.productList),
products: DataHelper.handleProductList(data.productList, q),
order: q.order
}));
} else {
... ...
... ... @@ -144,7 +144,7 @@ const shop = {
};
res.display('shop-list', _.assign(data, {
products: DataHelper.handleProductList(ret.productList),
products: DataHelper.handleProductList(ret.productList, q),
order: q.order
}));
} else {
... ...
... ... @@ -44,6 +44,45 @@ const helpers = {
return letters;
},
getLettersFromBrand(brands, numberIndex) {
numberIndex = numberIndex || 0;
let letters = new Set();
let other = false;
_.forEach(brands, (b) => {
let name = b.brandNameEn || b.brandName;
let char = name.toLowerCase().charAt(0);
if ((char >= 'a' && char <= 'z') || (char >= 'A' && char <= 'Z')) {
letters.add(char);
} else {
other = true;
}
});
letters = Array.from(letters).sort().map(s => {
return {
letter: s.toUpperCase(),
selected: false
};
});
if (other && numberIndex === -1) {
letters.push({
letter: '0-9',
selected: false
});
} else if (other && numberIndex === 0) {
letters.unshift({
letter: '0-9',
selected: false
});
}
return letters;
},
/**
* 男女条件
* @returns {*[]}
... ... @@ -280,7 +319,7 @@ const helpers = {
priceRange: priceRange,
filters: filters,
showFilters: filters.length > 0,
letters: this.brandLetters(),
letters: this.getLettersFromBrand(brands),
customPriceLow: customPriceLow,
customPriceHigh: customPriceHigh,
showSize: showSize,
... ... @@ -294,20 +333,27 @@ const helpers = {
* @param list
* @returns {*}
*/
handleProductList(list) {
handleProductList(list, q) {
if (_.isArray(list)) {
list.forEach(g => {
let goodsList = g.goodsList;
let defaultImages = g.defaultImages;
let goodsId;
console.log(g);
if (goodsList && goodsList.length > 0) {
goodsId = goodsList[0].goodsId;
goodsList.forEach(o => {
o.url = `${config.siteUrl}/product/pro_${g.productId}_${o.goodsId}/${o.cnAlphabet}.html`;
if (q.color && q.color === o.colorId) {
defaultImages = o.imagesUrl;
}
});
}
g.salesPrice = g.salesPrice || g.marketPrice;
g.defaultImages = defaultImages;
if (g.salesPrice === g.marketPrice) {
delete g.marketPrice;
}
... ...
... ... @@ -25,7 +25,7 @@ const Alipay = {
partner: payParams.merchant_id,
_input_charset: 'utf-8',
notify_url: config.pay.serviceNotify + 'payment/alipay_notify',
return_url: helpers.urlFormat('/shopping/pay/callback/alipay'),
return_url: 'http:' + helpers.urlFormat('/shopping/pay/callback/alipay'),
subject: '有货订单号:' + order.orderId,
out_trade_no: order.orderCode,
it_b_pay: common.getPayExpireMin(order.payExpire) + 'm',
... ...
... ... @@ -49,7 +49,7 @@ const updateOrderPayBank = (code, payment, bankCode) => {
const sendPayConfirm = (code, payment, uid) => {
return api.get('', {
method: 'app.SpaceOrders.payConfirm',
orderCode: code,
order_code: code,
payment_id: payment,
uid: uid
});
... ...
... ... @@ -18,7 +18,7 @@ const logger = global.yoho.logger;
const _ = require('lodash');
const payments = {
alipay: 33
alipay: 2
};
/**
... ... @@ -32,13 +32,13 @@ const getOnlinePayProvider = () => {
}
let online = _(result.data)
.filter(i => _.includes([33], i.id))
.filter(i => _.includes([payments.alipay], i.id))
.map(i => {
return {
id: i.id,
name: i.payName,
img: i.payIcon,
selected: i.id === 33
selected: i.id === payments.alipay
};
})
.value();
... ...
... ... @@ -20,23 +20,7 @@ var YohoListPage = {
require('../../common/header');
lazyload();
$('.nano').nanoScroller();
$('.yoho-ui-accordion', this.rootDoc).each(function() {
var opts = {
collapsible: true,
heightStyle: 'content',
active: 0
};
if ($(this).hasClass('no-active')) {
opts.active = false;
}
$(this).find('h3').each(function(index) {
if ($(this).hasClass('active')) {
opts.active = index;
}
});
$(this).accordion(opts);
});
YohoListPage.initAccordion();
$('.sex-body .input-radio', this.rootDoc).check({
type: 'radio',
... ... @@ -100,7 +84,29 @@ var YohoListPage = {
YohoListPage.eventBind();
},
initAccordion() {
$('.yoho-ui-accordion', this.rootDoc).each(function() {
var opts = {
collapsible: true,
heightStyle: 'content',
active: 0
};
if ($(this).hasClass('no-active')) {
opts.active = false;
}
$(this).find('h3').each(function(index) {
if ($(this).hasClass('active')) {
opts.active = index;
}
});
$(this).accordion(opts);
});
},
eventBind: function() {
$(window).resize(function() {
YohoListPage.initAccordion();
});
$('.mulit-choose', this.rootDoc).click(function() {
YohoListPage.openBrandMulitChoose();
});
... ...
... ... @@ -80,6 +80,8 @@
overflow: hidden;
text-overflow: ellipsis;
line-height: 18px;
margin-top: 10px;
padding: 0 10px;
}
.price {
... ... @@ -118,7 +120,7 @@
.slide-switch {
display: block;
position: absolute;
top: 70px;
top: 90px;
width: 100%;
.iconfont {
... ...