Browse Source

mobile

master
maochaoying 2 years ago
parent
commit
97393bc18b
  1. 4
      src/App.vue
  2. 7
      src/common/utils.js
  3. 2
      stats.html

4
src/App.vue

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

7
src/common/utils.js

@ -304,3 +304,10 @@ export const toAnchor = url => {
return 16 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
}

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

Loading…
Cancel
Save