achieve.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. const app = getApp()
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. frameStyle: { useTop: true, name: '赛事信息', leftArrow: true, useBar: false },
  8. tabs: {
  9. active: 'c',
  10. list: [
  11. { title: '小组赛', name: 'a' },
  12. { title: '淘汰赛', name: 'b' },
  13. { title: '名次', name: 'c' },
  14. { title: '个人积分', name: 'd' },
  15. { title: '团体积分', name: 'e' },
  16. ],
  17. },
  18. options: {},
  19. info: {},
  20. list: [
  21. { name: '张三' },
  22. { name: '李四' },
  23. { name: '王二麻子' },
  24. { name: '孙二' },
  25. { name: '赵五' },
  26. ]
  27. },
  28. // 跳转菜单
  29. back(e) {
  30. wx.navigateBack({ delta: 1 })
  31. },
  32. // 选项卡
  33. tabsChange: function (e) {
  34. const that = this;
  35. const { name } = e.detail;
  36. that.setData({ 'tabs.active': name });
  37. },
  38. /**
  39. * 生命周期函数--监听页面加载
  40. */
  41. onLoad: function (options) {
  42. const that = this;
  43. that.setData({ options: { match_id: options.match_id || '62e388d4fd61d871861b80af', grouping_id: options.grouping_id || '62e601db2dc7343e137fff76', project_id: options.project_id || '62e5ffba2dc7343e137ffee9' } })
  44. that.search()
  45. },
  46. search: async function () {
  47. const that = this;
  48. const options = that.data.options;
  49. let arr;
  50. arr = await app.$get(`/newCourt/api/match/${options.match_id}`);
  51. if (arr.errcode == '') { that.setData({ info: arr.data }) }
  52. },
  53. /**
  54. * 生命周期函数--监听页面初次渲染完成
  55. */
  56. onReady: function () {
  57. },
  58. /**
  59. * 生命周期函数--监听页面显示
  60. */
  61. onShow: function () {
  62. },
  63. /**
  64. * 生命周期函数--监听页面隐藏
  65. */
  66. onHide: function () {
  67. },
  68. /**
  69. * 生命周期函数--监听页面卸载
  70. */
  71. onUnload: function () {
  72. },
  73. /**
  74. * 页面相关事件处理函数--监听用户下拉动作
  75. */
  76. onPullDownRefresh: function () {
  77. },
  78. /**
  79. * 页面上拉触底事件的处理函数
  80. */
  81. onReachBottom: function () {
  82. },
  83. /**
  84. * 用户点击右上角分享
  85. */
  86. onShareAppMessage: function () {
  87. }
  88. })