12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import {
- getBannerList
- } from '~/api/global'
- Component({
- properties: {
-
- classify: {
- type: Number,
- value: 1,
- observer(newVal) {
- this.getBannerList()
- }
- }
- },
- data: {
- bannerList: [],
- current: 0
- },
- methods: {
- async getBannerList() {
- let bannerList = await getBannerList(this.properties.classify)
- this.setData({
- bannerList,
- current: 0
- })
- },
- bannelEvent({
- currentTarget
- }) {
- console.log(currentTarget);
-
- let {
- type,
- id,
- content
- } = currentTarget.dataset
- if ([2, 3, 4].includes(type)) {
- wx.navigateTo({
- url: `/pages/ranking/index?id=${id}&type=${type}`,
- })
- } else if (type == 5) {
- wx.navigateTo({
- url: '/pages/match/index',
- })
- } else if (type == 1) {
- wx.navigateTo({
- url: `/pages/rankIntro/index?img=${content}`,
- })
- }
- },
- }
- })
|