feat(主播中心、代理中心): 获取提现权限状态,用于提现按钮的显隐
This commit is contained in:
parent
59bf3aaaca
commit
249121585a
@ -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 // 触发计算属性更新
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user