index.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // pages/login/login.js
  2. import WxValidate from '../../utils/wxValidate'
  3. const app = getApp()
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. src: '/image/fen.jpg',
  10. src3: '/image/huang.png',
  11. src4: '/image/zan.png',
  12. frameStyle: { useTop: false, name: '我的', leftArrow: false, useBar: true },
  13. // 主体高度
  14. infoHeight: '',
  15. total:'4',
  16. list: [
  17. {
  18. id: '1', listbisai: [
  19. {
  20. head2: '/image/head2.png', head1: '/image/head1.png', fraction2: '0', groupname2: '马尼拉组', fraction1: '0', site: '第一场', groupname1: '哈拉海组',week: '星期五', time: '13:00',
  21. state: '已结束', date: '2022.01.15',start:'未开始'
  22. }
  23. ], name: '张爽', company: '福瑞科技有限公司', gender: '女', src: '/image/tou.png', address: '马利克克海拉队', team: '队员',
  24. },
  25. ],
  26. list3: [
  27. {
  28. id: '1', head: '/image/head1.png', group: '哈拉海队', time: '08:30', ball: '足球', grade: 'c', date: '2022.01.15', person: '10',
  29. },
  30. {
  31. id: '2', head: '/image/head1.png', group: '尼奥尔队', time: '08:30', ball: '篮球', grade: 'c', date: '2022.01.15', person: '9',
  32. },
  33. ],
  34. },
  35. tabPath(e) {
  36. let query = e.detail.detail;
  37. if (query) wx.redirectTo({ url: `/pages/${query}/index` })
  38. },
  39. /**
  40. * 生命周期函数--监听页面加载
  41. */
  42. onLoad: function (options) {
  43. // 计算高度
  44. this.searchHeight()
  45. },
  46. // 计算高度
  47. searchHeight: function () {
  48. let frameStyle = this.data.frameStyle;
  49. let client = app.globalData.client;
  50. // 减去状态栏
  51. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  52. // 是否减去底部菜单
  53. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  54. if (infoHeight) this.setData({ infoHeight: infoHeight })
  55. },
  56. /**
  57. * 生命周期函数--监听页面初次渲染完成
  58. */
  59. onReady: function () {
  60. },
  61. /**
  62. * 生命周期函数--监听页面显示
  63. */
  64. onShow: function () {
  65. },
  66. /**
  67. * 生命周期函数--监听页面隐藏
  68. */
  69. onHide: function () {
  70. },
  71. /**
  72. * 生命周期函数--监听页面卸载
  73. */
  74. onUnload: function () {
  75. },
  76. /**
  77. * 页面相关事件处理函数--监听用户下拉动作
  78. */
  79. onPullDownRefresh: function () {
  80. },
  81. /**
  82. * 页面上拉触底事件的处理函数
  83. */
  84. onReachBottom: function () {
  85. },
  86. /**
  87. * 用户点击右上角分享
  88. */
  89. onShareAppMessage: function () {
  90. }
  91. })