diff --git a/src/api/community/communityWechatApi.js b/src/api/community/communityWechatApi.js new file mode 100644 index 0000000..32e6718 --- /dev/null +++ b/src/api/community/communityWechatApi.js @@ -0,0 +1,81 @@ +import request from '@/utils/request' + +// 获取管理员小区列表 +export function listAdminCommunitys(params) { + return new Promise((resolve, reject) => { + request({ + url: '/community.listAdminCommunitys', + method: 'get', + params + }).then(response => { + const res = response.data + if (res.code == 0) { + resolve(res) + } else { + reject(new Error(res.msg || '获取小区列表失败')) + } + }).catch(error => { + reject(error) + }) + }) +} + +// 获取公众号列表 +export function listAdminSmallWeChats(params) { + return new Promise((resolve, reject) => { + request({ + url: '/smallWeChat.listAdminSmallWeChats', + method: 'get', + params + }).then(response => { + const res = response.data + if (res.code == 0) { + resolve(res) + } else { + reject(new Error(res.msg || '获取公众号列表失败')) + } + }).catch(error => { + reject(error) + }) + }) +} + +// 添加公众号 +export function saveAdminSmallWeChat(data) { + return new Promise((resolve, reject) => { + request({ + url: '/smallWeChat.saveAdminSmallWeChat', + method: 'post', + data + }).then(response => { + const res = response.data + if (res.code == 0) { + resolve(res) + } else { + reject(new Error(res.msg || '添加公众号失败')) + } + }).catch(error => { + reject(error) + }) + }) +} + +// 更新公众号 +export function updateAdminSmallWeChat(data) { + return new Promise((resolve, reject) => { + request({ + url: '/smallWeChat.updateAdminSmallWeChat', + method: 'post', + data + }).then(response => { + const res = response.data + if (res.code == 0) { + resolve(res) + } else { + reject(new Error(res.msg || '更新公众号失败')) + } + }).catch(error => { + reject(error) + }) + }) +} \ No newline at end of file diff --git a/src/components/community/addCommunityWechat.vue b/src/components/community/addCommunityWechat.vue new file mode 100644 index 0000000..5b8a805 --- /dev/null +++ b/src/components/community/addCommunityWechat.vue @@ -0,0 +1,154 @@ + + + \ No newline at end of file diff --git a/src/components/community/editCommunityWechat.vue b/src/components/community/editCommunityWechat.vue new file mode 100644 index 0000000..72cfa9f --- /dev/null +++ b/src/components/community/editCommunityWechat.vue @@ -0,0 +1,152 @@ + + + \ No newline at end of file diff --git a/src/components/staff/deleteAStaffCommunity.vue b/src/components/staff/deleteAStaffCommunity.vue index 9538b28..cc55190 100644 --- a/src/components/staff/deleteAStaffCommunity.vue +++ b/src/components/staff/deleteAStaffCommunity.vue @@ -47,27 +47,3 @@ export default { } - -{ - "en": { - "deleteAStaffCommunity": { - "confirmOperation": "Confirm Your Operation", - "confirmDelete": "Are you sure you want to delete this community?", - "cancel": "Cancel", - "confirm": "Confirm Delete", - "deleteSuccess": "Community deleted successfully", - "deleteError": "Failed to delete community" - } - }, - "zh": { - "deleteAStaffCommunity": { - "confirmOperation": "请确认您的操作", - "confirmDelete": "确定删除隶属小区?", - "cancel": "点错了", - "confirm": "确认删除", - "deleteSuccess": "小区删除成功", - "deleteError": "小区删除失败" - } - } -} - \ No newline at end of file diff --git a/src/i18n/index.js b/src/i18n/index.js index 55072b2..0e9b88a 100644 --- a/src/i18n/index.js +++ b/src/i18n/index.js @@ -115,6 +115,7 @@ import { messages as supplierCouponBuyMessages } from '../views/scm/supplierCoup import { messages as aStaffMessages } from '../views/staff/aStaffLang' import { messages as aStaffDetailMessages } from '../views/staff/aStaffDetailLang' import { messages as aStaffCommunityMessages } from '../views/staff/aStaffCommunityLang' +import { messages as communityWechatMessages } from '../views/community/communityWechatLang' Vue.use(VueI18n) @@ -234,6 +235,7 @@ const messages = { ...aStaffMessages.en, ...aStaffDetailMessages.en, ...aStaffCommunityMessages.en, + ...communityWechatMessages.en, }, zh: { ...loginMessages.zh, @@ -349,6 +351,7 @@ const messages = { ...aStaffMessages.zh, ...aStaffDetailMessages.zh, ...aStaffCommunityMessages.zh, + ...communityWechatMessages.zh, } } diff --git a/src/router/index.js b/src/router/index.js index 43eace4..09813e3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -561,6 +561,11 @@ const routes = [ name:'/pages/staff/aStaffCommunity', component: () => import('@/views/staff/aStaffCommunityList.vue') }, + { + path:'/pages/community/communityWechat', + name:'/pages/community/communityWechat', + component: () => import('@/views/community/communityWechatList.vue') + }, // 其他子路由可以在这里添加 ] }, diff --git a/src/views/community/communityWechatLang.js b/src/views/community/communityWechatLang.js new file mode 100644 index 0000000..82dfb5a --- /dev/null +++ b/src/views/community/communityWechatLang.js @@ -0,0 +1,98 @@ +export const messages = { + en: { + communityWechat: { + title: 'Community WeChat', + name: 'Name', + communityName: 'Community Name', + appId: 'APPID', + appSecret: 'App Secret', + description: 'Description', + operation: 'Operation', + add: 'Add', + edit: 'Edit', + cancel: 'Cancel', + save: 'Save', + required: 'Required', + maxLength100: 'Cannot exceed 100 characters', + maxLength200: 'Cannot exceed 200 characters', + addSuccess: 'Add successful', + editSuccess: 'Update successful' + }, + addCommunityWechat: { + title: 'Add WeChat', + name: 'Name', + appId: 'APPID', + appSecret: 'App Secret', + description: 'Description', + remarks: 'Remarks', + placeholder: { + name: 'Required, please enter name', + appId: 'Required, please enter APPID', + appSecret: 'Required, please enter app secret', + remarks: 'Optional, please enter description' + } + }, + editCommunityWechat: { + title: 'Edit WeChat', + name: 'Name', + appId: 'APPID', + appSecret: 'App Secret', + description: 'Description', + remarks: 'Remarks', + placeholder: { + name: 'Required, please enter name', + appId: 'Required, please enter APPID', + appSecret: 'Required, please enter app secret', + remarks: 'Optional, please enter description' + } + }, + }, + zh: { + communityWechat: { + title: '小区公众号', + name: '名称', + communityName: '小区名称', + appId: 'APPID', + appSecret: '应用密钥', + description: '描述', + operation: '操作', + add: '添加', + edit: '修改', + cancel: '取消', + save: '保存', + required: '不能为空', + maxLength100: '不能超过100个字符', + maxLength200: '不能超过200个字符', + addSuccess: '添加成功', + editSuccess: '修改成功' + }, + addCommunityWechat: { + title: '添加公众号', + name: '名称', + appId: 'APPID', + appSecret: '应用密钥', + description: '描述', + remarks: '备注', + placeholder: { + name: '必填,请填写名称', + appId: '必填,请填写APPID', + appSecret: '必填,请填写应用密钥', + remarks: '选填,请填写描述信息' + } + }, + editCommunityWechat: { + title: '修改公众号', + name: '名称', + appId: 'APPID', + appSecret: '应用密钥', + description: '描述', + remarks: '备注', + placeholder: { + name: '必填,请填写名称', + appId: '必填,请填写APPID', + appSecret: '必填,请填写应用密钥', + remarks: '选填,请填写描述信息' + } + }, + } +} \ No newline at end of file diff --git a/src/views/community/communityWechatList.vue b/src/views/community/communityWechatList.vue new file mode 100644 index 0000000..a7d6435 --- /dev/null +++ b/src/views/community/communityWechatList.vue @@ -0,0 +1,143 @@ + + + + + \ No newline at end of file