diff --git a/.env.development b/.env.development index 914ba38..5f2219f 100644 --- a/.env.development +++ b/.env.development @@ -1,10 +1,10 @@ VITE_APP_NAME=后台管理系统 VITE_SOCKET_URL=wss://server.gxwebsoft.com -VITE_SERVER_URL=https://server.gxwebsoft.com/api -#VITE_API_URL=https://modules.gxwebsoft.com/api +#VITE_SERVER_URL=https://server.gxwebsoft.com/api +VITE_API_URL=https://modules.gxwebsoft.com/api -VITE_API_URL=http://127.0.0.1:9099/api -#VITE_SERVER_URL=http://127.0.0.1:9091/api +#VITE_API_URL=http://127.0.0.1:9099/api +VITE_SERVER_URL=http://127.0.0.1:9091/api #VITE_SOCKET_URL=ws://localhost:9191 #VITE_API_URL=https://server.gxwebsoft.com/api #VITE_API_URL=http://103.233.255.195:9300/api diff --git a/src/api/shop/merchant/model/index.ts b/src/api/shop/merchant/model/index.ts index ebb896d..d34d194 100644 --- a/src/api/shop/merchant/model/index.ts +++ b/src/api/shop/merchant/model/index.ts @@ -28,12 +28,20 @@ export interface Merchant { region?: string; // 地址 address?: string; + // 每小时价格 + price?: number; // 手续费 commission?: number; // 关键字 keywords?: string; // 资质图片 files?: string; + // 营业时间 + businessTime?: string; + timePeriod1?: string; + timePeriod2?: string; + // 商户介绍 + content?: string; // 是否自营 ownStore?: number; // 是否推荐 diff --git a/src/api/system/payment/index.ts b/src/api/system/payment/index.ts new file mode 100644 index 0000000..20b218c --- /dev/null +++ b/src/api/system/payment/index.ts @@ -0,0 +1,121 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { Payment, PaymentParam } from './model'; +import { SERVER_API_URL } from '@/config/setting'; +import type { Order } from '@/api/shop/order/model'; + +/** + * 分页查询支付方式 + */ +export async function pagePayment(params: PaymentParam) { + const res = await request.get>>( + SERVER_API_URL + '/system/payment/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询支付方式列表 + */ +export async function listPayment(params?: PaymentParam) { + const res = await request.get>( + SERVER_API_URL + '/system/payment', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加支付方式 + */ +export async function addPayment(data: Payment) { + const res = await request.post>( + SERVER_API_URL + '/system/payment', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改支付方式 + */ +export async function updatePayment(data: Payment) { + const res = await request.put>( + SERVER_API_URL + '/system/payment', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除支付方式 + */ +export async function removePayment(id?: number) { + const res = await request.delete>( + SERVER_API_URL + '/system/payment/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除支付方式 + */ +export async function removeBatchPayment(data: (number | undefined)[]) { + const res = await request.delete>( + SERVER_API_URL + '/system/payment/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询支付方式 + */ +export async function getPayment(id: number) { + const res = await request.get>( + SERVER_API_URL + '/system/payment/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 生成支付二维码(微信native) + */ +export async function getNativeCode(data: Order) { + const res = await request.post>( + SERVER_API_URL + '/system/wx-native-pay/codeUrl', + data + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/system/payment/model/index.ts b/src/api/system/payment/model/index.ts new file mode 100644 index 0000000..76fc787 --- /dev/null +++ b/src/api/system/payment/model/index.ts @@ -0,0 +1,51 @@ +import type { PageParam } from '@/api'; + +/** + * 支付方式 + */ +export interface Payment { + // ID + id?: number; + // 支付方式 + name?: string; + // 标识 + code?: string; + // 支付图标 + image?: string; + // 微信商户号类型 1普通商户2子商户 + wechatType?: number; + // 应用ID + appId?: string; + // 商户号 + mchId?: string; + // 设置APIv3密钥 + apiKey?: string; + // 证书文件 (CERT) + apiclientCert?: string; + // 证书文件 (KEY) + apiclientKey?: string; + // 商户证书序列号 + merchantSerialNumber?: string; + // 备注 + comments?: string; + // 文章排序(数字越小越靠前) + sortNumber?: number; + // 状态, 0启用, 1禁用 + status?: boolean; + // 是否删除, 0否, 1是 + deleted?: number; + // 租户id + tenantId?: number; + // 注册时间 + createTime?: string; + // 修改时间 + updateTime?: string; +} + +/** + * 支付方式搜索条件 + */ +export interface PaymentParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/components/PayMethod/index.vue b/src/components/PayMethod/index.vue new file mode 100644 index 0000000..660d2db --- /dev/null +++ b/src/components/PayMethod/index.vue @@ -0,0 +1,56 @@ + + + + diff --git a/src/views/booking/order/components/orderEdit.vue b/src/views/booking/order/components/orderEdit.vue index 20f6f00..d86ff7f 100644 --- a/src/views/booking/order/components/orderEdit.vue +++ b/src/views/booking/order/components/orderEdit.vue @@ -110,7 +110,10 @@ v-model:value="form.totalPrice" /> - + - + - + - + - + - + - + + 生成支付二维码 + +
+ +
使用微信扫一扫完成支付
+
+
+ + diff --git a/src/views/booking/school/components/merchantEdit.vue b/src/views/booking/school/components/merchantEdit.vue index a797fb1..86c4a9e 100644 --- a/src/views/booking/school/components/merchantEdit.vue +++ b/src/views/booking/school/components/merchantEdit.vue @@ -1,7 +1,7 @@