index.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. const _my = require("../../../__antmove/api/index.js")(my);
  2. const wx = _my;
  3. import { recentMeetingRecord, } from "../../../utils/api/meeting";
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. list: [],
  10. tomorrowList: [],
  11. //tab的current
  12. currentPage: 0,
  13. searchData: {
  14. data: {
  15. status: null
  16. },
  17. pageNum: 1,
  18. pageSize: 1000,
  19. },
  20. total: 0,
  21. type: "meeting-record"
  22. },
  23. // 获取列表 type-> 1:初始化 2:下拉加载 currentPage-> 0全部1审核中2通过3不通过
  24. getList(type) {
  25. let {
  26. searchData,
  27. list,
  28. tomorrowList,
  29. currentPage
  30. } = this.data;
  31. if (currentPage == 0) {
  32. searchData.data.status = null;
  33. } else if (currentPage == 1) {
  34. searchData.data.status = 2
  35. } else if (currentPage == 2) {
  36. searchData.data.status = 3
  37. } else if (currentPage == 3) {
  38. searchData.data.status = 4
  39. }
  40. searchData.pageNum = type === 1 ? 1 : searchData.pageNum + 1;
  41. this.setData({
  42. "searchData.pageNum": searchData.pageNum
  43. });
  44. wx.showLoading({
  45. title: "加载中"
  46. });
  47. recentMeetingRecord({
  48. status: searchData.data.status
  49. }).then(res => {
  50. list = res.data.todayMeetingRecords
  51. tomorrowList = res.data.tomorrowMeetingRecords
  52. this.setData({
  53. list,
  54. tomorrowList
  55. });
  56. wx.hideLoading();
  57. });
  58. },
  59. // scrollView触底事件
  60. reachBottom(e) {
  61. },
  62. //获得切换tab的index
  63. changeSwiper(e) {
  64. var {
  65. currentPage
  66. } = this.data;
  67. switch (e.currentTarget.dataset.type) {
  68. case "click":
  69. currentPage = e.currentTarget.dataset.index;
  70. break;
  71. case "slide":
  72. currentPage = e.detail.current;
  73. break;
  74. default:
  75. break;
  76. }
  77. this.setData({
  78. currentPage
  79. });
  80. this.getList(1);
  81. },
  82. /**
  83. * 生命周期函数--监听页面加载
  84. */
  85. onLoad(options) {
  86. if (options.type) {
  87. this.setData({
  88. type: options.type
  89. });
  90. }
  91. },
  92. /**
  93. * 生命周期函数--监听页面初次渲染完成
  94. */
  95. onReady() { },
  96. /**
  97. * 生命周期函数--监听页面显示
  98. */
  99. onShow() {
  100. this.getList(1);
  101. },
  102. /**
  103. * 生命周期函数--监听页面隐藏
  104. */
  105. onHide() { },
  106. /**
  107. * 生命周期函数--监听页面卸载
  108. */
  109. onUnload() { },
  110. /**
  111. * 页面相关事件处理函数--监听用户下拉动作
  112. */
  113. onPullDownRefresh() { },
  114. /**
  115. * 页面上拉触底事件的处理函数
  116. */
  117. onReachBottom() { },
  118. /**
  119. * 用户点击右上角分享
  120. */
  121. onShareAppMessage() { },
  122. antmoveAction: function () {
  123. //执行时动态赋值,请勿删除
  124. }
  125. });