|
|
@@ -42,7 +42,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, reactive, onMounted } from 'vue'
|
|
|
+import { ref, reactive, onMounted, computed } from 'vue'
|
|
|
// import { useRouter, useRoute } from 'vue-router'
|
|
|
// import { useStore } from '@/store'
|
|
|
import Message from '@/utils/Message'
|
|
|
@@ -68,6 +68,18 @@ const handleCurrentChange = (val: number) => {
|
|
|
pageConfig.page = val
|
|
|
getTableData()
|
|
|
}
|
|
|
+const platform = computed(() => {
|
|
|
+ var u = navigator.userAgent
|
|
|
+ return {
|
|
|
+ mobile: !!u.match(/AppleWebKit.*Mobile.*/), // 是否为移动终端
|
|
|
+ ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), // ios终端
|
|
|
+ android: u.indexOf('Android') > -1 || u.indexOf('Adr') > -1, // android终端
|
|
|
+ iPhone: u.indexOf('iPhone') > -1, // 是否为iPhone或者QQHD浏览器
|
|
|
+ iPad: u.indexOf('iPad') > -1, // 是否iPad
|
|
|
+ webApp: u.indexOf('Safari') === -1, // 是否web应该程序,没有头部与底部
|
|
|
+ weixin: u.indexOf('MicroMessenger') > -1 // 是否微信
|
|
|
+ }
|
|
|
+})
|
|
|
const getTableData = async() => {
|
|
|
const params = {
|
|
|
page: pageConfig.page,
|
|
|
@@ -94,7 +106,7 @@ const addPage = () => {
|
|
|
}
|
|
|
onMounted(async() => {
|
|
|
getTableData()
|
|
|
- if (vanList.value) {
|
|
|
+ if (vanList.value && platform.value.mobile) {
|
|
|
vanList.value.onLoad(1)
|
|
|
}
|
|
|
})
|