feat(邀请新用户): 获取我的邀请人,并跳转app私聊页
This commit is contained in:
parent
f04191b070
commit
fba87c71f3
@ -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 {
|
||||
|
||||
BIN
src/assets/images/InvitationNewUser/privateChat.png
Normal file
BIN
src/assets/images/InvitationNewUser/privateChat.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
@ -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() // 邀请用户奖励池
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user