feat(主播中心、代理中心): 获取提现权限状态,用于提现按钮的显隐

This commit is contained in:
hzj 2026-03-20 17:22:01 +08:00
parent 59bf3aaaca
commit 249121585a
2 changed files with 42 additions and 5 deletions

View File

@ -360,7 +360,8 @@
</button>
<!-- 提现按钮 -->
<!-- <button
<button
v-if="withdrawEnabled"
class="action-btn"
style="
background: linear-gradient(135deg, #a6f1b2 2.82%, #2fff3d 99.15%), #fff;
@ -370,7 +371,7 @@
@click="goToWithdraw"
>
{{ t('withdraw') }}
</button> -->
</button>
</div>
</div>
@ -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 //

View File

@ -179,7 +179,7 @@
></workReportBox>
<!-- 操作按钮 -->
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 2vw; margin: 0 1%">
<div style="display: flex; align-items: center; gap: 2vw; margin: 0 1%">
<!-- 兑换按钮 -->
<button
class="action-btn"
@ -199,13 +199,14 @@
</button>
<!-- 提现按钮 -->
<!-- <button
<button
v-if="withdrawEnabled"
class="action-btn"
style="background: linear-gradient(135deg, #a6f1b2 2.82%, #2fff3d 99.15%), #fff"
@click="goToWithdraw"
>
{{ t('withdraw') }}
</button> -->
</button>
</div>
</div>
@ -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() //
})
</script>
@ -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;