Showing
1 changed file
with
14 additions
and
3 deletions
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | </div> | 17 | </div> |
18 | </li> | 18 | </li> |
19 | </ul> | 19 | </ul> |
20 | - <div class="more" :class="{'show-more': value.data.list.length <= 3}" :style="moreMove" ref="more" v-show="value.data.url" @click="moreAction"></div> | 20 | + <div class="more" :class="{'show-more': value.data.list.length <= 3}" :style="moreMove" ref="more" v-show="isShowMore" @click="moreAction"></div> |
21 | <a-link ref="linkA" :href="value.data.url"></a-link> | 21 | <a-link ref="linkA" :href="value.data.url"></a-link> |
22 | </resource> | 22 | </resource> |
23 | </template> | 23 | </template> |
@@ -43,6 +43,13 @@ export default { | @@ -43,6 +43,13 @@ export default { | ||
43 | index: Number | 43 | index: Number |
44 | }, | 44 | }, |
45 | computed: { | 45 | computed: { |
46 | + isShowMore() { | ||
47 | + if (!this.value.data.url || this.value.data.url === 'http://www.yohobuy.com') { | ||
48 | + return false; | ||
49 | + } else { | ||
50 | + return true; | ||
51 | + } | ||
52 | + } | ||
46 | }, | 53 | }, |
47 | methods: { | 54 | methods: { |
48 | touchStart(ev) { | 55 | touchStart(ev) { |
@@ -60,7 +67,7 @@ export default { | @@ -60,7 +67,7 @@ export default { | ||
60 | let moreWd = this.$refs.more.offsetWidth; | 67 | let moreWd = this.$refs.more.offsetWidth; |
61 | let scrollLeft = this.$refs.goodsList.scrollLeft; | 68 | let scrollLeft = this.$refs.goodsList.scrollLeft; |
62 | 69 | ||
63 | - if (this.value.data.list.length <= 3 || !this.value.data.url) { | 70 | + if (this.value.data.list.length <= 3 || !this.isShowMore) { |
64 | return; | 71 | return; |
65 | } | 72 | } |
66 | 73 | ||
@@ -100,7 +107,7 @@ export default { | @@ -100,7 +107,7 @@ export default { | ||
100 | let moreWd = this.$refs.more.offsetWidth; | 107 | let moreWd = this.$refs.more.offsetWidth; |
101 | let scrollLeft = this.$refs.goodsList.scrollLeft; | 108 | let scrollLeft = this.$refs.goodsList.scrollLeft; |
102 | 109 | ||
103 | - if (this.value.data.list.length <= 3 || !this.value.data.url) { | 110 | + if (this.value.data.list.length <= 3 || !this.isShowMore) { |
104 | return; | 111 | return; |
105 | } | 112 | } |
106 | 113 | ||
@@ -116,6 +123,8 @@ export default { | @@ -116,6 +123,8 @@ export default { | ||
116 | } else { | 123 | } else { |
117 | // 大于一半 滑动到最大值 | 124 | // 大于一半 滑动到最大值 |
118 | this.$refs.linkA.click(); | 125 | this.$refs.linkA.click(); |
126 | + this.moreSlider = 'transform:translateX(0px)'; | ||
127 | + this.moreMove = 'transform:translateX(' + moreWd + 'px)'; | ||
119 | } | 128 | } |
120 | } | 129 | } |
121 | }, | 130 | }, |
@@ -125,6 +134,8 @@ export default { | @@ -125,6 +134,8 @@ export default { | ||
125 | } | 134 | } |
126 | 135 | ||
127 | this.$refs.linkA.click(); | 136 | this.$refs.linkA.click(); |
137 | + this.moreSlider = 'transform:translateX(0px)'; | ||
138 | + this.moreMove = 'transform:translateX(' + this.$refs.more.offsetWidth + 'px)'; | ||
128 | } | 139 | } |
129 | }, | 140 | }, |
130 | components: {Resource} | 141 | components: {Resource} |
-
Please register or login to post a comment