Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
penjj committed Jan 8, 2024
1 parent 092adfe commit 14e2757
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"packageManager": "[email protected]",
"scripts": {
"dev": "astro dev",
"build": "astro build",
"build": "cp -r public dist",
"preview": "astro preview",
"prepare": "simple-git-hooks",
"ts-check": "tsc --noEmit && astro check --noEmit",
Expand Down
2 changes: 1 addition & 1 deletion public/CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
me.unco.site
demo.unco.site
62 changes: 62 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!doctype html>
<html lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1" />
<title>打开小程序</title>
<style>
* {
margin: 0;
padding: 0;
border: none;
}

body,
html {
height: 100%;
}

.container {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}

.btn {
padding: 10px 20px;
background: #07c160;
font-size: 17px;
color: #fff;
border-radius: 5px;
}

.displayNo {
display: none;
}
</style>
</head>

<body>
<div class="container">
<div id="jump-btn" class="btn displayNo" onclick="openWeapp()">打开小程序</div>
<div id="tip" class="tip displayNo">请在手机上打开网页链接</div>
</div>
<script src="https://hm.baidu.com/hm.js?d1054cae0cbf68aac88c08c4cfef1396"></script>
<script>
var btnElem = document.getElementById('jump-btn')
var tipElem = document.getElementById('tip')
if (navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|IEMobile)/i)) {
btnElem.classList.remove('displayNo')
} else {
tipElem.classList.remove('displayNo')
}
var uRLScheme = 'weixin://dl/business/?ticket=l259dfcade2d3996caf26803cf90b0dfe'
function openWeapp() {
location.href = uRLScheme
}
</script>
</body>

</html>

0 comments on commit 14e2757

Please sign in to comment.