index.tsx 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { Cell, Icon, Image } from 'vant'
  2. import styles from './index.module.less'
  3. import { defineComponent } from 'vue'
  4. import IconXin from '@/common/images/icon-xin.png'
  5. import IconXinActive from '@/common/images/icon-xin-active.png'
  6. import TheTitle from '../the-title'
  7. import { openDefaultWebView } from '@/student/home-layout-orchestra/state-orchestra'
  8. import { useRouter } from 'vue-router'
  9. import event from '../../event'
  10. export default defineComponent({
  11. name: 'hot-album',
  12. props: {
  13. album: {
  14. type: Array,
  15. default: []
  16. }
  17. },
  18. setup(props) {
  19. const router = useRouter()
  20. return () => (
  21. <>
  22. {props.album.length > 0 && (
  23. <TheTitle
  24. title="热门专辑"
  25. onDetail={() => {
  26. event.emit('downloadApp')
  27. }}
  28. />
  29. )}
  30. <div class={styles.albumContainer}>
  31. {props.album.map((item: any) => (
  32. <div
  33. class={styles.album}
  34. key={item.id}
  35. onClick={() => {
  36. event.emit('downloadApp')
  37. }}
  38. >
  39. <div class={styles.main}>
  40. {item.paymentType === 'CHARGE' && (
  41. <span class={styles.albumType}>付费</span>
  42. )}
  43. <Image class={styles.img} src={item.albumCoverUrl} />
  44. <div class={styles.model}>
  45. <Icon name={item.favorite ? IconXinActive : IconXin} />
  46. <span class={styles.num}>{item.albumFavoriteCount}人</span>
  47. </div>
  48. </div>
  49. <h4 class={[styles.title, 'van-ellipsis']}>{item.albumName}</h4>
  50. </div>
  51. ))}
  52. </div>
  53. </>
  54. )
  55. }
  56. })