Showing
4 changed files
with
70 additions
and
29 deletions
@@ -8,8 +8,20 @@ | @@ -8,8 +8,20 @@ | ||
8 | export default { | 8 | export default { |
9 | name: 'LayoutLink', | 9 | name: 'LayoutLink', |
10 | props: { | 10 | props: { |
11 | - href: String | 11 | + href: String, |
12 | + report: { | ||
13 | + type: Object, | ||
14 | + } | ||
15 | + }, | ||
16 | + watch: { | ||
17 | + 'report': function(newVal) { | ||
18 | + console.log(newVal); | ||
19 | + } | ||
12 | }, | 20 | }, |
21 | + // activated() { | ||
22 | + // console.log(this.report); | ||
23 | + // console.log("this.report"); | ||
24 | + // }, | ||
13 | methods: { | 25 | methods: { |
14 | jumpTo() { | 26 | jumpTo() { |
15 | if (!this.href) { | 27 | if (!this.href) { |
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | <input class="search-input" type="search" disabled="true" placeholder="搜索商品名称或货号"/> | 17 | <input class="search-input" type="search" disabled="true" placeholder="搜索商品名称或货号"/> |
18 | </div> | 18 | </div> |
19 | <template v-for="(item, index) in channelList.list"> | 19 | <template v-for="(item, index) in channelList.list"> |
20 | - <Swiper @click="getParams" :list="item.data" :key="index" v-if="item.template_name == 'threePicture'"/> | 20 | + <Swiper :list="item" :index="index" :key="index" v-if="item.template_name == 'threePicture'"/> |
21 | <Hot :list="item.data" :key="index" v-if="item.template_name == 'image_list'"/> | 21 | <Hot :list="item.data" :key="index" v-if="item.template_name == 'image_list'"/> |
22 | <Banner :list="item.data" :key="index" v-if="item.template_name == 'single_image'"/> | 22 | <Banner :list="item.data" :key="index" v-if="item.template_name == 'single_image'"/> |
23 | <TwoBanner :list="item.data" :key="index" v-if="item.template_name == 'twoPicture'"/> | 23 | <TwoBanner :list="item.data" :key="index" v-if="item.template_name == 'twoPicture'"/> |
@@ -56,6 +56,7 @@ export default { | @@ -56,6 +56,7 @@ export default { | ||
56 | props: ['hideHeader'], | 56 | props: ['hideHeader'], |
57 | data() { | 57 | data() { |
58 | return { | 58 | return { |
59 | + reportParams: {}, | ||
59 | options: { | 60 | options: { |
60 | pullUpLoad: true, | 61 | pullUpLoad: true, |
61 | // pullDownRefresh: true, | 62 | // pullDownRefresh: true, |
@@ -73,7 +74,6 @@ export default { | @@ -73,7 +74,6 @@ export default { | ||
73 | listBaseParams: { | 74 | listBaseParams: { |
74 | isHome: true, | 75 | isHome: true, |
75 | }, | 76 | }, |
76 | - | ||
77 | productList: { | 77 | productList: { |
78 | showErrorPage: false, | 78 | showErrorPage: false, |
79 | isFetching: false, | 79 | isFetching: false, |
@@ -118,13 +118,11 @@ export default { | @@ -118,13 +118,11 @@ export default { | ||
118 | if (!this.channelList.list || !this.channelList.list.length) { | 118 | if (!this.channelList.list || !this.channelList.list.length) { |
119 | this.fetchChannelList(); | 119 | this.fetchChannelList(); |
120 | } | 120 | } |
121 | + this.init(); | ||
121 | }, | 122 | }, |
122 | async serverPrefetch() { | 123 | async serverPrefetch() { |
123 | return this.fetchChannelList(); | 124 | return this.fetchChannelList(); |
124 | }, | 125 | }, |
125 | - mounted() { | ||
126 | - this.init(); | ||
127 | - }, | ||
128 | methods: { | 126 | methods: { |
129 | ...mapActions(['fetchChannelList']), | 127 | ...mapActions(['fetchChannelList']), |
130 | ...mapActionsList(['fetchProductList']), | 128 | ...mapActionsList(['fetchProductList']), |
@@ -225,9 +223,26 @@ export default { | @@ -225,9 +223,26 @@ export default { | ||
225 | }); | 223 | }); |
226 | }, | 224 | }, |
227 | 225 | ||
228 | - getParams() { | ||
229 | - console.log("2222"); | 226 | + getParams(params) { |
227 | + this.reportParams = params; | ||
228 | + console.log(this.reportParams); | ||
230 | } | 229 | } |
230 | + | ||
231 | + // getReportParams(item, index) { | ||
232 | + // let { template_id, template_name } = item; | ||
233 | + // let PAGE_URL = window.location.href; | ||
234 | + | ||
235 | + // this.searchParams = { | ||
236 | + // F_ID: template_id, | ||
237 | + // PAGE_URL, | ||
238 | + // F_INDEX: index + 1, | ||
239 | + // F_NAME: template_name, | ||
240 | + // I_INDEX: '', | ||
241 | + // F_URL: '', | ||
242 | + // } | ||
243 | + // console.log(item); | ||
244 | + // console.log(this.searchParams); | ||
245 | + // } | ||
231 | // onPullingDown() { | 246 | // onPullingDown() { |
232 | // let params = this.searchParams; | 247 | // let params = this.searchParams; |
233 | 248 |
1 | <template> | 1 | <template> |
2 | - <div v-if="list.length" class="swiper"> | 2 | + <div class="swiper" v-if="list.data && list.data.length > 0"> |
3 | <div class="swiper-item swiper-item-left"> | 3 | <div class="swiper-item swiper-item-left"> |
4 | - <LayoutLink :href="list[0].url" :report="reportParams" class="img-link"> | ||
5 | - <ImageFormat :lazy="false" class="item-imge" :src="list[0].src" :width="310" :height="402"></ImageFormat> | 4 | + <LayoutLink :href="list.data[0].url" class="img-link" :report="{...params, I_INDEX: 1}"> |
5 | + <ImageFormat :lazy="false" class="item-imge" :src="list.data[0].src" :width="310" :height="402"></ImageFormat> | ||
6 | </LayoutLink> | 6 | </LayoutLink> |
7 | </div> | 7 | </div> |
8 | <div class="swiper-item swiper-item-right"> | 8 | <div class="swiper-item swiper-item-right"> |
9 | - <LayoutLink :href="list[1].url" class="img-link"> | ||
10 | - <ImageFormat :lazy="false" class="item-imge" :src="list[1].src" :width="380" :height="196"></ImageFormat> | 9 | + <LayoutLink :href="list.data[1].url" class="img-link" :report="{...params, I_INDEX: 2}"> |
10 | + <ImageFormat :lazy="false" class="item-imge" :src="list.data[1].src" :width="380" :height="196"></ImageFormat> | ||
11 | </LayoutLink> | 11 | </LayoutLink> |
12 | - <LayoutLink :href="list[2].url" class="img-link"> | ||
13 | - <ImageFormat :lazy="false" class="item-imge" :src="list[2].src" :width="380" :height="196"></ImageFormat> | 12 | + <LayoutLink :href="list.data[2].url" class="img-link" :report="{...params, I_INDEX: 3}"> |
13 | + <ImageFormat :lazy="false" class="item-imge" :src="list.data[2].src" :width="380" :height="196"></ImageFormat> | ||
14 | </LayoutLink> | 14 | </LayoutLink> |
15 | </div> | 15 | </div> |
16 | </div> | 16 | </div> |
@@ -21,24 +21,38 @@ export default { | @@ -21,24 +21,38 @@ export default { | ||
21 | name: 'swiper', | 21 | name: 'swiper', |
22 | props: { | 22 | props: { |
23 | list: { | 23 | list: { |
24 | - type: Array, | ||
25 | - default: [] | 24 | + type: Object, |
26 | }, | 25 | }, |
26 | + index: { | ||
27 | + type: Number, | ||
28 | + } | ||
27 | }, | 29 | }, |
28 | data() { | 30 | data() { |
29 | return { | 31 | return { |
30 | - reportParams: { | ||
31 | - P_NAME: 'XY_UFOHome', | ||
32 | - P_PARAM: 'f788335b57b67c1711f255648c744dab', | ||
33 | - PAGE_URL: '当前页面URL', | ||
34 | - F_ID: '楼层唯一id', | ||
35 | - F_NAME: '楼层名称', | ||
36 | - F_INDEX: '楼层顺序号', | ||
37 | - I_INDEX: '楼层内部顺序号,从1开始,所有more按钮传0', | ||
38 | - ACTION_URL: '跳转URL', | ||
39 | - }, | 32 | + params: {}, |
40 | } | 33 | } |
41 | - } | 34 | + }, |
35 | + mounted() { | ||
36 | + // console.log(this.list) | ||
37 | + }, | ||
38 | + activated() { | ||
39 | + let { template_id, template_name } = this.list; | ||
40 | + let PAGE_URL = window.location.href; | ||
41 | + let F_INDEX = this.index + 1; | ||
42 | + let params = { | ||
43 | + P_NAME: 'XY_UFOHome', | ||
44 | + P_PARAM: 'cfcd8de156d3edc26c84091804c43e23', | ||
45 | + F_ID: template_id, | ||
46 | + PAGE_URL, | ||
47 | + F_INDEX, | ||
48 | + F_NAME: template_name, | ||
49 | + F_URL: 'F_URL', | ||
50 | + } | ||
51 | + this.params = params; | ||
52 | + }, | ||
53 | + methods: { | ||
54 | + | ||
55 | + }, | ||
42 | }; | 56 | }; |
43 | </script> | 57 | </script> |
44 | 58 |
@@ -51,7 +51,7 @@ export default function() { | @@ -51,7 +51,7 @@ export default function() { | ||
51 | }, | 51 | }, |
52 | async fetchChannelList({ commit }) { | 52 | async fetchChannelList({ commit }) { |
53 | const result = await this.$api.get('/api/ufo/channel/channelList', { | 53 | const result = await this.$api.get('/api/ufo/channel/channelList', { |
54 | - content_code: 'cfcd8de156d3edc26c84091804c43e23', | 54 | + content_code: 'f788335b57b67c1711f255648c744dab', |
55 | }); | 55 | }); |
56 | if (result.code === 200) { | 56 | if (result.code === 200) { |
57 | commit(Types.FETCH_CHANNEL, { list: result.data }); | 57 | commit(Types.FETCH_CHANNEL, { list: result.data }); |
-
Please register or login to post a comment