|
@@ -2,7 +2,16 @@ import ColSticky from '@/components/col-sticky'
|
|
|
import request from '@/helpers/request'
|
|
|
import { browser, removeAuth } from '@/helpers/utils'
|
|
|
import { postMessage } from '@/helpers/native-message'
|
|
|
-import { Button, Cell, CellGroup, Dialog, Image, Notify, Popup, Toast } from 'vant'
|
|
|
+import {
|
|
|
+ Button,
|
|
|
+ Cell,
|
|
|
+ CellGroup,
|
|
|
+ Dialog,
|
|
|
+ Image,
|
|
|
+ Notify,
|
|
|
+ Popup,
|
|
|
+ Toast
|
|
|
+} from 'vant'
|
|
|
import { defineComponent } from 'vue'
|
|
|
import styles from './index.module.less'
|
|
|
import logo from '@/common/images/logo.png'
|
|
@@ -13,6 +22,7 @@ import dayjs from 'dayjs'
|
|
|
import { orderStatus } from '@/views/order-detail/orderStatus'
|
|
|
import { difficulty } from '@/constant'
|
|
|
import { state } from '@/state'
|
|
|
+import iconTeacher from '@/common/images/icon_teacher.png'
|
|
|
|
|
|
export const getAssetsHomeFile = (fileName: string) => {
|
|
|
const path = `./images/${fileName}`
|
|
@@ -49,6 +59,22 @@ export default defineComponent({
|
|
|
}
|
|
|
})
|
|
|
return status
|
|
|
+ },
|
|
|
+ // this.activeInfo.activityRewardList
|
|
|
+ rewardList() {
|
|
|
+ const activityRewardList = this.activeInfo.activityRewardList
|
|
|
+ console.log(activityRewardList)
|
|
|
+ let list = activityRewardList || []
|
|
|
+ if (activityRewardList && activityRewardList.length > 0) {
|
|
|
+ const last = activityRewardList.sort((a: any, b: any) => {
|
|
|
+ return Number(a.group) < Number(b.group) ? -1 : 1
|
|
|
+ })
|
|
|
+ list = this.groupBy(last, (item: any) => {
|
|
|
+ return [item.group]
|
|
|
+ })
|
|
|
+ console.log(list, 'list')
|
|
|
+ }
|
|
|
+ return list || []
|
|
|
}
|
|
|
},
|
|
|
async mounted() {
|
|
@@ -89,6 +115,18 @@ export default defineComponent({
|
|
|
document.removeEventListener(visibilityChangeEvent, this.onVisibilityChange)
|
|
|
},
|
|
|
methods: {
|
|
|
+ groupBy(array: any, f: any) {
|
|
|
+ const groups = {}
|
|
|
+ array.forEach(function (o) {
|
|
|
+ //注意这里必须是forEach 大写
|
|
|
+ const group = JSON.stringify(f(o))
|
|
|
+ groups[group] = groups[group] || []
|
|
|
+ groups[group].push(o)
|
|
|
+ })
|
|
|
+ return Object.keys(groups).map(function (group) {
|
|
|
+ return groups[group]
|
|
|
+ })
|
|
|
+ },
|
|
|
onVisibilityChange() {
|
|
|
if (!document[this.hiddenProperty]) {
|
|
|
this.getMusicInfo()
|
|
@@ -305,21 +343,64 @@ export default defineComponent({
|
|
|
活动奖品
|
|
|
</span>
|
|
|
|
|
|
- <img
|
|
|
+ {/* <img
|
|
|
src={getAssetsHomeFile('star_bg.png')}
|
|
|
class={styles.iconStar}
|
|
|
- />
|
|
|
+ /> */}
|
|
|
+ <span
|
|
|
+ class={styles.titleTips}
|
|
|
+ onClick={() =>
|
|
|
+ this.$router.push({
|
|
|
+ path: '/leaderboard',
|
|
|
+ query: { id: this.id }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ >
|
|
|
+ 查看挑战排行榜
|
|
|
+ <img
|
|
|
+ style={{ width: '16px', marginLeft: '4px' }}
|
|
|
+ src={getAssetsHomeFile('icon-lv.png')}
|
|
|
+ />
|
|
|
+ </span>
|
|
|
</h2>
|
|
|
- {this.activeInfo.activityRewardList &&
|
|
|
- this.activeInfo.activityRewardList.map((item: any) => (
|
|
|
- <div class={styles.prize}>
|
|
|
- <Image src={item.imgUrl} />
|
|
|
- <div class={styles.prizeContainer}>
|
|
|
- <div class={styles.prizeName}>{item.rewardName}</div>
|
|
|
- <div class={styles.prizeDesc}>{item.rewardDescribe}</div>
|
|
|
- </div>
|
|
|
+ {this.rewardList.map((item: any, index: number) => (
|
|
|
+ <>
|
|
|
+ <div class={styles.prizeTitle}>
|
|
|
+ {index === 0 && (
|
|
|
+ <Image
|
|
|
+ class={styles.prizeLevel}
|
|
|
+ src={getAssetsHomeFile('icon_level.png')}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {index === 1 && (
|
|
|
+ <Image
|
|
|
+ class={styles.prizeLevel}
|
|
|
+ src={getAssetsHomeFile('icon_level2.png')}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {index === 2 && (
|
|
|
+ <Image
|
|
|
+ class={styles.prizeLevel}
|
|
|
+ src={getAssetsHomeFile('icon_level3.png')}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ 第{++index}名奖品
|
|
|
</div>
|
|
|
- ))}
|
|
|
+ <div class={styles.prizeSection}>
|
|
|
+ {item.map((child: any) => (
|
|
|
+ <div class={[styles.prize]}>
|
|
|
+ <Image src={child.imgUrl} />
|
|
|
+ <div class={styles.prizeContainer}>
|
|
|
+ <div class={styles.prizeName}>{child.rewardName}</div>
|
|
|
+ <div class={styles.prizeDesc}>
|
|
|
+ {child.rewardDescribe}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+ </>
|
|
|
+ ))}
|
|
|
</div>
|
|
|
|
|
|
<div class={[styles.section]} style={{ backgroundColor: '#fff' }}>
|
|
@@ -328,10 +409,8 @@ export default defineComponent({
|
|
|
<i class={styles.titlePrefix}></i>
|
|
|
活动曲目
|
|
|
</span>
|
|
|
-
|
|
|
- <span class={styles.titleTips} onClick={() => this.$router.push({path: '/leaderboard', query:{id: this.id}})}>
|
|
|
- 查看挑战排行榜
|
|
|
- <img style={{width: '16px', marginLeft: '4px'}} src={getAssetsHomeFile('icon-lv.png')} />
|
|
|
+ <span class={styles.titleTips}>
|
|
|
+ 共{this.activityMusic.length || 0}首曲目
|
|
|
</span>
|
|
|
</h2>
|
|
|
|
|
@@ -378,7 +457,7 @@ export default defineComponent({
|
|
|
{item.userId ? (
|
|
|
<>
|
|
|
<Image
|
|
|
- src={item.userAvatar}
|
|
|
+ src={item.userAvatar || iconTeacher}
|
|
|
class={styles.userLogo}
|
|
|
fit="cover"
|
|
|
/>
|
|
@@ -483,7 +562,7 @@ export default defineComponent({
|
|
|
<img
|
|
|
src={getAssetsHomeFile('icon_close.png')}
|
|
|
class={styles.popupClose}
|
|
|
- onClick={()=>this.popupStatus = false}
|
|
|
+ onClick={() => (this.popupStatus = false)}
|
|
|
/>
|
|
|
</div>
|
|
|
|