diff --git a/.env.development b/.env.development index 145e790..920091a 100644 --- a/.env.development +++ b/.env.development @@ -2,4 +2,8 @@ VITE_PUBLIC_PATH = / VITE_API_BASE_URL = 'http://test-admin.haituaigc.com' -VITE_API_CHAT_URL = 'http://openai-test.haituaigc.com' \ No newline at end of file +VITE_API_CHAT_URL = 'http://openai-test.haituaigc.com' + +VITE_PC_HOST = 'http://test.haituaigc.com' + +VITE_M_HOST = 'http://test-m.haituaigc.com' \ No newline at end of file diff --git a/.env.production b/.env.production index 145e790..920091a 100644 --- a/.env.production +++ b/.env.production @@ -2,4 +2,8 @@ VITE_PUBLIC_PATH = / VITE_API_BASE_URL = 'http://test-admin.haituaigc.com' -VITE_API_CHAT_URL = 'http://openai-test.haituaigc.com' \ No newline at end of file +VITE_API_CHAT_URL = 'http://openai-test.haituaigc.com' + +VITE_PC_HOST = 'http://test.haituaigc.com' + +VITE_M_HOST = 'http://test-m.haituaigc.com' \ No newline at end of file diff --git a/src/main.js b/src/main.js index ff6975b..d7ebac0 100644 --- a/src/main.js +++ b/src/main.js @@ -15,6 +15,15 @@ import 'vant/es/toast/style'; import 'amfe-flexible' +function platCheck() { + const userAgent = navigator.userAgent.toLowerCase(); + const mobileKeywords = ['iphone', 'ipod', 'android', 'silk', 'blackberry', 'bb10', 'phone', 'mobile', 'kindle', 'opera mini', 'mobile safari', 'windows phone']; + const isMobileDevice = mobileKeywords.some(keyword => userAgent.includes(keyword)); + if (!isMobileDevice) { + window.location.href = import.meta.env.VITE_PC_HOST; + } +} +platCheck(); const app = createApp(App); diff --git a/src/views/business/components/CategoryCardList.vue b/src/views/business/components/CategoryCardList.vue index 3c1ecb6..6dff1de 100644 --- a/src/views/business/components/CategoryCardList.vue +++ b/src/views/business/components/CategoryCardList.vue @@ -58,7 +58,7 @@ onMounted(()=>{ const getList = ()=>{ placeholder.value = '数据加载中...'; let params = { - category_id: props.cid, + category_id: props.cid ? props.cid : undefined, type: props.type, per_page: pageSize.value, page: pageNum.value diff --git a/src/views/business/legal/policyDetail.vue b/src/views/business/legal/policyDetail.vue index dcee0e0..e63c2f0 100644 --- a/src/views/business/legal/policyDetail.vue +++ b/src/views/business/legal/policyDetail.vue @@ -73,7 +73,7 @@ const getRecommendList = () => { let params = { recommend: 1, type: 'policy', - per_page: 6, + per_page: 4, page: 1 }; http('/api/article', params, 'get').then(res => { @@ -162,50 +162,50 @@ const goDetail = (id) => { .recommend{ padding: 30px 0; .blockTitle{ - height: 46px; - line-height: 45px; + height: 80px; + line-height: 80px; border-bottom: 1px solid #666; - font-size: 18px; + font-size: 39px; font-weight: bold; } ul{ display: flex; flex-wrap: wrap; li{ - width: 50%; + width: 100%; padding-right: 30px; display: flex; margin-top: 30px; .img{ - width: 120px; - height: 168px; + width: 260px; + height: 360px; overflow: hidden; img{ - width: 120px; - height: 168px; + width: 260px; + height: 360px; } } .info{ flex: 1; margin-left: 15px; - height: 168px; + height: 360px; display: flex; flex-direction: column; justify-content: space-between; h3{ - font-size: 14px; + font-size: 32px; font-weight: bold; padding-bottom: 10px; } p{ padding: 10px 0; - font-size: 12px; - line-height: 22px; + font-size: 26px; + line-height: 30px; flex: 1; } span{ color: #999; - font-size: 12px; + font-size: 22px; } } }