aftersaleDetail.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. var util = require('../../../utils/util.js');
  2. var api = require('../../../config/api.js');
  3. Page({
  4. data: {
  5. orderId: 0,
  6. order: {},
  7. orderGoods: [],
  8. aftersale: {},
  9. statusColumns: ['未申请', '已申请,待审核', '审核通过,待退款', '退款成功', '审核不通过,已拒绝'],
  10. typeColumns: ['未收货退款', '不退货退款', '退货退款'],
  11. fileList: []
  12. },
  13. onLoad: function (options) {
  14. // 页面初始化 options为页面跳转所带来的参数
  15. this.setData({
  16. orderId: options.id
  17. });
  18. this.getAftersaleDetail();
  19. },
  20. getAftersaleDetail: function () {
  21. wx.showLoading({
  22. title: '加载中',
  23. });
  24. setTimeout(function () {
  25. wx.hideLoading()
  26. }, 2000);
  27. let that = this;
  28. util.request(api.AftersaleDetail, {
  29. orderId: that.data.orderId
  30. }).then(function (res) {
  31. if (res.errno === 0) {
  32. let _fileList = []
  33. res.data.aftersale.pictures.forEach(function (v) {
  34. _fileList.push({
  35. url: v
  36. })
  37. });
  38. that.setData({
  39. order: res.data.order,
  40. orderGoods: res.data.orderGoods,
  41. aftersale: res.data.aftersale,
  42. fileList: _fileList
  43. });
  44. }
  45. wx.hideLoading();
  46. });
  47. },
  48. onReady: function () {
  49. // 页面渲染完成
  50. },
  51. onShow: function () {
  52. // 页面显示
  53. },
  54. onHide: function () {
  55. // 页面隐藏
  56. },
  57. onUnload: function () {
  58. // 页面关闭
  59. }
  60. })