Authored by ccbikai

Merge branch 'feature/sale' into release/4.8

... ... @@ -22,14 +22,18 @@
{{/if}}
{{!-- 会员专享 --}}
{{#if vipFloor}}
<div class="vip-floor-wrap">
{{#if vipFloor}}
{{> resources/vip-floor}}
{{/if}}
</div>
{{!-- 断码区 --}}
{{#if offCodeArea}}
{{> resources/off-code-area}}
{{/if}}
<div class="off-code-area-wrap">
{{#if offCodeArea}}
{{> resources/off-code-area}}
{{/if}}
</div>
{{!-- OUTLETS --}}
{{#if titleImage}}
... ...
... ... @@ -72,6 +72,13 @@
max-height: 320px;
}
.vip-floor-wrap,
.off-code-area-wrap {
.banner-top {
height: 200px;
}
}
.vip-floor {
border-bottom: 1px solid #e0e0e0;
... ...
... ... @@ -29,10 +29,21 @@ const _procProductImg = (product, gender, yhChannel) => {
const _sortListByField = (list, key, desc) => {
list = _.toArray(list);
list = list.sort((a, b) => {
let matchNumber = /([\d]+)/g;
// 有键,使用键的值排序
if (a[key] && b[key]) {
return (desc ? a[key] > b[key] : a[key] < b[key]) ? -1 : 1;
let numA = +(_.toArray(a[key].match(matchNumber))[0] || 0); // 取第一个出现的数字排序,如果不存在,取0
let numB = +(_.toArray(b[key].match(matchNumber))[0] || 0);
return (desc ? numA > numB : numA < numB) ? -1 : 1;
}
return (desc ? a > b : a < b) ? -1 : 1;
// 无键, 使用本身
let numA = +(_.toArray(a.match(matchNumber))[0] || 0);
let numB = +(_.toArray(b.match(matchNumber))[0] || 0);
return numA < numB ? -1 : 1;
});
return list;
};
... ...