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') }} + +