search name red display
Showing
1 changed file
with
4 additions
and
3 deletions
@@ -181,10 +181,10 @@ exports.processProductList = (list, options) => { | @@ -181,10 +181,10 @@ exports.processProductList = (list, options) => { | ||
181 | product.tags.is_advance = product.is_advance === 'Y'; // 再到着 | 181 | product.tags.is_advance = product.is_advance === 'Y'; // 再到着 |
182 | 182 | ||
183 | // 打折与即将售完组合显示打折 | 183 | // 打折与即将售完组合显示打折 |
184 | - /*if (product.is_soon_sold_out && product.tags.is_discount) { | 184 | + /* if (product.is_soon_sold_out && product.tags.is_discount) { |
185 | product.tags.is_few = false; | 185 | product.tags.is_few = false; |
186 | } else*/ | 186 | } else*/ |
187 | - if(product.tags.is_new) { | 187 | + if (product.tags.is_new) { |
188 | product.tags.is_sale = false; | 188 | product.tags.is_sale = false; |
189 | } | 189 | } |
190 | if (product.tags.is_sale && | 190 | if (product.tags.is_sale && |
@@ -197,8 +197,9 @@ exports.processProductList = (list, options) => { | @@ -197,8 +197,9 @@ exports.processProductList = (list, options) => { | ||
197 | } | 197 | } |
198 | } | 198 | } |
199 | 199 | ||
200 | - if(options.query && _.isString(product.product_name)) { | 200 | + if (options.query && _.isString(product.product_name)) { |
201 | let qreg = new RegExp(options.query, 'ig'); | 201 | let qreg = new RegExp(options.query, 'ig'); |
202 | + | ||
202 | product.product_name = product.product_name.replace(qreg, '<span style="color:#c00;">$&</span>'); | 203 | product.product_name = product.product_name.replace(qreg, '<span style="color:#c00;">$&</span>'); |
203 | } | 204 | } |
204 | 205 |
-
Please register or login to post a comment