Authored by ccbikai

Merge branch 'develop' into release/1.0

@@ -7,6 +7,11 @@ const processProductList = require(`${global.utils}/beautify/product`); @@ -7,6 +7,11 @@ const processProductList = require(`${global.utils}/beautify/product`);
7 7
8 /* 查询最新产品列表 */ 8 /* 查询最新产品列表 */
9 exports.getNewData = (params) => { 9 exports.getNewData = (params) => {
  10 + if (params.hasOwnProperty('priceRange')) {
  11 + params.price = params.priceRange;
  12 + delete params.priceRange;
  13 + }
  14 +
10 params = Object.assign({ 15 params = Object.assign({
11 method: 'app.search.newProduct', 16 method: 'app.search.newProduct',
12 }, params); 17 }, params);
@@ -19,6 +19,7 @@ const search = { @@ -19,6 +19,7 @@ const search = {
19 cache: true, 19 cache: true,
20 code: 200 20 code: 200
21 }).then(result => { 21 }).then(result => {
  22 + result = result || {};
22 if (result.data) { 23 if (result.data) {
23 prettyFilter(result.data.filter); 24 prettyFilter(result.data.filter);
24 result = camelCase(result); 25 result = camelCase(result);
@@ -15,9 +15,9 @@ @@ -15,9 +15,9 @@
15 (function(d,c){var e=d.documentElement,a="orientationchange" in window?"orientationchange":"resize",b=function(){var f=e.clientWidth;if(!f){return}if(f>=750){e.style.fontSize="40px"}else{e.style.fontSize=40*(f/750)+"px"}};if(!d.addEventListener){return}b();c.addEventListener(a,b,false);d.addEventListener("DOMContentLoaded",b,false)})(document,window); 15 (function(d,c){var e=d.documentElement,a="orientationchange" in window?"orientationchange":"resize",b=function(){var f=e.clientWidth;if(!f){return}if(f>=750){e.style.fontSize="40px"}else{e.style.fontSize=40*(f/750)+"px"}};if(!d.addEventListener){return}b();c.addEventListener(a,b,false);d.addEventListener("DOMContentLoaded",b,false)})(document,window);
16 </script> 16 </script>
17 {{#if devEnv}} 17 {{#if devEnv}}
18 - <link rel="stylesheet" href="//localhost:5004/css/index.css"> 18 + <link rel="stylesheet" media="all" href="//localhost:5004/css/index.css">
19 {{#unless noLocalCSS}} 19 {{#unless noLocalCSS}}
20 - <link rel="stylesheet" href="//localhost:5004/{{module}}.{{page}}.css"> 20 + <link rel="stylesheet" media="all" href="//localhost:5004/{{module}}.{{page}}.css">
21 {{/unless}} 21 {{/unless}}
22 {{^}} 22 {{^}}
23 <link rel="stylesheet" href="//cdn.yoho.cn/yohoblk-wap/{{version}}/index.css"> 23 <link rel="stylesheet" href="//cdn.yoho.cn/yohoblk-wap/{{version}}/index.css">
@@ -101,6 +101,7 @@ @@ -101,6 +101,7 @@
101 & + .item { 101 & + .item {
102 height: 142px; 102 height: 142px;
103 line-height: 142px; 103 line-height: 142px;
  104 + font-family: "PingFang SC", Helvetica, Roboto, "Heiti SC", "黑体", Arial;
104 } 105 }
105 } 106 }
106 } 107 }
@@ -31,8 +31,11 @@ @@ -31,8 +31,11 @@
31 let locationQuery = qs(decodeURIComponent(location.search.replace(/^\?/, ''))); 31 let locationQuery = qs(decodeURIComponent(location.search.replace(/^\?/, '')));
32 let hasSort = !!locationQuery.sort; 32 let hasSort = !!locationQuery.sort;
33 33
  34 + // filter 字段 对应 的 查询 字段
34 const aliasMap = { 35 const aliasMap = {
35 - groupSort: 'sort' 36 + groupSort: 'sort',
  37 + priceRange: 'price',
  38 + discount: 'p_d'
36 }; 39 };
37 40
38 module.exports = { 41 module.exports = {
@@ -97,15 +100,12 @@ @@ -97,15 +100,12 @@
97 100
98 let filter = {}; 101 let filter = {};
99 $.each(this.selected, (type, item) => { 102 $.each(this.selected, (type, item) => {
100 - if (item.id) {  
101 - filter[type] = item.id;  
102 - } 103 + filter[type] = item.id;
103 }); 104 });
104 105
105 let query; 106 let query;
106 query = $.extend({}, locationQuery, filter); 107 query = $.extend({}, locationQuery, filter);
107 query = $.param(query); 108 query = $.param(query);
108 -  
109 if (history.replaceState) { 109 if (history.replaceState) {
110 history.replaceState({}, '', location.pathname + '?'+ query); 110 history.replaceState({}, '', location.pathname + '?'+ query);
111 } 111 }
@@ -79,7 +79,7 @@ @@ -79,7 +79,7 @@
79 return $.get(this.url, Object.assign({ 79 return $.get(this.url, Object.assign({
80 order: this.order, 80 order: this.order,
81 page: nextPage 81 page: nextPage
82 - }, this.filter, locationQuery)) 82 + }, locationQuery, this.filter))
83 .done(res => { 83 .done(res => {
84 if (res.data) { 84 if (res.data) {
85 self.page = res.data.page; 85 self.page = res.data.page;
@@ -72,7 +72,7 @@ @@ -72,7 +72,7 @@
72 this.inSearching = true; 72 this.inSearching = true;
73 return $.get(this.url, Object.assign({ 73 return $.get(this.url, Object.assign({
74 page: nextPage 74 page: nextPage
75 - }, this.filter, locationQuery)) 75 + }, locationQuery, this.filter))
76 .done(res => { 76 .done(res => {
77 if (res.code === 200) { 77 if (res.code === 200) {
78 self.page = res.data.page; 78 self.page = res.data.page;
@@ -123,7 +123,7 @@ @@ -123,7 +123,7 @@
123 this.inSearching = true; 123 this.inSearching = true;
124 $.get(this.url, Object.assign({ 124 $.get(this.url, Object.assign({
125 page: nextPage 125 page: nextPage
126 - }, this.filter, locationQuery)).done(result => { 126 + }, locationQuery, this.filter)).done(result => {
127 if (result.code === 200) { 127 if (result.code === 200) {
128 self.page = result.data.page; 128 self.page = result.data.page;
129 self.totalPage = result.data.pageTotal; 129 self.totalPage = result.data.pageTotal;