fix: 将微信配置改成支付配置
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m41s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m41s
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<CommissionSummary v-if="hasPermission('dashboard_analysis:commission_summary')" />
|
||||
<CommissionStats v-if="hasPermission('dashboard_analysis:commission_stats')" />
|
||||
<WithdrawalSettings v-if="hasPermission('dashboard_analysis:withdrawal_settings')" />
|
||||
<ActiveWechatConfig v-if="hasPermission('dashboard_analysis:wechat_config')" />
|
||||
<ActivePaymentSettings v-if="hasPermission('dashboard_analysis:payment_settings')" />
|
||||
|
||||
<!--<el-row :gutter="20">-->
|
||||
<!-- <el-col :xl="14" :lg="15" :xs="24">-->
|
||||
@@ -46,7 +46,7 @@
|
||||
import CommissionSummary from './widget/CommissionSummary.vue'
|
||||
import CommissionStats from './widget/CommissionStats.vue'
|
||||
import WithdrawalSettings from './widget/WithdrawalSettings.vue'
|
||||
import ActiveWechatConfig from './widget/ActiveWechatConfig.vue'
|
||||
import ActivePaymentSettings from './widget/ActivePaymentSettings.vue'
|
||||
import { usePermission } from '@/composables/usePermission'
|
||||
|
||||
defineOptions({ name: 'Analysis' })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<ElCard shadow="never" class="active-wechat-config-widget">
|
||||
<ElCard shadow="never" class="active-payment-settings-widget">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<div class="header-left">
|
||||
@@ -94,9 +94,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { WechatConfigService } from '@/api/modules'
|
||||
import { PaymentSettingsService } from '@/api/modules'
|
||||
import { ElTag } from 'element-plus'
|
||||
import type { WechatConfig } from '@/types/api'
|
||||
import type { PaymentSettings } from '@/types/api'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import {
|
||||
getPaymentConfigStatus,
|
||||
@@ -106,26 +106,26 @@
|
||||
} from '@/utils/business/paymentConfig'
|
||||
import { usePermission } from '@/composables/usePermission'
|
||||
|
||||
defineOptions({ name: 'ActiveWechatConfigWidget' })
|
||||
defineOptions({ name: 'ActivePaymentSettingsWidget' })
|
||||
|
||||
const { hasPermission } = usePermission()
|
||||
|
||||
// 当前生效的支付配置
|
||||
const activeConfig = ref<WechatConfig | null>(null)
|
||||
const activeConfig = ref<PaymentSettings | null>(null)
|
||||
|
||||
const getProviderTypeText = (type: WechatConfig['provider_type']): string => {
|
||||
const getProviderTypeText = (type: PaymentSettings['provider_type']): string => {
|
||||
return getPaymentProviderText(type)
|
||||
}
|
||||
|
||||
const getMerchantId = (config: WechatConfig): string => {
|
||||
const getMerchantId = (config: PaymentSettings): string => {
|
||||
return getPaymentMerchantId(config)
|
||||
}
|
||||
|
||||
const getNotifyUrl = (config: WechatConfig): string => {
|
||||
const getNotifyUrl = (config: PaymentSettings): string => {
|
||||
return getPaymentNotifyUrl(config)
|
||||
}
|
||||
|
||||
const getCredentialStatus = (config: WechatConfig): string => {
|
||||
const getCredentialStatus = (config: PaymentSettings): string => {
|
||||
if (config.provider_type === 'wechat' || config.provider_type === 'wechat_v2') {
|
||||
const certStatus = getPaymentConfigStatus(config.wx_cert_content)
|
||||
const keyStatus = getPaymentConfigStatus(config.wx_key_content)
|
||||
@@ -156,12 +156,12 @@
|
||||
// 加载当前生效配置
|
||||
const loadActiveConfig = async () => {
|
||||
// 检查权限,没有权限不调用接口
|
||||
if (!hasPermission('dashboard_analysis:wechat_config')) {
|
||||
if (!hasPermission('dashboard_analysis:payment_settings')) {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await WechatConfigService.getActiveWechatConfig()
|
||||
const res = await PaymentSettingsService.getActivePaymentSettings()
|
||||
if (res.code === 0 && res.data) {
|
||||
activeConfig.value = res.data
|
||||
}
|
||||
@@ -176,7 +176,7 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.active-wechat-config-widget {
|
||||
.active-payment-settings-widget {
|
||||
:deep(.el-card__header) {
|
||||
padding: 18px 20px;
|
||||
background: var(--el-fill-color-light);
|
||||
@@ -276,7 +276,7 @@
|
||||
}
|
||||
|
||||
@media (width <= 768px) {
|
||||
.active-wechat-config-widget {
|
||||
.active-payment-settings-widget {
|
||||
.card-header {
|
||||
.header-left,
|
||||
.header-right {
|
||||
Reference in New Issue
Block a user