Authored by ccbikai(👎🏻🍜)

Merge branch 'master' into release/5.4.1

@@ -17,6 +17,7 @@ exports.productLst = function(req, res, next) { @@ -17,6 +17,7 @@ exports.productLst = function(req, res, next) {
17 specified_sort: req.query.enum, 17 specified_sort: req.query.enum,
18 stocknumber: req.query.sn, 18 stocknumber: req.query.sn,
19 p_d: req.query.pd, 19 p_d: req.query.pd,
  20 + noDup: req.query.noDup,
20 limit: req.query.limit || 10 21 limit: req.query.limit || 10
21 }; 22 };
22 23
  1 +/**
  2 + * 唤起苹果 app 配置文件
  3 + */
  4 +
  5 +'use strict';
  6 +let configFile = `
  7 +{
  8 + "applinks": {
  9 + "apps": [],
  10 + "details": [
  11 + {
  12 + "appID": "6U82P566A4.com.yoho.buy",
  13 + "paths": [ "*"]
  14 + },
  15 + {
  16 + "appID": "EX33S4LRW7.com.yoho.buy",
  17 + "paths": [ "*" ]
  18 + }
  19 + ]
  20 + }
  21 +}
  22 +`;
  23 +
  24 +const appSiteAssociation = (req, res) => {
  25 + res.set('Content-Disposition', 'attachment; filename="apple-app-site-association"');
  26 + res.send(configFile);
  27 +};
  28 +
  29 +module.exports = {
  30 + appSiteAssociation
  31 +};
@@ -13,12 +13,13 @@ var multipart = require('connect-multiparty'); @@ -13,12 +13,13 @@ var multipart = require('connect-multiparty');
13 var multipartMiddleware = multipart(); 13 var multipartMiddleware = multipart();
14 14
15 const uploadApi = require(cRoot + '/upload.js'); 15 const uploadApi = require(cRoot + '/upload.js');
16 -  
17 const hotfix = require(`${cRoot}/hotfix`); 16 const hotfix = require(`${cRoot}/hotfix`);
  17 +const apple = require(`${cRoot}/apple`);
18 18
19 // routers 19 // routers
20 -  
21 router.post('/api/upload/image', multipartMiddleware, uploadApi.uploadImg); 20 router.post('/api/upload/image', multipartMiddleware, uploadApi.uploadImg);
22 router.post('/hf/v1', hotfix.v1); 21 router.post('/hf/v1', hotfix.v1);
23 22
  23 +router.get('/.well-known/apple-app-site-association', apple.appSiteAssociation);
  24 +
24 module.exports = router; 25 module.exports = router;
@@ -24,7 +24,7 @@ const bind = { @@ -24,7 +24,7 @@ const bind = {
24 indexPage: (req, res) => { 24 indexPage: (req, res) => {
25 // 如果没有originalUrl,判定为非法链接 25 // 如果没有originalUrl,判定为非法链接
26 if (req.session.originalUrl !== 'true') { 26 if (req.session.originalUrl !== 'true') {
27 - res.redirect('//m.yohobuy.com'); 27 + return res.redirect('//m.yohobuy.com');
28 } 28 }
29 let refer = req.get('Referer'); 29 let refer = req.get('Referer');
30 30
@@ -22,7 +22,7 @@ const list = (req, res, next) => { @@ -22,7 +22,7 @@ const list = (req, res, next) => {
22 cartUrl: helpers.urlFormat('/cart/index/index') 22 cartUrl: helpers.urlFormat('/cart/index/index')
23 }, req.query); 23 }, req.query);
24 let title = ''; 24 let title = '';
25 - let query = req.query.query; 25 + let query = (req.query.query || '').toString();
26 let isQueryFirstClass = false; // 标识用户搜的是不是一级品类 26 let isQueryFirstClass = false; // 标识用户搜的是不是一级品类
27 let isQuerySecondClass = false; // 标识用户搜的是不是二级品类 27 let isQuerySecondClass = false; // 标识用户搜的是不是二级品类
28 let domain = null; 28 let domain = null;
@@ -76,7 +76,7 @@ module.exports = { @@ -76,7 +76,7 @@ module.exports = {
76 port: '4444' // influxdb port 76 port: '4444' // influxdb port
77 }, 77 },
78 console: { 78 console: {
79 - level: 'info', 79 + level: 'debug',
80 colorize: 'all', 80 colorize: 'all',
81 prettyPrint: true 81 prettyPrint: true
82 } 82 }
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 a.async = 1; 12 a.async = 1;
13 a.src = j; 13 a.src = j;
14 m.parentNode.insertBefore(a, m); 14 m.parentNode.insertBefore(a, m);
15 - }(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cdn.yoho.cn/yas-jssdk/2.2.4/yas.js', '_yas')); 15 + }(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cdn.yoho.cn/yas-jssdk/2.2.5/yas.js', '_yas'));
16 16
17 var _hmt = _hmt || []; 17 var _hmt = _hmt || [];
18 18
@@ -56,7 +56,7 @@ @@ -56,7 +56,7 @@
56 uid = uid === 0 ? '' : uid; 56 uid = uid === 0 ? '' : uid;
57 window._ozuid = uid; // 暴露ozuid 57 window._ozuid = uid; // 暴露ozuid
58 if (window._yas) { 58 if (window._yas) {
59 - window._yas(1 * new Date(), '2.2.2', 'yohobuy_m', uid, '', ''); 59 + window._yas(1 * new Date(), '2.2.5', 'yohobuy_m', uid, '', '');
60 } 60 }
61 61
62 setTimeout(function() { 62 setTimeout(function() {
1 { 1 {
2 "name": "m-yohobuy-node", 2 "name": "m-yohobuy-node",
3 - "version": "5.4.7", 3 + "version": "5.4.8",
4 "private": true, 4 "private": true,
5 "description": "A New Yohobuy Project With Express", 5 "description": "A New Yohobuy Project With Express",
6 "repository": { 6 "repository": {
@@ -406,7 +406,7 @@ function search(opt) { @@ -406,7 +406,7 @@ function search(opt) {
406 if (nav.reload) { 406 if (nav.reload) {
407 page = 1; 407 page = 1;
408 } else if (nav.end) { 408 } else if (nav.end) {
409 - 409 + $('.search-divide').remove();
410 // 不需要重新加载并且数据请求结束 410 // 不需要重新加载并且数据请求结束
411 return; 411 return;
412 } 412 }
@@ -583,7 +583,6 @@ function search(opt) { @@ -583,7 +583,6 @@ function search(opt) {
583 583
584 if (data === '' || (data.list && data.list.length <= 0)) { 584 if (data === '' || (data.list && data.list.length <= 0)) {
585 nav.end = true; 585 nav.end = true;
586 - $('.search-divide').remove();  
587 if (nav.reload) { 586 if (nav.reload) {
588 if (data.total === 0) { 587 if (data.total === 0) {
589 $container.html(noResult); 588 $container.html(noResult);
@@ -52,6 +52,12 @@ const toArray = (obj) => { @@ -52,6 +52,12 @@ const toArray = (obj) => {
52 const _sortListByField = (list, key, desc) => { 52 const _sortListByField = (list, key, desc) => {
53 let array = toArray(list); 53 let array = toArray(list);
54 54
  55 + return array.sort(function(a, b) {
  56 + a = a._key.split(',')[0] * 1;
  57 + b = b._key.split(',')[0] * 1;
  58 + return desc ? a < b : a > b;
  59 + });
  60 +/*
55 array = array.sort((a, b) => { 61 array = array.sort((a, b) => {
56 let matchNumber = /([\d]+)/g; 62 let matchNumber = /([\d]+)/g;
57 63
@@ -70,7 +76,7 @@ const _sortListByField = (list, key, desc) => { @@ -70,7 +76,7 @@ const _sortListByField = (list, key, desc) => {
70 return numA < numB ? -1 : 1; 76 return numA < numB ? -1 : 1;
71 }); 77 });
72 78
73 - return array; 79 + return array;*/
74 }; 80 };
75 81
76 /** 82 /**