Browse Source

bug 修复

lilei 4 years ago
parent
commit
cc42071d64
2 changed files with 22 additions and 2 deletions
  1. 11 1
      pages/goods/index.vue
  2. 11 1
      pages/index/index.vue

+ 11 - 1
pages/goods/index.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
 	<view class="content">
 	<view class="content">
-		<u-swiper height="250" :list="imageTopList"></u-swiper>
+		<u-swiper height="250" @click="clickBanner" :list="imageTopList"></u-swiper>
 		<view class="t1">
 		<view class="t1">
 			<u-image height="40" src="/static/t1.png"></u-image>
 			<u-image height="40" src="/static/t1.png"></u-image>
 		</view>
 		</view>
@@ -55,6 +55,16 @@
 			})
 			})
 		},
 		},
 		methods: { 
 		methods: { 
+			// 点击banner
+			clickBanner(index){
+				let row = this.imageTopList[index]
+				console.log(index,row)
+				if(row.jumpType !== 'NONE'){
+					uni.navigateTo({
+						url: row.jumpUrl
+					})
+				}
+			},
 			// 获取banner
 			// 获取banner
 			getbannerList(){
 			getbannerList(){
 				bannerList({type:'banner',location:'MALL_TOP'}).then(res=>{
 				bannerList({type:'banner',location:'MALL_TOP'}).then(res=>{

+ 11 - 1
pages/index/index.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
 	<view class="content">
 	<view class="content">
-		<u-swiper height="250" :list="imageTopList" ></u-swiper>
+		<u-swiper height="250" @click="clickBanner" :list="imageTopList" ></u-swiper>
 		<!-- 导航按钮 -->
 		<!-- 导航按钮 -->
 		<view class="nav">
 		<view class="nav">
 			<u-grid :col="4" :border="false" @click="toPage">
 			<u-grid :col="4" :border="false" @click="toPage">
@@ -176,6 +176,16 @@
 					}
 					}
 				})
 				})
 			},
 			},
+			// 点击banner
+			clickBanner(index){
+				let row = this.imageTopList[index]
+				console.log(index,row)
+				if(row.jumpType !== 'NONE'){
+					uni.navigateTo({
+						url: row.jumpUrl
+					})
+				}
+			},
 			// 查询购物车
 			// 查询购物车
 			getCartList(){
 			getCartList(){
 				getCartList({}).then(res => {
 				getCartList({}).then(res => {