index.js 3.2 KB

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