From 316052faf27393916f1a65b8f608a87eb5dd1900 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Fri, 18 Jul 2025 12:03:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E7=94=A8=E6=88=B7=E5=85=B3?= =?UTF-8?q?=E6=B3=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/community/wechatSubscribeApi.js | 40 +++++ .../community/syncSubscribeWechat.vue | 66 ++++++++ src/i18n/communityI18n.js | 3 + src/router/communityRouter.js | 5 + src/views/community/wechatSubscribeLang.js | 36 ++++ src/views/community/wechatSubscribeList.vue | 158 ++++++++++++++++++ 6 files changed, 308 insertions(+) create mode 100644 src/api/community/wechatSubscribeApi.js create mode 100644 src/components/community/syncSubscribeWechat.vue create mode 100644 src/views/community/wechatSubscribeLang.js create mode 100644 src/views/community/wechatSubscribeList.vue diff --git a/src/api/community/wechatSubscribeApi.js b/src/api/community/wechatSubscribeApi.js new file mode 100644 index 000000000..c82c751a8 --- /dev/null +++ b/src/api/community/wechatSubscribeApi.js @@ -0,0 +1,40 @@ +import request from '@/utils/request' +import { getCommunityId } from '@/api/community/communityApi' + +// 获取微信关注用户列表 +export function listWechatSubscribe(params) { + return new Promise((resolve, reject) => { + request({ + url: '/wechat.listWechatSubscribe', + method: 'get', + params: { + ...params, + communityId: getCommunityId() + } + }).then(response => { + const res = response.data + resolve(res) + }).catch(error => { + reject(error) + }) + }) +} + +// 同步微信关注用户 +export function synchronizeWechatSubscribe(data) { + return new Promise((resolve, reject) => { + request({ + url: '/wechat.synchronizeWechatSubscribe', + method: 'post', + data: { + ...data, + communityId: getCommunityId() + } + }).then(response => { + const res = response.data + resolve(res) + }).catch(error => { + reject(error) + }) + }) +} \ No newline at end of file diff --git a/src/components/community/syncSubscribeWechat.vue b/src/components/community/syncSubscribeWechat.vue new file mode 100644 index 000000000..b21cad04a --- /dev/null +++ b/src/components/community/syncSubscribeWechat.vue @@ -0,0 +1,66 @@ + + + + + \ No newline at end of file diff --git a/src/i18n/communityI18n.js b/src/i18n/communityI18n.js index 1fd068f8f..53821b37d 100644 --- a/src/i18n/communityI18n.js +++ b/src/i18n/communityI18n.js @@ -13,6 +13,7 @@ import { messages as adminCarDetailMessages } from '../views/aCommunity/adminCar import { messages as adminFeeDetailMessages } from '../views/aCommunity/adminFeeDetailLang.js' import { messages as listRoomDecorationRecordMessages } from '../views/community/listRoomDecorationRecordLang' import { messages as listRoomRenovationRecordDetailsMessages } from '../views/community/listRoomRenovationRecordDetailsLang' +import { messages as wechatSubscribeMessages } from '../views/community/wechatSubscribeLang' export const messages = { en: { ...roomStructureMessages.en, @@ -30,6 +31,7 @@ export const messages = { ...adminFeeDetailMessages.en, ...listRoomDecorationRecordMessages.en, ...listRoomRenovationRecordDetailsMessages.en, + ...wechatSubscribeMessages.en, }, zh: { ...roomStructureMessages.zh, @@ -47,5 +49,6 @@ export const messages = { ...adminFeeDetailMessages.zh, ...listRoomDecorationRecordMessages.zh, ...listRoomRenovationRecordDetailsMessages.zh, + ...wechatSubscribeMessages.zh, } } \ No newline at end of file diff --git a/src/router/communityRouter.js b/src/router/communityRouter.js index bde9b25e6..873da2751 100644 --- a/src/router/communityRouter.js +++ b/src/router/communityRouter.js @@ -74,4 +74,9 @@ export default [ name: '/views/community/listRoomRenovationRecordDetails', component: () => import('@/views/community/listRoomRenovationRecordDetailsList.vue') }, + { + path: '/pages/community/wechatSubscribe', + name: '/pages/community/wechatSubscribe', + component: () => import('@/views/community/wechatSubscribeList.vue') + }, ] \ No newline at end of file diff --git a/src/views/community/wechatSubscribeLang.js b/src/views/community/wechatSubscribeLang.js new file mode 100644 index 000000000..d810d3731 --- /dev/null +++ b/src/views/community/wechatSubscribeLang.js @@ -0,0 +1,36 @@ +export const messages = { + en: { + wechatSubscribe: { + title: 'Subscribed Users', + type: 'Type', + openId: 'Open ID', + unionId: 'Union ID', + syncTime: 'Sync Time', + wechat: 'WeChat', + other: 'Other', + syncUser: 'Sync Users', + confirmTitle: 'Please confirm your operation!', + syncConfirmText: 'Confirm to sync subscribed users data from WeChat official account. Please do not use frequently to avoid being banned by WeChat. Please refresh to view sync records after submission.', + syncSuccess: 'Sync successfully', + syncError: 'Sync failed', + fetchError: 'Failed to fetch subscribed users' + } + }, + zh: { + wechatSubscribe: { + title: '关注用户', + type: '类型', + openId: 'Open ID', + unionId: 'Union ID', + syncTime: '同步时间', + wechat: '微信', + other: '其他', + syncUser: '同步用户', + confirmTitle: '请确认您的操作!', + syncConfirmText: '确定从公众号同步关注用户数据,请不要频繁使用,以免微信公众号封禁,提交后请刷新查看同步记录', + syncSuccess: '同步成功', + syncError: '同步失败', + fetchError: '获取关注用户失败' + } + } +} \ No newline at end of file diff --git a/src/views/community/wechatSubscribeList.vue b/src/views/community/wechatSubscribeList.vue new file mode 100644 index 000000000..b4cc79219 --- /dev/null +++ b/src/views/community/wechatSubscribeList.vue @@ -0,0 +1,158 @@ + + + + + \ No newline at end of file