增加代客下单,商品公共处理函数
This commit is contained in:
22
commons/utils/goodsUtil.js
Normal file
22
commons/utils/goodsUtil.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
export function canComputedPackFee(v) {
|
||||||
|
return v => v.pack && v.status != 'return' && v.status != 'refund' && v.status != 'refunding'
|
||||||
|
}
|
||||||
|
export function returnCanComputedGoodsArr(arr) {
|
||||||
|
return arr.filter(v=>canComputedPackFee(v))
|
||||||
|
}
|
||||||
|
export function returnPackFee(arr) {
|
||||||
|
return arr.reduce((prve, cur) => {
|
||||||
|
return prve + cur.packAmount
|
||||||
|
}, 0).toFixed(2)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function canTuicai(orderInfo,item){
|
||||||
|
return orderInfo.status=='unpaid'&&orderInfo.useType!='dine-in-before'
|
||||||
|
}
|
||||||
|
export function canTuiKuan(orderInfo,item){
|
||||||
|
|
||||||
|
return orderInfo.status!='unpaid'&& item.status!='return'&&item.status!='refund'&&item.status!='refunding'
|
||||||
|
}
|
||||||
|
export function isTui(item){
|
||||||
|
return item.status=='return'||item.status=='refund'||item.status=='refunding'
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user