Sfoglia il codice sorgente

支付宝扫码跳转

hwb0 3 anni fa
parent
commit
7600e74c60
2 ha cambiato i file con 23 aggiunte e 13 eliminazioni
  1. 21 12
      src/App.vue
  2. 2 1
      src/pages/lucky/index.vue

+ 21 - 12
src/App.vue

@@ -1,10 +1,19 @@
 <script>
 	import $http from '@/utils/request.js'
+	import { urlParameter } from '@/utils/util.js'
 	export default {
 		globalData: {
 			userInfo: {},
 		},
-		onLaunch: function() {
+		onLaunch: function(options) {
+			console.log(`====参数app====`, options.query);
+			if (options.query && options.query.qrCode) {
+				const { qrCode } = options.query
+				let parameter = urlParameter(qrCode)
+				uni.reLaunch({
+					url: `/pages/lucky/index?id=${ parameter.id }`
+				})
+			}
 			uni.hideTabBar()
 		},
 		onShow: function() {
@@ -13,9 +22,9 @@
 		methods: {
 			updateManager() {
 				const updateManager = uni.getUpdateManager();
-				if(updateManager){
+				if (updateManager) {
 					updateManager.onCheckForUpdate(res => {
-					// 请求完新版本信息的回调
+						// 请求完新版本信息的回调
 					})
 					updateManager.onUpdateReady(() => {
 						uni.showModal({
@@ -72,35 +81,35 @@
 		align-items: center;
 		justify-content: center;
 	}
-	
-	.ells{
+
+	.ells {
 		overflow: hidden;
 		text-overflow: ellipsis;
 		display: -webkit-box;
 		-webkit-box-orient: vertical;
 		-webkit-line-clamp: 2;
 	}
-	
-	.ells-one{
+
+	.ells-one {
 		overflow: hidden;
 		text-overflow: ellipsis;
 		display: -webkit-box;
 		-webkit-box-orient: vertical;
 		-webkit-line-clamp: 1;
 	}
-	
+
 	@font-face {
-	    font-family: 'YouSheBiaoTiHei';
-	    src: url('https://mp-public-1310078123.cos.ap-shanghai.myqcloud.com/YouSheBiaoTiHei.ttf');
+		font-family: 'YouSheBiaoTiHei';
+		src: url('https://mp-public-1310078123.cos.ap-shanghai.myqcloud.com/YouSheBiaoTiHei.ttf');
 	}
-	
+
 	// 只有在app.vue里面定义的keyframes才能在style里面使用
 	@keyframes moveLeft {
 		0% {
 			-webkit-transform: translate3d(0, 0, 0);
 			transform: translate3d(0, 0, 0);
 		}
-	
+
 		100% {
 			-webkit-transform: translate3d(-100%, 0, 0);
 			transform: translate3d(-100%, 0, 0);

+ 2 - 1
src/pages/lucky/index.vue

@@ -112,10 +112,11 @@
 		},
 
 		onLoad(options) {
+			console.log(`====参数lucky====`, options.query);
 			if (options.id) {
 				this.serialNo = options.id
 				this.getDetail()
-			}
+			}	
 			if (options.q) {
 				let obj = urlParameter(decodeURIComponent(options.q))
 				this.serialNo = obj.id