diff --git a/src/api/pay/application.js b/src/api/pay/application.js index c0b8972..9b071af 100644 --- a/src/api/pay/application.js +++ b/src/api/pay/application.js @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-07-04 15:20:02 * @LastEditors: ch - * @LastEditTime: 2022-07-06 17:20:08 + * @LastEditTime: 2022-07-07 11:06:40 * @Description: file content */ import request from '@/utils/request.js'; @@ -34,7 +34,7 @@ export const update = (data) => { }; export const updateStatus = (params) => { return request({ - url: `/payCenter/appInfo/updateStatus`, + url: '/payCenter/appInfo/updateStatus', method: 'put', params, }); @@ -46,6 +46,13 @@ export const getApplicationList = (params) => { params, }); }; +export const getApplicationSelector = (params) => { + return request({ + url: '/payCenter/appInfo/appSelector', + method: 'get', + params, + }); +}; export const getPayType = () => { return request({ url: '/payCenter/appInfo/payCode', diff --git a/src/api/pay/merchant.js b/src/api/pay/merchant.js index b857ba5..6628ee0 100644 --- a/src/api/pay/merchant.js +++ b/src/api/pay/merchant.js @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-07-04 15:20:02 * @LastEditors: ch - * @LastEditTime: 2022-07-06 14:14:31 + * @LastEditTime: 2022-07-07 10:10:21 * @Description: file content */ import request from '@/utils/request.js'; @@ -34,7 +34,7 @@ export const update = (data) => { }; export const updateStatus = (params) => { return request({ - url: `/payCenter/mchInfo/updateStatus`, + url: '/payCenter/mchInfo/updateStatus', method: 'put', params, }); diff --git a/src/api/pay/payOrder.js b/src/api/pay/payOrder.js new file mode 100644 index 0000000..e9a36c3 --- /dev/null +++ b/src/api/pay/payOrder.js @@ -0,0 +1,21 @@ +/* + * @Author: ch + * @Date: 2022-07-04 15:20:02 + * @LastEditors: ch + * @LastEditTime: 2022-07-07 14:55:24 + * @Description: file content + */ +import request from '@/utils/request.js'; +export const detail = (orderId) => { + return request({ + url: `/payCenter/payOrder/${orderId}`, + method: 'get', + }); +}; +export const getOrderList = (params) => { + return request({ + url: '/payCenter/payOrder/page', + method: 'get', + params, + }); +}; diff --git a/src/api/pay/refundOrder.js b/src/api/pay/refundOrder.js new file mode 100644 index 0000000..36af2ec --- /dev/null +++ b/src/api/pay/refundOrder.js @@ -0,0 +1,21 @@ +/* + * @Author: ch + * @Date: 2022-07-04 15:20:02 + * @LastEditors: ch + * @LastEditTime: 2022-07-07 15:25:01 + * @Description: file content + */ +import request from '@/utils/request.js'; +export const detail = (refundOrderId) => { + return request({ + url: `/payCenter/refundOrder/${refundOrderId}`, + method: 'get', + }); +}; +export const getOrderList = (params) => { + return request({ + url: '/payCenter/refundOrder/page', + method: 'get', + params, + }); +}; diff --git a/src/store/modules/pay/payOrder.js b/src/store/modules/pay/payOrder.js new file mode 100644 index 0000000..384a710 --- /dev/null +++ b/src/store/modules/pay/payOrder.js @@ -0,0 +1,114 @@ +/* + * @Author: ch + * @Date: 2022-07-04 15:21:30 + * @LastEditors: ch + * @LastEditTime: 2022-07-07 11:37:49 + * @Description: file content + */ +import * as appApi from '@/api/pay/application.js'; +import * as mchApi from '@/api/pay/merchant.js'; +import * as api from '@/api/pay/payOrder.js'; +import { ElMessage } from '@/plugins/element-plus'; +const state = { + code: 'PayCenterPayOrderManagement', + list: [], + detail: {}, + total: 0, + opts: { + notifyStatus: [ + { + value: 1, + label: '未通知', + }, + { + value: 2, + label: '已通知', + }, + { + value: 3, + label: '已响应', + }, + ], + payStatus: [ + { + value: 1, + label: '支付中', + }, + { + value: 2, + label: '已关闭', + }, + { + value: 3, + label: '支付成功', + }, + { + value: 4, + label: '支付失败', + }, + { + value: 5, + label: '部分退款', + }, + { + value: 6, + label: '全额退款', + }, + ], + merchant: [], + payType: [], + application: [], + }, +}; +const getters = {}; +const mutations = { + setList: (state, data) => (state.list = data), + setPayType: (state, data) => (state.opts.payType = data), + setMerchant: (state, data) => (state.opts.merchant = data), + setApplication: (state, data) => (state.opts.application = data), + setTotal: (state, data) => (state.total = data), +}; +const actions = { + async search({ rootGetters, commit }, params) { + const res = await api.getOrderList({ + ...rootGetters['local/page'](state.code), + ...params, + }); + if (res) { + commit('setList', res?.records.map((i) => ({ ...i, isShow: !i.isDisabled })) || []); + commit('setTotal', res?.total || 0); + } + }, + detail: async (context, id) => { + let res = await api.detail(id); + if (!res) { + ElMessage.error('加载详情失败'); + } + return res; + }, + async getMerchantList({ commit }) { + const res = await mchApi.getMerchantSelector(); + if (res) { + commit('setMerchant', res || []); + } + }, + async getApplicationList({ commit }) { + const res = await appApi.getApplicationSelector(); + if (res) { + commit('setApplication', res || []); + } + }, + async getPayType({ commit }) { + const res = await appApi.getPayType(); + if (res) { + commit('setPayType', res || []); + } + }, +}; + +export default { + state, + getters, + mutations, + actions, +}; diff --git a/src/store/modules/pay/refundOrder.js b/src/store/modules/pay/refundOrder.js new file mode 100644 index 0000000..dfbdc2a --- /dev/null +++ b/src/store/modules/pay/refundOrder.js @@ -0,0 +1,106 @@ +/* + * @Author: ch + * @Date: 2022-07-04 15:21:30 + * @LastEditors: ch + * @LastEditTime: 2022-07-07 15:25:26 + * @Description: file content + */ +import * as appApi from '@/api/pay/application.js'; +import * as mchApi from '@/api/pay/merchant.js'; +import * as api from '@/api/pay/refundOrder.js'; +import { ElMessage } from '@/plugins/element-plus'; +const state = { + code: 'PayCenterRefundOrderManagement', + list: [], + detail: {}, + total: 0, + opts: { + notifyStatus: [ + { + value: 1, + label: '未通知', + }, + { + value: 2, + label: '已通知', + }, + { + value: 3, + label: '已响应', + }, + ], + refundStatus: [ + { + value: 1, + label: '退款中', + }, + { + value: 2, + label: '退款关闭', + }, + { + value: 3, + label: '退款成功', + }, + { + value: 4, + label: '退款失败', + }, + ], + merchant: [], + payType: [], + application: [], + }, +}; +const getters = {}; +const mutations = { + setList: (state, data) => (state.list = data), + setPayType: (state, data) => (state.opts.payType = data), + setMerchant: (state, data) => (state.opts.merchant = data), + setApplication: (state, data) => (state.opts.application = data), + setTotal: (state, data) => (state.total = data), +}; +const actions = { + async search({ rootGetters, commit }, params) { + const res = await api.getOrderList({ + ...rootGetters['local/page'](state.code), + ...params, + }); + if (res) { + commit('setList', res?.records.map((i) => ({ ...i, isShow: !i.isDisabled })) || []); + commit('setTotal', res?.total || 0); + } + }, + detail: async (context, id) => { + let res = await api.detail(id); + if (!res) { + ElMessage.error('加载详情失败'); + } + return res; + }, + async getMerchantList({ commit }) { + const res = await mchApi.getMerchantSelector(); + if (res) { + commit('setMerchant', res || []); + } + }, + async getApplicationList({ commit }) { + const res = await appApi.getApplicationSelector(); + if (res) { + commit('setApplication', res || []); + } + }, + async getPayType({ commit }) { + const res = await appApi.getPayType(); + if (res) { + commit('setPayType', res || []); + } + }, +}; + +export default { + state, + getters, + mutations, + actions, +}; diff --git a/src/views/goods/comment/detail/index.vue b/src/views/goods/comment/detail.vue similarity index 100% rename from src/views/goods/comment/detail/index.vue rename to src/views/goods/comment/detail.vue diff --git a/src/views/goods/comment/list/index.vue b/src/views/goods/comment/list.vue similarity index 100% rename from src/views/goods/comment/list/index.vue rename to src/views/goods/comment/list.vue diff --git a/src/views/pay/application/form.vue b/src/views/pay/application/form.vue index 412f8c5..ce770c6 100644 --- a/src/views/pay/application/form.vue +++ b/src/views/pay/application/form.vue @@ -2,12 +2,12 @@ * @Author: ch * @Date: 2022-07-04 16:42:21 * @LastEditors: ch - * @LastEditTime: 2022-07-06 19:01:37 + * @LastEditTime: 2022-07-07 16:26:45 * @Description: file content -->