see-logistics.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
  2. import tickleBehavior, { getTickleContext } from "../../../../core/behavior/tickle.behavior";
  3. import { getDietMethod } from "../../request";
  4. // module/diet/pages/delivery-address/delivery-address.ts
  5. Component({
  6. behaviors: [
  7. PageContainerBehavior,
  8. tickleBehavior,
  9. ],
  10. lifetimes: {
  11. attached() {
  12. }
  13. },
  14. properties: {
  15. },
  16. data: {
  17. goodsList: [
  18. {
  19. id: 1,
  20. img: 'https://pic.nximg.cn/file/20190718/28170468_214109363000_2.jpg',
  21. name: '元气茶',
  22. count: 3,
  23. expressNo: '00385322232830'
  24. },
  25. {
  26. id: 2,
  27. img: 'https://pic.nximg.cn/file/20190718/28170468_214109363000_2.jpg',
  28. name: '芡实米仁燕麦粥',
  29. count: 21,
  30. expressNo: '00385322290821'
  31. },
  32. {
  33. id: 3,
  34. img: 'https://pic.nximg.cn/file/20190718/28170468_214109363000_2.jpg',
  35. name: '复方膏贴',
  36. count: 10,
  37. expressNo: ''
  38. }
  39. ]
  40. },
  41. methods: {
  42. async load() {
  43. wx.showLoading({ title: '加载中' });
  44. try {
  45. const dataset = await getDietMethod(this.data.id);
  46. this.setData({ dataset, title: dataset.name });
  47. } catch (error) {
  48. getTickleContext.call(this).showWarnMessage(error.errMsg);
  49. }
  50. wx.hideLoading();
  51. },
  52. copyExpressNo(e) {
  53. wx.setClipboardData({
  54. data: e.currentTarget.dataset.no,
  55. success: () => wx.showToast({ title: '已复制', icon: 'none' })
  56. });
  57. }
  58. }
  59. })