From c452ea29e926b75d6a9d05f6f885216659b3efba Mon Sep 17 00:00:00 2001
From: Jafeng <2998840497@qq.com>
Date: Wed, 4 Feb 2026 18:39:57 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=96=87=E7=AB=A0?=
=?UTF-8?q?=E9=98=85=E8=AF=BB=E8=AE=B0=E5=BD=95=E5=92=8C=E9=97=AE=E5=8D=B7?=
=?UTF-8?q?=E8=B0=83=E6=9F=A5=E7=9B=B8=E5=85=B3API=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E6=96=87=E7=AB=A0=E5=92=8C=E9=97=AE?=
=?UTF-8?q?=E5=8D=B7=E5=88=97=E8=A1=A8=E5=8A=A0=E8=BD=BD=E7=8A=B6=E6=80=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/article/article-detail.vue | 14 ++
pages/article/article-list.vue | 238 ++++++++++++++++++++++-------
pages/survey/survey-list.vue | 249 ++++++++++++++++++++++---------
utils/api.js | 7 +-
4 files changed, 381 insertions(+), 127 deletions(-)
diff --git a/pages/article/article-detail.vue b/pages/article/article-detail.vue
index 5d8927f..9ef3aaf 100644
--- a/pages/article/article-detail.vue
+++ b/pages/article/article-detail.vue
@@ -28,8 +28,11 @@
import { onLoad } from "@dcloudio/uni-app";
import api from "@/utils/api.js";
import { ref } from "vue";
+import { storeToRefs } from "pinia";
+import useAccountStore from "@/store/account.js";
const env = __VITE_ENV__;
const corpId = env.MP_CORP_ID;
+const { account } = storeToRefs(useAccountStore());
const loading = ref(true);
const error = ref("");
const articleData = ref({
@@ -40,6 +43,16 @@ const articleData = ref({
let articleId = "";
+const markArticleRead = async () => {
+ const unionid = account.value?.unionid;
+ if (!unionid || !articleId) return;
+ try {
+ await api("addArticleReadRecord", { corpId, articleId, unionid }, false);
+ } catch (err) {
+ console.warn("markArticleRead failed:", err?.message || err);
+ }
+};
+
// 处理富文本内容,使图片自适应
const processRichTextContent = (html) => {
if (!html) return "";
@@ -107,6 +120,7 @@ const loadArticle = async () => {
onLoad((options) => {
if (options.id) {
articleId = options.id;
+ markArticleRead();
loadArticle();
} else {
error.value = "文章信息不完整";
diff --git a/pages/article/article-list.vue b/pages/article/article-list.vue
index 6cf29d1..ed0c095 100644
--- a/pages/article/article-list.vue
+++ b/pages/article/article-list.vue
@@ -11,16 +11,25 @@
? 'bg-orange-100 text-orange-500 border-orange-500'
: 'bg-white text-gray-600 border-gray-200'
]"
- @click="activeTab = tab.value"
+ @click="selectTab(tab.value)"
>
{{ tab.name }}
-
+
+
+ 加载中...
+
+
+
+
+
+
+
- {{ item.type }}
+ 宣教文章
@@ -44,86 +53,168 @@
class="text-sm mr-2"
:class="item.status === 'UNREAD' ? 'text-red-500' : 'text-gray-400'"
>
- {{ item.status === 'UNREAD' ? '未阅读' : '查看' }}
+ {{ item.status === 'UNREAD' ? '未阅读' : '已阅读' }}
-
-
- 人员:
- {{ item.person }}
+
+ 人员:
+ {{ item.person || '-' }}
-
-
- 团队:
- {{ item.team }}
+
+
+ 团队:
+ {{ item.team || '-' }}
- 发送时间: {{ item.time }}
+ 发送时间: {{ item.time || '-' }}
+
+
+
+ 加载中...
+
+
+
+ 没有更多了
+
diff --git a/pages/survey/survey-list.vue b/pages/survey/survey-list.vue
index e213a83..1613e69 100644
--- a/pages/survey/survey-list.vue
+++ b/pages/survey/survey-list.vue
@@ -11,16 +11,25 @@
? 'bg-orange-100 text-orange-500 border-orange-500'
: 'bg-white text-gray-600 border-gray-200'
]"
- @click="activeTab = tab.value"
+ @click="selectTab(tab.value)"
>
{{ tab.name }}
-
+
+
+ 加载中...
+
+
+
+
+
+
+
- {{ item.type }}
+ 问卷调查
@@ -38,93 +47,166 @@
-
+
-
- {{ item.status === 'UNFILLED' ? '未填写' : '查看' }}
-
-
+ 查看
+
-
-
- 人员:
- {{ item.person }}
+
+ 人员:
+ {{ item.person || '-' }}
-
-
- 团队:
- {{ item.team }}
+
+
+ 团队:
+ {{ item.team || '-' }}
- 发送时间: {{ item.time }}
+ 发送时间: {{ item.time || '-' }}
+
+
+
+ 加载中...
+
+
+
+ 没有更多了
+
\ No newline at end of file
+
+.field-label {
+ flex-shrink: 0;
+ white-space: nowrap;
+}
+
+.loading-container,
+.empty-container {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 100rpx 0;
+}
+
+.loading-text {
+ margin-top: 20rpx;
+ font-size: 28rpx;
+ color: #999;
+}
+
+.loading-more,
+.no-more {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 30rpx 0;
+ font-size: 24rpx;
+ color: #999;
+ gap: 10rpx;
+}
+
diff --git a/utils/api.js b/utils/api.js
index bec6614..7a1dd49 100644
--- a/utils/api.js
+++ b/utils/api.js
@@ -31,7 +31,9 @@ const urlsConfig = {
getArticleCateList: 'getArticleCateList',
getArticleList: 'getArticleList',
getArticle: 'getArticle',
- addArticleSendRecord: 'addArticleSendRecord'
+ addArticleSendRecord: 'addArticleSendRecord',
+ addArticleReadRecord: 'addArticleReadRecord',
+ getMiniAppReceivedArticleList: 'getMiniAppReceivedArticleList'
},
member: {
addCustomer: 'add',
@@ -63,6 +65,9 @@ const urlsConfig = {
createConsultGroup: "createConsultGroup",
cancelConsultApplication: "cancelConsultApplication",
getGroupList: "getGroupList"
+ },
+ survery: {
+ getMiniAppReceivedSurveryList: 'getMiniAppReceivedSurveryList'
}
}
const urls = Object.keys(urlsConfig).reduce((acc, path) => {