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