视频播放列表更新,增加分享海报生成

This commit is contained in:
2025-01-10 18:24:40 +08:00
parent df3bc23cfc
commit 4a141878f2
34 changed files with 3399 additions and 1752 deletions

View File

@@ -1,3 +1,39 @@
export function isEmpty(val){
return val===null||val===undefined||val===''
}
import {
getCurrentInstance,
} from 'vue';
export async function getElRect(elClass, instance,option) {
instance = instance ? instance : getCurrentInstance();
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({
size: true,
...option
}, res => {
// 如果节点尚未生成res值为null循环调用执行
if (!res) {
return setTimeout(() => {
getEle(query,elClass,option);
}, 10);
}
resolve(res);
}).exec();
})
}
export async function getSafeBottomHeight(className, height = 16) {
const bottomEle = await getElRect(className)
return bottomEle.height + height
}