index.js 955 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. data: {
  4. steps: [],
  5. sa_logisticsid: 0,
  6. content: {
  7. nocache: true,
  8. pageNumber: 1,
  9. pageTotal: 1,
  10. total: null
  11. }
  12. },
  13. methods: {
  14. copyNum(e) {
  15. if (this.data.un) wx.setClipboardData({
  16. data: this.data.un,
  17. success: function (res) {
  18. wx.showToast({
  19. title: '快递单号复制成功',
  20. icon: "none"
  21. })
  22. }
  23. })
  24. },
  25. getList(id) {
  26. let content = this.data.content;
  27. content.sa_logisticsid = id;
  28. _Http.basic({
  29. "id": "20230110135004",
  30. content
  31. }).then(res => {
  32. console.log("物流查询", res)
  33. if (res.msg != '成功') return wx.showToast({
  34. title: res.msg,
  35. icon: "none"
  36. })
  37. if (res.data.message) this.setData({
  38. steps: res.data.data.map(v => {
  39. return {
  40. text: v.time,
  41. desc: v.context
  42. }
  43. }),
  44. nu: res.data.nu,
  45. "content.total": 1,
  46. sa_logisticsid: id
  47. })
  48. })
  49. }
  50. }
  51. })