Merge branch 'hotfix/cate' into 'master'
Hotfix/cate See merge request !29
Showing
3 changed files
with
24 additions
and
19 deletions
@@ -16,15 +16,15 @@ module.exports = { | @@ -16,15 +16,15 @@ module.exports = { | ||
16 | siteUrl: '//m.yohobuy.com', | 16 | siteUrl: '//m.yohobuy.com', |
17 | assetUrl: '//localhost:5001', | 17 | assetUrl: '//localhost:5001', |
18 | domains: { | 18 | domains: { |
19 | - // api: 'http://api.yoho.cn/', | ||
20 | - // service: 'http://service.yoho.cn/', | ||
21 | - // liveApi: 'http://api.live.yoho.cn/', | ||
22 | - // singleApi: 'http://single.yoho.cn/' | 19 | + api: 'http://api.yoho.cn/', |
20 | + service: 'http://service.yoho.cn/', | ||
21 | + liveApi: 'http://api.live.yoho.cn/', | ||
22 | + singleApi: 'http://single.yoho.cn/' | ||
23 | 23 | ||
24 | - api: 'http://api-test3.yohops.com:9999/', | ||
25 | - service: 'http://service-test3.yohops.com:9999/', | ||
26 | - liveApi: 'http://testapi.live.yohops.com:9999/', | ||
27 | - singleApi: 'http://api-test3.yohops.com:9999/' | 24 | + // api: 'http://api-test3.yohops.com:9999/', |
25 | + // service: 'http://service-test3.yohops.com:9999/', | ||
26 | + // liveApi: 'http://testapi.live.yohops.com:9999/', | ||
27 | + // singleApi: 'http://api-test3.yohops.com:9999/' | ||
28 | 28 | ||
29 | // favApi: 'http://192.168.102.31:8092/brower', | 29 | // favApi: 'http://192.168.102.31:8092/brower', |
30 | // api: 'http://192.168.102.205:8080/gateway/', | 30 | // api: 'http://192.168.102.205:8080/gateway/', |
@@ -27,7 +27,7 @@ if (!shelljs.grep('npm run -s', path.resolve('./.git/hooks/pre-commit')).stdout. | @@ -27,7 +27,7 @@ if (!shelljs.grep('npm run -s', path.resolve('./.git/hooks/pre-commit')).stdout. | ||
27 | 27 | ||
28 | if (changeFiles.js) { | 28 | if (changeFiles.js) { |
29 | changeFiles.js = changeFiles.js.replace(/\n/g, ' '); | 29 | changeFiles.js = changeFiles.js.replace(/\n/g, ' '); |
30 | - lintResult.js = shelljs.exec(`${lintPath.js}${ext} -c .eslintrc --cache --fix ${changeFiles.js}`); | 30 | + lintResult.js = shelljs.exec(`${lintPath.js}${ext} -c .eslintrc --cache ${changeFiles.js}`); |
31 | } | 31 | } |
32 | 32 | ||
33 | if (changeFiles.css) { | 33 | if (changeFiles.css) { |
@@ -37,7 +37,7 @@ if (changeFiles.css) { | @@ -37,7 +37,7 @@ if (changeFiles.css) { | ||
37 | 37 | ||
38 | if (changeFiles.vue) { | 38 | if (changeFiles.vue) { |
39 | changeFiles.vue = changeFiles.vue.replace(/\n/g, ' '); | 39 | changeFiles.vue = changeFiles.vue.replace(/\n/g, ' '); |
40 | - lintResult.vueScript = shelljs.exec(`${lintPath.js}${ext} -c .eslintrc --cache --fix ${changeFiles.vue}`); | 40 | + lintResult.vueScript = shelljs.exec(`${lintPath.js}${ext} -c .eslintrc --cache ${changeFiles.vue}`); |
41 | lintResult.vueStyle = shelljs.exec(`${lintPath.css}${ext} --syntax scss --extract --config .stylelintrc ${changeFiles.vue}`); // eslint-disable-line | 41 | lintResult.vueStyle = shelljs.exec(`${lintPath.css}${ext} --syntax scss --extract --config .stylelintrc ${changeFiles.vue}`); // eslint-disable-line |
42 | } | 42 | } |
43 | 43 |
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | */ | 5 | */ |
6 | 6 | ||
7 | var $ = require('yoho-jquery'); | 7 | var $ = require('yoho-jquery'); |
8 | +var FastClick = require('yoho-fastclick'); | ||
8 | 9 | ||
9 | var $nav = $('.category-nav'), | 10 | var $nav = $('.category-nav'), |
10 | $search = $('#search-input'), | 11 | $search = $('#search-input'), |
@@ -15,6 +16,10 @@ var $nav = $('.category-nav'), | @@ -15,6 +16,10 @@ var $nav = $('.category-nav'), | ||
15 | 16 | ||
16 | require('../common'); | 17 | require('../common'); |
17 | 18 | ||
19 | +$(function() { | ||
20 | + FastClick.attach(document.body); | ||
21 | +}); | ||
22 | + | ||
18 | function resetHeight() { | 23 | function resetHeight() { |
19 | var h = document.body.scrollHeight - $search.outerHeight() - $nav.outerHeight(); | 24 | var h = document.body.scrollHeight - $search.outerHeight() - $nav.outerHeight(); |
20 | 25 | ||
@@ -47,7 +52,7 @@ $nav.on('touchend touchcancel', function(e) { | @@ -47,7 +52,7 @@ $nav.on('touchend touchcancel', function(e) { | ||
47 | $contents.filter(selector).removeClass('hide'); | 52 | $contents.filter(selector).removeClass('hide'); |
48 | }); | 53 | }); |
49 | 54 | ||
50 | -$categoryContainer.on('touchend', function(e) { | 55 | +$categoryContainer.on('click', function(e) { |
51 | var $this = $(e.target), | 56 | var $this = $(e.target), |
52 | $subLevel, | 57 | $subLevel, |
53 | $cur, index; | 58 | $cur, index; |
@@ -59,6 +64,14 @@ $categoryContainer.on('touchend', function(e) { | @@ -59,6 +64,14 @@ $categoryContainer.on('touchend', function(e) { | ||
59 | e.preventDefault(); | 64 | e.preventDefault(); |
60 | } | 65 | } |
61 | 66 | ||
67 | + if ($this[0] && $this[0].tagName === 'LI' && $this.find('a').attr('href')) { | ||
68 | + location.href = $this.find('a').attr('href'); | ||
69 | + } | ||
70 | + | ||
71 | + if ($this[0] && $this[0].tagName === 'A' && $this.attr('href')) { | ||
72 | + location.href = $this.attr('href'); | ||
73 | + } | ||
74 | + | ||
62 | if ($cur.length > 0) { | 75 | if ($cur.length > 0) { |
63 | index = $cur.index(); | 76 | index = $cur.index(); |
64 | $subLevel = $this.closest('.content').find('.sub-level'); | 77 | $subLevel = $this.closest('.content').find('.sub-level'); |
@@ -73,14 +86,6 @@ $categoryContainer.on('touchend', function(e) { | @@ -73,14 +86,6 @@ $categoryContainer.on('touchend', function(e) { | ||
73 | $subLevel.not('.hide').addClass('hide'); | 86 | $subLevel.not('.hide').addClass('hide'); |
74 | $subLevel.eq(index).removeClass('hide'); | 87 | $subLevel.eq(index).removeClass('hide'); |
75 | } | 88 | } |
76 | - | ||
77 | - if ($this[0] && $this[0].tagName === 'LI' && $this.find('a').attr('href')) { | ||
78 | - location.href = $this.find('a').attr('href'); | ||
79 | - } | ||
80 | - | ||
81 | - if ($this[0] && $this[0].tagName === 'A' && $this.attr('href')) { | ||
82 | - location.href = $this.attr('href'); | ||
83 | - } | ||
84 | }); | 89 | }); |
85 | 90 | ||
86 | $categoryContainer.find('.primary-level').on('touchstart touchend touchcancel', 'li', function() { | 91 | $categoryContainer.find('.primary-level').on('touchstart touchend touchcancel', 'li', function() { |
-
Please register or login to post a comment