feat:合作伙伴支付
This commit is contained in:
1 parent
b0153e20bb
commit
cb013c2c87
4 files changed
+1483
-1409
No files matched your search
+3
-1
@@ -4,7 +4,9 @@ NODE_ENV=development
|
||||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='https://yffzpapi.zianxin.com'
|
||||
# VITE_BASE_URL='https://yffzpapi.zianxin.com'
|
||||
|
||||
VITE_BASE_URL='http://localhost:48088'
|
||||
|
||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
||||
VITE_UPLOAD_TYPE=server
|
||||
|
||||
Vendored
+1
-1
@@ -87,7 +87,7 @@
|
||||
"source.fixAll.stylelint": "explicit"
|
||||
},
|
||||
"[vue]": {
|
||||
"editor.defaultFormatter": "octref.vetur"
|
||||
"editor.defaultFormatter": "Vue.volar"
|
||||
},
|
||||
"i18n-ally.localesPaths": ["src/locales"],
|
||||
"i18n-ally.keystyle": "nested",
|
||||
|
||||
Generated
+1383
-1309
File diff suppressed because it is too large.
Load diff
@@ -1,61 +1,71 @@
|
||||
<template>
|
||||
<div>
|
||||
<Dialog v-model="dialogVisible" :title="dialogTitle" width="800px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
v-loading="formLoading"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-tabs v-model="state.currentTab" class="demo-tabs" @tab-click="tabClick">
|
||||
<el-tab-pane v-for="(v) in data.tabs" :key="v.name" :label="v.label" :name="v.name" />
|
||||
</el-tabs>
|
||||
|
||||
|
||||
<el-form ref="formRef" v-loading="formLoading" :model="formData" :rules="formRules" label-width="120px">
|
||||
<el-form-item label="渠道费率" label-width="180px" prop="feeRate">
|
||||
<el-input
|
||||
v-model="formData.feeRate"
|
||||
:style="{ width: '100%' }"
|
||||
clearable
|
||||
placeholder="请输入渠道费率"
|
||||
>
|
||||
<el-input v-model="formData.feeRate" :style="{ width: '100%' }" clearable placeholder="请输入渠道费率">
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="微信 APPID" label-width="180px" prop="config.appId">
|
||||
<el-input
|
||||
v-model="formData.config.appId"
|
||||
:style="{ width: '100%' }"
|
||||
clearable
|
||||
placeholder="请输入微信 APPID"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="180px">
|
||||
<a
|
||||
href="https://pay.weixin.qq.com/index.php/extend/merchant_appid/mapay_platform/account_manage"
|
||||
target="_blank"
|
||||
>
|
||||
前往微信商户平台查看 APPID
|
||||
</a>
|
||||
</el-form-item>
|
||||
<el-form-item label="商户号" label-width="180px" prop="config.mchId">
|
||||
<el-input v-model="formData.config.mchId" :style="{ width: '100%' }" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label-width="180px">
|
||||
<a href="https://pay.weixin.qq.com/index.php/extend/pay_setting" target="_blank">
|
||||
前往微信商户平台查看商户号
|
||||
</a>
|
||||
</el-form-item>
|
||||
<!-- start 单商户 start -->
|
||||
<div v-if="state.currentTab === 'Single'">
|
||||
<el-form-item label="微信 APPID" label-width="180px" prop="config.appId">
|
||||
<el-input v-model="formData.config.appId" :style="{ width: '100%' }" clearable placeholder="请输入微信 APPID" />
|
||||
</el-form-item>
|
||||
<el-form-item label-width="180px">
|
||||
<a href="https://pay.weixin.qq.com/index.php/extend/merchant_appid/mapay_platform/account_manage"
|
||||
target="_blank">
|
||||
前往微信商户平台查看 APPID
|
||||
</a>
|
||||
</el-form-item>
|
||||
<el-form-item label="商户号" label-width="180px" prop="config.mchId">
|
||||
<el-input v-model="formData.config.mchId" :style="{ width: '100%' }" />
|
||||
</el-form-item>
|
||||
<el-form-item label-width="180px">
|
||||
<a href="https://pay.weixin.qq.com/index.php/extend/pay_setting" target="_blank">
|
||||
前往微信商户平台查看商户号
|
||||
</a>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!-- end 单商户 end -->
|
||||
|
||||
<!-- start 合作商户 start -->
|
||||
<div v-if="state.currentTab === 'Cooperate'">
|
||||
<el-form-item label="微信平台 APPID" label-width="180px" prop="config.appId">
|
||||
<el-input v-model="formData.config.appId" :style="{ width: '100%' }" clearable
|
||||
placeholder="请输入微信平台 APPID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="微信平台商户号" label-width="180px" prop="config.mchId">
|
||||
<el-input v-model="formData.config.mchId" :style="{ width: '100%' }" clearable placeholder="请输入微信平台商户号" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="微信合作伙伴 APPID" label-width="180px" prop="config.subAppId">
|
||||
<el-input v-model="formData.config.subAppId" :style="{ width: '100%' }" clearable
|
||||
placeholder="请输入微信平台 APPID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="微信合作伙伴商户号" label-width="180px" prop="config.subMchId">
|
||||
<el-input v-model="formData.config.subMchId" :style="{ width: '100%' }" clearable
|
||||
placeholder="请输入微信平台商户号" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!-- end 合作商户 end -->
|
||||
|
||||
<el-form-item label="渠道状态" label-width="180px" prop="status">
|
||||
<el-radio-group v-model="formData.status">
|
||||
<el-radio
|
||||
v-for="dict in getDictOptions(DICT_TYPE.COMMON_STATUS)"
|
||||
:key="parseInt(dict.value)"
|
||||
:value="parseInt(dict.value)"
|
||||
>
|
||||
<el-radio v-for="dict in getDictOptions(DICT_TYPE.COMMON_STATUS)" :key="parseInt(dict.value)"
|
||||
:value="parseInt(dict.value)">
|
||||
{{ dict.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="API 版本" label-width="180px" prop="config.apiVersion">
|
||||
<el-radio-group v-model="formData.config.apiVersion">
|
||||
<el-radio-group v-model="formData.config.apiVersion" :disabled="formData.config.mchType == 'Cooperate'">
|
||||
<el-radio value="v2">v2</el-radio>
|
||||
<el-radio value="v3">v3</el-radio>
|
||||
</el-radio-group>
|
||||
@@ -64,28 +74,13 @@
|
||||
<el-form-item label="商户密钥" label-width="180px" prop="config.mchKey">
|
||||
<el-input v-model="formData.config.mchKey" clearable placeholder="请输入商户密钥" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="apiclient_cert.p12 证书"
|
||||
label-width="180px"
|
||||
prop="config.keyContent"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.config.keyContent"
|
||||
:autosize="{ minRows: 8, maxRows: 8 }"
|
||||
:style="{ width: '100%' }"
|
||||
placeholder="请上传 apiclient_cert.p12 证书"
|
||||
readonly
|
||||
type="textarea"
|
||||
/>
|
||||
<el-form-item label="apiclient_cert.p12 证书" label-width="180px" prop="config.keyContent">
|
||||
<el-input v-model="formData.config.keyContent" :autosize="{ minRows: 8, maxRows: 8 }"
|
||||
:style="{ width: '100%' }" placeholder="请上传 apiclient_cert.p12 证书" readonly type="textarea" />
|
||||
</el-form-item>
|
||||
<el-form-item label="" label-width="180px">
|
||||
<el-upload
|
||||
:before-upload="p12FileBeforeUpload"
|
||||
:http-request="keyContentUpload"
|
||||
:limit="1"
|
||||
accept=".p12"
|
||||
action=""
|
||||
>
|
||||
<el-upload :before-upload="p12FileBeforeUpload" :http-request="keyContentUpload" :limit="1" accept=".p12"
|
||||
action="">
|
||||
<el-button type="primary">
|
||||
<Icon class="mr-5px" icon="ep:upload" />
|
||||
点击上传
|
||||
@@ -95,35 +90,15 @@
|
||||
</div>
|
||||
<div v-if="formData.config.apiVersion === 'v3'">
|
||||
<el-form-item label="API V3 密钥" label-width="180px" prop="config.apiV3Key">
|
||||
<el-input
|
||||
v-model="formData.config.apiV3Key"
|
||||
clearable
|
||||
placeholder="请输入 API V3 密钥"
|
||||
/>
|
||||
<el-input v-model="formData.config.apiV3Key" clearable placeholder="请输入 API V3 密钥" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="apiclient_key.pem 证书"
|
||||
label-width="180px"
|
||||
prop="config.privateKeyContent"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.config.privateKeyContent"
|
||||
:autosize="{ minRows: 8, maxRows: 8 }"
|
||||
:style="{ width: '100%' }"
|
||||
placeholder="请上传 apiclient_key.pem 证书"
|
||||
readonly
|
||||
type="textarea"
|
||||
/>
|
||||
<el-form-item label="apiclient_key.pem 证书" label-width="180px" prop="config.privateKeyContent">
|
||||
<el-input v-model="formData.config.privateKeyContent" :autosize="{ minRows: 8, maxRows: 8 }"
|
||||
:style="{ width: '100%' }" placeholder="请上传 apiclient_key.pem 证书" readonly type="textarea" />
|
||||
</el-form-item>
|
||||
<el-form-item label="" label-width="180px" prop="privateKeyContentFile">
|
||||
<el-upload
|
||||
ref="privateKeyContentFile"
|
||||
:before-upload="pemFileBeforeUpload"
|
||||
:http-request="privateKeyContentUpload"
|
||||
:limit="1"
|
||||
accept=".pem"
|
||||
action=""
|
||||
>
|
||||
<el-upload ref="privateKeyContentFile" :before-upload="pemFileBeforeUpload"
|
||||
:http-request="privateKeyContentUpload" :limit="1" accept=".pem" action="">
|
||||
<el-button type="primary">
|
||||
<Icon class="mr-5px" icon="ep:upload" />
|
||||
点击上传
|
||||
@@ -131,17 +106,10 @@
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="证书序列号" label-width="180px" prop="config.certSerialNo">
|
||||
<el-input
|
||||
v-model="formData.config.certSerialNo"
|
||||
clearable
|
||||
placeholder="请输入证书序列号"
|
||||
/>
|
||||
<el-input v-model="formData.config.certSerialNo" clearable placeholder="请输入证书序列号" />
|
||||
</el-form-item>
|
||||
<el-form-item label-width="180px">
|
||||
<a
|
||||
href="https://pay.weixin.qq.com/index.php/core/cert/api_cert#/api-cert-manage"
|
||||
target="_blank"
|
||||
>
|
||||
<a href="https://pay.weixin.qq.com/index.php/core/cert/api_cert#/api-cert-manage" target="_blank">
|
||||
前往微信商户平台查看证书序列号
|
||||
</a>
|
||||
</el-form-item>
|
||||
@@ -167,6 +135,19 @@ defineOptions({ name: 'WeixinChannelForm' })
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const data = {
|
||||
tabs: [
|
||||
{
|
||||
label: "单商户",
|
||||
name: "Single",
|
||||
},
|
||||
{
|
||||
label: "合作商户",
|
||||
name: "Cooperate",
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
@@ -177,8 +158,11 @@ const formData = ref<any>({
|
||||
feeRate: undefined,
|
||||
remark: '',
|
||||
config: {
|
||||
mchType: data.tabs[0].name,
|
||||
appId: '',
|
||||
mchId: '',
|
||||
subAppId: '',
|
||||
subMchId: '',
|
||||
apiVersion: '',
|
||||
mchKey: '',
|
||||
keyContent: '',
|
||||
@@ -187,11 +171,18 @@ const formData = ref<any>({
|
||||
apiV3Key: ''
|
||||
}
|
||||
})
|
||||
|
||||
const state = reactive({
|
||||
currentTab: data.tabs[0].name,
|
||||
})
|
||||
|
||||
const formRules = {
|
||||
feeRate: [{ required: true, message: '请输入渠道费率', trigger: 'blur' }],
|
||||
status: [{ required: true, message: '渠道状态不能为空', trigger: 'blur' }],
|
||||
'config.mchId': [{ required: true, message: '请传入商户号', trigger: 'blur' }],
|
||||
'config.appId': [{ required: true, message: '请输入公众号APPID', trigger: 'blur' }],
|
||||
'config.subMchId': [{ required: true, message: '请传入合作伙伴商户号', trigger: 'blur' }],
|
||||
'config.subAppId': [{ required: true, message: '请输入合作伙伴公众号APPID', trigger: 'blur' }],
|
||||
'config.apiVersion': [{ required: true, message: 'API版本不能为空', trigger: 'blur' }],
|
||||
'config.mchKey': [{ required: true, message: '请输入商户密钥', trigger: 'blur' }],
|
||||
'config.keyContent': [
|
||||
@@ -318,4 +309,11 @@ const keyContentUpload = async (event) => {
|
||||
}
|
||||
readFile.readAsDataURL(event.file) // 读成 base64
|
||||
}
|
||||
|
||||
function tabClick(e: any) {
|
||||
formData.value.config.mchType = e.paneName
|
||||
if (e.paneName == "Cooperate") {
|
||||
formData.value.config.apiVersion = "v2"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in new issue
Block a user