xiaokuang 16 ore fa
parent
commit
7942e297f7
2 ha cambiato i file con 12 aggiunte e 6 eliminazioni
  1. 10 5
      pages/index/home.vue
  2. 2 1
      pages/news/index.vue

+ 10 - 5
pages/index/home.vue

@@ -26,8 +26,8 @@
 			</view>
 			<view class="panel-group panel-group-1">
 				<u-panel title="精彩视频" link="https://www.productronicachina.com.cn/for-journalists-impression-videos">
-					<u-swiper :items="videos" useComponentName="videoSwiper" :height="360" :autoplay="false" :border-radius="10" :image-width="508"
-						:image-height="286" next-margin="100rpx" />
+					<u-swiper :items="videos" useComponentName="videoSwiper" :height="360" :autoplay="false" :border-radius="10"
+						:image-width="508" :image-height="286" next-margin="100rpx" />
 				</u-panel>
 				<u-panel title="精彩图集" link="https://www.productronicachina.com.cn/for-journalists-impression-videos">
 					<view class="album">
@@ -50,7 +50,7 @@
 						<template v-slot="{ scope }">
 							<view class="partners">
 								<template v-for="(item, index) in scope">
-									<view class="partner" :key="index">
+									<view class="partner" :key="index" @tap="onLogoClick(item)">
 										<image :src="item.url" />
 									</view>
 								</template>
@@ -76,13 +76,13 @@
 						<template v-slot="{ scope }">
 							<view class="partners">
 								<template v-for="(item, index) in scope">
-									<view class="partner" :key="index">
+									<view class="partner" :key="index" @tap="onLogoClick(item)">
 										<image :src="item.url" />
 									</view>
 								</template>
 							</view>
 						</template>
-					</u-swiper>	
+					</u-swiper>
 				</u-panel>
 			</view>
 		</view>
@@ -221,6 +221,11 @@
 					this.part1 = res.data.module4.part1.logo
 					this.part2 = res.data.module4.part2.logo
 				})
+			},
+			onLogoClick(item) {
+				if (item.url) {
+					this.navigateTo(item.href)
+				}
 			}
 		}
 	}

+ 2 - 1
pages/news/index.vue

@@ -60,7 +60,8 @@
 				this.tabActive = options.type
 			}
 		},
-		created() {
+		mounted() {
+			this.getNewsList()
 		},
 		methods: {
 			getList() {