cleanReport.js 1.9 KB

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