Skip to content

Commit dae9bc1

Browse files
YunaiVgitee-org
authored andcommitted
!188 feat: 支付管理/应用信息
Merge pull request !188 from dhb52/master
2 parents 945903d + 36268cf commit dae9bc1

File tree

8 files changed

+889
-115
lines changed

8 files changed

+889
-115
lines changed

src/api/pay/channel/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export interface ChannelVO {
77
status: number
88
remark: string
99
feeRate: number
10-
merchantId: number
1110
appId: number
1211
createTime: Date
1312
}
@@ -18,13 +17,12 @@ export const getChannelPage = (params: PageParam) => {
1817
}
1918

2019
// 查询详情支付渠道
21-
export const getChannel = (merchantId: number, appId: string, code: string) => {
20+
export const getChannel = (appId: string, code: string) => {
2221
const params = {
23-
merchantId: merchantId,
2422
appId: appId,
2523
code: code
2624
}
27-
return request.get({ url: '/pay/channel/get-channel', params: params })
25+
return request.get({ url: '/pay/channel/get', params: params })
2826
}
2927

3028
// 新增支付渠道

src/utils/constants.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ export const PayChannelEnum = {
118118
ALIPAY_BAR: {
119119
code: 'alipay_bar',
120120
name: '支付宝条码支付'
121+
},
122+
MOCK: {
123+
code: 'mock',
124+
name: '模拟支付'
121125
}
122126
}
123127

@@ -126,7 +130,8 @@ export const PayChannelEnum = {
126130
*/
127131
export const PayType = {
128132
WECHAT: 'WECHAT',
129-
ALIPAY: 'ALIPAY'
133+
ALIPAY: 'ALIPAY',
134+
MOCK: 'MOCK'
130135
}
131136

132137
/**

src/views/pay/app/AppForm.vue renamed to src/views/pay/app/components/AppForm.vue

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@
1010
<el-form-item label="应用名" prop="name">
1111
<el-input v-model="formData.name" placeholder="请输入应用名" />
1212
</el-form-item>
13-
<el-form-item label="所属商户" prop="merchantId">
14-
<el-select v-model="formData.merchantId" placeholder="请选择所属商户">
15-
<el-option
16-
v-for="item in merchantList"
17-
:key="item.id"
18-
:label="item.name"
19-
:value="item.id"
20-
/>
21-
</el-select>
22-
</el-form-item>
2313
<el-form-item label="开启状态" prop="status">
2414
<el-radio-group v-model="formData.status">
2515
<el-radio
@@ -47,10 +37,10 @@
4737
</template>
4838
</Dialog>
4939
</template>
40+
5041
<script lang="ts" setup>
5142
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
5243
import * as AppApi from '@/api/pay/app'
53-
import * as MerchantApi from '@/api/pay/merchant'
5444
import { CommonStatusEnum } from '@/utils/constants'
5545
5646
defineOptions({ name: 'PayAppForm' })
@@ -77,11 +67,9 @@ const formRules = reactive({
7767
name: [{ required: true, message: '应用名不能为空', trigger: 'blur' }],
7868
status: [{ required: true, message: '开启状态不能为空', trigger: 'blur' }],
7969
payNotifyUrl: [{ required: true, message: '支付结果的回调地址不能为空', trigger: 'blur' }],
80-
refundNotifyUrl: [{ required: true, message: '退款结果的回调地址不能为空', trigger: 'blur' }],
81-
merchantId: [{ required: true, message: '商户编号不能为空', trigger: 'blur' }]
70+
refundNotifyUrl: [{ required: true, message: '退款结果的回调地址不能为空', trigger: 'blur' }]
8271
})
8372
const formRef = ref() // 表单 Ref
84-
const merchantList = ref([]) // 商户列表
8573
8674
/** 打开弹窗 */
8775
const open = async (type: string, id?: number) => {
@@ -98,8 +86,6 @@ const open = async (type: string, id?: number) => {
9886
formLoading.value = false
9987
}
10088
}
101-
// 加载商户列表
102-
merchantList.value = await MerchantApi.getMerchantListByName()
10389
}
10490
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
10591
@@ -137,8 +123,7 @@ const resetForm = () => {
137123
status: CommonStatusEnum.ENABLE,
138124
remark: undefined,
139125
payNotifyUrl: undefined,
140-
refundNotifyUrl: undefined,
141-
merchantId: undefined
126+
refundNotifyUrl: undefined
142127
}
143128
formRef.value?.resetFields()
144129
}

0 commit comments

Comments
 (0)