|
@@ -121,44 +121,46 @@ onShow(async () => {
|
|
|
reqs.push(setStudyTours())
|
|
|
}
|
|
|
await Promise.all(reqs)
|
|
|
- const { data: badgeData } = await getBadges({})
|
|
|
- const { data: certificates } = await getCertificates()
|
|
|
- console.log(certificates)
|
|
|
- const badges = Object.values(badgeData)
|
|
|
- .flat()
|
|
|
- .filter((it) => !it.popUp && it.quantity)
|
|
|
- const honors = [
|
|
|
- ...badges.map((it) => ({
|
|
|
- type: HonorDialogType.Badge,
|
|
|
- id: it.id,
|
|
|
- title: it.badgeName,
|
|
|
- content: it.badgeDescription,
|
|
|
- image: it.badgeYesObtainedImage,
|
|
|
- })),
|
|
|
- ...certificates
|
|
|
- .filter((it) => !it.popUp)
|
|
|
- .map((it) => ({
|
|
|
- type: HonorDialogType.Certificate,
|
|
|
+ if (userInfo.value.level != null){
|
|
|
+ const { data: badgeData } = await getBadges({})
|
|
|
+ const { data: certificates } = await getCertificates()
|
|
|
+ console.log(certificates)
|
|
|
+ const badges = Object.values(badgeData)
|
|
|
+ .flat()
|
|
|
+ .filter((it) => !it.popUp && it.quantity)
|
|
|
+ const honors = [
|
|
|
+ ...badges.map((it) => ({
|
|
|
+ type: HonorDialogType.Badge,
|
|
|
id: it.id,
|
|
|
- title: it.certificateName,
|
|
|
- content: it.certificateDescription,
|
|
|
- image: it.certificateImage,
|
|
|
+ title: it.badgeName,
|
|
|
+ content: it.badgeDescription,
|
|
|
+ image: it.badgeYesObtainedImage,
|
|
|
})),
|
|
|
- ]
|
|
|
- if (honors.length) {
|
|
|
- const honor = honors[0]
|
|
|
- await show({
|
|
|
- title: honor.title ?? ' ',
|
|
|
- content: honor.content ?? ' ',
|
|
|
- image: honor.image,
|
|
|
- type: honor.type,
|
|
|
- onLoad: async () => {
|
|
|
- await updateHonorPopUp({
|
|
|
- bizId: String(honor.id),
|
|
|
- bizType: honor.type === HonorDialogType.Badge ? '1' : '2',
|
|
|
- })
|
|
|
- },
|
|
|
- })
|
|
|
+ ...certificates
|
|
|
+ .filter((it) => !it.popUp)
|
|
|
+ .map((it) => ({
|
|
|
+ type: HonorDialogType.Certificate,
|
|
|
+ id: it.id,
|
|
|
+ title: it.certificateName,
|
|
|
+ content: it.certificateDescription,
|
|
|
+ image: it.certificateImage,
|
|
|
+ })),
|
|
|
+ ]
|
|
|
+ if (honors.length) {
|
|
|
+ const honor = honors[0]
|
|
|
+ await show({
|
|
|
+ title: honor.title ?? ' ',
|
|
|
+ content: honor.content ?? ' ',
|
|
|
+ image: honor.image,
|
|
|
+ type: honor.type,
|
|
|
+ onLoad: async () => {
|
|
|
+ await updateHonorPopUp({
|
|
|
+ bizId: String(honor.id),
|
|
|
+ bizType: honor.type === HonorDialogType.Badge ? '1' : '2',
|
|
|
+ })
|
|
|
+ },
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
onLoad(async () => {
|