From a82d86efc2104701de4065ebcf737a1e72f85ea8 Mon Sep 17 00:00:00 2001 From: zzp <34701892@qq.com> Date: Sat, 30 Aug 2025 13:50:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=9B=BD=E5=86=85=E6=96=B0=E9=97=BB):=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=9B=BD=E5=86=85=E6=96=B0=E9=97=BB=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=8F=8A=E7=9B=B8=E5=85=B3=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加国内新闻API接口getDomestic 创建domesticMini.vue组件用于展示国内新闻列表 在minihome页面中添加国内新闻tab支持 新增indexDomestic.vue组件作为国内新闻列表项 --- src/api/index.ts | 4 + src/components/articleList/indexDomestic.vue | 335 +++++++++++++++++++ src/components/domestic.vue | 40 ++- src/components/domesticMini.vue | 54 +++ src/pages/minihome/index.vue | 27 +- 5 files changed, 446 insertions(+), 14 deletions(-) create mode 100644 src/components/articleList/indexDomestic.vue create mode 100644 src/components/domesticMini.vue diff --git a/src/api/index.ts b/src/api/index.ts index 0068af6..e2d75e1 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -72,3 +72,7 @@ export const doShare = (data: any) => { return Request.post("/user/share", data); }; +// 微信分享 +export const getDomestic = (data: any) => { + return Request.get("/news/domestic", data); +}; \ No newline at end of file diff --git a/src/components/articleList/indexDomestic.vue b/src/components/articleList/indexDomestic.vue new file mode 100644 index 0000000..1266a4e --- /dev/null +++ b/src/components/articleList/indexDomestic.vue @@ -0,0 +1,335 @@ + + + + + diff --git a/src/components/domestic.vue b/src/components/domestic.vue index cdcb098..26f3c0f 100644 --- a/src/components/domestic.vue +++ b/src/components/domestic.vue @@ -21,8 +21,16 @@ - - + + @@ -44,8 +52,11 @@ - + @@ -95,7 +106,11 @@ watch( () => props.newsList, (newValue, oldValue) => { const token = Session.get("token"); - isPay.value = !token ? true : newValue[0]?.needpay ? newValue[0]?.needpay : false; + isPay.value = !token + ? true + : newValue[0]?.needpay + ? newValue[0]?.needpay + : false; } ); @@ -253,7 +268,8 @@ const handlePopupSuccessCallback = () => { display: block; width: 44rpx; height: 6rpx; - background: url("https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/icon_dot.png") no-repeat center; + background: url("https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/icon_dot.png") + no-repeat center; background-size: 100% 100%; } } @@ -434,7 +450,11 @@ const handlePopupSuccessCallback = () => { // margin-bottom: 24rpx; padding: 40rpx 0; border-radius: 8rpx; - background: linear-gradient(90deg, rgba(255, 250, 240, 1) 0%, rgba(254, 238, 210, 1) 100%); + background: linear-gradient( + 90deg, + rgba(255, 250, 240, 1) 0%, + rgba(254, 238, 210, 1) 100% + ); .need-pay-text { font-size: 28rpx; @@ -452,7 +472,11 @@ const handlePopupSuccessCallback = () => { font-size: 32rpx; color: #fff; border-radius: 20rpx; - background: linear-gradient(90deg, rgba(252, 92, 105, 1) 0%, rgba(231, 48, 63, 1) 100%); + background: linear-gradient( + 90deg, + rgba(252, 92, 105, 1) 0%, + rgba(231, 48, 63, 1) 100% + ); } } } diff --git a/src/components/domesticMini.vue b/src/components/domesticMini.vue new file mode 100644 index 0000000..bd489eb --- /dev/null +++ b/src/components/domesticMini.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/src/pages/minihome/index.vue b/src/pages/minihome/index.vue index f80c655..1917af4 100644 --- a/src/pages/minihome/index.vue +++ b/src/pages/minihome/index.vue @@ -15,7 +15,7 @@ top: 0, zIndex: '999999', }" - v-if="tabIndex == 0" + v-if="tabIndex == 0 || tabIndex == 2" > - + + + + + + @@ -93,6 +99,7 @@ import Tabs from "@/components/mini/Tabs.vue"; import { getTopNews } from "@/api/newsInfo"; import { onPageNotFound, onPageScroll, onShow } from "@dcloudio/uni-app"; import { getNavHeight } from "@/utils/util"; +import Domestic from "@/components/domesticMini.vue"; const list1 = reactive([ "https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/banner1.png", @@ -134,10 +141,18 @@ function goSreach() { const isScroll = ref(false); onPageScroll((val) => { - if (val.scrollTop > 150) { - isScroll.value = true; + if (tabIndex.value == 0 || tabIndex.value == 1) { + if (val.scrollTop > 150) { + isScroll.value = true; + } else { + isScroll.value = false; + } } else { - isScroll.value = false; + if (val.scrollTop > 80) { + isScroll.value = true; + } else { + isScroll.value = false; + } } });