detail.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. console.log(options)
  28. this.setData({
  29. repairsId: options.repairsId
  30. })
  31. this.detailRepair()
  32. },
  33. /**
  34. * 生命周期函数--监听页面初次渲染完成
  35. */
  36. onReady: function () {
  37. },
  38. /**
  39. * 生命周期函数--监听页面显示
  40. */
  41. onShow: function () {
  42. },
  43. /**
  44. * 生命周期函数--监听页面隐藏
  45. */
  46. onHide: function () {
  47. },
  48. /**
  49. * 生命周期函数--监听页面卸载
  50. */
  51. onUnload: function () {
  52. },
  53. /**
  54. * 页面相关事件处理函数--监听用户下拉动作
  55. */
  56. onPullDownRefresh: function () {
  57. },
  58. /**
  59. * 页面上拉触底事件的处理函数
  60. */
  61. onReachBottom: function () {
  62. },
  63. /**
  64. * 用户点击右上角分享
  65. */
  66. onShareAppMessage: function () {
  67. },
  68. closeDetail(){
  69. wx.navigateTo({
  70. url: '/pages/repairs/index',
  71. })
  72. },
  73. detailRepair(){
  74. var that = this
  75. util.request(util.api.queryByRepairsId, {id:that.data.repairsId}, "GET", false, true,app.globalData.token).then((res)=>{
  76. if (res.code == 200) {
  77. that.setData({
  78. values: res.result
  79. })
  80. }
  81. }).catch((res) => {})
  82. },
  83. })