From b63bd3703aac6e99805419a4fd0953c795ece43e Mon Sep 17 00:00:00 2001 From: "34701892@qq.com" <34701892@qq.com> Date: Thu, 25 Dec 2025 11:13:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=96=B0=E9=97=BB=E8=AF=A6=E6=83=85):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7=E5=8F=82=E6=95=B0=E4=BC=A0?= =?UTF-8?q?=E9=80=92=E5=92=8C=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=8F=91=E9=80=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在RankListMini组件中添加userParams参数传递 - 修改新闻详情页导航栏为注释状态 - 添加微信小程序环境判断及消息发送功能 - 优化搜索页面布局和样式 --- src/components/RankListMini.vue | 9 ++++++++- src/pages/detail/indexNewsInfo.vue | 20 +++++++++++++++++--- src/pages/minihome/index.vue | 2 +- src/pages/sreachReq/index.vue | 19 +++++-------------- 4 files changed, 31 insertions(+), 19 deletions(-) diff --git a/src/components/RankListMini.vue b/src/components/RankListMini.vue index 29e5e22..10ad0a4 100644 --- a/src/components/RankListMini.vue +++ b/src/components/RankListMini.vue @@ -144,6 +144,11 @@ const props = defineProps({ required: true, default: () => [], }, + userParams: { + type: Object, + required: true, + default: () => {}, + }, }); const clickItem = ref({}); @@ -158,8 +163,10 @@ function goDetail(item) { // url: "/pages/login/indexMini", // }); // } + let phone = props.userParams.phone || ""; + let userType = props.userParams.userType || ""; uni.navigateTo({ - url: `/pages/detail/indexNewsInfo?id=${item.news_id}`, + url: `/pages/detail/indexNewsInfo?id=${item.news_id}&phone=${phone}&userType=${userType}`, }); } diff --git a/src/pages/detail/indexNewsInfo.vue b/src/pages/detail/indexNewsInfo.vue index b023aff..ae0248c 100644 --- a/src/pages/detail/indexNewsInfo.vue +++ b/src/pages/detail/indexNewsInfo.vue @@ -12,7 +12,7 @@ - - + -->
@@ -143,7 +143,6 @@ onLoad(async (option: any) => { } if (option?.userType == 2) { - console.log("🚀 ~ Date.now():", Date.now()); // 打开页面时链接中带有time字段,表示上次分享的时间 let shareTime = option?.time || 0; // 现在的时间对比上次的分享时间,如果超过24小时,则刷新推荐栏目 @@ -153,6 +152,21 @@ onLoad(async (option: any) => { window.location.reload(); } } + + console.log("准备发送消息到小程序"); + if (typeof wx !== "undefined" && wx.miniProgram) { + wx.miniProgram.postMessage({ + data: { + type: "share_info", + userType: option?.userType || null, + phone: option?.phone || null, + id: option?.id || null, + }, + }); + console.log("消息已发送"); + } else { + console.log("非微信小程序环境,无法发送消息"); + } }); const newList = async (columnId: number) => { diff --git a/src/pages/minihome/index.vue b/src/pages/minihome/index.vue index 8302218..ce3139e 100644 --- a/src/pages/minihome/index.vue +++ b/src/pages/minihome/index.vue @@ -85,7 +85,7 @@ - + diff --git a/src/pages/sreachReq/index.vue b/src/pages/sreachReq/index.vue index 9e6c5d3..8de8aa1 100644 --- a/src/pages/sreachReq/index.vue +++ b/src/pages/sreachReq/index.vue @@ -12,7 +12,7 @@ - - + --> @@ -52,15 +52,11 @@ :border="false" /> - 搜索 + 搜索 - + @@ -70,7 +66,6 @@ v-if="screenList.length === 0" text="无搜索结果" width="157" - height="50" icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/nosearch_icon%E5%A4%87%E4%BB%BD%402x.png" > @@ -242,10 +237,7 @@ const getData = async () => { `$&` ); - item.title = item.title.replace( - keyWord.value, - '' + keyWord.value + "" - ); + item.title = item.title.replace(keyWord.value, '' + keyWord.value + ""); console.log("🚀 ~ getData ~ item.title :", item.title); item.MarkInRedContent = @@ -285,7 +277,6 @@ onShow(() => { display: flex; align-items: center; // height: 60rpx; - gap: 20rpx; box-sizing: border-box; padding: 12rpx 0; position: sticky;