meeting-inspection-history-detail.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // pages/meeting-inspection-history-detail/meeting-inspection-history-detail.js
  2. const util = require('../../utils/util.js');
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. list: []
  9. },
  10. /**
  11. * 生命周期函数--监听页面加载
  12. */
  13. onLoad: function (options) {
  14. let that = this;
  15. util.post({
  16. url: '/api/inspection/record/queryDetails',
  17. header: {
  18. 'content-type': 'application/x-www-form-urlencoded'
  19. },
  20. data: {
  21. id: options.id
  22. },
  23. success: (res) => {
  24. console.info(res)
  25. wx.hideLoading();
  26. let arr = res.data.data.inspectionResultVoList;
  27. for (let i in arr) {
  28. if (arr[i].result == 10) {
  29. arr[i].results = '正常';
  30. arr[i].color = '#2EC3CD';
  31. } else {
  32. arr[i].results = '不正常';
  33. arr[i].color = '#E95543';
  34. }
  35. }
  36. that.setData({
  37. list: arr
  38. });
  39. }
  40. });
  41. },
  42. /**
  43. * 生命周期函数--监听页面初次渲染完成
  44. */
  45. onReady: function () {
  46. },
  47. /**
  48. * 生命周期函数--监听页面显示
  49. */
  50. onShow: function () {
  51. },
  52. /**
  53. * 生命周期函数--监听页面隐藏
  54. */
  55. onHide: function () {
  56. },
  57. /**
  58. * 生命周期函数--监听页面卸载
  59. */
  60. onUnload: function () {
  61. },
  62. /**
  63. * 页面相关事件处理函数--监听用户下拉动作
  64. */
  65. onPullDownRefresh: function () {
  66. },
  67. /**
  68. * 页面上拉触底事件的处理函数
  69. */
  70. onReachBottom: function () {
  71. },
  72. /**
  73. * 用户点击右上角分享
  74. */
  75. onShareAppMessage: function () {
  76. }
  77. })