diff --git a/src/views/AgencyCenter/index.vue b/src/views/AgencyCenter/index.vue index adf87eb..dc7b92d 100644 --- a/src/views/AgencyCenter/index.vue +++ b/src/views/AgencyCenter/index.vue @@ -360,7 +360,8 @@ - + @@ -454,6 +455,7 @@ import { getUserIdentity, getBankCardList, // 获取正在使用的银行卡 getWithdrawInfoList, // 获取申请提现信息 + apiGetWithdrawEnabled, // 获取提现权限 } from '@/api/wallet.js' import GeneralHeader from '@/components/GeneralHeader.vue' @@ -466,6 +468,7 @@ const router = useRouter() // 监听语言变化并设置文档方向 locale.value && setDocumentDirection(locale.value) +const withdrawEnabled = ref(false) // 提现权限 const maskLayerShow = ref(false) // 弹窗遮罩层显示状态 const totalSalary = ref('0') //历史收入 @@ -795,6 +798,19 @@ const getWithdrawInfoListData = async () => { } } +// 获取提现权限 +const getWithdrawEnabled = async () => { + try { + const resWithdrawEnabled = await apiGetWithdrawEnabled() + if (resWithdrawEnabled.body && resWithdrawEnabled.status) { + withdrawEnabled.value = resWithdrawEnabled.body + } + } catch (error) { + console.error('获取提现信息列表失败:', error) + showError(error.response?.errorMsg) + } +} + const { userInfo, salaryInfo, taskInfo } = usePageInitializationWithConfig('AGENCY_CENTER', { needsTeamInfo: true, forceRefresh: true, // 强制刷新 @@ -808,6 +824,7 @@ const { userInfo, salaryInfo, taskInfo } = usePageInitializationWithConfig('AGEN onMounted(() => { getBankCards() // 获取正在使用的银行卡 getWithdrawInfoListData() // 获取提现信息列表 + getWithdrawEnabled() // 获取提现权限 underlineStyle.value // 触发计算属性更新 diff --git a/src/views/HostCenter/index.vue b/src/views/HostCenter/index.vue index a41ba31..f4ad3f3 100644 --- a/src/views/HostCenter/index.vue +++ b/src/views/HostCenter/index.vue @@ -179,7 +179,7 @@ > -
+
@@ -291,6 +292,7 @@ import { getWithdrawInfoList, // 获取申请提现信息 useBankCard, // 设置默认银行卡 withdrawApply, //提现 + apiGetWithdrawEnabled, // 获取提现权限 } from '@/api/wallet.js' import GeneralHeader from '@/components/GeneralHeader.vue' @@ -327,6 +329,7 @@ const checkStatus = computed(() => { return bankCardInfo.value == null || usedBankCard.value == null }) +const withdrawEnabled = ref(false) // 提现权限 const maskLayerShow = ref(false) // 弹窗遮罩层显示状态 // 格式化薪资数值(与 TeamBillView 保持一致) @@ -481,6 +484,19 @@ const getWithdrawInfoListData = async () => { } } +// 获取提现权限 +const getWithdrawEnabled = async () => { + try { + const resWithdrawEnabled = await apiGetWithdrawEnabled() + if (resWithdrawEnabled.body && resWithdrawEnabled.status) { + withdrawEnabled.value = resWithdrawEnabled.body + } + } catch (error) { + console.error('获取提现信息列表失败:', error) + showError(error.response?.errorMsg) + } +} + const { appConnected, userInfo, salaryInfo, taskInfo, handleImageError, getAvatarPlaceholder } = usePageInitializationWithConfig('HOST_CENTER', { needsTeamInfo: true, @@ -494,6 +510,7 @@ onMounted(() => { clearSelectedPayee() //清除选中的收款人 getBankCards() // 获取正在使用的银行卡 getWithdrawInfoListData() // 获取提现信息列表 + getWithdrawEnabled() // 获取提现权限 }) @@ -576,6 +593,9 @@ onMounted(() => { } .action-btn { + flex: 1; + min-width: 0; + border-radius: 4px; box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.25); color: white;