65 lines
1.5 KiB
JavaScript
65 lines
1.5 KiB
JavaScript
import { stateType } from '../../constants/index';
|
|
import { img_url } from '../../utils/util';
|
|
|
|
Component({
|
|
properties: {
|
|
isTopShow: { // 接口通过后根据传递订单编号判断是否展示头部区域
|
|
type: String,
|
|
value: '',
|
|
},
|
|
isBottomShow: { // 是否显示底部按钮
|
|
type: Boolean,
|
|
value: false,
|
|
},
|
|
shopInfoShow: { // 是否展示商铺信息
|
|
type: Boolean,
|
|
value: false,
|
|
},
|
|
state: { // 商品状态 默认不展示
|
|
type: Boolean,
|
|
value: false
|
|
},
|
|
headerText: {
|
|
type: String,
|
|
value: '',
|
|
},
|
|
headerDesc: {
|
|
type: String,
|
|
value: ''
|
|
},
|
|
item: {
|
|
type: Object,
|
|
value: null,
|
|
}
|
|
|
|
},
|
|
data: {
|
|
stateType,
|
|
picUrl: img_url,
|
|
},
|
|
|
|
methods: {
|
|
handleLeftClick(e) {
|
|
const { id } = e.currentTarget.dataset;
|
|
this.triggerEvent('orde', id)
|
|
},
|
|
// 详情点击事件
|
|
handleOptionClick(e) {
|
|
const { id, ordersn } = e.currentTarget.dataset;
|
|
// 触发父组件方法 传递订单id 及订单编号
|
|
this.triggerEvent('details', {id, ordersn});
|
|
},
|
|
handleRigthClick(e) {
|
|
const { item } = e.currentTarget.dataset;
|
|
if (item.status !== 1) {
|
|
wx.showToast({
|
|
title: '当前订单状态无法进行支付',
|
|
icon: 'none',
|
|
})
|
|
return;
|
|
}
|
|
// 触发父组件方法
|
|
this.triggerEvent('goPay', item);
|
|
}
|
|
}
|
|
}) |