Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
陈峰
7 years ago
Commit
c4e06f3055b983ebc12e65deadc6f15360b4a5b2
1 parent
1a896fa3
Revert "品牌列表灵敏度"
This reverts commit
2317447b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
53 deletions
public/vue/channel/brand-list.vue
public/vue/channel/brand-list.vue
View file @
c4e06f3
...
...
@@ -4,7 +4,7 @@
<div class="index"><a :href="'#' + item.index" :id="item.index" :name="item.index">{{item.index}}</a></div>
<div class="brand-big-box clearfix">
<div class="brand-box" v-for="brand in item.brands" :key="brand.name">
<a v-brand-href="brand.domain"
:class="hrefClass"
>
<a v-brand-href="brand.domain">
<span class="brand-name">{{brand.name}}</span>
</a>
</div>
...
...
@@ -110,7 +110,6 @@
import bus from 'common/vue-bus';
import tip from 'common/tip';
import indexList from 'component/tool/index-list.vue';
import yoho from 'yoho';
export default {
props: ['channel'],
...
...
@@ -119,9 +118,6 @@
brandList: [],
indexList: [],
currentChannel: this.channel,
hrefClass: {
'no-link': false
}
};
},
watch: {
...
...
@@ -158,43 +154,6 @@
}
window.scrollTo(0, top);
}
},
touchmove() {
this.hrefClass['no-link'] = true;
},
touchend() {
this.hrefClass['no-link'] = false;
},
scrollEnd() {
this.hrefClass['no-link'] = false;
},
getScrollEventTarget(element) {
let getComputedStyle = document.defaultView.getComputedStyle;
let currentNode = element;
while (currentNode && currentNode.tagName !== 'HTML' && currentNode.tagName !== 'BODY' && currentNode.nodeType === 1) {
let overflowY = getComputedStyle(currentNode).overflowY;
if (overflowY === 'scroll' || overflowY === 'auto') {
return currentNode;
}
currentNode = currentNode.parentNode;
}
return window;
},
throttle(fn, delay) {
let timer;
return () => {
if (timer) {
clearTimeout(timer);
timer = null;
}
this.hrefClass['no-link'] = true;
timer = setTimeout(() => {
fn();
}, delay);
};
}
},
components: {
...
...
@@ -206,16 +165,6 @@
this.currentChannel = channel;
this.getBrandList();
});
},
mounted() {
const $scrollEl = this.getScrollEventTarget(this.$el);
if (yoho.isiOS) {
$scrollEl.addEventListener('touchmove', this.touchmove);
$scrollEl.addEventListener('touchend', this.touchend);
} else {
$scrollEl.addEventListener('scroll', this.throttle(this.scrollEnd, 200));
}
},
}
};
</script>
...
...
Please
register
or
login
to post a comment