index.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. Component({
  2. properties: {
  3. userInfo: {
  4. type: Object,
  5. value: {}
  6. },
  7. bannerList: {
  8. type: Array,
  9. value: [],
  10. observer() {
  11. this.setData({
  12. current: 0
  13. })
  14. }
  15. }
  16. // banner的classify是:1:官方推荐;2:作品展播;3:官方活动;4:关注作品;5:我的作品 6:收藏作品;
  17. },
  18. data: {
  19. current: 0
  20. },
  21. methods: {
  22. bannelEvent({
  23. currentTarget
  24. }) {
  25. //1:图片,2:邀新榜,3:热播榜,4:挑战pk榜,5,朗读赛,6,领取勋章,8跳购买页
  26. let {
  27. type,
  28. content
  29. } = currentTarget.dataset
  30. if ([2, 3, 4].includes(type)) {
  31. wx.navigateTo({
  32. url: `/pages/ranking/index?id=${content}&type=${type}`,
  33. })
  34. } else if (type == 5) {
  35. wx.navigateTo({
  36. url: `/pages/match/index?activityId=${content}`,
  37. })
  38. } else if (type == 1) {
  39. wx.navigateTo({
  40. url: `/pages/rankIntro/index?img=${content}`,
  41. })
  42. } else if (type == 8) {
  43. this.selectComponent('#buyVip').open()
  44. } else if (type == 9) {
  45. wx.navigateTo({
  46. url: '/pages/invite/index',
  47. })
  48. } else if (type == 7) {
  49. let url = ''
  50. if (!this.properties.userInfo.saleUserId) {
  51. url = '/salesperson/pages/sale/index'
  52. } else {
  53. url = '/salesperson/pages/saleOffice/index'
  54. }
  55. wx.navigateTo({
  56. url
  57. })
  58. }
  59. },
  60. }
  61. })