...
|
...
|
@@ -17,7 +17,7 @@ |
|
|
</div>
|
|
|
</li>
|
|
|
</ul>
|
|
|
<div class="more" :class="{'show-more': value.data.list.length <= 3}" :style="moreMove" ref="more" v-show="value.data.url" @click="moreAction"></div>
|
|
|
<div class="more" :class="{'show-more': value.data.list.length <= 3}" :style="moreMove" ref="more" v-show="isShowMore" @click="moreAction"></div>
|
|
|
<a-link ref="linkA" :href="value.data.url"></a-link>
|
|
|
</resource>
|
|
|
</template>
|
...
|
...
|
@@ -43,6 +43,13 @@ export default { |
|
|
index: Number
|
|
|
},
|
|
|
computed: {
|
|
|
isShowMore() {
|
|
|
if (!this.value.data.url || this.value.data.url === 'http://www.yohobuy.com') {
|
|
|
return false;
|
|
|
} else {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
touchStart(ev) {
|
...
|
...
|
@@ -60,7 +67,7 @@ export default { |
|
|
let moreWd = this.$refs.more.offsetWidth;
|
|
|
let scrollLeft = this.$refs.goodsList.scrollLeft;
|
|
|
|
|
|
if (this.value.data.list.length <= 3 || !this.value.data.url) {
|
|
|
if (this.value.data.list.length <= 3 || !this.isShowMore) {
|
|
|
return;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -100,7 +107,7 @@ export default { |
|
|
let moreWd = this.$refs.more.offsetWidth;
|
|
|
let scrollLeft = this.$refs.goodsList.scrollLeft;
|
|
|
|
|
|
if (this.value.data.list.length <= 3 || !this.value.data.url) {
|
|
|
if (this.value.data.list.length <= 3 || !this.isShowMore) {
|
|
|
return;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -116,6 +123,8 @@ export default { |
|
|
} else {
|
|
|
// 大于一半 滑动到最大值
|
|
|
this.$refs.linkA.click();
|
|
|
this.moreSlider = 'transform:translateX(0px)';
|
|
|
this.moreMove = 'transform:translateX(' + moreWd + 'px)';
|
|
|
}
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -125,6 +134,8 @@ export default { |
|
|
}
|
|
|
|
|
|
this.$refs.linkA.click();
|
|
|
this.moreSlider = 'transform:translateX(0px)';
|
|
|
this.moreMove = 'transform:translateX(' + this.$refs.more.offsetWidth + 'px)';
|
|
|
}
|
|
|
},
|
|
|
components: {Resource}
|
...
|
...
|
|