cleanReport.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // pages/my/cleanReport/cleanReport.js
  2. var app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. id: '',
  9. info: ''
  10. },
  11. /**
  12. * 生命周期函数--监听页面加载
  13. */
  14. onLoad: function (options) {
  15. this.setData({id:options.id})
  16. },
  17. onShow(){
  18. this.detail()
  19. },
  20. detail() {
  21. var that = this;
  22. app.api.useApi(app.globalData.baseAppUrl + "api/CleaningReport", {
  23. order_id: that.data.id,
  24. }, "get").then(function (res) {
  25. if (res.code != 200) {
  26. wx.showLoading({
  27. title: res.message.msg,
  28. })
  29. setTimeout(function () {
  30. wx.hideLoading({
  31. success: (res) => { },
  32. })
  33. }, 2000);
  34. } else {
  35. that.setData({info:res.message.data})
  36. console.log(res.message.data);
  37. }
  38. }).catch(function (err) {
  39. console.log(222);
  40. })
  41. },
  42. previewImg(e){
  43. let that = this;
  44. wx.previewImage({
  45. current:e.currentTarget.dataset.src, //当前图片地址
  46. urls: e.currentTarget.dataset.list, //所有要预览的图片的地址集合 数组形式
  47. })
  48. }
  49. })