| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
- import tickleBehavior, { getTickleContext } from "../../../../core/behavior/tickle.behavior";
- import { getDietMethod } from "../../request";
- // module/diet/pages/delivery-address/delivery-address.ts
- Component({
- behaviors: [
- PageContainerBehavior,
- tickleBehavior,
- ],
- lifetimes: {
- attached() {
- }
- },
- properties: {
- },
- data: {
- goodsList: [
- {
- id: 1,
- img: 'https://pic.nximg.cn/file/20190718/28170468_214109363000_2.jpg',
- name: '元气茶',
- count: 3,
- expressNo: '00385322232830'
- },
- {
- id: 2,
- img: 'https://pic.nximg.cn/file/20190718/28170468_214109363000_2.jpg',
- name: '芡实米仁燕麦粥',
- count: 21,
- expressNo: '00385322290821'
- }
- ]
- },
- methods: {
-
- async load() {
- wx.showLoading({ title: '加载中' });
- try {
- const dataset = await getDietMethod(this.data.id);
- this.setData({ dataset, title: dataset.name });
- } catch (error) {
- getTickleContext.call(this).showWarnMessage(error.errMsg);
- }
- wx.hideLoading();
- },
- copyExpressNo(e) {
- wx.setClipboardData({
- data: e.currentTarget.dataset.no,
- success: () => wx.showToast({ title: '已复制', icon: 'none' })
- });
- },
- onCancel() {
- // 关闭弹窗或返回
- wx.navigateBack();
- },
- // 确认收货逻辑
- onConfirmReceiving() {
- // 确认收货逻辑
- wx.showToast({ title: '确认收货成功', icon: 'success' });
- }
- }
- })
|