🎈 perf(邀请码): 完善邀请码列表对接
This commit is contained in:
parent
e38b6da438
commit
fbe6e9b449
@ -52,6 +52,7 @@ export {
|
||||
export {
|
||||
GetInvitationInfo,
|
||||
GenBarCodeOrQrCode,
|
||||
GetInvitationList,
|
||||
} from './inviteCode/index'
|
||||
/**
|
||||
* 系列列表
|
||||
|
||||
@ -8,6 +8,13 @@ export const GetInvitationInfo = () => {
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
// 获取邀请进度
|
||||
export const GetInvitationList = () => {
|
||||
return useRequest({
|
||||
url: '/v2/mp/user/inviterList',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
// 生成二维码
|
||||
export const GenBarCodeOrQrCode = () => {
|
||||
return useRequest({
|
||||
|
||||
@ -9,7 +9,7 @@ import type { TablePropsType } from '@/components/table'
|
||||
import Table from '@/components/table'
|
||||
import NormalButton from '@/components/normalButton'
|
||||
import { alert } from '@/common/common'
|
||||
import { GenBarCodeOrQrCode, GetInvitationInfo } from '@/api'
|
||||
import { GenBarCodeOrQrCode, GetInvitationInfo, GetInvitationList } from '@/api'
|
||||
import { getCDNSource } from '@/common/constant'
|
||||
import Painter from '@/components/painter'
|
||||
|
||||
@ -64,7 +64,7 @@ const inviteColumns = [
|
||||
// 邀请码
|
||||
const InviteCode = () => {
|
||||
screenK = SystemInfo.screenWidth / 750
|
||||
|
||||
const { fetchData: getInvitationListAPI } = GetInvitationList()
|
||||
const { fetchData } = GetInvitationInfo()
|
||||
const { fetchData: genCode } = GenBarCodeOrQrCode()
|
||||
const [inviteInfo, setInviteInfo] = useState<any>({})
|
||||
@ -73,23 +73,28 @@ const InviteCode = () => {
|
||||
dataSource: { list: [], total: 0 },
|
||||
})
|
||||
const [loading, setLoading] = useState(false)
|
||||
// 获取邀请码
|
||||
const getInviteCode = async() => {
|
||||
const res = await fetchData()
|
||||
const getInvitationList = async() => {
|
||||
const res = await getInvitationListAPI()
|
||||
if (res.success) {
|
||||
console.log('getInviteCode', res)
|
||||
setCurrentTable((prev: any) => ({
|
||||
...prev,
|
||||
dataSource: {
|
||||
list: res.data.invitation_record.map((item, index: number) => ({
|
||||
list: res.data.list.map((item, index: number) => ({
|
||||
key: index,
|
||||
index: index + 1,
|
||||
invitee: item.name || '--',
|
||||
InviteResults: '已邀请',
|
||||
invitee: item.invitee_name || '--',
|
||||
InviteResults: item.schedule,
|
||||
})),
|
||||
total: res.data.invitation_record.length,
|
||||
total: res.data.list.length,
|
||||
},
|
||||
}))
|
||||
}
|
||||
}
|
||||
// 获取邀请码
|
||||
const getInviteCode = async() => {
|
||||
const res = await fetchData()
|
||||
if (res.success) {
|
||||
setInviteInfo(res.data)
|
||||
}
|
||||
}
|
||||
@ -293,6 +298,7 @@ const InviteCode = () => {
|
||||
}
|
||||
useReady(() => {
|
||||
getInviteCode()
|
||||
getInvitationList()
|
||||
setTimeout(() => {
|
||||
initCanvas()
|
||||
}, 200)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user