detail.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. // pages/repairs/detail.js
  2. const util = require('../../utils/util.js');
  3. const app = getApp();
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. values:{
  10. repairsBy:'',
  11. repairsPhone:'',
  12. expressCompany:'',
  13. expressSn:'',
  14. area:'',
  15. address:'',
  16. deviceId:'',
  17. deviceSn:'',
  18. repairsRemark:'',
  19. auditStatus:'',
  20. },
  21. repairsId:''
  22. },
  23. /**
  24. * 生命周期函数--监听页面加载
  25. */
  26. onLoad: function (options) {
  27. this.setData({
  28. repairsId: options.repairsId
  29. })
  30. this.detailRepair()
  31. },
  32. /**
  33. * 生命周期函数--监听页面初次渲染完成
  34. */
  35. onReady: function () {
  36. },
  37. /**
  38. * 生命周期函数--监听页面显示
  39. */
  40. onShow: function () {
  41. },
  42. /**
  43. * 生命周期函数--监听页面隐藏
  44. */
  45. onHide: function () {
  46. },
  47. /**
  48. * 生命周期函数--监听页面卸载
  49. */
  50. onUnload: function () {
  51. },
  52. /**
  53. * 页面相关事件处理函数--监听用户下拉动作
  54. */
  55. onPullDownRefresh: function () {
  56. },
  57. /**
  58. * 页面上拉触底事件的处理函数
  59. */
  60. onReachBottom: function () {
  61. },
  62. /**
  63. * 用户点击右上角分享
  64. */
  65. onShareAppMessage: function () {
  66. },
  67. closeDetail(){
  68. wx.navigateTo({
  69. url: '/pages/repairs/index',
  70. })
  71. },
  72. detailRepair(){
  73. var that = this
  74. util.request(util.api.queryByRepairsId, {id:that.data.repairsId}, "GET", false, true,app.globalData.token).then((res)=>{
  75. if (res.code == 200) {
  76. that.setData({
  77. values: res.result
  78. })
  79. }
  80. }).catch((res) => {})
  81. },
  82. })