123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import {
- getBannerList
- } from '~/api/global'
- Component({
- properties: {
- classify: {
- type: Number,
- value: 1
- }
- },
- data: {
- bannerList: []
- },
- lifetimes: {
- attached() {
- this.getBannerList()
- },
- },
- /**
- * 组件的方法列表
- */
- methods: {
- async getBannerList() {
- let bannerList = await getBannerList(this.properties.classify)
- this.setData({
- bannerList
- })
- },
- bannelEvent({
- currentTarget
- }) {
- //1:图片,2:邀新榜,3:热播榜,4:挑战pk榜,5,朗读赛,6,领取勋章
- switch (currentTarget.dataset.type) {
- case 1:
- break;
- case 2:
- wx.navigateTo({
- url: '/pages/ranking/index?type=2&title=邀新榜',
- })
- break;
- default:
- }
- },
- }
- })
|