From 6c969df9593967483195778fadfee808759331a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=96=84=E7=BE=8E?= <192406826@qq.com> Date: Thu, 28 Aug 2025 15:16:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/composables/useHomePage.ts | 31 ++-- src/pages.json | 6 +- src/pages/index/components/categoryGroup.vue | 90 ------------ src/pages/index/components/hotRecommend.vue | 137 ------------------ src/pages/index/components/notice-bar.vue | 130 ----------------- src/pages/index/index.vue | 109 -------------- .../companyPortrait/components/data-card.vue | 0 .../components/market-title.vue | 0 .../pages/companyPortrait/index.vue | 0 src/styles/common.scss | 54 +++++++ 10 files changed, 69 insertions(+), 488 deletions(-) delete mode 100644 src/pages/index/components/categoryGroup.vue delete mode 100644 src/pages/index/components/hotRecommend.vue delete mode 100644 src/pages/index/components/notice-bar.vue delete mode 100644 src/pages/index/index.vue rename src/{pageCompany => pagesCompany}/pages/companyPortrait/components/data-card.vue (100%) rename src/{pageCompany => pagesCompany}/pages/companyPortrait/components/market-title.vue (100%) rename src/{pageCompany => pagesCompany}/pages/companyPortrait/index.vue (100%) create mode 100644 src/styles/common.scss diff --git a/src/composables/useHomePage.ts b/src/composables/useHomePage.ts index a4f2f09..114efa3 100644 --- a/src/composables/useHomePage.ts +++ b/src/composables/useHomePage.ts @@ -22,7 +22,7 @@ export function useHomePage() { showRefreshSuccess: true, showLoadError: true, }) - const homeData = ref({}) + const homeData = ref({}) // ==================== 页面数据 ==================== const bannerList = ref([ { @@ -44,13 +44,7 @@ export function useHomePage() { goods_id: '3', }, ]) - // const noticeBarList = ref([ - // { - // id: 1, - // title: '智慧', - // content: '公告公告公告公告公告', - // }, - // ]) + const noticeBarList = ref([ '公告公告公告公告公告1111111', '智慧关务系统升级通知', @@ -92,29 +86,28 @@ export function useHomePage() { showError: false, }) - // ==================== 页面初始化 ==================== + //页面初始化 const initPage = async () => { try { - await Promise.all([fetchHomeIndex().then(res=>{ - if(res.code == 1){ - homeData.value = res.data - console.log(homeData.value) - } - })]) + await Promise.all([fetchHomeIndex().then(res => { + if (res.code == 1) { + homeData.value = res.data + } + })]) // 在这里赋值或者获取接口返回的数据 } catch (error) { console.error('页面初始化失败:', error) } } - // ==================== 刷新处理 ==================== + // 刷新处理 const onRefresh = async () => { await handleRefresh(async () => { await initPage() }) } - // ==================== 加载更多处理 ==================== + // 加载更多 const onLoadMore = async () => { await handleLoadMore(async () => { // 这里可以加载更多数据 @@ -122,7 +115,7 @@ export function useHomePage() { }) } - // ==================== 返回数据和方法 ==================== + // 返回数据和方法 return { // 背景样式 backgroundStyle, @@ -145,6 +138,6 @@ export function useHomePage() { onRefresh, onLoadMore, resetState, - homeData + homeData } } diff --git a/src/pages.json b/src/pages.json index 52d4b68..720975b 100644 --- a/src/pages.json +++ b/src/pages.json @@ -8,7 +8,7 @@ } }, "pages": [{ - "path": "pages/index/index", + "path": "pages/home/index", "style": { "navigationBarTitleText": "首页", // #ifdef WEB @@ -80,7 +80,7 @@ "borderStyle": "white", "list": [{ "text": "首页", - "pagePath": "pages/index/index", + "pagePath": "pages/home/index", "iconPath": "/static/tabs/home_default.png", "selectedIconPath": "/static/tabs/home_selected.png" }, @@ -119,7 +119,7 @@ }, // company企业相关分包 { - "root": "pageCompany", + "root": "pagesCompany", "pages": [{ "path": "pages/companyPortrait/index", "style": { diff --git a/src/pages/index/components/categoryGroup.vue b/src/pages/index/components/categoryGroup.vue deleted file mode 100644 index b9120ac..0000000 --- a/src/pages/index/components/categoryGroup.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - - - diff --git a/src/pages/index/components/hotRecommend.vue b/src/pages/index/components/hotRecommend.vue deleted file mode 100644 index 4466e53..0000000 --- a/src/pages/index/components/hotRecommend.vue +++ /dev/null @@ -1,137 +0,0 @@ - - - - - diff --git a/src/pages/index/components/notice-bar.vue b/src/pages/index/components/notice-bar.vue deleted file mode 100644 index 3e335d0..0000000 --- a/src/pages/index/components/notice-bar.vue +++ /dev/null @@ -1,130 +0,0 @@ - - - - - diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue deleted file mode 100644 index d236528..0000000 --- a/src/pages/index/index.vue +++ /dev/null @@ -1,109 +0,0 @@ - - - - diff --git a/src/pageCompany/pages/companyPortrait/components/data-card.vue b/src/pagesCompany/pages/companyPortrait/components/data-card.vue similarity index 100% rename from src/pageCompany/pages/companyPortrait/components/data-card.vue rename to src/pagesCompany/pages/companyPortrait/components/data-card.vue diff --git a/src/pageCompany/pages/companyPortrait/components/market-title.vue b/src/pagesCompany/pages/companyPortrait/components/market-title.vue similarity index 100% rename from src/pageCompany/pages/companyPortrait/components/market-title.vue rename to src/pagesCompany/pages/companyPortrait/components/market-title.vue diff --git a/src/pageCompany/pages/companyPortrait/index.vue b/src/pagesCompany/pages/companyPortrait/index.vue similarity index 100% rename from src/pageCompany/pages/companyPortrait/index.vue rename to src/pagesCompany/pages/companyPortrait/index.vue diff --git a/src/styles/common.scss b/src/styles/common.scss new file mode 100644 index 0000000..d4a7967 --- /dev/null +++ b/src/styles/common.scss @@ -0,0 +1,54 @@ +$primary-color: #4d7eec; +$secondary-color: #0478f4; +$tertiary-color: #144cec; +$else-highlight-color: #426bd2; + +$border-radius: 24rpx; + +$font-family-bold: 'AlimamaShuHeiTi-Bold'; +$font-family-regular: 'Alibaba-PuHuiTi-R'; +.flex-col { + display: flex; + flex-direction: column; +} +.flex-row { + display: flex; + flex-direction: row; +} +.justify-start { + display: flex; + justify-content: flex-start; +} +.justify-center { + display: flex; + justify-content: center; +} + +.justify-end { + display: flex; + justify-content: flex-end; +} +.justify-evenly { + display: flex; + justify-content: space-evenly; +} +.justify-around { + display: flex; + justify-content: space-around; +} +.justify-between { + display: flex; + justify-content: space-between; +} +.align-start { + display: flex; + align-items: flex-start; +} +.align-center { + display: flex; + align-items: center; +} +.align-end { + display: flex; + align-items: flex-end; +}