visitorcheck.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. const util = require('../../../utils/util.js');
  2. const api = require('../../../utils/api.js');
  3. const app = getApp()
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. isregiste: true,
  10. list: [{
  11. img: '/images/head.png',
  12. name: '刘天仙',
  13. address: '一号宿舍楼 502宿舍',
  14. time: '2019-10-28 15:18'
  15. }, {
  16. img: '/images/head.png',
  17. name: '陈方明',
  18. address: '一号宿舍楼 508宿舍',
  19. time: '2019-10-28 15:18'
  20. }]
  21. },
  22. checkTab: function(e) {
  23. const that = this;
  24. that.setData({
  25. isregiste: !that.data.isregiste
  26. })
  27. if (that.data.isregiste) {
  28. that.getVisitorCheckInfo(2);
  29. } else {
  30. that.getVisitorCheckInfo(3);
  31. }
  32. },
  33. todetail: function(e) {
  34. wx.navigateTo({
  35. url: '../visitorcheckdetail/visitorcheckdetail',
  36. })
  37. },
  38. getVisitorCheckInfo: function(status) {
  39. const that = this;
  40. util.httpRequest(api.getVisitorCheckInfo, {
  41. status: status,
  42. rows: 20,
  43. page: 1
  44. }, 'post').then(res => {
  45. })
  46. },
  47. /**
  48. * 生命周期函数--监听页面加载
  49. */
  50. onLoad: function(options) {
  51. const that = this;
  52. that.getVisitorCheckInfo(2);
  53. },
  54. /**
  55. * 生命周期函数--监听页面初次渲染完成
  56. */
  57. onReady: function() {
  58. },
  59. /**
  60. * 生命周期函数--监听页面显示
  61. */
  62. onShow: function() {
  63. },
  64. /**
  65. * 生命周期函数--监听页面隐藏
  66. */
  67. onHide: function() {
  68. },
  69. /**
  70. * 生命周期函数--监听页面卸载
  71. */
  72. onUnload: function() {
  73. },
  74. /**
  75. * 页面相关事件处理函数--监听用户下拉动作
  76. */
  77. onPullDownRefresh: function() {
  78. },
  79. /**
  80. * 页面上拉触底事件的处理函数
  81. */
  82. onReachBottom: function() {
  83. }
  84. })