maochaoying 2 years ago
parent
commit
2bc7e3dba3
  1. 28
      index.html
  2. 4
      src/App.vue
  3. 7
      src/common/utils.js
  4. 9
      src/entry-client.js
  5. 2
      stats.html

28
index.html

@ -8,22 +8,22 @@
/>
<title>产品梦工厂</title>
<link rel="shortcut icon" href="./logo.ico" />
<script
type="text/javascript"
src="https://api.map.baidu.com/api?v=1.0&&type=webgl&ak=17ODuchhGW7mcLRYumeQAV3ofrL9Zj3L"
></script>
<script>
var _hmt = _hmt || []
;(function () {
var hm = document.createElement('script')
hm.src = 'https://hm.baidu.com/hm.js?aead83b1b0f20ee468cdb1a81eb2e9c8'
var s = document.getElementsByTagName('script')[0]
s.parentNode.insertBefore(hm, s)
})()
</script>
<script type="module" src="/src/entry-client.js" defer></script>
</head>
<body>
<div id="app" style="min-width: 1280px"></div>
<script type="module" src="/src/main.js"></script>
</body>
<script
type="text/javascript"
src="https://api.map.baidu.com/api?v=1.0&&type=webgl&ak=17ODuchhGW7mcLRYumeQAV3ofrL9Zj3L"
></script>
<script>
var _hmt = _hmt || []
;(function () {
var hm = document.createElement('script')
hm.src = 'https://hm.baidu.com/hm.js?aead83b1b0f20ee468cdb1a81eb2e9c8'
var s = document.getElementsByTagName('script')[0]
s.parentNode.insertBefore(hm, s)
})()
</script>
</html>

4
src/App.vue

@ -9,12 +9,8 @@ import QRCode from 'cpns/QRCode'
import { toAnchor } from '@/common/utils'
import { useSwiperStore } from '@/store'
import { onMounted } from 'vue'
import { _isMobile } from '@/common/utils'
const swiperStore = useSwiperStore()
onMounted(() => {
if (_isMobile()) {
window.location.href = 'https://www.iflytop.com/mobile/'
}
window.addEventListener(
'popstate',
function (event) {

7
src/common/utils.js

@ -304,10 +304,3 @@ export const toAnchor = url => {
return 16
}
}
export const _isMobile = () => {
let flag = navigator.userAgent.match(
/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i,
)
return flag
}

9
src/entry-client.js

@ -0,0 +1,9 @@
if (
/(Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini)/i.test(
navigator.userAgent,
)
) {
window.location.href = 'https://www.iflytop.com/mobile/'
} else {
import('./main.js')
}

2
stats.html
File diff suppressed because it is too large
View File

Loading…
Cancel
Save