feat(邀请新用户): 获取我的邀请人,并跳转app私聊页

This commit is contained in:
hzj 2025-10-28 20:29:22 +08:00
parent f04191b070
commit fba87c71f3
3 changed files with 33 additions and 0 deletions

View File

@ -12,6 +12,18 @@ export const getMyInviteCode = async () => {
}
}
// 获取我的邀请人信息
export const getMyInviter = async () => {
try {
const response = await get(`/activity/invite/user/my-inviter-info`)
return response
} catch (error) {
console.error('Failed to fetch get my inviter:', error)
console.error('error:' + error.response.errorMsg)
throw error
}
}
// 绑定邀请码
export const bindInviteCode = async (data) => {
try {

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -7,12 +7,21 @@
<!-- 确认邀请码 -->
<div style="padding: 87% 0 5%">
<img
v-if="!myInviter.expired && !myInviter.userId"
:src="images.enterCode"
alt=""
width="40%"
@click="enterCodeShow = true"
style="display: block"
/>
<img
v-else-if="myInviter.userId"
:src="images.privateChat"
alt=""
width="40%"
@click="gotoPrivateChat(myInviter.userId)"
style="display: block"
/>
</div>
<!-- 主体内容 -->
@ -425,6 +434,7 @@ import {
parseHeader,
setHttpHeaders,
isInApp,
gotoPrivateChat,
} from '@/utils/appBridge.js'
import {
appConnectionManager,
@ -444,6 +454,7 @@ import {
getMyInviteUsers, //
getInviteAwardPool, //
getInviteReceiveAward, //
getMyInviter, //
} from '@/api/invitation.js'
// vite
@ -470,6 +481,7 @@ const tipShow = ref(false) //提示弹窗
const invitationCode = ref('') //
const myInviteInfo = ref({}) //
const myInviter = ref({}) //
const myInviteIncome = ref({}) //
const myInviteUsers = ref([]) //
const inviteAwardPool = ref({})
@ -529,6 +541,14 @@ const apiGetMyInviteCode = async () => {
}
}
//
const apiGetMyInviter = async () => {
const resInviter = await getMyInviter()
if (resInviter.status && resInviter.body) {
myInviter.value = resInviter.body.myInfo || {}
}
}
//
const confirm = async () => {
if (!invitationCode.value.trim()) {
@ -585,6 +605,7 @@ const receiveAward = async (awardId) => {
//
const initData = () => {
apiGetMyInviteCode() //
apiGetMyInviter() //
apiGetMyInviteIncome() //
apiGetMyInviteUsers() //
apiGetInviteAwardPool() //