detail.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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/detail.jpg',
  10. src1: '/image/head1.png',
  11. // 上传图片
  12. fileList: [],
  13. frameStyle: { useTop: true, name: '比赛信息', leftArrow: true, useBar: false },
  14. // 主体高度
  15. infoHeight: '',
  16. listb: [
  17. {
  18. time: '1-15 15:00',
  19. ranks1: '哈拉海队幼儿园组',
  20. score1: '2',
  21. score2: '1',
  22. ranks2: '马尼拉老年组',
  23. state: '未开始'
  24. }
  25. ],
  26. lists: [
  27. {
  28. id: '1', name: '老头1', head: '/image/tou.png'
  29. },
  30. {
  31. id: '1', name: '老头2', head: '/image/tou.png'
  32. },
  33. {
  34. id: '1', name: '老头3', head: '/image/tou.png'
  35. },
  36. {
  37. id: '1', name: '老头4', head: '/image/tou.png'
  38. },
  39. {
  40. id: '1', name: '老头5', head: '/image/tou.png'
  41. }
  42. ],
  43. list: [
  44. {
  45. id: '1', name: '老头1', head: '/image/tou.png'
  46. },
  47. {
  48. id: '1', name: '老头2', head: '/image/tou.png'
  49. },
  50. {
  51. id: '1', name: '老头3', head: '/image/tou.png'
  52. },
  53. {
  54. id: '1', name: '老头4', head: '/image/tou.png'
  55. },
  56. {
  57. id: '1', name: '老头5', head: '/image/tou.png'
  58. },
  59. {
  60. id: '1', name: '老头6', head: '/image/tou.png'
  61. },
  62. {
  63. id: '1', name: '老头7', head: '/image/tou.png'
  64. },
  65. {
  66. id: '1', name: '老头8', head: '/image/tou.png'
  67. },
  68. {
  69. id: '1', name: '老头9', head: '/image/tou.png'
  70. },
  71. {
  72. id: '1', name: '老头10', head: '/image/tou.png'
  73. }
  74. ],
  75. },
  76. //上传图片
  77. imgUpload:function(e){
  78. const that = this;
  79. let data = that.data.fileList;
  80. data.push(e.detail)
  81. that.setData({fileList:data})
  82. },
  83. //删除图片
  84. imgDel:function(e){
  85. const that = this;
  86. let data = that.data.fileList;
  87. let arr = data.filter((i,index) => index != e.detail.index)
  88. that.setData({fileList:arr})
  89. },
  90. back: function () {
  91. wx.navigateBack({ url: '/pages/home/index' })
  92. },
  93. /**
  94. * 生命周期函数--监听页面加载
  95. */
  96. onLoad: function (options) {
  97. // 计算高度
  98. this.searchHeight()
  99. },
  100. // 计算高度
  101. searchHeight: function () {
  102. let frameStyle = this.data.frameStyle;
  103. let client = app.globalData.client;
  104. // 减去状态栏
  105. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  106. // 是否减去底部菜单
  107. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  108. if (infoHeight) this.setData({ infoHeight: infoHeight })
  109. },
  110. /**
  111. * 生命周期函数--监听页面初次渲染完成
  112. */
  113. onReady: function () {
  114. },
  115. /**
  116. * 生命周期函数--监听页面显示
  117. */
  118. onShow: function () {
  119. },
  120. /**
  121. * 生命周期函数--监听页面隐藏
  122. */
  123. onHide: function () {
  124. },
  125. /**
  126. * 生命周期函数--监听页面卸载
  127. */
  128. onUnload: function () {
  129. },
  130. /**
  131. * 页面相关事件处理函数--监听用户下拉动作
  132. */
  133. onPullDownRefresh: function () {
  134. },
  135. /**
  136. * 页面上拉触底事件的处理函数
  137. */
  138. onReachBottom: function () {
  139. },
  140. /**
  141. * 用户点击右上角分享
  142. */
  143. onShareAppMessage: function () {
  144. }
  145. })