feat(主播设置中心): 新增“提现”按钮和“资料不足”提醒弹窗

This commit is contained in:
hzj 2026-03-16 15:58:59 +08:00
parent bcd075457e
commit 5604077c81
6 changed files with 176 additions and 39 deletions

View File

@ -127,6 +127,8 @@
"host_setting": "إعدادات المضيف",
"my_agency": "وكيلي",
"tips": "نصائح",
"prompt": "موجه",
"to_improve": "إكمال المعلومات",
"leave_agent_tips": "يمكن للمضيف مغادرة الوكيل الحالي فقط في اليوم الأول والـ16 من كل شهر",
"loading": "جار التحميل",

View File

@ -127,6 +127,8 @@
"host_setting": "হোস্ট সেটিং",
"my_agency": "আমার এজেন্সি",
"tips": "টিপস",
"prompt": "প্রম্পট",
"to_improve": "সম্পূর্ণ করুন",
"leave_agent_tips": "হোস্ট শুধুমাত্র প্রতি মাসের ১ এবং ১৬ তারিখে বর্তমান এজেন্ট ছাড়তে পারে",
"loading": "লোড হচ্ছে",

View File

@ -127,6 +127,8 @@
"host_setting": "Host Setting",
"my_agency": "My Agency",
"tips": "Tips",
"prompt": "Prompt",
"to_improve": "To improve",
"leave_agent_tips": "The host can only leave the current agent on the 1st and 16th of each month",
"loading": "Loading",

View File

@ -127,6 +127,8 @@
"host_setting": "Host Ayarı",
"my_agency": "Acentem",
"tips": "İpuçları",
"prompt": "İstem",
"to_improve": "Bilgileri Tamamla",
"leave_agent_tips": "Host sadece her ayın 1'i ve 16'sında mevcut acenteden ayrılabilir",
"loading": "Yükleniyor",

View File

@ -127,6 +127,8 @@
"host_setting": "主播设置",
"my_agency": "我的代理",
"tips": "提示",
"prompt": "提示",
"to_improve": "去完善",
"leave_agent_tips": "主播只能在每月1日和16日离开当前代理",
"loading": "加载中",

View File

@ -7,7 +7,6 @@
:title="t('host_center')"
color="black"
style="box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); z-index: 999"
@help="goToHelp"
/>
<!-- 主要内容 -->
@ -191,24 +190,85 @@
<button
class="action-btn"
style="background: linear-gradient(135deg, #a6aaf1 2.82%, #592fff 99.15%), #fff"
@click="transfer"
@click="goToTransfer"
>
{{ t('transfer') }}
</button>
<button
class="action-btn"
style="background: linear-gradient(135deg, #a6f1b2 2.82%, #2fff3d 99.15%), #fff"
@click="withdraw"
@click="goToWithdraw"
>
{{ t('withdraw') }}
</button>
</div>
</div>
<!-- 弹窗遮罩层 -->
<maskLayer :maskLayerShow="maskLayerShow" @click="maskLayerShow = false">
<!-- 资料不足提示弹窗 -->
<div
style="
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
"
@click="maskLayerShow = false"
>
<div
style="
width: 80%;
border-radius: 12px;
background: #fff;
padding: 12px;
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
"
@click.stop
>
<div style="color: rgba(0, 0, 0, 0.8); font-weight: 800">{{ t('prompt') }}</div>
<div style="color: rgba(0, 0, 0, 0.4); font-weight: 600; font-size: 0.8em">
{{ t('fill_info_tips') }}
</div>
<div style="color: rgba(0, 0, 0, 0.4); font-weight: 600; font-size: 0.6em">
{{ t('card_issue_tips') }}
</div>
<div
style="
display: flex;
justify-content: center;
align-items: center;
border-radius: 999999px;
background:
linear-gradient(180deg, #d3acff 0%, rgba(222, 172, 255, 0) 58.38%),
linear-gradient(152deg, #c670ff 7.01%, #7726ff 92.99%), #ff4768;
box-shadow:
-1px 0 5px 0 rgba(255, 255, 255, 0.7) inset,
-3.5px 0 7.5px 0 rgba(255, 255, 255, 0.2) inset,
1px 0 5px 0 rgba(255, 255, 255, 0.7) inset,
3.5px 0 7.5px 0 rgba(255, 255, 255, 0.2) inset;
color: #fff;
font-weight: 800;
padding: 8px 12px;
width: 50%;
"
@click="goToImprove"
>
{{ t('to_improve') }}
</div>
</div>
</div>
</maskLayer>
</div>
</template>
<script setup>
import { onMounted, reactive, ref } from 'vue'
import { computed, onMounted, reactive, ref } from 'vue'
import { useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { setDocumentDirection } from '@/locales/i18n'
@ -217,10 +277,18 @@ import { getUserId } from '@/utils/userStore.js'
import { clearSelectedPayee } from '@/utils/payeeStore.js'
import { getTeamMemberWork } from '@/api/teamBill.js'
import { getUserIdentity } from '@/api/wallet.js'
import {
getUserIdentity, //
getBankBalance, //
getBankCardList, // 使
getWithdrawInfoList, //
useBankCard, //
withdrawApply, //
} from '@/api/wallet.js'
import GeneralHeader from '@/components/GeneralHeader.vue'
import workReportBox from '@/components/workReportBox.vue'
import maskLayer from '@/components/MaskLayer.vue'
const { t, locale } = useI18n()
const router = useRouter()
@ -239,10 +307,67 @@ const progressInfo = reactive({
agentSalary: '',
total: '',
})
const loadingProgressInfo = reactive({ value: false })
const historySalary = ref(0)
const bankCardList = ref([]) //
const usedBankCard = ref(null) //使
const bankCardInfo = ref(null)
const checkStatus = computed(() => {
return bankCardInfo.value == null || usedBankCard.value == null
})
const maskLayerShow = ref(false) //
// TeamBillView
const formatSalaryValue = (value) => {
if (!value || value === '0' || value === 0) return '0.00'
const numValue = parseFloat(value)
return numValue.toFixed(2)
}
//
const showDatePicker = () => {
router.push('/history-salary')
}
//
const goToPlatformPolicy = () => {
router.push('/platform-policy?from=hostcenter')
}
//
const goToNotification = () => {
router.push('/host-setting')
}
//
const exchangeGoldCoins = () => {
router.push('/exchange-gold-coins')
}
//
const goToTransfer = () => {
router.push('/transfer')
}
//
const goToWithdraw = () => {
if (checkStatus.value) {
maskLayerShow.value = true
return
}
router.push('/cash-withdraw')
}
//
const goToImprove = () => {
router.push('/host-setting')
}
//
const fetchMemberWorkData = async () => {
try {
@ -311,42 +436,42 @@ const fetchMemberWorkData = async () => {
}
}
// TeamBillView
const formatSalaryValue = (value) => {
if (!value || value === '0' || value === 0) return '0.00'
const numValue = parseFloat(value)
return numValue.toFixed(2)
//
const getBankCards = async () => {
try {
const resBankCards = await getBankCardList()
console.log('银行卡列表:', resBankCards)
if (resBankCards.status && resBankCards.body) {
//
bankCardList.value = resBankCards.body
const usedCard = bankCardList.value.find((card) => card.use)
if (usedCard) {
usedBankCard.value = usedCard
} else {
// 使
usedBankCard.value = null
}
}
} catch (error) {
console.error('获取银行卡列表失败:', error)
}
}
const showDatePicker = () => {
router.push('/history-salary')
}
const goToPlatformPolicy = () => {
router.push('/platform-policy?from=hostcenter')
}
const goToNotification = () => {
router.push('/host-setting')
}
const goToHelp = () => {
//
console.log('Help clicked')
}
const exchangeGoldCoins = () => {
router.push('/exchange-gold-coins')
}
//
const transfer = () => {
router.push('/transfer')
}
//
const withdraw = () => {
router.push('/cash-withdraw')
//
const getWithdrawInfoListData = async () => {
try {
const resWithdrawInfoList = await getWithdrawInfoList()
console.log('提现信息列表:', resWithdrawInfoList)
if (resWithdrawInfoList.status && resWithdrawInfoList.body?.length > 0) {
let imgList = JSON.parse(resWithdrawInfoList.body[0].passportFrontUrl)
let previewUrls = imgList.map((item) => item)
bankCardInfo.value = { previewUrls, ...resWithdrawInfoList.body[0] }
}
} catch (error) {
console.error('获取提现信息列表失败:', error)
showError(error.response?.errorMsg)
}
}
const { appConnected, userInfo, salaryInfo, taskInfo, handleImageError, getAvatarPlaceholder } =
@ -360,6 +485,8 @@ const { appConnected, userInfo, salaryInfo, taskInfo, handleImageError, getAvata
onMounted(() => {
clearSelectedPayee() //
getBankCards() // 使
getWithdrawInfoListData() //
})
</script>