diff --git a/.env b/.env index 714c44b..f6306ba 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ -VITE_BASE_URL=/api +VITE_BASE_URL=https://k8s-horse-gateway.mashibing.cn VITE_SOCKET_URL=wss://k8s-horse-gateway.mashibing.cn/ws -#VITE_SOCKET_URL=ws://192.168.10.93:8090/ws -VITE_REQUEST_TIMEOUT=5000 -VITE_BROWSER_URL = https://k8s-shop-pc.mashibing.cn \ No newline at end of file +VITE_BROWSER_URL = https://k8s-shop-pc.mashibing.cn + +VITE_REQUEST_TIMEOUT=5000 \ No newline at end of file diff --git a/.env.bate b/.env.bate new file mode 100644 index 0000000..811cd1a --- /dev/null +++ b/.env.bate @@ -0,0 +1,4 @@ +VITE_BASE_URL=https://you-gateway.mashibing.com +VITE_SOCKET_URL=wss://you-gateway.mashibing.com/ws +VITE_REQUEST_TIMEOUT=20000 +VITE_BROWSER_URL = https://you.mashibing.com diff --git a/.env.test b/.env.test index 21b266b..9a974a3 100644 --- a/.env.test +++ b/.env.test @@ -1,4 +1,4 @@ -VITE_BASE_URL=https://k8s-horse-gateway.mashibing.cn/ +VITE_BASE_URL=https://k8s-horse-gateway.mashibing.cn VITE_SOCKET_URL=wss://k8s-horse-gateway.mashibing.cn/ws VITE_REQUEST_TIMEOUT=20000 VITE_BROWSER_URL = https://k8s-shop-pc.mashibing.cn diff --git a/components.d.ts b/components.d.ts new file mode 100644 index 0000000..9e35d3f --- /dev/null +++ b/components.d.ts @@ -0,0 +1,61 @@ +// generated by unplugin-vue-components +// We suggest you to commit this file into source control +// Read more: https://github.com/vuejs/vue-next/pull/3399 + +declare module 'vue' { + export interface GlobalComponents { + ElArea: typeof import('./src/components/ElArea.vue')['default'] + ElAvatar: typeof import('element-plus/es')['ElAvatar'] + ElBadge: typeof import('element-plus/es')['ElBadge'] + ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] + ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] + ElButton: typeof import('./src/components/extra/ElButton.vue')['default'] + ElCard: typeof import('element-plus/es')['ElCard'] + ElCascader: typeof import('./src/components/extra/ElCascader.vue')['default'] + ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] + ElCheckboxGroup: typeof import('./src/components/extra/ElCheckboxGroup.vue')['default'] + ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] + ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] + ElDescriptions: typeof import('element-plus/es')['ElDescriptions'] + ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem'] + ElDialog: typeof import('./src/components/extra/ElDialog.vue')['default'] + ElDropdown: typeof import('./src/components/extra/ElDropdown.vue')['default'] + ElEditor: typeof import('./src/components/ElEditor.vue')['default'] + ElEmpty: typeof import('element-plus/es')['ElEmpty'] + ElForm: typeof import('element-plus/es')['ElForm'] + ElFormItem: typeof import('element-plus/es')['ElFormItem'] + ElIcon: typeof import('./src/components/extra/ElIcon.vue')['default'] + ElImage: typeof import('./src/components/extra/ElImage.vue')['default'] + ElInput: typeof import('./src/components/extra/ElInput.vue')['default'] + ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] + ElMenu: typeof import('element-plus/es')['ElMenu'] + ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] + ElOption: typeof import('element-plus/es')['ElOption'] + ElPagination: typeof import('element-plus/es')['ElPagination'] + ElRadio: typeof import('element-plus/es')['ElRadio'] + ElRadioGroup: typeof import('./src/components/extra/ElRadioGroup.vue')['default'] + ElRate: typeof import('element-plus/es')['ElRate'] + ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] + ElSelect: typeof import('./src/components/extra/ElSelect.vue')['default'] + ElStep: typeof import('element-plus/es')['ElStep'] + ElSteps: typeof import('element-plus/es')['ElSteps'] + ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] + ElSwitch: typeof import('./src/components/extra/ElSwitch.vue')['default'] + ElTable: typeof import('./src/components/extra/ElTable.vue')['default'] + ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] + ElTabPane: typeof import('element-plus/es')['ElTabPane'] + ElTabs: typeof import('element-plus/es')['ElTabs'] + ElTag: typeof import('element-plus/es')['ElTag'] + ElTimeline: typeof import('element-plus/es')['ElTimeline'] + ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] + ElTooltip: typeof import('./src/components/extra/ElTooltip.vue')['default'] + ElTree: typeof import('element-plus/es')['ElTree'] + ElUpload: typeof import('element-plus/es')['ElUpload'] + ElUploadFile: typeof import('./src/components/ElUploadFile.vue')['default'] + ElUploadImage: typeof import('./src/components/ElUploadImage.vue')['default'] + Loading: typeof import('element-plus/es')['ElLoadingDirective'] + TableList: typeof import('./src/components/TableList.vue')['default'] + } +} + +export { } diff --git a/package.json b/package.json index f97a241..8158044 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,10 @@ "private": true, "version": "0.0.1", "scripts": { - "dev": "vite", + "server": "vite", + "server:test": "vite --mode test", + "server:bate": "vite --mode bate", + "server:prod": "vite --mode prod", "build:test": "vite build --mode test", "build:beta": "vite build --mode beta", "build:prod": "vite build --mode prod", diff --git a/src/api/file.js b/src/api/file.js index dc1a8e2..11dccfc 100644 --- a/src/api/file.js +++ b/src/api/file.js @@ -1,4 +1,13 @@ +/* + * @Author: ch + * @Date: 2022-07-07 17:27:04 + * @LastEditors: ch + * @LastEditTime: 2022-07-11 17:47:42 + * @Description: file content + */ +import { ElMessage } from '@/plugins/element-plus'; import request from '@/utils/request'; +import { CreateUUID } from '@/utils/utils'; // OSS签名 export function sign(serviceName, configId) { return request({ @@ -9,24 +18,32 @@ export function sign(serviceName, configId) { configId, }, }); - // console.info(serviceName, configId); - // return { - // accessId: 'LTAI4GHRNb5Xn2w5NeHVbR4c', - // policy: 'eyJleHBpcmF0aW9uIjoiMjAyMi0wNC0xNVQyMDowODoyNi4zMTlaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCJ0ZXN0LyJdXX0=', - // signature: 'okaB3sNp3vzyfM0S3ypudaUAZ+0=', - // dir: 'test/', - // host: 'https://msb-edu-dev.oss-cn-beijing.aliyuncs.com', - // expire: '1650053306', - // }; } +export function payCenterSign() { + return request({ + url: '/payCenter/oss/ossSignature', + method: 'GET', + }); +} + // 上传文件 -export async function upload(serviceName, configId, file, cancelToken) { - let oss = await sign(serviceName, configId); - let data = new FormData(); - let arr = file.name.split('/'); - arr[arr.length - 1] = encodeURIComponent(arr[arr.length - 1]); - data.append('name', arr.join('/')); - data.append('key', `${oss.dir}${'${filename}'}`); +export async function upload(serviceName, configId, file, cancelToken, suffix) { + const _suffix = file.name.substring(file.name.lastIndexOf('.')); + const suffixObj = typeof suffix === 'string' ? suffix.split(',') : suffix; + if (suffixObj && !suffixObj.includes(_suffix)) { + ElMessage.error('上传文件类型错误'); + return ''; + } + let oss = {}; + if (serviceName) { + oss = await sign(serviceName, configId); + } else { + oss = await payCenterSign(); + } + const data = new FormData(); + const name = CreateUUID() + _suffix; + data.append('name', name); + data.append('key', `${oss.dir}${name}`); data.append('policy', oss.policy); data.append('OSSAccessKeyId', oss.accessId); data.append('Signature', oss.signature); diff --git a/src/api/pay/application.js b/src/api/pay/application.js new file mode 100644 index 0000000..9b071af --- /dev/null +++ b/src/api/pay/application.js @@ -0,0 +1,61 @@ +/* + * @Author: ch + * @Date: 2022-07-04 15:20:02 + * @LastEditors: ch + * @LastEditTime: 2022-07-07 11:06:40 + * @Description: file content + */ +import request from '@/utils/request.js'; +export const create = (data) => { + return request({ + url: '/payCenter/appInfo', + method: 'post', + data, + }); +}; +export const del = (mchPrimaryId) => { + return request({ + url: `/payCenter/appInfo/${mchPrimaryId}`, + method: 'delete', + }); +}; +export const detail = (mchPrimaryId) => { + return request({ + url: `/payCenter/appInfo/${mchPrimaryId}`, + method: 'get', + }); +}; +export const update = (data) => { + return request({ + url: '/payCenter/appInfo', + method: 'put', + data, + }); +}; +export const updateStatus = (params) => { + return request({ + url: '/payCenter/appInfo/updateStatus', + method: 'put', + params, + }); +}; +export const getApplicationList = (params) => { + return request({ + url: '/payCenter/appInfo/page', + method: 'get', + params, + }); +}; +export const getApplicationSelector = (params) => { + return request({ + url: '/payCenter/appInfo/appSelector', + method: 'get', + params, + }); +}; +export const getPayType = () => { + return request({ + url: '/payCenter/appInfo/payCode', + method: 'get', + }); +}; diff --git a/src/api/pay/merchant.js b/src/api/pay/merchant.js new file mode 100644 index 0000000..6628ee0 --- /dev/null +++ b/src/api/pay/merchant.js @@ -0,0 +1,61 @@ +/* + * @Author: ch + * @Date: 2022-07-04 15:20:02 + * @LastEditors: ch + * @LastEditTime: 2022-07-07 10:10:21 + * @Description: file content + */ +import request from '@/utils/request.js'; +export const create = (data) => { + return request({ + url: '/payCenter/mchInfo', + method: 'post', + data, + }); +}; +export const del = (mchPrimaryId) => { + return request({ + url: `/payCenter/mchInfo/${mchPrimaryId}`, + method: 'delete', + }); +}; +export const detail = (mchPrimaryId) => { + return request({ + url: `/payCenter/mchInfo/${mchPrimaryId}`, + method: 'get', + }); +}; +export const update = (data) => { + return request({ + url: '/payCenter/mchInfo', + method: 'put', + data, + }); +}; +export const updateStatus = (params) => { + return request({ + url: '/payCenter/mchInfo/updateStatus', + method: 'put', + params, + }); +}; +export const getMerchantList = (params) => { + return request({ + url: '/payCenter/mchInfo/page', + method: 'get', + params, + }); +}; +export const getMerchantSelector = () => { + return request({ + url: '/payCenter/mchInfo/mchSelector', + method: 'get', + }); +}; +export const getMerchantPlatform = (params) => { + return request({ + url: '/payCenter/mchInfo/mchCode', + method: 'get', + 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/chat/chat.js b/src/store/modules/chat/chat.js index 8edd291..a8bdfa4 100644 --- a/src/store/modules/chat/chat.js +++ b/src/store/modules/chat/chat.js @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-06-07 15:41:05 * @LastEditors: ch - * @LastEditTime: 2022-06-14 15:26:44 + * @LastEditTime: 2022-07-04 11:34:14 * @Description: file content */ import * as api from '@/api/chat'; @@ -166,7 +166,7 @@ const actions = { /** * 提交转移会话 */ - submitTransferSession: ({}, data) => { + submitTransferSession: (context, data) => { return api .transferCustomerService({ storeId: 1, diff --git a/src/store/modules/goods/comment.js b/src/store/modules/goods/comment.js index 62c6461..54f8239 100644 --- a/src/store/modules/goods/comment.js +++ b/src/store/modules/goods/comment.js @@ -150,10 +150,6 @@ const actions = { data.commentTimeBegin = data.dateRange[0]; data.commentTimeEnd = data.dateRange[1]; } - if (data.scoreList) { - data.commentScoreList = data.scoreList.join(','); - delete data.scoreList; - } delete data.dateRange; delete data.pagingCode; const res = await api.commentList({ @@ -171,7 +167,7 @@ const actions = { commit('setTotal', res?.total || 0); } }, - async updateShow({}, params) { + async updateShow(context, params) { const res = await api.updateCommentShow(params); if (!res) { ElMessage.error('状态更新失败!'); @@ -188,7 +184,7 @@ const actions = { commit('setDetail', res); return Promise.resolve(res); }, - async add({}, data) { + async add(context, data) { const res = await api.commentAdd(data); if (!res) { ElMessage.error('回复失败'); diff --git a/src/store/modules/pay/application.js b/src/store/modules/pay/application.js new file mode 100644 index 0000000..53ad07f --- /dev/null +++ b/src/store/modules/pay/application.js @@ -0,0 +1,112 @@ +/* + * @Author: ch + * @Date: 2022-07-04 15:21:30 + * @LastEditors: ch + * @LastEditTime: 2022-07-06 17:18:37 + * @Description: file content + */ +import * as api from '@/api/pay/application.js'; +import * as mchApi from '@/api/pay/merchant.js'; +import { ElMessage, ElMessageBox } from '@/plugins/element-plus'; +const state = { + code: 'PayApplicationManagement', + list: [], + detail: {}, + total: 0, + opts: { + status: [ + { + value: false, + label: '启用', + }, + { + value: true, + label: '禁用', + }, + ], + merchant: [], + payType: [], + }, +}; +const getters = {}; +const mutations = { + setList: (state, data) => (state.list = data), + setPayType: (state, data) => (state.opts.payType = data), + setMerchant: (state, data) => (state.opts.merchant = data), + setTotal: (state, data) => (state.total = data), + setDetail: (state, data) => (state.detail = data), +}; +const actions = { + async search({ rootGetters, commit }, params) { + const res = await api.getApplicationList({ + ...rootGetters['local/page'](state.code), + ...params, + }); + if (res) { + commit('setList', res?.records.map((i) => ({ ...i, isShow: !i.isDisabled })) || []); + commit('setTotal', res?.total || 0); + } + }, + async save({ dispatch }, data) { + let save = data.appPrimaryId ? api.update : api.create; + let res = await save(data); + if (res) { + ElMessage.success('保存成功'); + dispatch('search'); + } else { + ElMessage.error('保存失败'); + } + return res; + }, + detail: async (context, id) => { + let res = await api.detail(id); + if (!res) { + ElMessage.error('加载详情失败'); + } + return res; + }, + del: async ({ dispatch }, id) => { + try { + await ElMessageBox.confirm('数据删除后无法恢复,确定要删除吗?', '危险操作'); + let res = await api.del(id); + if (res) { + ElMessage.success('删除成功'); + dispatch('search'); + } else { + ElMessage.error('删除失败'); + } + return res; + } catch (e) { + console.info('取消删除', e); + } + }, + async updateStatus({ dispatch }, data) { + let res = await api.updateStatus(data); + if (res) { + ElMessage.success('保存成功'); + dispatch('search'); + } else { + ElMessage.error('保存失败'); + } + return res; + }, + async getMerchantList({ commit }) { + const res = await mchApi.getMerchantSelector(); + if (res) { + commit('setMerchant', res || []); + } + }, + async getPayType({ commit }) { + const res = await api.getPayType(); + if (res) { + commit('setPayType', res || []); + } + }, +}; + +export default { + state, + getters, + mutations, + actions, +}; diff --git a/src/store/modules/pay/merchant.js b/src/store/modules/pay/merchant.js new file mode 100644 index 0000000..be58c41 --- /dev/null +++ b/src/store/modules/pay/merchant.js @@ -0,0 +1,103 @@ +/* + * @Author: ch + * @Date: 2022-07-04 15:21:30 + * @LastEditors: ch + * @LastEditTime: 2022-07-06 11:26:06 + * @Description: file content + */ +import * as api from '@/api/pay/merchant.js'; +import { ElMessage, ElMessageBox } from '@/plugins/element-plus'; +const state = { + code: 'PayMerchantManagement', + list: [], + detail: {}, + total: 0, + opts: { + status: [ + { + value: false, + label: '启用', + }, + { + value: true, + label: '禁用', + }, + ], + platform: [], + }, +}; +const getters = {}; +const mutations = { + setList: (state, data) => (state.list = data), + setPlatform: (state, data) => (state.opts.platform = data), + setTotal: (state, data) => (state.total = data), + setDetail: (state, data) => (state.detail = data), +}; +const actions = { + async search({ rootGetters, commit }, params) { + const res = await api.getMerchantList({ + ...rootGetters['local/page'](state.code), + ...params, + }); + if (res) { + commit('setList', res?.records.map((i) => ({ ...i, isShow: !i.isDisabled })) || []); + commit('setTotal', res?.total || 0); + } + }, + async save({ dispatch }, data) { + let save = data.mchPrimaryId ? api.update : api.create; + let res = await save(data); + if (res) { + ElMessage.success('保存成功'); + dispatch('search'); + } else { + ElMessage.error('保存失败'); + } + return res; + }, + detail: async (context, id) => { + let res = await api.detail(id); + if (!res) { + ElMessage.error('加载详情失败'); + } + return res; + }, + del: async ({ dispatch }, id) => { + try { + await ElMessageBox.confirm('数据删除后无法恢复,确定要删除吗?', '危险操作'); + let res = await api.del(id); + if (res) { + ElMessage.success('删除成功'); + dispatch('search'); + } else { + ElMessage.error('删除失败'); + } + return res; + } catch (e) { + console.info('取消删除', e); + } + }, + async updateStatus({ dispatch }, data) { + let res = await api.updateStatus(data); + if (res) { + ElMessage.success('保存成功'); + dispatch('search'); + } else { + ElMessage.error('保存失败'); + } + return res; + }, + async getMerchantPlatform({ commit }) { + const res = await api.getMerchantPlatform(); + if (res) { + commit('setPlatform', res || []); + } + }, +}; + +export default { + state, + getters, + mutations, + actions, +}; 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 new file mode 100644 index 0000000..659fff8 --- /dev/null +++ b/src/views/pay/application/form.vue @@ -0,0 +1,204 @@ + + + + diff --git a/src/views/pay/application/index.vue b/src/views/pay/application/index.vue new file mode 100644 index 0000000..ee9386f --- /dev/null +++ b/src/views/pay/application/index.vue @@ -0,0 +1,204 @@ + + + + diff --git a/src/views/pay/merchant/form/ali.vue b/src/views/pay/merchant/form/ali.vue new file mode 100644 index 0000000..e09601c --- /dev/null +++ b/src/views/pay/merchant/form/ali.vue @@ -0,0 +1,126 @@ + + + diff --git a/src/views/pay/merchant/form/index.vue b/src/views/pay/merchant/form/index.vue new file mode 100644 index 0000000..8741eed --- /dev/null +++ b/src/views/pay/merchant/form/index.vue @@ -0,0 +1,122 @@ + + + + diff --git a/src/views/pay/merchant/form/wx.vue b/src/views/pay/merchant/form/wx.vue new file mode 100644 index 0000000..4a108ff --- /dev/null +++ b/src/views/pay/merchant/form/wx.vue @@ -0,0 +1,182 @@ + + + diff --git a/src/views/pay/merchant/index.vue b/src/views/pay/merchant/index.vue new file mode 100644 index 0000000..a24118e --- /dev/null +++ b/src/views/pay/merchant/index.vue @@ -0,0 +1,180 @@ + + + + diff --git a/src/views/pay/payOrder/detail.vue b/src/views/pay/payOrder/detail.vue new file mode 100644 index 0000000..5f0192f --- /dev/null +++ b/src/views/pay/payOrder/detail.vue @@ -0,0 +1,58 @@ + + + + diff --git a/src/views/pay/payOrder/list.vue b/src/views/pay/payOrder/list.vue new file mode 100644 index 0000000..ec435b6 --- /dev/null +++ b/src/views/pay/payOrder/list.vue @@ -0,0 +1,232 @@ + + + + diff --git a/src/views/pay/refundOrder/detail.vue b/src/views/pay/refundOrder/detail.vue new file mode 100644 index 0000000..c72d4e5 --- /dev/null +++ b/src/views/pay/refundOrder/detail.vue @@ -0,0 +1,55 @@ + + + + diff --git a/src/views/pay/refundOrder/list.vue b/src/views/pay/refundOrder/list.vue new file mode 100644 index 0000000..237e729 --- /dev/null +++ b/src/views/pay/refundOrder/list.vue @@ -0,0 +1,231 @@ + + + + diff --git a/vite.config.js b/vite.config.js index ae401cf..1e8d5c8 100644 --- a/vite.config.js +++ b/vite.config.js @@ -16,12 +16,12 @@ export default (configEnv) => { return { server: { host: '0.0.0.0', - port: 3000, + port: 3001, open: false, proxy: { '/api': { - target: 'https://k8s-horse-gateway.mashibing.cn/', // 测试地址 - // target: 'https://you-gateway.mashibing.com', // 生产环境 + // target: 'https://k8s-horse-gateway.mashibing.cn/', // 测试地址 + target: 'https://you-gateway.mashibing.com', // 生产环境 changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, ''), }, @@ -67,13 +67,13 @@ export default (configEnv) => { dts: 'src/auto-imports.d.ts', }), Components({ - dirs: ['src/components'], - extensions: ['vue', 'jsx', 'tsx', 'js', 'ts'], - deep: true, + // dirs: ['src/components'], + // extensions: ['vue', 'jsx', 'tsx', 'js', 'ts'], + // deep: true, resolvers: [ElementPlusResolver()], - dts: 'src/components.d.ts', - include: [/\.tsx$/, /\.jsx$/, /\.ts$/, /\.js$/, /\.vue$/, /\.vue\?vue/], - exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/], + // dts: 'src/components.d.ts', + // include: [/\.tsx$/, /\.jsx$/, /\.ts$/, /\.js$/, /\.vue$/, /\.vue\?vue/], + // exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/], }), removeConsole(), globalStyle({ @@ -85,7 +85,7 @@ export default (configEnv) => { { ...eslintPlugin({ eslintOptions: { - cache: true, + cache: false, }, shouldLint: (path) => /\/src\/[^?]*\.(vue|m?[jt]sx?)$/.test(path), }),