修改部分功公共方法
This commit is contained in:
@@ -11,11 +11,15 @@ export function returnPackFee(arr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function canTuicai(orderInfo, item) {
|
export function canTuicai(orderInfo, item) {
|
||||||
|
if (orderInfo.status == 'unpaid' && orderInfo.isPostpaid !== null && orderInfo.isPostpaid == 0) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return orderInfo.status == 'unpaid' && orderInfo.useType != 'dine-in-before' && item.status != 'return'
|
return orderInfo.status == 'unpaid' && orderInfo.useType != 'dine-in-before' && item.status != 'return'
|
||||||
}
|
}
|
||||||
export function canTuiKuan(orderInfo, item) {
|
export function canTuiKuan(orderInfo, item) {
|
||||||
// 不是未支付退款等状态,也不是商品券抵扣才可以退款
|
// 已完成的订单,也不是商品券抵扣才可以退款
|
||||||
return orderInfo.status!='unpaid'&& item.status!='return'&&item.status!='refund'&&item.status!='refunding'&&!item.userCouponId
|
return orderInfo.status == 'closed' && item.status != 'return' && item.status != 'refund' && item.status !=
|
||||||
|
'refunding' && !item.userCouponId
|
||||||
}
|
}
|
||||||
export function isTui(item) {
|
export function isTui(item) {
|
||||||
return item.status == 'return' || item.status == 'refund' || item.status == 'refunding'
|
return item.status == 'return' || item.status == 'refund' || item.status == 'refunding'
|
||||||
|
|||||||
@@ -1,23 +1,32 @@
|
|||||||
import {
|
import {
|
||||||
getCurrentInstance,
|
getCurrentInstance,
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
export function getElRect(elClass, dataVal) {
|
export async function getElRect(elClass, instance,option) {
|
||||||
const instance = getCurrentInstance();
|
instance = instance ? instance : getCurrentInstance();
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
const query = uni.createSelectorQuery().in(instance.proxy);
|
const query = uni.createSelectorQuery().in(instance.proxy);
|
||||||
|
try{
|
||||||
|
const res= await getEle(query,elClass,option)
|
||||||
|
return res
|
||||||
|
}catch(e){
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function getEle(query,elClass,option){
|
||||||
|
return new Promise((resolve, reject)=>{
|
||||||
query.select('.' + elClass).fields({
|
query.select('.' + elClass).fields({
|
||||||
size: true
|
size: true,
|
||||||
|
...option
|
||||||
}, res => {
|
}, res => {
|
||||||
// 如果节点尚未生成,res值为null,循环调用执行
|
// 如果节点尚未生成,res值为null,循环调用执行
|
||||||
if (!res) {
|
if (!res) {
|
||||||
setTimeout(() => {
|
return setTimeout(() => {
|
||||||
getElRect(elClass);
|
getEle(query,elClass,option);
|
||||||
}, 10);
|
}, 10);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
resolve(res);
|
resolve(res);
|
||||||
}).exec();
|
}).exec();
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getSafeBottomHeight(className, height = 16) {
|
export async function getSafeBottomHeight(className, height = 16) {
|
||||||
|
|||||||
Reference in New Issue
Block a user