1
|
<template>
|
1
|
<template>
|
2
|
- <LayoutApp :show-back="true">
|
|
|
3
|
- <div class="scroll-list-wrap">
|
|
|
4
|
- <Scroll
|
|
|
5
|
- ref="scroll"
|
|
|
6
|
- :options="options"
|
|
|
7
|
- @pulling-up="onPullingUp">
|
|
|
8
|
- <div class="body" ref="body">
|
|
|
9
|
- <div v-for="(item, index) in channelList.list" :key="index">
|
|
|
10
|
- <template v-if="item.template_name == 'focus'">
|
|
|
11
|
- <Slider :list="list"></Slider>
|
|
|
12
|
- </template>
|
|
|
13
|
-
|
|
|
14
|
- <template v-if="item.template_name == 'hotSeries'">
|
|
|
15
|
- <Hot :list="item.data"></Hot>
|
|
|
16
|
- </template>
|
|
|
17
|
-
|
|
|
18
|
- <template v-if="item.template_name == 'single_image'">
|
|
|
19
|
- <Banner :linkUrl="linkUrl" :imgUrl="imgUrl"></Banner>
|
|
|
20
|
- </template>
|
|
|
21
|
-
|
|
|
22
|
- <template v-if="item.template_name == 'twoPicture'">
|
|
|
23
|
- <TwoBanner :list="item.data"></TwoBanner>
|
|
|
24
|
- </template>
|
|
|
25
|
- </div>
|
|
|
26
|
- <ScrollNav></ScrollNav>
|
|
|
27
|
- <ProductList :list="channelList.productlist"></ProductList>
|
2
|
+ <div class="scroll-app">
|
|
|
3
|
+ <div class="scroll-flex">
|
|
|
4
|
+ <div class="scroll-list-wrap">
|
|
|
5
|
+ <Scroll
|
|
|
6
|
+ ref="scroll"
|
|
|
7
|
+ :options="options"
|
|
|
8
|
+ @pulling-up="onPullingUp">
|
|
|
9
|
+ <div class="body" ref="body">
|
|
|
10
|
+ <div v-for="(item, index) in channelList.list" :key="index">
|
|
|
11
|
+ <Slider :list="item.data" v-if="item.template_name == 'focus'" />
|
|
|
12
|
+ <Hot :list="item.data" v-if="item.template_name == 'hotSeries'" />
|
|
|
13
|
+ <Banner :list="item.data" v-if="item.template_name == 'single_image'" />
|
|
|
14
|
+ <TwoBanner :list="item.data" v-if="item.template_name == 'twoPicture'" />
|
|
|
15
|
+ </div>
|
|
|
16
|
+ <ScrollNav></ScrollNav>
|
|
|
17
|
+ <ProductList :list="channelList.productlist"></ProductList>
|
|
|
18
|
+ </div>
|
|
|
19
|
+ </Scroll>
|
28
|
</div>
|
20
|
</div>
|
29
|
- </Scroll>
|
21
|
+ </div>
|
30
|
</div>
|
22
|
</div>
|
31
|
- </LayoutApp>
|
|
|
32
|
</template>
|
23
|
</template>
|
33
|
|
24
|
|
34
|
<script>
|
25
|
<script>
|
|
@@ -52,178 +43,18 @@ export default { |
|
@@ -52,178 +43,18 @@ export default { |
52
|
},
|
43
|
},
|
53
|
pullUpLoad: true
|
44
|
pullUpLoad: true
|
54
|
},
|
45
|
},
|
55
|
- items: [1,2,3,4,5,6,7,8,9],
|
|
|
56
|
- list: [
|
|
|
57
|
- {
|
|
|
58
|
- url: 'http://www.didichuxing.com/',
|
|
|
59
|
- image: '//webapp.didistatic.com/static/webapp/shield/cube-ui-examples-slide01.png'
|
|
|
60
|
- },
|
|
|
61
|
- {
|
|
|
62
|
- url: 'http://www.didichuxing.com/',
|
|
|
63
|
- image: '//webapp.didistatic.com/static/webapp/shield/cube-ui-examples-slide01.png'
|
|
|
64
|
- }
|
|
|
65
|
- ],
|
|
|
66
|
- linkUrl: 'https://www.baidu.com',
|
|
|
67
|
- imgUrl: 'https://ss0.baidu.com/94o3dSag_xI4khGko9WTAnF6hhy/baike/pic/item/cb8065380cd79123d7648113a7345982b3b780d4.jpg',
|
|
|
68
|
- list2: [
|
|
|
69
|
- {
|
|
|
70
|
- "data": [
|
|
|
71
|
- {
|
|
|
72
|
- "bgColor": "",
|
|
|
73
|
- "src": "http://img10.static.yhbimg.com/yhb-img01/2017/07/26/16/01d47fc95f71a19469f38a19c7c843fe43.jpg?imageView2/{mode}/w/{width}/h/{height}",
|
|
|
74
|
- "title": "",
|
|
|
75
|
- "url": "https://m.yohobuy.com/?title=标题&openby:yohobuy={\"action\":\"go.collagehome\",\"params\":{\"title\":\"标题\"}}"
|
|
|
76
|
- },
|
|
|
77
|
- {
|
|
|
78
|
- "bgColor": "",
|
|
|
79
|
- "src": "http://img10.static.yhbimg.com/yhb-img01/2017/07/26/16/01e90704cc16d5a32a1680ae1d415426c6.jpg?imageView2/{mode}/w/{width}/h/{height}",
|
|
|
80
|
- "title": "",
|
|
|
81
|
- "url": "https://m.yohobuy.com/groupPurchase?activityId=56&type=2&title=模式2测试&openby:yohobuy={\"action\":\"go.activitytemplate\",\"params\":{\"activityId\":\"56\",\"type\":\"2\",\"title\":\"模式2测试\"}}"
|
|
|
82
|
- },
|
|
|
83
|
- {
|
|
|
84
|
- "bgColor": "",
|
|
|
85
|
- "src": "http://img10.static.yhbimg.com/yhb-img01/2017/07/27/09/01cc06fea3c1d22375abcd90836759f85f.png?imageView2/{mode}/w/{width}/h/{height}",
|
|
|
86
|
- "title": "",
|
|
|
87
|
- "url": "http://m.yohobuy.com/groupPurchase?activityId=58&type=2&title=团购状态验证&openby:yohobuy={\"action\":\"go.activitytemplate\",\"params\":{\"activityId\":\"58\",\"type\":\"2\",\"title\":\"团购状态验证\"}}"
|
|
|
88
|
- },
|
|
|
89
|
- {
|
|
|
90
|
- "bgColor": "",
|
|
|
91
|
- "src": "http://img11.static.yhbimg.com/yhb-img01/2017/09/20/09/01cf74dac1b0a354b82dc894dc66634352.jpg?imageView2/{mode}/w/{width}/h/{height}",
|
|
|
92
|
- "title": "",
|
|
|
93
|
- "url": "https://list.m.yohobuy.com/?specialsale_id=2&gender=1,3&actiontype=2&cover_url=http://img10.static.yhbimg.com/couponImg/2018/08/27/10/01021a4ec4029934bcffca8ee912f61654.jpg&openby:yohobuy={\"action\":\"go.list\",\"params\":{\"actiontype\":\"2\",\"cover_url\":\"http://img10.static.yhbimg.com/couponImg/2018/08/27/10/01021a4ec4029934bcffca8ee912f61654.jpg\",\"gender\":\"1,3\",\"specialsale_id\":\"2\"}}"
|
|
|
94
|
- },
|
|
|
95
|
- {
|
|
|
96
|
- "bgColor": "",
|
|
|
97
|
- "src": "http://img11.static.yhbimg.com/yhb-img01/2017/10/13/18/018044cceeb5a2afe6223a1412ccda89b9.jpg?imageView2/{mode}/w/{width}/h/{height}",
|
|
|
98
|
- "title": "",
|
|
|
99
|
- "url": "https://search.m.yohobuy.com/?productPool=680&title=618抢先购-6.1折封顶&openby:yohobuy={\"action\":\"go.poollist\",\"params\":{\"title\":\"618抢先购-6.1折封顶\",\"productPool\":\"680\"}}"
|
|
|
100
|
- },
|
|
|
101
|
- {
|
|
|
102
|
- "bgColor": "",
|
|
|
103
|
- "src": "http://img11.static.yhbimg.com/yhb-img01/2018/03/06/11/019dea67754e6c4c08711b118c3d050891.JPG?imageView2/{mode}/w/{width}/h/{height}",
|
|
|
104
|
- "title": "秒杀",
|
|
|
105
|
- "url": "http://m.yohobuy.com/product/seckill?type=2&openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"param\":{\"type\":\"2\"},\"type\":\"2\",\"url\":\"http://m.yohobuy.com/product/seckill\"}}"
|
|
|
106
|
- },
|
|
|
107
|
- {
|
|
|
108
|
- "bgColor": "",
|
|
|
109
|
- "src": "http://img11.static.yhbimg.com/yhb-img01/2018/03/06/11/016a0402a7ff364326046b215f4d088cb8.JPG?imageView2/{mode}/w/{width}/h/{height}",
|
|
|
110
|
- "title": "",
|
|
|
111
|
- "url": "https://m.yohobuy.com/home/family?openby:yohobuy={\"action\":\"go.family\"}"
|
|
|
112
|
- }
|
|
|
113
|
- ],
|
|
|
114
|
- "focus_type": "2",
|
|
|
115
|
- "original_template_id": 1,
|
|
|
116
|
- "template_id": "1",
|
|
|
117
|
- "template_intro": "焦点图",
|
|
|
118
|
- "template_name": "focus"
|
|
|
119
|
- },
|
|
|
120
|
- {
|
|
|
121
|
- "template_name": "hotSeries",
|
|
|
122
|
- "data": [
|
|
|
123
|
- {
|
|
|
124
|
- "image_url": "http://img11.static.yhbimg.com/yhb-img01/2017/07/26/16/0186f834d5a21f26717254407c28fc3c53.jpg",
|
|
|
125
|
- "series_name": "哈哈",
|
|
|
126
|
- "series_id": "1"
|
|
|
127
|
- },
|
|
|
128
|
- {
|
|
|
129
|
- "image_url": "http://img11.static.yhbimg.com/yhb-img01/2017/07/26/16/0186f834d5a21f26717254407c28fc3c53.jpg",
|
|
|
130
|
- "series_name": "耐克",
|
|
|
131
|
- "series_id": "2"
|
|
|
132
|
- },
|
|
|
133
|
- {
|
|
|
134
|
- "image_url": "http://img11.static.yhbimg.com/yhb-img01/2017/07/26/16/0186f834d5a21f26717254407c28fc3c53.jpg",
|
|
|
135
|
- "series_name": "哈哈",
|
|
|
136
|
- "series_id": "1"
|
|
|
137
|
- },
|
|
|
138
|
- {
|
|
|
139
|
- "image_url": "http://img11.static.yhbimg.com/yhb-img01/2017/07/26/16/0186f834d5a21f26717254407c28fc3c53.jpg",
|
|
|
140
|
- "series_name": "耐克",
|
|
|
141
|
- "series_id": "2"
|
|
|
142
|
- },
|
|
|
143
|
- {
|
|
|
144
|
- "image_url": "http://img11.static.yhbimg.com/yhb-img01/2017/07/26/16/0186f834d5a21f26717254407c28fc3c53.jpg",
|
|
|
145
|
- "series_name": "哈哈",
|
|
|
146
|
- "series_id": "1"
|
|
|
147
|
- },
|
|
|
148
|
- {
|
|
|
149
|
- "image_url": "http://img11.static.yhbimg.com/yhb-img01/2017/07/26/16/0186f834d5a21f26717254407c28fc3c53.jpg",
|
|
|
150
|
- "series_name": "耐克",
|
|
|
151
|
- "series_id": "2"
|
|
|
152
|
- },
|
|
|
153
|
- {
|
|
|
154
|
- "image_url": "http://img11.static.yhbimg.com/yhb-img01/2017/07/26/16/0186f834d5a21f26717254407c28fc3c53.jpg",
|
|
|
155
|
- "series_name": "耐克",
|
|
|
156
|
- "series_id": "2"
|
|
|
157
|
- },
|
|
|
158
|
- ],
|
|
|
159
|
- "template_intro": "热门系列",
|
|
|
160
|
- "template_id": "1"
|
|
|
161
|
- },
|
|
|
162
|
- {
|
|
|
163
|
- "template_name": "single_image",
|
|
|
164
|
- "data": [
|
|
|
165
|
- {
|
|
|
166
|
- "image_url": "http://img11.static.yhbimg.com/yhb-img01/2017/07/26/16/0186f834d5a21f26717254407c28fc3c53.jpg",
|
|
|
167
|
- "series_name": "",
|
|
|
168
|
- "series_id": "1"
|
|
|
169
|
- },
|
|
|
170
|
- {
|
|
|
171
|
- "image_url": "http://img11.static.yhbimg.com/yhb-img01/2017/07/26/16/0186f834d5a21f26717254407c28fc3c53.jpg",
|
|
|
172
|
- "series_name": "",
|
|
|
173
|
- "series_id": "2"
|
|
|
174
|
- }
|
|
|
175
|
- ],
|
|
|
176
|
- "template_intro": "热门系列",
|
|
|
177
|
- "template_id": "1"
|
|
|
178
|
- },
|
|
|
179
|
- {
|
|
|
180
|
- "template_name": "twoPicture",
|
|
|
181
|
- "data": [
|
|
|
182
|
- {
|
|
|
183
|
- "src": "http://img11.static.yhbimg.com/yhb-img01/2019/09/24/14/01bdf0e379025b33c9690861b843dbd966.jpg",
|
|
|
184
|
- "id": "",
|
|
|
185
|
- "url": "https://m.yohobuy.com/?openby:yohobuy={'action':'go.bargainlist'}"
|
|
|
186
|
- },
|
|
|
187
|
- {
|
|
|
188
|
- "src": "http://img11.static.yhbimg.com/yhb-img01/2019/09/24/14/01bdf0e379025b33c9690861b843dbd966.jpg",
|
|
|
189
|
- "id": "",
|
|
|
190
|
- "url": "https://m.yohobuy.com/?openby:yohobuy={'action':'go.bargainlist'}"
|
|
|
191
|
- },
|
|
|
192
|
- ],
|
|
|
193
|
- "template_intro": "热门系列",
|
|
|
194
|
- "template_id": "1"
|
|
|
195
|
- },
|
|
|
196
|
- {
|
|
|
197
|
- "template_name": "single_image",
|
|
|
198
|
- "data": [
|
|
|
199
|
- {
|
|
|
200
|
- "image_url": "http://img11.static.yhbimg.com/yhb-img01/2017/07/26/16/0186f834d5a21f26717254407c28fc3c53.jpg",
|
|
|
201
|
- "series_name": "",
|
|
|
202
|
- "series_id": "1"
|
|
|
203
|
- },
|
|
|
204
|
- {
|
|
|
205
|
- "image_url": "http://img11.static.yhbimg.com/yhb-img01/2017/07/26/16/0186f834d5a21f26717254407c28fc3c53.jpg",
|
|
|
206
|
- "series_name": "",
|
|
|
207
|
- "series_id": "2"
|
|
|
208
|
- }
|
|
|
209
|
- ],
|
|
|
210
|
- "template_intro": "热门系列",
|
|
|
211
|
- "template_id": "1"
|
|
|
212
|
- },
|
|
|
213
|
-
|
|
|
214
|
- ],
|
|
|
215
|
}
|
46
|
}
|
216
|
},
|
47
|
},
|
217
|
computed: {
|
48
|
computed: {
|
218
|
...mapState(['channelList']),
|
49
|
...mapState(['channelList']),
|
219
|
},
|
50
|
},
|
220
|
- created() {
|
|
|
221
|
-
|
|
|
222
|
- },
|
|
|
223
|
mounted() {
|
51
|
mounted() {
|
224
|
this.fetchChannelList();
|
52
|
this.fetchChannelList();
|
225
|
this.fetchProductList();
|
53
|
this.fetchProductList();
|
226
|
},
|
54
|
},
|
|
|
55
|
+ created() {
|
|
|
56
|
+
|
|
|
57
|
+ },
|
227
|
methods: {
|
58
|
methods: {
|
228
|
...mapActions(['fetchChannelList','fetchProductList']),
|
59
|
...mapActions(['fetchChannelList','fetchProductList']),
|
229
|
|
60
|
|
|
@@ -231,7 +62,6 @@ export default { |
|
@@ -231,7 +62,6 @@ export default { |
231
|
await this.fetchProductList();
|
62
|
await this.fetchProductList();
|
232
|
setTimeout(() => { this.$refs.scroll.forceUpdate() }, 1000)
|
63
|
setTimeout(() => { this.$refs.scroll.forceUpdate() }, 1000)
|
233
|
}
|
64
|
}
|
234
|
-
|
|
|
235
|
},
|
65
|
},
|
236
|
components: {
|
66
|
components: {
|
237
|
Slider,
|
67
|
Slider,
|
|
@@ -247,6 +77,29 @@ export default { |
|
@@ -247,6 +77,29 @@ export default { |
247
|
</script>
|
77
|
</script>
|
248
|
|
78
|
|
249
|
<style lang="scss" scoped>
|
79
|
<style lang="scss" scoped>
|
|
|
80
|
+.scroll-app {
|
|
|
81
|
+ position: absolute;
|
|
|
82
|
+ top: 0;
|
|
|
83
|
+ left: 0;
|
|
|
84
|
+ right: 0;
|
|
|
85
|
+ bottom: 0;
|
|
|
86
|
+ overflow: hidden;
|
|
|
87
|
+ font-size: 0.6rem;
|
|
|
88
|
+ display: -webkit-box;
|
|
|
89
|
+ display: -webkit-flex;
|
|
|
90
|
+ display: flex;
|
|
|
91
|
+ -webkit-box-orient: vertical;
|
|
|
92
|
+ -webkit-box-direction: normal;
|
|
|
93
|
+ -webkit-flex-direction: column;
|
|
|
94
|
+ flex-direction: column;
|
|
|
95
|
+}
|
|
|
96
|
+.scroll-flex {
|
|
|
97
|
+ -webkit-box-flex: 1;
|
|
|
98
|
+ -webkit-flex: 1;
|
|
|
99
|
+ flex: 1;
|
|
|
100
|
+ overflow: hidden;
|
|
|
101
|
+ position: relative;
|
|
|
102
|
+}
|
250
|
.scroll-list-wrap {
|
103
|
.scroll-list-wrap {
|
251
|
height: 100%;
|
104
|
height: 100%;
|
252
|
width: 100%;
|
105
|
width: 100%;
|