visitorcheck.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. approvalNum:0,
  11. approvedNum:0,
  12. list: []
  13. },
  14. checkTab: function(e) {
  15. const that = this;
  16. that.setData({
  17. isregiste: !that.data.isregiste
  18. })
  19. if (that.data.isregiste) {
  20. that.getVisitorCheckInfo(2);
  21. } else {
  22. that.getVisitorCheckInfo(3);
  23. }
  24. },
  25. todetail: function(e) {
  26. wx.navigateTo({
  27. url: '../visitorcheckdetail/visitorcheckdetail',
  28. })
  29. },
  30. getVisitorCheckInfo: function(status) {
  31. const that = this;
  32. util.httpRequest(api.getVisitorCheckInfo, {
  33. status: status,
  34. rows: 20,
  35. page: 1
  36. }, 'post').then(res => {
  37. that.setData({
  38. list: res.data.data.data,
  39. approvalNum:res.data.data.approval,
  40. approvedNum:res.data.data.approved
  41. })
  42. })
  43. },
  44. /**
  45. * 生命周期函数--监听页面加载
  46. */
  47. onLoad: function(options) {
  48. const that = this;
  49. that.getVisitorCheckInfo(2);
  50. },
  51. /**
  52. * 生命周期函数--监听页面初次渲染完成
  53. */
  54. onReady: function() {
  55. },
  56. /**
  57. * 生命周期函数--监听页面显示
  58. */
  59. onShow: function() {
  60. },
  61. /**
  62. * 生命周期函数--监听页面隐藏
  63. */
  64. onHide: function() {
  65. },
  66. /**
  67. * 生命周期函数--监听页面卸载
  68. */
  69. onUnload: function() {
  70. },
  71. /**
  72. * 页面相关事件处理函数--监听用户下拉动作
  73. */
  74. onPullDownRefresh: function() {
  75. },
  76. /**
  77. * 页面上拉触底事件的处理函数
  78. */
  79. onReachBottom: function() {
  80. }
  81. })