You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.2 KiB
57 lines
1.2 KiB
function isEmpty(val) {
|
|
return typeof val === 'undefined' || val === '' || val === null
|
|
}
|
|
|
|
function orderStatus(status) {
|
|
if (status == 1) {
|
|
return '待付诚意金'
|
|
} else if (status == 2) {
|
|
return '待上传资料'
|
|
} else if (status == 3) {
|
|
return '待上传资料确认'
|
|
} else if (status == 4) {
|
|
return '待支付尾款'
|
|
} else if (status == 5) {
|
|
return '待收货'
|
|
} else if (status == 6) {
|
|
return '待扣点确认'
|
|
} else if (status == 7) {
|
|
return '待退货确认'
|
|
} else if (status == 8) {
|
|
return '已完成'
|
|
} else if (status == 9) {
|
|
return '已关闭'
|
|
}
|
|
return ''
|
|
}
|
|
|
|
function cancelOrder(type, status){
|
|
if(parseInt(type) == 0){
|
|
var statusList = [1, 2, 3, 4]
|
|
for (var index = 0; index < statusList.length; index++) {
|
|
if(parseInt(status) == statusList[index]){
|
|
return true
|
|
}
|
|
}
|
|
} else {
|
|
|
|
}
|
|
return false
|
|
}
|
|
|
|
function formateWeight(value, kg) {
|
|
if (value || value == 0) {
|
|
if(kg){
|
|
return (parseFloat(value)).toFixed(1) + 'KG'
|
|
} else {
|
|
return (parseFloat(value) / 1000).toFixed(3) + '吨'
|
|
}
|
|
}
|
|
return ''
|
|
}
|
|
|
|
module.exports = {
|
|
orderStatus: orderStatus,
|
|
cancelOrder: cancelOrder,
|
|
formateWeight: formateWeight
|
|
}
|