提交 5c285042 编写于 作者: W wangjinxin613

Merge branch 'dev' of gitcode.net:dcloud/hello-uvue into dev

......@@ -161,7 +161,7 @@ describe("shot-compare", () => {
// set webview-screenshot-comparison page baseSrc
baseSrc =
process.env.UNI_WEB_SERVICE_URL ? `${process.env.UNI_WEB_SERVICE_URL}/#/` :
"http://192.168.31.223:5173/#/";
"http://test.dcloud.io/unix_h5_build/98_dev_hello-uvue/#/";
page.setData({
baseSrc,
});
......@@ -217,7 +217,7 @@ describe("shot-compare", () => {
const isLoaded = await page.data("isLoaded");
return isLoaded || Date.now() - startTime > 3000;
});
await page.waitFor(4500);
await page.waitFor(800);
// web 端非 adb 截图时设置 offsetY 移除导航栏
const webSnapshot = await program.screenshot({
......
......@@ -27,33 +27,15 @@
this.webviewContext = uni.createWebviewContext('webview-screenshot-comparison', this)
},
methods: {
customNavigationBarPageAppendWebHeadPlaceholder() {
if (this.src.indexOf('pages/template/navbar-lite/navbar-lite') > -1) {
this.webviewContext?.evalJS(`
const uniNavbar = document.querySelector('.uni-navbar');
uniNavbar.style.paddingTop = '${this.statusBarHeight}px';
`)
} else if (this.src.indexOf('pages/template/scroll-fold-nav/scroll-fold-nav') > -1) {
this.webviewContext?.evalJS(`
const heightSeat = document.querySelector('.height-seat');
heightSeat.style.height = '125px';
heightSeat.style.backgroundColor = '#f0f8ff';
const topBox = document.querySelector('.top-box');
topBox.style.top = '35px';
`)
}
},
loaded() {
this.isLoaded = true
this.customNavigationBarPageAppendWebHeadPlaceholder();
},
error(event : WebViewErrorEvent) {
console.log('webview load error', JSON.stringify(event.detail));
},
getWindowInfo() {
const res = uni.getWindowInfo();
// 获取状态栏+导航栏高度, 供截图对比使用
// 获取状态栏, 供截图对比使用
this.statusBarHeight = res.statusBarHeight;
},
getDeviceInfo: function () {
......
......@@ -152,7 +152,7 @@ describe("shot-compare", () => {
// set webview-screenshot page baseSrc
baseSrc =
process.env.UNI_WEB_SERVICE_URL ? `${process.env.UNI_WEB_SERVICE_URL}/#/` :
"http://192.168.31.223:5173/#/";
"http://test.dcloud.io/unix_h5_build/98_dev_hello-uvue/#/";
page.setData({
baseSrc,
});
......@@ -208,8 +208,7 @@ describe("shot-compare", () => {
const isLoaded = await page.data("isLoaded");
return isLoaded || Date.now() - startTime > 3000;
});
await page.waitFor(5000)
await page.waitFor(800);
// web 端非 adb 截图时设置 offsetY 移除导航栏
const webSnapshot = await program.screenshot({
......
......@@ -34,7 +34,7 @@
},
getWindowInfo() {
const res = uni.getWindowInfo();
// 获取状态栏+导航栏高度, 供截图对比使用
// 获取状态栏, 供截图对比使用
this.headerHeight = res.statusBarHeight;
},
getDeviceInfo: function () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册