From 0e3df9ef62d561bb32279c8bf5242cb703ced1ec Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Wed, 4 Jun 2025 19:06:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=89=A9=E4=B8=9A=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E4=B8=8B=E5=88=87=E6=8D=A2=E5=B0=8F=E5=8C=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/community/communityApi.js | 30 +++++- src/components/community/moreCommunity.vue | 106 +++++++++++++++++++++ src/main.js | 9 ++ src/views/layout/LayoutLang.js | 6 +- src/views/layout/layout.vue | 76 +++++++++++++-- 5 files changed, 214 insertions(+), 13 deletions(-) create mode 100644 src/components/community/moreCommunity.vue diff --git a/src/api/community/communityApi.js b/src/api/community/communityApi.js index 5b7a408e5..831ff6dbc 100644 --- a/src/api/community/communityApi.js +++ b/src/api/community/communityApi.js @@ -1,4 +1,4 @@ -import { setCommunitys,setCurrentCommunity } from "@/utils/vc" +import { setCommunitys,setCurrentCommunity,getCurrentCommunity } from "@/utils/vc" import request from '@/utils/request' export function _loadCommunityInfo(_param) { return new Promise((resolve, reject) => { @@ -51,4 +51,32 @@ export function getDict(tableName,tableColumns) { reject(error) }) }) +} + +export function getCommunityId() { + return getCurrentCommunity().communityId +} + + + +export function getCommunityName() { + return getCurrentCommunity().name +} + +export function getMyEnteredCommunitys(_param) { + return new Promise((resolve, reject) => { + request({ + url: '/community.listMyEnteredCommunitys', + method: 'get', + params: { + ..._param + } + }).then(response => { + const res = response.data + // 获取验证码成功 + resolve(res) + }).catch(error => { + reject(error) + }) + }) } \ No newline at end of file diff --git a/src/components/community/moreCommunity.vue b/src/components/community/moreCommunity.vue new file mode 100644 index 000000000..107b79f89 --- /dev/null +++ b/src/components/community/moreCommunity.vue @@ -0,0 +1,106 @@ + + + + + \ No newline at end of file diff --git a/src/main.js b/src/main.js index b1e87a830..ee9c7154f 100644 --- a/src/main.js +++ b/src/main.js @@ -4,6 +4,15 @@ import router from './router' import ElementUI from 'element-ui' import 'element-ui/lib/theme-chalk/index.css' import i18n from './i18n' +import {getCommunityName,getCommunityId} from '@/api/community/communityApi' + +Vue.prototype.getCommunityId = function(){ + return getCommunityId() +} +Vue.prototype.getCommunityName = function(){ + return getCommunityName() +} + Vue.prototype.hasPrivilege = function(_privaleges) { // 确保 _privaleges 是数组,如果不是则转换为数组 diff --git a/src/views/layout/LayoutLang.js b/src/views/layout/LayoutLang.js index f86efe0f0..b1c1d080b 100644 --- a/src/views/layout/LayoutLang.js +++ b/src/views/layout/LayoutLang.js @@ -44,7 +44,8 @@ export const messages = { tip: 'Tip', fetchError: 'Failed to fetch data', deleteError: 'Failed to delete', - submitError: 'Failed to submit' + submitError: 'Failed to submit', + moreCommunity:'More Community' } }, zh: { @@ -92,7 +93,8 @@ export const messages = { tip: '提示', fetchError: '获取数据失败', deleteError: '删除失败', - submitError: '提交失败' + submitError: '提交失败', + moreCommunity:'更多小区' } } } \ No newline at end of file diff --git a/src/views/layout/layout.vue b/src/views/layout/layout.vue index 7b4ee268c..fcc1b437b 100644 --- a/src/views/layout/layout.vue +++ b/src/views/layout/layout.vue @@ -11,6 +11,16 @@
+ + + + {{ c.name }} + {{ $t('layout.moreCommunity') }} + +