const computedBehavior = require('miniprogram-computed')
Component({
behaviors: [computedBehavior.behavior],
properties: {
data: {
type: Object,
value: {
orderSource: '',
orderStatus: -1
}
}
},
data: {},
computed: {
isShowCancelBtn(data) {
if (!data.data) {
return false
}
const { orderSource, orderStatus, dtype, timeEnd } = data.data
if (dtype === 6) {
return false
}
if (orderStatus !== 1) {
return false
}
if (dtype === 3) {
return true
}
if (![9, 16, 5].includes(orderSource) && timeEnd) {
return true
}
return false
},
},
})