feat(BD中心): 新增“前往送礼页面”按钮(后台控制显隐)

This commit is contained in:
hzj 2026-03-31 14:11:53 +08:00
parent 94fb8b77f2
commit 0e29ee8150

View File

@ -277,6 +277,36 @@
</div>
</div>
</div>
<!-- 进入赠送礼物页面 -->
<div
v-if="sendShow"
style="
background-color: white;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
padding: 16px;
cursor: pointer;
transition: all 0.2s;
border: 1px solid #e5e7eb;
display: flex;
flex-direction: column;
gap: 10px;
"
@click="goToSend"
>
<div style="display: flex; justify-content: space-between; align-items: center">
<span style="font-weight: 600; color: #1f2937"> {{ t('send_welcome_gift') }}</span>
<img
src="../../assets/icon/Azizi/arrow.png"
alt=""
style="display: block; width: 20px"
class="flipImg"
/>
</div>
</div>
</div>
<!-- 遮罩层 -->
@ -550,7 +580,12 @@ import { setDocumentDirection } from '@/locales/i18n'
import { useIdentityStore } from '@/stores/identity.js'
import { handleAvatarImageError } from '@/utils/image/imageHandler.js'
import { getBdMemberBillList, getBdHistory, getBdHistoryMore } from '@/api/bdCenter.js'
import {
getBdMemberBillList,
getBdHistory,
getBdHistoryMore,
hasSendGiftsPermission,
} from '@/api/bdCenter.js'
import { apiGetBankBalance } from '@/api/wallet.js'
import GeneralHeader from '@/components/GeneralHeader.vue'
@ -565,6 +600,9 @@ const identityStore = useIdentityStore()
//
locale.value && setDocumentDirection(locale.value)
const sendShow = ref(false)
// const sendShow = ref(true)
//
const showHistory = ref(false) //
const showMore = ref(false) //
@ -602,6 +640,10 @@ const goToInviteAgency = () => {
router.push('/invite-agency')
}
const goToSend = () => {
router.push({ path: '/bd-item-distribution' })
}
//
const getBankBalance = async () => {
const res = await apiGetBankBalance('BD_SALARY')
@ -617,6 +659,14 @@ const { appConnected, userInfo } = usePageInitializationWithConfig('BD_CENTER',
onDataLoaded: () => {},
})
//
const getHasSendGiftsPermission = async () => {
const response = await hasSendGiftsPermission('AVATAR_FRAME')
if (response.status) {
sendShow.value = response.body
}
}
// BD
const apiGetBdMemberBillList = async () => {
const res = await getBdMemberBillList('BD')
@ -657,6 +707,7 @@ const initData = async () => {
apiGetBdMemberBillList() //BD
apiGetBdHistory() //BD
getBankBalance() //
getHasSendGiftsPermission() //
}
onMounted(() => {