Files
huangjingfen/pro_v3.5.1/view/uniapp/static/html/pc.html

64 lines
1.7 KiB
HTML
Raw Normal View History

2026-03-07 22:29:07 +08:00
<!DOCTYPE html>
<html lang=zh-CN>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1">
<title>PC端</title>
<meta name="Copyright" content="helang">
<link rel="shortcut icon" type="image/png" href="">
<meta name="keywords" content="">
<meta name="description" content="">
<style type="text/css">
body{
margin: 0;
background-color: #f3f3f3;
}
iframe{
width: 375px;
height: 667px;
background-color: #fff;
box-sizing: content-box;
border: none;
}
@media screen and (min-width: 450px) {
iframe {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
border: rgba(0,0,0,0.1) solid 1px;
border-radius: 4px;
}
}
</style>
</head>
<body>
<iframe id="app-frame"></iframe>
2026-03-07 22:29:07 +08:00
<script type="text/javascript">
window.isPC = true;
/* 根据当前地址推导 H5 根路径:本地 dev 多为 /,线上部署多为 /h5/ */
function h5AppRootPathname() {
var path = (window.location.pathname || '/').replace(/\/$/, '') || '/';
var marker = '/static/html/pc.html';
if (path.endsWith(marker)) {
var root = path.slice(0, -marker.length);
if (!root) root = '/';
return root === '/' ? '/' : (root + '/');
2026-03-07 22:29:07 +08:00
}
return '/';
2026-03-07 22:29:07 +08:00
}
var H5_ROOT = h5AppRootPathname();
document.getElementById('app-frame').src = H5_ROOT + '?type=1';
window.onresize = function(){
if (window.innerWidth <= 420) {
var target = H5_ROOT.replace(/\/$/, '');
window.location.pathname = target || '/';
}
};
2026-03-07 22:29:07 +08:00
</script>
</body>
</html>