sign.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. const app = getApp()
  2. import { examine_status } from '../../utils/dict';
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. frameStyle: { useTop: true, name: '组队信息审核', leftArrow: true, useBar: false },
  9. //查询条件
  10. searchName: '',
  11. list: [],
  12. dialog: { title: '详细信息', show: false, type: '1' },
  13. info: {},
  14. statusList: examine_status
  15. },
  16. // 跳转菜单
  17. back(e) {
  18. wx.navigateBack({ delta: 1 })
  19. },
  20. // 查询信息
  21. onSearch: function (e) {
  22. const that = this;
  23. that.setData({ searchName: e.detail });
  24. that.watchLogin();
  25. },
  26. // 查看
  27. toView: async function (e) {
  28. const that = this;
  29. const { id } = e.currentTarget.dataset;
  30. const arr = await app.$get(`/newCourt/api/user/${id}`);
  31. if (arr.errcode == '0') {
  32. that.setData({ info: arr.data })
  33. that.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
  34. }
  35. },
  36. // 审核
  37. toCheck: async function (e) {
  38. const that = this;
  39. let { id } = e.currentTarget.dataset;
  40. const arr = await app.$get(`/newCourt/api/user/${id}`);
  41. if (arr.errcode == '0') {
  42. that.setData({ info: arr.data })
  43. that.setData({ dialog: { title: '信息审核', show: true, type: '2' } })
  44. }
  45. },
  46. // 关闭弹框
  47. toClose: function () {
  48. const that = this;
  49. that.setData({ dialog: { title: '详细信息', show: false, type: '1' } })
  50. },
  51. /**
  52. * 生命周期函数--监听页面加载
  53. */
  54. onLoad: function (options) {
  55. const that = this;
  56. that.watchLogin();
  57. },
  58. // 监听用户是否登录
  59. watchLogin: async function () {
  60. const that = this;
  61. wx.getStorage({
  62. key: 'user',
  63. success: async res => {
  64. let info = {};
  65. if (that.data.searchName) info.name = that.data.searchName;
  66. const arr = await app.$get(`/newCourt/api/user/`, { ...info });
  67. // if (arr.errcode == '0') { that.setData({ list: arr.data }) }
  68. },
  69. fail: res => {
  70. wx.redirectTo({ url: '/pages/index/index', })
  71. }
  72. })
  73. },
  74. /**
  75. * 生命周期函数--监听页面初次渲染完成
  76. */
  77. onReady: function () {
  78. },
  79. /**
  80. * 生命周期函数--监听页面显示
  81. */
  82. onShow: function () {
  83. },
  84. /**
  85. * 生命周期函数--监听页面隐藏
  86. */
  87. onHide: function () {
  88. },
  89. /**
  90. * 生命周期函数--监听页面卸载
  91. */
  92. onUnload: function () {
  93. },
  94. /**
  95. * 页面相关事件处理函数--监听用户下拉动作
  96. */
  97. onPullDownRefresh: function () {
  98. },
  99. /**
  100. * 页面上拉触底事件的处理函数
  101. */
  102. onReachBottom: function () {
  103. },
  104. /**
  105. * 用户点击右上角分享
  106. */
  107. onShareAppMessage: function () {
  108. }
  109. })