confirm-receiving.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. },
  34. methods: {
  35. async load() {
  36. wx.showLoading({ title: '加载中' });
  37. try {
  38. const dataset = await getDietMethod(this.data.id);
  39. this.setData({ dataset, title: dataset.name });
  40. } catch (error) {
  41. getTickleContext.call(this).showWarnMessage(error.errMsg);
  42. }
  43. wx.hideLoading();
  44. },
  45. copyExpressNo(e) {
  46. wx.setClipboardData({
  47. data: e.currentTarget.dataset.no,
  48. success: () => wx.showToast({ title: '已复制', icon: 'none' })
  49. });
  50. },
  51. onCancel() {
  52. // 关闭弹窗或返回
  53. wx.navigateBack();
  54. },
  55. // 确认收货逻辑
  56. onConfirmReceiving() {
  57. // 确认收货逻辑
  58. wx.showToast({ title: '确认收货成功', icon: 'success' });
  59. }
  60. }
  61. })