index.js 3.0 KB

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