12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- 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;
- case 3:
- wx.navigateTo({
- url: '/pages/ranking/index?type=3&title=热播榜',
- })
- break;
- case 4:
- wx.navigateTo({
- url: '/pages/ranking/index?type=4&title=挑战榜',
- })
- break;
- default:
- }
- },
- }
- })
|