From 8dcfae4fff98fbbb19ff46bd9750f25bc56801a9 Mon Sep 17 00:00:00 2001
From: zhaojs <349234519@qq.com>
Date: 星期一, 31 七月 2023 10:42:20 +0800
Subject: [PATCH] Merge branch 'release/v1.1.5发布'

---
 h5/apph5/pages/index/index.vue |   71 ++++++++++++++++++++---------------
 1 files changed, 40 insertions(+), 31 deletions(-)

diff --git a/h5/apph5/pages/index/index.vue b/h5/apph5/pages/index/index.vue
index b6baf1e..d2c1124 100644
--- a/h5/apph5/pages/index/index.vue
+++ b/h5/apph5/pages/index/index.vue
@@ -1,6 +1,8 @@
 <template>
 	<view class="content">
-		
+		<view @click="openTuer()">鐐瑰嚮璺宠浆澶ц繑瀹�</view>
+
+		<a :href="tourl">test:</a>
 	</view>
 </template>
 
@@ -8,22 +10,47 @@
 	export default {
 		data() {
 			return {
-				title: 'Hello'
+				timer:null,
+				tourl: 'dafanguan://{"url":"/pages/rankinglist/common_act?t_url=http://appapitest.ushopvip.com/html/freebuy.html","totype":"0"}'
 			}
 		},
 		onLoad() {
-		var data={
-			actid:'sdfsdf',
-			dat:{
-				nvt:1,
-				ist:'3235'
-			}
-		}
-		this.$http.post('/api/activity/getRankingList',data).then(res=>{
-			
-		})
 		},
 		methods: {
+			openTuer() {
+				if (this.isBlackApp()) {
+					uni.showToast({
+						title: '璇峰鍒舵閾炬帴锛岃嚦娴忚鍣ㄤ腑鎵撳紑',
+						icon: 'none'
+					});
+				} else {
+					// 涓嶆槸澶撮儴APP灏辩洿鎺ユ墦寮�
+					this.openApp();
+				}
+			},
+			openApp() {
+				//杩欓噷闇�瑕佹湁涓畨鍗撳拰ios骞冲彴鐨勫垽鏂垎鍒彇涓嶅悓鐨凷chemeURL
+				this.jumpApp(this.tourl); //姝ゅ嚱鏁拌礋璐f墦寮�APP鐨�,scheme鍗忚鍦板潃鐢卞畨鍗撶璺焛os绔彁渚�
+				this.noApp(); //姝ゅ嚱鏁拌礋璐e鏋滄病鏈夋墦寮�APP鎴栨病鏈夊畨瑁匒PP鏃惰烦杞殑鍦板潃澶勭悊
+			},
+			isBlackApp() {
+				var u = navigator.userAgent.toLowerCase();
+				return /micromessenger/i.test(u) || u.indexOf("weibo") > -1 || u.indexOf("qq") > -1 || u.indexOf(
+					'mqqbrowser') > -1;
+			},
+			jumpApp(t)
+			{
+				window.location.href=t;
+			},
+			noApp() {
+				//杩欓噷闇�瑕佹湁涓畨鍗撳拰ios骞冲彴鐨勫垽鏂垎鍒彇涓嶅悓鐨勪笅杞藉湴鍧�
+			  var t = Date.now(),r = "浣犵殑app涓嬭浇鍦板潃";
+			  this.timer = setTimeout(function() {
+			    return Date.now() - t > 2200
+			      ? (clearTimeout(this.timer), !1)
+			      : !document.webkitHidden && !document.hidden && void (location.href = r);
+			  }, 2000);
+			}
 
 		}
 	}
@@ -37,22 +64,4 @@
 		justify-content: center;
 	}
 
-	.logo {
-		height: 200rpx;
-		width: 200rpx;
-		margin-top: 200rpx;
-		margin-left: auto;
-		margin-right: auto;
-		margin-bottom: 50rpx;
-	}
-
-	.text-area {
-		display: flex;
-		justify-content: center;
-	}
-
-	.title {
-		font-size: 36rpx;
-		color: #8f8f94;
-	}
-</style>
+</style>
\ No newline at end of file

--
Gitblit v1.9.3