fix: 屏幕宽度确定pc/mobile模板问题
This commit is contained in:
@@ -7,7 +7,7 @@ use Detection\MobileDetect;
|
|||||||
|
|
||||||
$detect = new MobileDetect();
|
$detect = new MobileDetect();
|
||||||
$view_device_name = 'pc';
|
$view_device_name = 'pc';
|
||||||
if ($detect->isMobile() || $detect->isTablet()) {
|
if ($detect->isMobile() || $detect->isTablet() || request()->get('mtpl') == 1) {
|
||||||
$view_device_name = 'mobile';
|
$view_device_name = 'mobile';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,13 @@
|
|||||||
<script type="text/javascript" src="https://unpkg.com/swiper@9.4.1/swiper-bundle.min.js"></script>
|
<script type="text/javascript" src="https://unpkg.com/swiper@9.4.1/swiper-bundle.min.js"></script>
|
||||||
<script type="text/javascript" src="__JS__/before-after.min.js"></script>
|
<script type="text/javascript" src="__JS__/before-after.min.js"></script>
|
||||||
<script type="text/javascript" src="__JS__/large.js"></script>
|
<script type="text/javascript" src="__JS__/large.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(window).ready(function() {
|
||||||
|
if ($(window).width() < 1024) {
|
||||||
|
window.location.href = '?mtpl=1';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{block name="header"}
|
{block name="header"}
|
||||||
|
|||||||
Reference in New Issue
Block a user