Ver código fonte

商城轮播图跳转链接

DELL 3 anos atrás
pai
commit
d026c90496
2 arquivos alterados com 7 adições e 7 exclusões
  1. 4 4
      src/packageOperate/webview/index.vue
  2. 3 3
      src/pages/core/index.vue

+ 4 - 4
src/packageOperate/webview/index.vue

@@ -1,20 +1,20 @@
 <template>
 	<view>
-		<web-view :src="url"></web-view>
+		<web-view :src="linkUrl"></web-view>
 	</view>
 </template>
 <script>
 	export default {
 		data() {
 			return {
-				url: '',
+				linkUrl: '',
 			}
 		},
 
 		onLoad(options) {
 			//decodeURIComponent()函数可以识别并且分立出url
-			let fromPath = decodeURIComponent(options.url);
-			this.url = fromPath
+			let fromPath = decodeURIComponent(options.linkUrl);
+			this.linkUrl = fromPath
 		},
 	}
 </script>

+ 3 - 3
src/pages/core/index.vue

@@ -66,8 +66,8 @@
 		<!-- 轮播 -->
 		<view class="core-swiper" v-if="swiperList.length">
 			<swiper class="core-swiper-centent" circular :indicator-dots="true" :autoplay="true" :interval="3000" indicator-active-color="#fff">
-				<swiper-item class="swiper-item" v-for="(item, index) in swiperList" :key="index" @click="toPage(item)">
-					<image :src="item.picUrl" mode="scaleToFill"></image>
+				<swiper-item class="swiper-item" v-for="(item, index) in swiperList" :key="index">
+					<image :src="item.picUrl" mode="scaleToFill" @click="toPage(item)"></image>
 				</swiper-item>
 			</swiper>
 		</view>
@@ -424,7 +424,7 @@
 			toPage(item) {
 				if (item.type == "link") {
 					uni.navigateTo({
-						url: `/packageOperate/webview/index?url=${ item.linkUrl }`,
+						url: `/packageOperate/webview/index?linkUrl=${ item.linkUrl }`,
 					})
 				} else if (item.type == "tag") {
 					uni.navigateTo({