From b2009403d847365a19426d5e9fcf3747d658463a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=8B=E4=BA=8E=E5=88=9D=E8=A7=81?= <752204717@qq.com> Date: Wed, 13 Aug 2025 14:53:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/commonJS.js | 26 +- common/debounce.js | 34 +- components/qizai-dynamic/Dynamic.vue | 312 ++++++++---------- main.js | 2 + pages.json | 2 +- pages/articleList/article.vue | 229 ++++++++++--- pages/articleList/index.vue | 229 +++++++++++-- pages/articleList/likeList.vue | 2 +- .../commonComponents/comment-like-popup.vue | 92 ++++++ pages/doctors/index.vue | 86 ++++- .../components/hb-comment/hb-comment.vue | 25 +- .../uni-popup-share/uni-popup-share.vue | 2 + .../components/uni-popup/uni-popup.vue | 2 +- 13 files changed, 761 insertions(+), 282 deletions(-) create mode 100644 pages/component/commonComponents/comment-like-popup.vue diff --git a/common/commonJS.js b/common/commonJS.js index a9725ada..0d7b9682 100644 --- a/common/commonJS.js +++ b/common/commonJS.js @@ -33,6 +33,18 @@ export default { } }) }, + refreshPrevPageData(reset) { + const pages = getCurrentPages(); // 当前页面栈 + if (pages.length > 1) { + const prevPage = pages[pages.length - 2]; // 上一页实例 + if (prevPage && typeof prevPage.refreshData === 'function') { + console.log('at line 514:', '调用刷新函数') + prevPage.refreshData(reset); // 调用刷新函数 + + } + } + uni.navigateBack({ delta: 1 }); + }, //复制内容 handleCopy(value, title) { uniCopy({ @@ -44,22 +56,22 @@ export default { }) }, error: (e) => { - + } }) }, //用户协议 - async getAgreement(id) { + async getAgreement(id) { console.log('id at line 56:', id) var data = { id: id } var result = { - title:'', - content:'' + title: '', + content: '' } - await $http + await $http .request({ url: "sys/agreement/getAgreement", method: "POST", @@ -111,8 +123,8 @@ export default { } }, }); - }, - // 注销账户 + }, + // 注销账户 logout() { let that = this; uni.showModal({ diff --git a/common/debounce.js b/common/debounce.js index ad3996bb..15d310af 100644 --- a/common/debounce.js +++ b/common/debounce.js @@ -25,5 +25,35 @@ function debounce(func, wait = 500, immediate = false) { }, wait) } } - -export default debounce +function throttle(fn, delay = 1000, immediate = false) { + console.log("进入节流对象") + let timer + let status = false // 是否为重复点击状态 + return function () { + let _this = this + let args = arguments + + if (immediate) { + console.log("立即执行参数 执行一次方法") + fn.apply(_this, args) + immediate = false + return + } + if (status) { + console.log("当前点击状态为正在重复点击,请稍等片刻后在点击执行") + return + } + console.log("执行节流:当前执行了一次点击方法") + fn.apply(_this, args) + status = true // 修改状态 + timer = setTimeout(() => { + console.log("规定时间到,重置状态,可以重新调用") + status = false + }, delay) + } + } + + export { + debounce, + throttle + } diff --git a/components/qizai-dynamic/Dynamic.vue b/components/qizai-dynamic/Dynamic.vue index 1cb9b8ef..24b93370 100644 --- a/components/qizai-dynamic/Dynamic.vue +++ b/components/qizai-dynamic/Dynamic.vue @@ -10,7 +10,8 @@ mode="aspectFill" class="user__header-image" > - {{ name }} - {{ - createTime + + createTime }} - - - - {{ title }} + + + {{ title }} - - - - - + font-size: 28rpx; + " + /> + + + + + - - - - + + + + + + {{ + likeList + .map((item) => + item.user.nickname ? item.user.nickname : "普通用户" + ) + .join(" , ") + }} + + + + {{ likeCount ? likeCount : "0" }} + + {{ commentCount ? commentCount : "0" }} - {{ likeList.map(item => item.user.nickname?item.user.nickname:'普通用户').join(' , ') }} - - - - - {{ likeCount ? likeCount : "0" }} - - {{ commentCount ? commentCount : "0" }} + + 分享 + + - - 分享 - - - - -