From 2530c618fa9d9cbba690935a72d5c0195230dc73 Mon Sep 17 00:00:00 2001 From: ronger Date: Mon, 30 Nov 2020 20:42:24 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E7=A7=AF=E5=88=86=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=9F=BA=E7=A1=80=E5=8A=9F=E8=83=BD=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/layouts/pc/header.vue | 1 + config/api.config.js | 4 +- pages/admin.vue | 10 +- pages/admin/bank-accounts.vue | 115 ++++++++++++++++ pages/admin/banks.vue | 168 ++++++++++++++++++++++++ pages/admin/users.vue | 217 ++++++++++++++++--------------- pages/drafts.vue | 3 + pages/notification.vue | 3 + pages/user/_nickname.vue | 2 +- pages/wallet.vue | 79 +++++++++++ store/bank-account.js | 51 ++++++++ store/bank.js | 51 ++++++++ store/wallet.js | 88 +++++++++++++ 13 files changed, 680 insertions(+), 112 deletions(-) create mode 100644 pages/admin/bank-accounts.vue create mode 100644 pages/admin/banks.vue create mode 100644 pages/wallet.vue create mode 100644 store/bank-account.js create mode 100644 store/bank.js create mode 100644 store/wallet.js diff --git a/components/layouts/pc/header.vue b/components/layouts/pc/header.vue index 5e8ce93..594e6d4 100644 --- a/components/layouts/pc/header.vue +++ b/components/layouts/pc/header.vue @@ -66,6 +66,7 @@ 系统管理 个人中心 我的草稿 + 我的钱包 设置 退出登录 diff --git a/config/api.config.js b/config/api.config.js index cec1fbb..7e81316 100644 --- a/config/api.config.js +++ b/config/api.config.js @@ -12,8 +12,8 @@ const apisMap = { production: { FE: 'https://rymcu.com', BASE: 'https://rymcu.com', - CDN: 'https://cdn.rymcu.com', - PROXY: 'https://cdn.rymcu.com/proxy', + CDN: 'https://static.rymcu.com', + PROXY: 'https://static.rymcu.com/proxy', SOCKET: 'https://rymcu.com', GRAVATAR: 'https://static.rymcu.com/avatar' } diff --git a/pages/admin.vue b/pages/admin.vue index 339e2bf..28a483c 100644 --- a/pages/admin.vue +++ b/pages/admin.vue @@ -23,9 +23,17 @@ 专题管理 - + 标签管理 + + + 银行管理 + + + + 银行卡管理 + diff --git a/pages/admin/bank-accounts.vue b/pages/admin/bank-accounts.vue new file mode 100644 index 0000000..2ae608d --- /dev/null +++ b/pages/admin/bank-accounts.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/pages/admin/banks.vue b/pages/admin/banks.vue new file mode 100644 index 0000000..54e4345 --- /dev/null +++ b/pages/admin/banks.vue @@ -0,0 +1,168 @@ + + + + + diff --git a/pages/admin/users.vue b/pages/admin/users.vue index 60a972b..c78d73d 100644 --- a/pages/admin/users.vue +++ b/pages/admin/users.vue @@ -29,8 +29,8 @@ width="180" prop="nickname"> @@ -55,7 +55,7 @@ prop="status"> @@ -65,7 +65,8 @@ 启用 - 禁用 + 禁用 + @@ -101,123 +102,123 @@ diff --git a/store/bank-account.js b/store/bank-account.js new file mode 100644 index 0000000..5ef5456 --- /dev/null +++ b/store/bank-account.js @@ -0,0 +1,51 @@ +export const BANK_ACCOUNT_API_PATH = '/api/admin/bank-account' + +const getDefaultListData = () => { + return { + bankAccounts: [], + pagination: {} + } +} + +export const state = () => { + return { + list: { + fetching: false, + data: getDefaultListData() + } + } +} + +export const mutations = { + updateListFetching(state, action) { + state.list.fetching = action + }, + updateListData(state, action) { + state.list.data = action + } +} + +export const actions = { + fetchList({commit}, params = {}) { + // 清空已有数据 + commit('updateListData', getDefaultListData()) + commit('updateListFetching', true) + let data = { + page: params.page || 1 + } + + return this.$axios + .$get(`${BANK_ACCOUNT_API_PATH}/list`, { + params: data + }) + .then(response => { + commit('updateListFetching', false); + commit('updateListData', response); + }) + .catch(error => { + console.log(error); + commit('updateListFetching', false); + }); + } +} + diff --git a/store/bank.js b/store/bank.js new file mode 100644 index 0000000..ab675ca --- /dev/null +++ b/store/bank.js @@ -0,0 +1,51 @@ +export const BANK_API_PATH = '/api/admin/bank' + +const getDefaultListData = () => { + return { + banks: [], + pagination: {} + } +} + +export const state = () => { + return { + list: { + fetching: false, + data: getDefaultListData() + } + } +} + +export const mutations = { + updateListFetching(state, action) { + state.list.fetching = action + }, + updateListData(state, action) { + state.list.data = action + } +} + +export const actions = { + fetchList({commit}, params = {}) { + // 清空已有数据 + commit('updateListData', getDefaultListData()) + commit('updateListFetching', true) + let data = { + page: params.page || 1 + } + + return this.$axios + .$get(`${BANK_API_PATH}/list`, { + params: data + }) + .then(response => { + commit('updateListFetching', false); + commit('updateListData', response); + }) + .catch(error => { + console.log(error); + commit('updateListFetching', false); + }); + } +} + diff --git a/store/wallet.js b/store/wallet.js new file mode 100644 index 0000000..d2fe186 --- /dev/null +++ b/store/wallet.js @@ -0,0 +1,88 @@ +export const BANK_ACCOUNT_API_PATH = '/api/admin/bank-account' + +const getDefaultListData = () => { + return { + records: [], + pagination: {} + } +} + +export const state = () => { + return { + list: { + fetching: false, + data: getDefaultListData() + }, + detail: { + fetching: false, + data: {} + } + } +} + +export const mutations = { + // 消费记录列表 + updateListFetching(state, action) { + state.list.fetching = action + }, + updateListData(state, action) { + state.list.data = action + }, + // 账户详情 + updateDetailFetching(state, action) { + state.detail.fetching = action + }, + updateDetailData(state, action) { + state.detail.data = action + } +} + +export const actions = { + // 获取消息列表 + fetchList({commit}, params = {}) { + // 清空已有数据 + commit('updateListData', getDefaultListData()) + commit('updateListFetching', true) + let data = { + page: params.page || 1 + } + + return this.$axios + .$get(`${BANK_ACCOUNT_API_PATH}/drafts`, { + params: data + }) + .then(response => { + commit('updateListFetching', false); + commit('updateListData', response); + }) + .catch(error => { + console.log(error); + commit('updateListFetching', false); + }); + }, + // 获取账户详情 + fetchDetail({ commit }, params = {}) { + commit('updateDetailFetching', true) + console.log(params) + return this.$axios + .$get(`${BANK_ACCOUNT_API_PATH}/${params.idUser}`, { + params: { + type: 3 + } + }) + .then(response => { + return new Promise(resolve => { + commit('updateDetailData', response) + commit('updateDetailFetching', false) + resolve(response) + // delay(() => { + // resolve(response) + // }) + }) + }) + .catch(error => { + commit('updateDetailFetching', false) + return Promise.reject(error) + }) + } +}