li.shaoyi 2 anni fa
parent
commit
49308b6eee

+ 21 - 10
src/business/goods/index.ts

@@ -45,8 +45,16 @@ export function useWrstandardList() {
 
 // 采购详细
 export function useWrstandardDetails(wrstandardid: number) {
+    type OptionalType<T, R extends keyof T> = Omit<T, R> & { [key in R]: Partial<T[R]> } // 指定某个属性为可选
+
     const loading = shallowRef(false)
-    const details = shallowRef<Partial<Model.THJWrstandardDetailRsp>>({})
+    const details = shallowRef<OptionalType<Model.THJWrstandardDetailRsp, 'goodsinfo'>>({
+        deliverymodes: [],
+        deliverymonth: [],
+        goodsinfo: {},
+        presaleapplydeposits: [],
+        spotgoodspricelogs: []
+    })
     const customDeposits = shallowRef<Model.THJinvesotrdepositRsp[]>([]) // 个性化定金比例
 
     // 图表数据
@@ -55,9 +63,10 @@ export function useWrstandardDetails(wrstandardid: number) {
         date: []
     })
 
+    // 获取采购详情
     const getWrstandardDetails = async () => {
         loading.value = true
-        const task1 = queryTHJWrstandardDetail({
+        return queryTHJWrstandardDetail({
             data: {
                 wrstandardid,
             },
@@ -69,19 +78,23 @@ export function useWrstandardDetails(wrstandardid: number) {
                     chartData.date.push(tradedate)
                 })
             },
+            complete: () => {
+                loading.value = false
+            }
         })
-        const task2 = queryTHJinvesotrdeposit({
+    }
+
+    // 获取个性化定金比例
+    const getTHJinvesotrdeposit = (presaleapplyid: string) => {
+        return queryTHJinvesotrdeposit({
             data: {
                 userid: userId.value,
-                wrstandardid
+                presaleapplyid
             },
             success: (res) => {
                 customDeposits.value = res.data
             }
         })
-        await Promise.all([task1, task2]).finally(() => {
-            loading.value = false
-        })
     }
 
     return {
@@ -90,10 +103,10 @@ export function useWrstandardDetails(wrstandardid: number) {
         customDeposits,
         chartData,
         getWrstandardDetails,
+        getTHJinvesotrdeposit,
     }
 }
 
-
 // 用户商品收藏信息
 export function useUserFavoriteGoods(goodsid: number) {
     // 添加收藏
@@ -196,8 +209,6 @@ export function useQueryTHJProductLists() {
     }
 }
 
-
-
 // 查询市场运行信息
 export function useQueryMarketRunLists() {
     const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.MarketRunRsp>()

+ 29 - 28
src/packages/mobile/assets/themes/base/reset.less

@@ -1,14 +1,14 @@
 @import './animation.less';
 
 * {
-    font-family                : -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, Simsun, sans-serif;
-    margin                     : 0;
-    padding                    : 0;
-    box-sizing                 : border-box;
-    background-repeat          : no-repeat;
-    background-position        : center center;
-    background-size            : contain;
-    outline                    : none;
+    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, Simsun, sans-serif;
+    margin: 0;
+    padding: 0;
+    box-sizing: border-box;
+    background-repeat: no-repeat;
+    background-position: center center;
+    background-size: contain;
+    outline: none;
     -webkit-tap-highlight-color: transparent;
 
     //-webkit-appearance: none;
@@ -22,20 +22,21 @@ html {
 }
 
 body {
-    height                    : inherit;
-    font-size                 : .28rem;
-    color                     : #333;
-    background-color          : #666;
-    margin                    : auto !important;
-    overflow                  : hidden;
+    position: relative;
+    height: inherit;
+    font-size: .28rem;
+    color: #333;
+    background-color: #666;
+    margin: auto !important;
+    overflow: hidden;
     -webkit-overflow-scrolling: touch;
 
     a {
         text-decoration: none;
-        color          : #333;
+        color: #333;
 
         &:hover {
-            color          : inherit;
+            color: inherit;
             text-decoration: underline;
         }
 
@@ -52,12 +53,12 @@ body {
     h4,
     h5,
     h6 {
-        margin     : 0;
+        margin: 0;
         font-weight: normal;
     }
 
     img {
-        border   : 0;
+        border: 0;
         max-width: 100%;
     }
 
@@ -65,10 +66,10 @@ body {
     input,
     textarea,
     select {
-        line-height     : initial;
-        border          : 0;
+        line-height: initial;
+        border: 0;
         background-color: transparent;
-        outline         : none;
+        outline: none;
 
         &:focus {
             outline: none;
@@ -76,10 +77,10 @@ body {
     }
 
     button {
-        display        : inline-flex;
+        display: inline-flex;
         justify-content: center;
-        align-items    : center;
-        cursor         : pointer;
+        align-items: center;
+        cursor: pointer;
 
         span {
             display: inline-block;
@@ -103,9 +104,9 @@ body {
 }
 
 .app {
-    width           : 100%;
-    height          : 100%;
+    position: relative;
+    width: 100%;
+    height: 100%;
     background-color: #fff;
-    position        : relative;
-    overflow-x      : hidden;
+    overflow-x: hidden;
 }

+ 3 - 3
src/packages/mobile/components/base/tabbar/index.vue

@@ -27,7 +27,7 @@
 <script lang="ts" setup>
 import { PropType, computed } from 'vue'
 import { Tabbar } from './interface'
-import client from '@/utils/client'
+import { themeStore } from '@/stores'
 import AppIconfont from '@mobile/components/base/iconfont/index.vue'
 
 const emit = defineEmits(['click'])
@@ -50,11 +50,11 @@ const props = defineProps({
   }
 })
 
-const { state } = client
+const { clientWidth } = themeStore.$mapState()
 
 const styles = computed(() => ({
   position: props.fixed ? 'fixed' : 'static',
-  width: state.clientWidth + 'px',
+  width: clientWidth.value + 'px',
 }))
 
 const onClick = (index: number) => {

+ 3 - 3
src/packages/mobile/components/layouts/navbar/index.vue

@@ -31,7 +31,7 @@
 <script lang="ts" setup>
 import { useAttrs, computed } from 'vue'
 import { useRouter } from 'vue-router'
-import client from '@/utils/client'
+import { themeStore } from '@/stores'
 
 const emit = defineEmits<{ (event: string, ...args: unknown[]): void }>()
 
@@ -49,11 +49,11 @@ const props = defineProps({
 
 const router = useRouter();
 const attrs = useAttrs();
-const { state } = client;
+const { clientWidth } = themeStore.$mapState();
 
 const styles = computed(() => ({
   position: props.fixed ? 'fixed' : 'static',
-  width: state.clientWidth + 'px',
+  width: clientWidth.value + 'px',
 }))
 
 // 返回按钮事件

+ 8 - 6
src/packages/mobile/components/layouts/page/index.less

@@ -23,7 +23,7 @@
 .route-in-leave-to {
     &::after {
         content: '';
-        position: fixed;
+        position: absolute;
         z-index: 100;
         top: 0;
         left: 0;
@@ -40,13 +40,13 @@
 }
 
 .route-in-enter-active {
-    position: fixed;
+    position: absolute;
     z-index: 1000;
     top: 0;
 }
 
 .route-out-leave-active {
-    position: fixed;
+    position: absolute;
     z-index: 1000;
     transform: translate3d(100%, 0, 0);
 }
@@ -61,7 +61,7 @@
 .route-out-enter-to {
     &::after {
         content: '';
-        position: fixed;
+        position: absolute;
         z-index: 100;
         top: 0;
         left: 0;
@@ -78,6 +78,8 @@
     height: 100%;
     overflow-y: auto;
     background-color: #f6f6f6;
-    padding-bottom: constant(safe-area-inset-bottom); /* 兼容 iOS<11.2 */
-    padding-bottom: env(safe-area-inset-bottom); /* 兼容iOS>= 11.2 */
+    padding-bottom: constant(safe-area-inset-bottom);
+    /* 兼容 iOS<11.2 */
+    padding-bottom: env(safe-area-inset-bottom);
+    /* 兼容iOS>= 11.2 */
 }

+ 4 - 3
src/packages/mobile/main.ts

@@ -7,12 +7,12 @@ import directives from '@/directives' // 自定义指令集
 //import 'default-passive-events'
 import '@/services/subscribe' // 全局订阅通知
 import '@/utils/h5plus' // 加载html5+
-import client from '@/utils/client' // 适配客户端
 import layouts from './components/layouts' // 全局布局组件
 import 'vant/lib/index.css'
 import './assets/iconfont/iconfont.js'
 import './assets/themes/style.less' // 主题样式
 import { timerInterceptor } from '@/utils/timer'
+import { themeStore } from '@/stores'
 // import Vconsole from 'vconsole'
 // new Vconsole()
 
@@ -24,7 +24,8 @@ app.mount('#app')
 
 // 等待 html 加载完成
 document.addEventListener('DOMContentLoaded', () => {
-    client.screenAdapter(true);
+    // 适配客户端
+    themeStore.actions.screenAdapter(true)
     // 监听窗口大小变化
-    window.addEventListener('resize', timerInterceptor.setDebounce(() => client.screenAdapter(true)));
+    window.addEventListener('resize', timerInterceptor.setDebounce(() => themeStore.actions.screenAdapter(true)))
 }, false)

+ 5 - 4
src/packages/mobile/views/purchase/detail/index.vue

@@ -115,13 +115,13 @@ const { router, getQueryStringToNumber } = useNavigation()
 const wrstandardid = getQueryStringToNumber('wrstandardid')
 const formRef = shallowRef<FormInstance>()
 
-const { loading, details, customDeposits, chartData, getWrstandardDetails } = useWrstandardDetails(wrstandardid)
+const { loading, details, customDeposits, chartData, getWrstandardDetails, getTHJinvesotrdeposit } = useWrstandardDetails(wrstandardid)
 const { formData, formSubmit } = usePurchaseOrderDesting()
 
 // 当前选中的交割日期
 const selectedDate = shallowRef<Model.THJWrstandardDetailRsp['deliverymonth'][number]>()
 // 商品信息
-const goodsinfo = computed<Partial<Model.THJWrstandardDetailRsp['goodsinfo']>>(() => details.value.goodsinfo ?? {})
+const goodsinfo = computed<Partial<Model.THJWrstandardDetailRsp['goodsinfo']>>(() => details.value.goodsinfo)
 
 // 商品图片列表
 const goodsImages = computed(() => {
@@ -131,7 +131,7 @@ const goodsImages = computed(() => {
 
 // 定金比例列表,商品定金比例和个性化定金比例进行合并
 const presaleApplyDeposits = computed(() => {
-    const deposits = details.value.presaleapplydeposits ?? []
+    const deposits = details.value.presaleapplydeposits
     const { presaleapplyid, remainqty = 0 } = selectedDate.value ?? {}
 
     const result = deposits.filter((e) => e.presaleapplyid === presaleapplyid).map((e) => ({
@@ -236,11 +236,12 @@ const formRules: { [key in keyof Proto.SpotPresaleDestingOrderReq | 'addressInfo
 
 // 切换交割月份
 const onMonthChange = (value: string) => {
-    const months = details.value.deliverymonth ?? []
+    const months = details.value.deliverymonth
     selectedDate.value = months.find((e) => e.presaleapplyid === value)
     formData.value.PresaleApplyID = Long.fromString(value)
     formData.value.DepositID = undefined
     formRef.value?.validate('PresaleApplyID')
+    getTHJinvesotrdeposit(value)
 }
 
 // 切换支付方式

+ 19 - 5
src/packages/pc/assets/themes/base/reset.less

@@ -2,7 +2,7 @@
 @import './animation.less';
 
 * {
-    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC","Helvetica Neue",STHeiti,"Microsoft Yahei",Tahoma,Simsun,sans-serif;
+    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, Simsun, sans-serif;
     margin: 0;
     padding: 0;
     box-sizing: border-box;
@@ -11,6 +11,7 @@
     background-size: contain;
     outline: none;
     -webkit-tap-highlight-color: transparent;
+
     //-webkit-appearance: none;
     &::-webkit-input-placeholder {
         color: #ccc;
@@ -22,6 +23,7 @@ html {
 }
 
 body {
+    position: relative;
     height: inherit;
     line-height: 1;
     font-size: 14px;
@@ -43,7 +45,14 @@ body {
         }
     }
 
-    p, label, h1, h2, h3, h4, h5, h6 {
+    p,
+    label,
+    h1,
+    h2,
+    h3,
+    h4,
+    h5,
+    h6 {
         margin: 0;
         font-weight: normal;
     }
@@ -53,7 +62,10 @@ body {
         max-width: 100%;
     }
 
-    button, input, textarea, select {
+    button,
+    input,
+    textarea,
+    select {
         line-height: initial;
         border: 0;
         background-color: transparent;
@@ -84,7 +96,9 @@ body {
         -moz-appearance: textfield;
     }
 
-    ul, ol, dl {
+    ul,
+    ol,
+    dl {
         list-style-type: none;
     }
 }
@@ -92,4 +106,4 @@ body {
 .app {
     width: 100%;
     height: 100%;
-}
+}

+ 4 - 5
src/packages/pc/components/layouts/header/index.vue

@@ -2,7 +2,7 @@
     <div class="app-header">
         <div class="app-header__left">
             <slot name="left"></slot>
-            <el-breadcrumb :separator-icon="ArrowRight" v-show="!state.isMobile">
+            <el-breadcrumb :separator-icon="ArrowRight" v-show="!isMobile">
                 <template v-for="(item, index) in $route.matched" :key="index">
                     <el-breadcrumb-item :to="{ path: item.path }">
                         <!--<i :class="item.meta.icon" v-if="item.meta.icon"></i>-->
@@ -20,7 +20,7 @@
             <el-dropdown class="user-dropdown" trigger="click">
                 <span class="user-dropdown__link">
                     <img class="g-image--avatar" :title="accountName" :src="userAvatar" />
-                    <span v-if="!state.isMobile">{{ accountName }}</span>
+                    <span v-if="!isMobile">{{ accountName }}</span>
                     <app-icon class="el-icon--right" icon="ArrowDown" />
                 </span>
                 <template #dropdown>
@@ -38,12 +38,11 @@
 import { ref, onMounted, computed } from 'vue'
 import { ArrowRight, SwitchButton } from '@element-plus/icons-vue'
 import { getImageUrl } from '@/filters'
-import { userStore } from '@/stores'
+import { userStore, themeStore } from '@/stores'
 import eventBus from '@/services/bus'
-import client from '@/utils/client'
 import AppIcon from '@pc/components/base/icon/index.vue'
 
-const { state } = client
+const { isMobile } = themeStore.$mapState()
 const { userInfo, accountName } = userStore.$mapGetters()
 const fullScreen = ref(false)
 

+ 2 - 2
src/packages/pc/components/layouts/navbar/index.vue

@@ -26,7 +26,7 @@
 <script lang="ts" setup>
 import { computed, ref, watch } from 'vue'
 import { useRoute, useRouter } from 'vue-router'
-import client from '@/utils/client'
+import { themeStore } from '@/stores'
 import historyRouter from '../../../router/historyRouter'
 
 const { state, removeHistory } = historyRouter;
@@ -40,7 +40,7 @@ const route = useRoute(),
 
 const isMobile = computed(() => {
     scrollTab();
-    return client.state.isMobile;
+    return themeStore.state.isMobile;
 })
 
 // 选择标签

+ 2 - 2
src/packages/pc/components/layouts/page/index.vue

@@ -36,13 +36,13 @@
 <script lang="ts" setup>
 import { ref } from 'vue'
 import { RouteRecordNormalized, RouteRecordName } from 'vue-router'
-import client from '@/utils/client'
+import { themeStore } from '@/stores'
 import AppHeader from '../header/index.vue'
 import AppFooter from '../footer/index.vue'
 import AppNavbar from '../navbar/index.vue'
 import AppSidebar from '../sidebar/index.vue'
 
-const isCollapse = ref(client.state.isMobile);
+const isCollapse = ref(themeStore.state.isMobile);
 
 // 手动给组件添加 name 属性,处理缓存 exclude 无效的问题
 const handleComponent = (component: Record<'type', { name: RouteRecordName | undefined }>, route: RouteRecordNormalized) => {

+ 8 - 8
src/packages/pc/components/layouts/sidebar/index.vue

@@ -1,22 +1,22 @@
 <template>
   <el-scrollbar :class="['app-sidebar', collapse && 'is-hide']" view-class="app-sidebar__view">
-    <div :class="['app-sidebar__header', state.isMobile ? 'is-show' : collapse && 'is-hide']">
+    <div :class="['app-sidebar__header', isMobile ? 'is-show' : collapse && 'is-hide']">
       <span class="logo">推广查询系统</span>
     </div>
     <div class="app-sidebar__menu">
-      <app-sidemenu :collapse="state.isMobile ? false : collapse" @select="routerTo" />
+      <app-sidemenu :collapse="isMobile ? false : collapse" @select="routerTo" />
     </div>
-    <div :class="['app-sidebar__copyright', state.isMobile ? 'is-show' : collapse && 'is-hide']">
+    <div :class="['app-sidebar__copyright', isMobile ? 'is-show' : collapse && 'is-hide']">
       <span>&copy;{{ year }} Muchinfo</span>
     </div>
-    <div :class="['app-sidebar__mask', collapse && 'is-hide']" @click="hideSidebar()" v-if="state.isMobile"></div>
+    <div :class="['app-sidebar__mask', collapse && 'is-hide']" @click="hideSidebar()" v-if="isMobile"></div>
   </el-scrollbar>
 </template>
 
 <script lang="ts" setup>
 import { watch } from 'vue'
 import { useRouter } from 'vue-router'
-import client from '@/utils/client'
+import { themeStore } from '@/stores'
 import AppSidemenu from '../sidemenu/index.vue'
 
 const emit = defineEmits(['update:collapse'])
@@ -26,12 +26,12 @@ defineProps({
   collapse: Boolean,
 })
 
-const { state } = client
+const { isMobile } = themeStore.$mapState()
 const router = useRouter()
 const year = new Date().getFullYear()
 
 const hideSidebar = () => {
-  emit('update:collapse', state.isMobile)
+  emit('update:collapse', isMobile.value)
 }
 
 // 菜单跳转
@@ -41,7 +41,7 @@ const routerTo = (active: string) => {
 }
 
 // 监听设备变化
-watch(() => state.isMobile, () => hideSidebar())
+watch(isMobile, () => hideSidebar())
 </script>
 
 <style lang="less">

+ 4 - 1
src/packages/pc/components/modules/auth-operation/index.vue

@@ -86,7 +86,10 @@ const auth = shallowRef<Model.UserRoutes[]>([]);
 const dataList = computed(() => {
     const menus = props.menus
     if (menus) {
-        return auth.value.filter((e) => menus.includes(e.code) || menus.includes(e.buttonName));
+        if (menus.length) {
+            return auth.value.filter((e) => menus.includes(e.code) || menus.includes(e.buttonName));
+        }
+        return [];
     } else {
         return auth.value;
     }

+ 4 - 3
src/packages/pc/main.ts

@@ -4,13 +4,13 @@ import router from './router'
 import directives from '@/directives' // 自定义指令集
 import '@/services/subscribe' // 全局订阅通知
 import '@/mock' // 模拟数据
-import client from '@/utils/client' // 适配客户端
 import layouts from "./components/layouts" // 布局组件
 import ElementPlus from 'element-plus'
 import * as ElementIcons from '@element-plus/icons-vue'
 import 'element-plus/dist/index.css'
 import './assets/themes/style.less' // 主题样式
 import { timerInterceptor } from '@/utils/timer'
+import { themeStore } from '@/stores'
 
 const app = createApp(App)
 app.use(router)
@@ -21,9 +21,10 @@ app.mount('#app')
 
 // 等待 html 加载完成
 document.addEventListener('DOMContentLoaded', () => {
-    client.screenAdapter(false);
+    // 适配客户端
+    themeStore.actions.screenAdapter()
     // 监听窗口大小变化
-    window.addEventListener('resize', timerInterceptor.setDebounce(() => client.screenAdapter(false)));
+    window.addEventListener('resize', timerInterceptor.setDebounce(() => themeStore.actions.screenAdapter()))
 }, false)
 
 // 注册全局图标

+ 57 - 0
src/stores/modules/theme.ts

@@ -7,6 +7,8 @@ export const themeStore = createStore({
     state() {
         return {
             appTheme: localData.getRef('appTheme'),
+            clientWidth: 0, // 客户端宽度
+            isMobile: false, // 是否移动设备
         }
     },
     actions: {
@@ -29,6 +31,61 @@ export const themeStore = createStore({
             this.actions.setStatusBarTheme(theme)
             document.documentElement.setAttribute('theme', theme)
             this.state.appTheme = theme
+        },
+        // 适配客户端屏幕
+        screenAdapter(remsize = false) {
+            const { clientWidth, isMobile } = this.$mapState()
+            const { isPc } = this.actions.getClientAgent()
+            const el = document.documentElement
+            const body = document.body
+            let screenWidth = el.clientWidth
+
+            if (remsize) {
+                const designSize = 750
+                isMobile.value = true
+
+                if (isPc) {
+                    screenWidth = designSize / 1.8
+                    body.style.setProperty('width', '540px')
+                } else {
+                    body.style.removeProperty('width')
+                }
+
+                if (screenWidth > 0) {
+                    const fontSize = (screenWidth / designSize) * 100 + 'px'
+                    el.style.setProperty('font-size', fontSize)
+                }
+            } else {
+                if (screenWidth > 768) {
+                    isMobile.value = false
+                } else {
+                    isMobile.value = true
+                }
+
+                el.setAttribute('screen', isMobile.value ? 'small' : 'normal')
+            }
+
+            clientWidth.value = body.clientWidth
+        },
+        // 获取客户端平台
+        getClientAgent() {
+            const ua = navigator.userAgent,
+                isWindowsPhone = /(?:Windows Phone)/.test(ua),
+                isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone,
+                isAndroid = /(?:Android)/.test(ua),
+                isFireFox = /(?:Firefox)/.test(ua),
+                isChrome = /(?:Chrome|CriOS)/.test(ua),
+                isTablet = /(?:iPad|PlayBook)/.test(ua) || (isAndroid && !/(?:Mobile)/.test(ua)) || (isFireFox && /(?:Tablet)/.test(ua)),
+                isiPhone = /(?:iPhone)/.test(ua) && !isTablet,
+                isPc = !isiPhone && !isAndroid && !isSymbian && !isTablet
+
+            return {
+                isTablet,
+                isiPhone,
+                isAndroid,
+                isChrome,
+                isPc,
+            }
         }
     }
 })

+ 1 - 1
src/types/model/common.d.ts

@@ -232,7 +232,7 @@ declare global {
         /** 定金比例个性化查询 请求 */
         interface THJinvesotrdepositReq {
             userid: number; // 用户ID
-            wrstandardid: number; // 现货商品ID
+            presaleapplyid: string; // 预售申请ID
             page?: number; // 页码
             pagesize?: number; // 每页条数
         }

+ 0 - 75
src/utils/client/index.ts

@@ -1,75 +0,0 @@
-import { reactive, toRefs, readonly } from 'vue'
-
-export default new (class {
-    private _state = reactive({
-        layout: 'default', // 页面布局
-        clientWidth: 0, // 客户端宽度
-        isMobile: false, // 是否移动设备
-    })
-
-    /** 只读状态 */
-    state = readonly(this._state);
-
-    /**
-     * 适配客户端屏幕
-     * @param pxtorem rem 布局
-     */
-    screenAdapter(pxtorem: boolean) {
-        const { clientWidth, isMobile } = toRefs(this._state);
-        const { isPc } = this.getClientAgent();
-        const el = document.documentElement;
-        const body = document.body;
-        let screenWidth = el.clientWidth;
-
-        if (pxtorem) {
-            const designSize = 750;
-            isMobile.value = true;
-
-            if (isPc) {
-                screenWidth = designSize / 1.8;
-                body.style.setProperty('width', '540px');
-            } else {
-                body.style.removeProperty('width')
-            }
-
-            if (screenWidth > 0) {
-                const fontSize = (screenWidth / designSize) * 100 + 'px';
-                el.style.setProperty('font-size', fontSize);
-            }
-        } else {
-            if (screenWidth > 768) {
-                isMobile.value = false;
-            } else {
-                isMobile.value = true;
-            }
-
-            el.setAttribute('screen', isMobile.value ? 'small' : 'normal');
-        }
-
-        clientWidth.value = body.clientWidth;
-    }
-
-    /**
-     * 获取客户端平台
-     * @returns 
-     */
-    getClientAgent() {
-        const ua = navigator.userAgent,
-            isWindowsPhone = /(?:Windows Phone)/.test(ua),
-            isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone,
-            isAndroid = /(?:Android)/.test(ua),
-            isFireFox = /(?:Firefox)/.test(ua),
-            isChrome = /(?:Chrome|CriOS)/.test(ua),
-            isTablet = /(?:iPad|PlayBook)/.test(ua) || (isAndroid && !/(?:Mobile)/.test(ua)) || (isFireFox && /(?:Tablet)/.test(ua)),
-            isiPhone = /(?:iPhone)/.test(ua) && !isTablet,
-            isPc = !isTablet && !isiPhone && !isAndroid && !isSymbian;
-
-        return {
-            isTablet,
-            isiPhone,
-            isAndroid,
-            isChrome,
-            isPc,
-        }
-    }
-})