index.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. radio:'',
  13. list: [
  14. { id: '1', name: '群名1', create_time: '2022-02-23', brief: '无',status: '审核通过' },
  15. { id: '1', name: '群名2', create_time: '2022-02-23', brief: '无',status: '审核通过' },
  16. ],
  17. // 弹框
  18. dialog: { title: '详细信息', show: false, type: '1' },
  19. // 弹框2
  20. dialog: { title: '解散审核', show: false, type: '2' },
  21. // 详细信息
  22. info: { id: '1', name: '群名1', create_time: '2022-02-23', brief: '无',status: '审核通过'},
  23. },
  24. // 详细信息
  25. toView: function (e) {
  26. const { id } = e.currentTarget.dataset;
  27. console.log(id);
  28. // this.setData({ info: {} })
  29. this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
  30. },
  31. formSubmit(e) {
  32. console.log('form发生了submit事件,携带数据为:', e.detail.value)
  33. const radio = e.detail.value.radio;
  34. console.log(radio);
  35. wx.showModal({
  36. title: '提示',content: '确定解散?',
  37. success: function () {
  38. if (radio=='radio3') {//这里是点击了确定以后
  39. wx.showToast({ title: `解散成功`, icon: 'success', duration: 2000 })
  40. } else {//这里是点击了取消以后
  41. wx.showToast({ title: `解散失败`, icon: 'error', duration: 2000 })
  42. }
  43. }
  44. })
  45. },
  46. back: function () {
  47. wx.navigateBack({ url: '/pages/home/index' })
  48. },
  49. // 添加人员
  50. toAdd: function () {
  51. wx.navigateTo({ url: `/pages/group/detail` })
  52. },
  53. // 信息变更
  54. toEdit: function (e) {
  55. const { id } = e.currentTarget.dataset;
  56. wx.navigateTo({ url: `/pages/group/detail?id=${id}` })
  57. },
  58. // 解散审核
  59. dissolution: function (e) {
  60. const { id } = e.currentTarget.dataset;
  61. console.log(id);
  62. // this.setData({ info: {} })
  63. this.setData({ dialog: { title: '解散审核', show: true, type: '2' } })
  64. },
  65. toAudit: function () {
  66. wx.navigateTo({ url: `/pages/group/create` })
  67. },
  68. toAdds: function () {
  69. wx.navigateTo({ url: `/pages/group/add` })
  70. },
  71. // // 解散审核
  72. // toUnbound: function (e) {
  73. // const { radio } = e.currentTarget.dataset.radio;
  74. // console.log(radio);
  75. // // wx.showToast({ title: `解散成功`, icon: 'success', duration: 2000 })
  76. // wx.showModal({
  77. // title: '提示',content: '确定解散?',
  78. // success: function (radio) {
  79. // if (radio=='radio3') {//这里是点击了确定以后
  80. // wx.showToast({ title: `解散成功`, icon: 'success', duration: 2000 })
  81. // wx.navigateBack({ url: `/pages/group/index` })
  82. // } else {//这里是点击了取消以后
  83. // wx.showToast({ title: `解散失败`, icon: 'error', duration: 2000 })
  84. // }
  85. // }
  86. // })
  87. // },
  88. /**
  89. * 生命周期函数--监听页面加载
  90. */
  91. onLoad: function (options) {
  92. // 计算高度
  93. this.searchHeight()
  94. },
  95. // 计算高度
  96. searchHeight: function () {
  97. let frameStyle = this.data.frameStyle;
  98. let client = app.globalData.client;
  99. // 减去状态栏
  100. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  101. // 是否减去底部菜单
  102. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  103. if (infoHeight) this.setData({ infoHeight: infoHeight })
  104. },
  105. /**
  106. * 生命周期函数--监听页面初次渲染完成
  107. */
  108. onReady: function () {
  109. },
  110. /**
  111. * 生命周期函数--监听页面显示
  112. */
  113. onShow: function () {
  114. },
  115. /**
  116. * 生命周期函数--监听页面隐藏
  117. */
  118. onHide: function () {
  119. },
  120. /**
  121. * 生命周期函数--监听页面卸载
  122. */
  123. onUnload: function () {
  124. },
  125. /**
  126. * 页面相关事件处理函数--监听用户下拉动作
  127. */
  128. onPullDownRefresh: function () {
  129. },
  130. /**
  131. * 页面上拉触底事件的处理函数
  132. */
  133. onReachBottom: function () {
  134. },
  135. /**
  136. * 用户点击右上角分享
  137. */
  138. onShareAppMessage: function () {
  139. }
  140. })