From cb2a3544ff1d30ef722a536210d6644a97d0ae77 Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期三, 26 七月 2023 09:13:14 +0800 Subject: [PATCH] no message --- h5/apph5/pages/index/index.vue | 71 ++++++++++++++++++++--------------- h5/apph5/manifest.json | 1 h5/apph5/pages.json | 3 + 3 files changed, 43 insertions(+), 32 deletions(-) diff --git a/h5/apph5/manifest.json b/h5/apph5/manifest.json index 64dd969..1b35728 100644 --- a/h5/apph5/manifest.json +++ b/h5/apph5/manifest.json @@ -74,6 +74,7 @@ "mode" : "history" }, "devServer" : { + "public" : "0.0.0.0", "proxy" : { //閰嶇疆浠g悊鏈嶅姟鍣ㄦ潵瑙e喅璺ㄥ煙闂锛寀niapp涓嶉�傜敤CORS鏂规鍜岃缃甁SONP鏂规 "/api/" : { diff --git a/h5/apph5/pages.json b/h5/apph5/pages.json index eba7535..44c65f1 100644 --- a/h5/apph5/pages.json +++ b/h5/apph5/pages.json @@ -3,7 +3,8 @@ { "path": "pages/index/index", "style": { - "navigationBarTitleText": "uni-app" + "navigationStyle":"custom",//涓嶆樉绀哄ご閮� + "navigationBarTitleText": "澶ц繑瀹�" } }, { 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