achieve.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. // 个人积分
  21. ownintegralList: [
  22. {
  23. person: [{ name: '李四' }, { name: '张三' }, { name: '刘二' }],
  24. integral: '48',
  25. rank: '1'
  26. },
  27. {
  28. person: [{ name: '李四' }, { name: '张三' }, { name: '刘二' }],
  29. integral: '28',
  30. rank: '2'
  31. }
  32. ],
  33. // 团体积分
  34. teamintegralList: [
  35. {
  36. address: '龙伟羽校',
  37. integral: '488',
  38. rank: '1'
  39. },
  40. {
  41. address: '龙伟羽校',
  42. integral: '200',
  43. rank: '2'
  44. }
  45. ],
  46. list: [
  47. { name: '张三' },
  48. { name: '李四' },
  49. { name: '王二麻子' },
  50. { name: '孙二' },
  51. { name: '赵五' },
  52. ]
  53. },
  54. // 跳转菜单
  55. back(e) {
  56. wx.navigateBack({ delta: 1 })
  57. },
  58. // 选项卡
  59. tabsChange: function (e) {
  60. const that = this;
  61. const { name } = e.detail;
  62. that.setData({ 'tabs.active': name });
  63. },
  64. /**
  65. * 生命周期函数--监听页面加载
  66. */
  67. onLoad: function (options) {
  68. const that = this;
  69. that.setData({ options: { match_id: options.match_id || '62e388d4fd61d871861b80af', grouping_id: options.grouping_id || '62e601db2dc7343e137fff76', project_id: options.project_id || '62e5ffba2dc7343e137ffee9' } })
  70. that.search()
  71. },
  72. search: async function () {
  73. const that = this;
  74. const options = that.data.options;
  75. let arr;
  76. arr = await app.$get(`/newCourt/api/match/${options.match_id}`);
  77. if (arr.errcode == '') { that.setData({ info: arr.data }) }
  78. },
  79. /**
  80. * 生命周期函数--监听页面初次渲染完成
  81. */
  82. onReady: function () {
  83. },
  84. /**
  85. * 生命周期函数--监听页面显示
  86. */
  87. onShow: function () {
  88. },
  89. /**
  90. * 生命周期函数--监听页面隐藏
  91. */
  92. onHide: function () {
  93. },
  94. /**
  95. * 生命周期函数--监听页面卸载
  96. */
  97. onUnload: function () {
  98. },
  99. /**
  100. * 页面相关事件处理函数--监听用户下拉动作
  101. */
  102. onPullDownRefresh: function () {
  103. },
  104. /**
  105. * 页面上拉触底事件的处理函数
  106. */
  107. onReachBottom: function () {
  108. },
  109. /**
  110. * 用户点击右上角分享
  111. */
  112. onShareAppMessage: function () {
  113. }
  114. })