Преглед изворни кода

新增兑换大厅轮播图跳转外链接

DELL пре 3 година
родитељ
комит
da10219350
3 измењених фајлова са 40 додато и 9 уклоњено
  1. 2 0
      pages.json
  2. 7 9
      pages/coupon/index.vue
  3. 31 0
      pages/webview/index.vue

+ 2 - 0
pages.json

@@ -59,6 +59,8 @@
 		"path": "pages/share/index"
 	}, {
 		"path": "pages/coreRange/coreRange"
+	}, {
+		"path": "pages/webview/index"
 	}],
 	"tabBar": {
 		"custom": true,

+ 7 - 9
pages/coupon/index.vue

@@ -50,8 +50,8 @@
 				radiovalue1: '', //选中项的下标
 				couponId: '', //选中项的id
 				boxId: '',
-				ticketId:'',
-				
+				ticketId: '',
+
 			};
 		},
 		onShow() {
@@ -59,8 +59,8 @@
 		},
 		onLoad(opthios) {
 			this.boxId = opthios.boxId
-			
-			if(opthios.ticketId){
+
+			if (opthios.ticketId) {
 				this.ticketId = opthios.ticketId
 			}
 			if (opthios.couponId) {
@@ -97,12 +97,11 @@
 
 			// 点击切换事件
 			changeChechk(e) {
-				
-				if(this.couponId == e){
+				if (this.couponId == e) {
 					this.radiovalue1 = -1
 					this.couponId = []
 					return
-				}else{
+				} else {
 					this.couponId = [e]
 					return
 				}
@@ -110,7 +109,6 @@
 
 			// 点击确认事件
 			exchange() {
-				console.log(this.ticketId)
 				let data = {
 					userCouponIds: this.couponId,
 					autoCoupon: 0,
@@ -130,7 +128,7 @@
 								.data.couponList[0].discount,
 							couponId: res.data && res.data.couponList && res.data.couponList.length && res.data
 								.couponList[0].id,
-							listNum:this.listNum
+							listNum: this.listNum
 						}
 						page.$vm.payInfo = payInfo
 						uni.navigateBack({

+ 31 - 0
pages/webview/index.vue

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