index.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. // pages/login/login.js
  2. import WxValidate from '../../utils/wxValidate'
  3. const app = getApp()
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. frameStyle: { useTop: true, name: '群组管理', leftArrow: true, useBar: false },
  10. // 主体高度
  11. infoHeight: '',
  12. list: [
  13. { id: '1', name: '群名1', create_time: '2022-02-23', brief: '无',status: '审核通过' },
  14. { id: '1', name: '群名2', create_time: '2022-02-23', brief: '无',status: '审核通过' },
  15. ],
  16. // 弹框
  17. dialog: { title: '详细信息', show: false, type: '1' },
  18. // 详细信息
  19. info: { id: '1', name: '群名1', create_time: '2022-02-23', brief: '无',status: '审核通过'},
  20. },
  21. // 详细信息
  22. toView: function () {
  23. wx.navigateTo({ url: `/pages/management/detail` })
  24. },
  25. back: function () {
  26. wx.navigateBack({ url: '/pages/home/index' })
  27. },
  28. // 添加人员
  29. toAdd: function () {
  30. wx.navigateTo({ url: `/pages/management/detail` })
  31. },
  32. // 信息变更
  33. toEdit: function (e) {
  34. const { id } = e.currentTarget.dataset;
  35. wx.navigateTo({ url: `/pages/group/detail?id=${id}` })
  36. },
  37. toAudit: function () {
  38. wx.navigateTo({ url: `/pages/group/create` })
  39. },
  40. // 解散申请
  41. toUnbound: function (e) {
  42. const { id } = e.currentTarget.dataset;
  43. console.log(id);
  44. // wx.showToast({ title: `解散成功`, icon: 'success', duration: 2000 })
  45. wx.showModal({
  46. title: '提示',content: '确定解散?',
  47. success: function (e) {
  48. if (id!=0) {//这里是点击了确定以后
  49. wx.showToast({ title: `解散成功`, icon: 'success', duration: 2000 })
  50. } else {//这里是点击了取消以后
  51. wx.showToast({ title: `解散失败`, icon: 'error', duration: 2000 })
  52. }
  53. }
  54. })
  55. },
  56. /**
  57. * 生命周期函数--监听页面加载
  58. */
  59. onLoad: function (options) {
  60. // 计算高度
  61. this.searchHeight()
  62. },
  63. // 计算高度
  64. searchHeight: function () {
  65. let frameStyle = this.data.frameStyle;
  66. let client = app.globalData.client;
  67. // 减去状态栏
  68. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  69. // 是否减去底部菜单
  70. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  71. if (infoHeight) this.setData({ infoHeight: infoHeight })
  72. },
  73. /**
  74. * 生命周期函数--监听页面初次渲染完成
  75. */
  76. onReady: function () {
  77. },
  78. /**
  79. * 生命周期函数--监听页面显示
  80. */
  81. onShow: function () {
  82. },
  83. /**
  84. * 生命周期函数--监听页面隐藏
  85. */
  86. onHide: function () {
  87. },
  88. /**
  89. * 生命周期函数--监听页面卸载
  90. */
  91. onUnload: function () {
  92. },
  93. /**
  94. * 页面相关事件处理函数--监听用户下拉动作
  95. */
  96. onPullDownRefresh: function () {
  97. },
  98. /**
  99. * 页面上拉触底事件的处理函数
  100. */
  101. onReachBottom: function () {
  102. },
  103. /**
  104. * 用户点击右上角分享
  105. */
  106. onShareAppMessage: function () {
  107. }
  108. })