index.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. // pages/login/login.js
  2. import WxValidate from '../../utils/wxValidate'
  3. const app = getApp()
  4. var isAll = false
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. // 主体高度
  11. infoHeight: '',
  12. frameStyle: { useTop: true, name: '已上传图片', leftArrow: true, useBar: false },
  13. list: [
  14. {
  15. id: '1', name: '朝阳沟第三节力气大赛', time: '2020.11.12', shop1: '/image/shop1.png', shop2: '/image/shop2.png', shop3: '/image/shop3.png',
  16. },
  17. {
  18. id: '1', name: '朝阳沟第三节力气大赛', time: '2020.11.12', shop1: '/image/shop1.png', shop2: '/image/shop2.png', shop3: '/image/shop3.png',
  19. }
  20. ],
  21. },
  22. back: function () {
  23. wx.navigateBack({ url: '/pages/me/index' })
  24. },
  25. //提交
  26. formSubmit: function (e) {
  27. },
  28. //实现全选的点击事件,首先要定义一个全局变量isAll=false,让复选框默认为不勾选状态
  29. checkq: function () {
  30. var list = this.data.list;
  31. isAll = !isAll;
  32. if (isAll) {
  33. for (var i = 0; i < list.length; i++) {
  34. var item = list[i];
  35. item.isCheck = true
  36. list.splice(i, 1, item)
  37. }
  38. } else {
  39. for (var i = 0; i < list.length; i++) {
  40. var item = list[i];
  41. item.isCheck = false
  42. list.splice(i, 1, item)
  43. }
  44. }
  45. this.setData({
  46. list: list
  47. })
  48. },
  49. //删除
  50. delList: function () {
  51. var list = this.data.list;
  52. list.pop();
  53. this.setData({
  54. list: list,
  55. })
  56. },
  57. //删除图片
  58. deleteImg: function (e) {
  59. },
  60. /**
  61. * 生命周期函数--监听页面加载
  62. */
  63. onLoad: function (options) {
  64. // 计算高度
  65. this.searchHeight()
  66. },
  67. // 计算高度
  68. searchHeight: function () {
  69. let frameStyle = this.data.frameStyle;
  70. let client = app.globalData.client;
  71. let infoHeight = client.windowHeight;
  72. // 是否去掉状态栏
  73. if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  74. // 是否减去底部菜单
  75. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  76. if (infoHeight) this.setData({ infoHeight: infoHeight })
  77. },
  78. /**
  79. * 生命周期函数--监听页面初次渲染完成
  80. */
  81. onReady: function () {
  82. },
  83. /**
  84. * 生命周期函数--监听页面显示
  85. */
  86. onShow: function () {
  87. },
  88. /**
  89. * 生命周期函数--监听页面隐藏
  90. */
  91. onHide: function () {
  92. },
  93. /**
  94. * 生命周期函数--监听页面卸载
  95. */
  96. onUnload: function () {
  97. },
  98. /**
  99. * 页面相关事件处理函数--监听用户下拉动作
  100. */
  101. onPullDownRefresh: function () {
  102. },
  103. /**
  104. * 页面上拉触底事件的处理函数
  105. */
  106. onReachBottom: function () {
  107. },
  108. /**
  109. * 用户点击右上角分享
  110. */
  111. onShareAppMessage: function () {
  112. }
  113. })