index.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. // 减去状态栏
  72. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  73. // 是否减去底部菜单
  74. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  75. if (infoHeight) this.setData({ infoHeight: infoHeight })
  76. },
  77. /**
  78. * 生命周期函数--监听页面初次渲染完成
  79. */
  80. onReady: function () {
  81. },
  82. /**
  83. * 生命周期函数--监听页面显示
  84. */
  85. onShow: function () {
  86. },
  87. /**
  88. * 生命周期函数--监听页面隐藏
  89. */
  90. onHide: function () {
  91. },
  92. /**
  93. * 生命周期函数--监听页面卸载
  94. */
  95. onUnload: function () {
  96. },
  97. /**
  98. * 页面相关事件处理函数--监听用户下拉动作
  99. */
  100. onPullDownRefresh: function () {
  101. },
  102. /**
  103. * 页面上拉触底事件的处理函数
  104. */
  105. onReachBottom: function () {
  106. },
  107. /**
  108. * 用户点击右上角分享
  109. */
  110. onShareAppMessage: function () {
  111. }
  112. })