serviceOrderDetail.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. var util = require('../../../utils/util.js')
  2. Page({
  3. data: {
  4. orderId:null,
  5. detailObj: {},
  6. goodsList:[]
  7. },
  8. onLoad(options) {
  9. const id = options.id;
  10. this.setData({
  11. orderId: id
  12. });
  13. this.getDetail()
  14. },
  15. getDetail() {
  16. var send_data = [
  17. { "name": "getInstallationOrderById", "returntype": "Map", "parammaps": { "id": this.data.orderId } },
  18. {"name":"getInstallationOrderDetail","returntype":"Map","parammaps":{"orderId":this.data.orderId}},
  19. ]
  20. util.getDataByNames(send_data, this.handleDetail)
  21. },
  22. handleDetail(res) {
  23. var data = res.data;
  24. console.log(data,'详情')
  25. if (data.getInstallationOrderById.list != null) {
  26. let acceptanceImagePath = data.getInstallationOrderById.list[0].acceptanceImagePath;
  27. if(acceptanceImagePath) {
  28. data.getInstallationOrderById.list[0].acceptanceImagePath = acceptanceImagePath.split(',').map(path => getApp().globalData.g_url + path);
  29. }
  30. this.setData({
  31. detailObj: data.getInstallationOrderById.list[0],
  32. goodsList: data.getInstallationOrderDetail.list,
  33. })
  34. } else {
  35. this.setData({
  36. detailObj: {},
  37. goodsList:[]
  38. })
  39. }
  40. },
  41. onBack() {
  42. wx.navigateBack();
  43. },
  44. viewHistory() {
  45. var id = this.data.orderId;
  46. wx.navigateTo({
  47. url:`/pages/workbench/historyFill/historyFill?id=${id}`
  48. });
  49. },
  50. previewImage(e) {
  51. console.log(e)
  52. const urls = e.currentTarget.dataset.urls;
  53. const current = e.currentTarget.dataset.current;
  54. wx.previewImage({
  55. urls:[current], // 需要预览的图片链接列表
  56. current: current // 当前显示图片的链接
  57. });
  58. }
  59. });