Authored by ccbikai

Merge branch 'feature/sale' into release/4.8

@@ -22,14 +22,18 @@ @@ -22,14 +22,18 @@
22 {{/if}} 22 {{/if}}
23 23
24 {{!-- 会员专享 --}} 24 {{!-- 会员专享 --}}
25 - {{#if vipFloor}} 25 + <div class="vip-floor-wrap">
  26 + {{#if vipFloor}}
26 {{> resources/vip-floor}} 27 {{> resources/vip-floor}}
27 {{/if}} 28 {{/if}}
  29 + </div>
28 30
29 {{!-- 断码区 --}} 31 {{!-- 断码区 --}}
30 - {{#if offCodeArea}}  
31 - {{> resources/off-code-area}}  
32 - {{/if}} 32 + <div class="off-code-area-wrap">
  33 + {{#if offCodeArea}}
  34 + {{> resources/off-code-area}}
  35 + {{/if}}
  36 + </div>
33 37
34 {{!-- OUTLETS --}} 38 {{!-- OUTLETS --}}
35 {{#if titleImage}} 39 {{#if titleImage}}
@@ -72,6 +72,13 @@ @@ -72,6 +72,13 @@
72 max-height: 320px; 72 max-height: 320px;
73 } 73 }
74 74
  75 + .vip-floor-wrap,
  76 + .off-code-area-wrap {
  77 + .banner-top {
  78 + height: 200px;
  79 + }
  80 + }
  81 +
75 .vip-floor { 82 .vip-floor {
76 border-bottom: 1px solid #e0e0e0; 83 border-bottom: 1px solid #e0e0e0;
77 84
@@ -29,10 +29,21 @@ const _procProductImg = (product, gender, yhChannel) => { @@ -29,10 +29,21 @@ const _procProductImg = (product, gender, yhChannel) => {
29 const _sortListByField = (list, key, desc) => { 29 const _sortListByField = (list, key, desc) => {
30 list = _.toArray(list); 30 list = _.toArray(list);
31 list = list.sort((a, b) => { 31 list = list.sort((a, b) => {
  32 + let matchNumber = /([\d]+)/g;
  33 +
  34 + // 有键,使用键的值排序
32 if (a[key] && b[key]) { 35 if (a[key] && b[key]) {
33 - return (desc ? a[key] > b[key] : a[key] < b[key]) ? -1 : 1; 36 + let numA = +(_.toArray(a[key].match(matchNumber))[0] || 0); // 取第一个出现的数字排序,如果不存在,取0
  37 + let numB = +(_.toArray(b[key].match(matchNumber))[0] || 0);
  38 +
  39 + return (desc ? numA > numB : numA < numB) ? -1 : 1;
34 } 40 }
35 - return (desc ? a > b : a < b) ? -1 : 1; 41 +
  42 + // 无键, 使用本身
  43 + let numA = +(_.toArray(a.match(matchNumber))[0] || 0);
  44 + let numB = +(_.toArray(b.match(matchNumber))[0] || 0);
  45 +
  46 + return numA < numB ? -1 : 1;
36 }); 47 });
37 return list; 48 return list;
38 }; 49 };