index.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. lifetimes: {
  14. attached: function () {
  15. getApp().globalData.Language.getLanguagePackage(this)
  16. }
  17. },
  18. methods: {
  19. copyNum(e) {
  20. if (this.data.un) wx.setClipboardData({
  21. data: this.data.un,
  22. success: function (res) {
  23. getApp().globalData.Language.showToast('快递单号复制成功')
  24. }
  25. })
  26. },
  27. getList(id) {
  28. let content = this.data.content;
  29. content.sa_logisticsid = id;
  30. _Http.basic({
  31. "id": "20230110135004",
  32. content
  33. }).then(res => {
  34. console.log("物流查询", res)
  35. if (res.code != '1') return wx.showToast({
  36. title: JSON.parse(res.msg).message,
  37. icon: "none"
  38. })
  39. if (res.data.message) this.setData({
  40. steps: res.data.data.map(v => {
  41. return {
  42. text: v.time,
  43. desc: v.context
  44. }
  45. }),
  46. nu: res.data.nu,
  47. "content.total": 1,
  48. sa_logisticsid: id
  49. })
  50. })
  51. }
  52. }
  53. })