diff --git a/pages.json b/pages.json
index 5e6eb3212a1dba6ff26aa24b06003fe7a8b4a0d0..16be72fb4cdd21db9dd73a0af8cbf4f7f6bd8b1a 100644
--- a/pages.json
+++ b/pages.json
@@ -1909,7 +1909,7 @@
}
},
// #endif
- // #ifdef APP-ANDROID || APP-IOS || WEB
+ // #ifdef APP-ANDROID || APP-IOS || WEB || MP
{
"path": "pages/template/custom-long-list/custom-long-list",
"style": {
diff --git a/pages/component/text/text-props.uvue b/pages/component/text/text-props.uvue
index 248c72dd324a7a99e40e6a56bf7b971c0d555616..19b3d70bbac5aa58666674c1541c45a0d84dab68 100644
--- a/pages/component/text/text-props.uvue
+++ b/pages/component/text/text-props.uvue
@@ -64,9 +64,7 @@
依次为lt gt amp apos nbsp ensp emsp效果
-
- < > & '
-
+ < > & '
uni-app x,终极跨平台方案
uni-app x,终极跨平台方案
uni-app x,终极跨平台方案
diff --git a/pages/tabBar/template.uvue b/pages/tabBar/template.uvue
index f465baefec1abd1e8b3cf6e5c5436696fa2e1989..496153eba537f2e4fb9fb78e153ca375bd0a82d7 100644
--- a/pages/tabBar/template.uvue
+++ b/pages/tabBar/template.uvue
@@ -195,14 +195,16 @@
open: false,
pages: [] as Page[],
},
- // #endif
+ // #endif
+ // #ifdef APP || WEB
{
id: 'schema',
url: 'schema',
name: '打开外部链接',
open: false,
pages: [] as Page[],
- },
+ },
+ // #endif
// #ifdef WEB
{
id: 'browser-element',
diff --git a/pages/template/half-screen/half-screen.uvue b/pages/template/half-screen/half-screen.uvue
index 6e9f8d66364cc53bb867bb592f5c4df869e955a8..b1d54c3a05a2300180e75d4b23fe7f323a288292 100644
--- a/pages/template/half-screen/half-screen.uvue
+++ b/pages/template/half-screen/half-screen.uvue
@@ -1,5 +1,5 @@
-
+
半屏弹窗,演示了弹出层内scroll-view滚动到顶时由滚变拖。本效果是通过监听TouchEvent实现,当半屏窗口移动时禁用scroll-view的滚动,避免两者的冲突。
@@ -56,7 +56,7 @@
//this.scrollNode?.setAttribute('scroll-y', 'false');
this.scrollNode?.setAttribute('direction', 'none');
// #endif
- // #ifdef WEB
+ // #ifdef WEB || MP
this.scrollDirection = 'none';
// #endif
this.halfNode?.style?.setProperty('transform', 'translateY(' + offset.toFixed(2) + 'px)');
@@ -71,7 +71,7 @@
//this.scrollNode?.setAttribute('scroll-y', 'true');
this.scrollNode?.setAttribute('direction', 'vertical');
// #endif
- // #ifdef WEB
+ // #ifdef WEB || MP
this.scrollDirection = 'vertical';
// #endif
this.halfNode?.style?.setProperty('transform', 'translateY(' + offset.toFixed(2) + 'px)');
@@ -110,7 +110,7 @@
//this.scrollNode?.setAttribute('scroll-y', 'true');
this.scrollNode?.setAttribute('direction', 'vertical');
// #endif
- // #ifdef WEB
+ // #ifdef WEB || MP
this.scrollDirection = 'vertical';
// #endif
this.halfScreenY = 0;
@@ -150,7 +150,7 @@
//this.scrollNode?.setAttribute('scroll-y', 'true');
this.scrollNode?.setAttribute('direction', 'vertical');
// #endif
- // #ifdef WEB
+ // #ifdef WEB || MP
this.scrollDirection = 'vertical';
// #endif
this.halfScreenY = 0;
@@ -164,24 +164,31 @@
},
onReady() {
this.halfNode = this.$refs['halfScreen'] as UniElement;//uni.getElementById('halfScreen');
- this.scrollNode = this.$refs['halfScroll'] as UniElement;//uni.getElementById('halfScroll');
-
- this.halfHeight = this.halfNode!.getBoundingClientRect().height;
- this.totalHeight = uni.getElementById('page')?.getBoundingClientRect()?.height ?? 0;//uni.getWindowInfo().windowHeight
- this.halfNode?.style?.setProperty('top', this.totalHeight.toFixed(2)+'px');
+ this.scrollNode = this.$refs['halfScroll'] as UniElement;//uni.getElementById('halfScroll');
+ this.halfNode!.getBoundingClientRectAsync().then((rect: DOMRect) => {
+ this.halfHeight = rect.height
+ });
+ (this.$refs['page'] as UniElement).getBoundingClientRectAsync().then((rect: DOMRect) => {
+ this.totalHeight = rect.height
+ this.halfNode?.style?.setProperty('top', this.totalHeight.toFixed(2)+'px');
+ });
},
- onResize() {
- this.halfHeight = this.halfNode?.getBoundingClientRect()?.height ?? 0;
+ onResize() {
+ this.halfNode?.getBoundingClientRectAsync().then((rect: DOMRect) => {
+ this.halfHeight = rect.height
+ });
this.totalHeight = uni.getWindowInfo().windowHeight;
this.halfNode?.style?.setProperty('top', this.totalHeight.toFixed(2)+'px');
this.halfNode?.style?.setProperty('visibility', 'hidden');
},
onBackPress(): boolean {
+ // #ifndef MP
if('visible' == this.halfNode?.style?.getPropertyValue('visibility')){
this.switchHalfScreen(false);
return true;
}
return false;
+ // #endif
}
}
diff --git a/pages/template/scroll-fold-nav/scroll-fold-nav.uvue b/pages/template/scroll-fold-nav/scroll-fold-nav.uvue
index e64cb41c993e8202adf7d14f54922604354626a5..c848c062608116030b13b81741d709df7eadcb94 100644
--- a/pages/template/scroll-fold-nav/scroll-fold-nav.uvue
+++ b/pages/template/scroll-fold-nav/scroll-fold-nav.uvue
@@ -49,7 +49,7 @@
}
},
onLoad() {
- // #ifdef APP
+ // #ifdef APP || MP
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
// #endif
this.nviBarHeight = NAVIBARHEIGHT + this.statusBarHeight;
diff --git a/pages/template/swiper-vertical-video/swiper-vertical-video.uvue b/pages/template/swiper-vertical-video/swiper-vertical-video.uvue
index d462a9a016aa48ac79aec27a0462883416cbd442..c3d2cc4ce0ee228734afa672a9a2228ea58ec577 100644
--- a/pages/template/swiper-vertical-video/swiper-vertical-video.uvue
+++ b/pages/template/swiper-vertical-video/swiper-vertical-video.uvue
@@ -87,7 +87,7 @@
onReady() {
// 一启动完成,就播放第一个
this.doPlay(0);
- // #ifdef APP
+ // #ifdef APP || MP
//App端适配不同状态栏高度
let backElement = this.$refs['back'] as UniElement;
backElement.style.setProperty('top', uni.getSystemInfoSync().statusBarHeight+'px');