未开启关怀模式的字体大小如图:
开启关怀模式后,字体跟随系统变大,导致展示不全
用这段js代码强制去刷还是不行:
var id = setInterval(() => {
setStyle()
},100)
function setStyle(){
var getBlessingValue = Forguncy.Page.getCell("blessing").getValue()
getBlessingValue && clearInterval(id);
if (getBlessingValue) {
if (isWeChatWorkDesktop()) {
setTimeout(function() {
Forguncy.Page.getCell("blessing")._pageCell.cellType._containerCache[0].style.lineHeight = "40px";
Forguncy.Page.getCell("blessing")._pageCell.cellType._containerCache[0].children[0].children[0].children[0].style.fontSize = "23px"
Forguncy.Page.getCell("nowDate")._pageCell.cellType._containerCache[0].children[0].children[0].children[0].style.fontSize = "18px"
}, 50);
}else{
setTimeout(function() {
Forguncy.Page.getCell("blessing")._pageCell.cellType._containerCache[0].style.lineHeight = "28px";
Forguncy.Page.getCell("blessing")._pageCell.cellType._containerCache[0].children[0].children[0].children[0].style.fontSize = "16px"
Forguncy.Page.getCell("nowDate")._pageCell.cellType._containerCache[0].children[0].children[0].children[0].style.fontSize = "12px"
}, 50);
}
}
}
function isWeChatWorkMobile() {
var userAgent = navigator.userAgent.toLowerCase();
return userAgent.includes("wxwork") && userAgent.includes("mobile");
}
function isWeChatWorkDesktop() {
var userAgent = navigator.userAgent.toLowerCase();
return userAgent.includes("wxwork") && !userAgent.includes("mobile");
}
活字格内页面:
|