修复platform的支付问题

This commit is contained in:
2026-09-16 10:35:55 +08:00
parent 71a14c46f9
commit 19687658e1
7 changed files with 415 additions and 148 deletions
@@ -9,7 +9,7 @@
</div>
<div class="title-wrap">
<div class="channel-name">{{ name }}</div>
<div class="merchant-no">商户号:{{ merchantNo || '未配置' }}</div>
<div class="merchant-no">{{ idLabel }}:{{ merchantNo || (status === 'unconfigured' ? '未配置' : '已配置') }}</div>
</div>
</div>
<StatusTag :status="status" dict="channel" />
@@ -22,7 +22,16 @@
<el-button v-if="status === 'enabled'" size="small" type="danger" plain @click="emit('disable')">
停用
</el-button>
<el-button v-else size="small" type="success" plain @click="emit('enable')">启用</el-button>
<el-button
v-else
size="small"
type="success"
plain
:disabled="status === 'unconfigured'"
@click="emit('enable')"
>
启用
</el-button>
</div>
</el-card>
</template>
@@ -51,6 +60,8 @@ const ICONS: Record<string, any> = {
const props = withDefaults(
defineProps<{
/** 渠道标识,如 wechat / alipay / paypal */
channel?: string
/** 渠道名称,如「微信支付」 */
name: string
/** 渠道状态:enabled 已启用 / disabled 已停用 / unconfigured 未配置 */
@@ -63,6 +74,7 @@ const props = withDefaults(
desc?: string
}>(),
{
channel: '',
status: 'unconfigured',
merchantNo: '',
icon: 'PriceTag',
@@ -76,6 +88,12 @@ const emit = defineEmits<{
(e: 'disable'): void
}>()
const idLabel = computed(() => {
if (props.channel === 'paypal') return 'Client ID'
if (props.channel === 'cloudpay') return '银联商户号'
return '商户号'
})
const iconComp = computed(() => ICONS[props.icon] || PriceTag)
const statusClass = computed(() => {