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) => {
|
export const bindInviteCode = async (data) => {
|
||||||
try {
|
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%">
|
<div style="padding: 87% 0 5%">
|
||||||
<img
|
<img
|
||||||
|
v-if="!myInviter.expired && !myInviter.userId"
|
||||||
:src="images.enterCode"
|
:src="images.enterCode"
|
||||||
alt=""
|
alt=""
|
||||||
width="40%"
|
width="40%"
|
||||||
@click="enterCodeShow = true"
|
@click="enterCodeShow = true"
|
||||||
style="display: block"
|
style="display: block"
|
||||||
/>
|
/>
|
||||||
|
<img
|
||||||
|
v-else-if="myInviter.userId"
|
||||||
|
:src="images.privateChat"
|
||||||
|
alt=""
|
||||||
|
width="40%"
|
||||||
|
@click="gotoPrivateChat(myInviter.userId)"
|
||||||
|
style="display: block"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 主体内容 -->
|
<!-- 主体内容 -->
|
||||||
@ -425,6 +434,7 @@ import {
|
|||||||
parseHeader,
|
parseHeader,
|
||||||
setHttpHeaders,
|
setHttpHeaders,
|
||||||
isInApp,
|
isInApp,
|
||||||
|
gotoPrivateChat,
|
||||||
} from '@/utils/appBridge.js'
|
} from '@/utils/appBridge.js'
|
||||||
import {
|
import {
|
||||||
appConnectionManager,
|
appConnectionManager,
|
||||||
@ -444,6 +454,7 @@ import {
|
|||||||
getMyInviteUsers, // 有效邀请用户列表
|
getMyInviteUsers, // 有效邀请用户列表
|
||||||
getInviteAwardPool, // 邀请用户奖励池
|
getInviteAwardPool, // 邀请用户奖励池
|
||||||
getInviteReceiveAward, // 邀请用户领取奖励
|
getInviteReceiveAward, // 邀请用户领取奖励
|
||||||
|
getMyInviter, // 获取我的邀请人信息
|
||||||
} from '@/api/invitation.js'
|
} from '@/api/invitation.js'
|
||||||
|
|
||||||
// vite动态导入图片
|
// vite动态导入图片
|
||||||
@ -470,6 +481,7 @@ const tipShow = ref(false) //提示弹窗
|
|||||||
|
|
||||||
const invitationCode = ref('') //邀请码
|
const invitationCode = ref('') //邀请码
|
||||||
const myInviteInfo = ref({}) //我的邀请信息
|
const myInviteInfo = ref({}) //我的邀请信息
|
||||||
|
const myInviter = ref({}) //我的邀请人信息
|
||||||
const myInviteIncome = ref({}) //邀请用户收益统计
|
const myInviteIncome = ref({}) //邀请用户收益统计
|
||||||
const myInviteUsers = ref([]) //邀请用户列表
|
const myInviteUsers = ref([]) //邀请用户列表
|
||||||
const inviteAwardPool = 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 () => {
|
const confirm = async () => {
|
||||||
if (!invitationCode.value.trim()) {
|
if (!invitationCode.value.trim()) {
|
||||||
@ -585,6 +605,7 @@ const receiveAward = async (awardId) => {
|
|||||||
// 页面初始化数据
|
// 页面初始化数据
|
||||||
const initData = () => {
|
const initData = () => {
|
||||||
apiGetMyInviteCode() // 获取我的邀请码
|
apiGetMyInviteCode() // 获取我的邀请码
|
||||||
|
apiGetMyInviter() // 获取我的邀请人信息
|
||||||
apiGetMyInviteIncome() // 获取收益统计
|
apiGetMyInviteIncome() // 获取收益统计
|
||||||
apiGetMyInviteUsers() // 有效邀请用户列表
|
apiGetMyInviteUsers() // 有效邀请用户列表
|
||||||
apiGetInviteAwardPool() // 邀请用户奖励池
|
apiGetInviteAwardPool() // 邀请用户奖励池
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user