Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
ad35ce84
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6013
Star
91
Fork
164
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
ad35ce84
编写于
11月 15, 2024
作者:
雪洛
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 调整示例项目适配微信小程序
上级
80d76507
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
27 addition
and
20 deletion
+27
-20
pages.json
pages.json
+1
-1
pages/component/text/text-props.uvue
pages/component/text/text-props.uvue
+1
-3
pages/tabBar/template.uvue
pages/tabBar/template.uvue
+4
-2
pages/template/half-screen/half-screen.uvue
pages/template/half-screen/half-screen.uvue
+19
-12
pages/template/scroll-fold-nav/scroll-fold-nav.uvue
pages/template/scroll-fold-nav/scroll-fold-nav.uvue
+1
-1
pages/template/swiper-vertical-video/swiper-vertical-video.uvue
...template/swiper-vertical-video/swiper-vertical-video.uvue
+1
-1
未找到文件。
pages.json
浏览文件 @
ad35ce84
...
@@ -1909,7 +1909,7 @@
...
@@ -1909,7 +1909,7 @@
}
}
},
},
//
#endif
//
#endif
//
#ifdef
APP-ANDROID
||
APP-IOS
||
WEB
//
#ifdef
APP-ANDROID
||
APP-IOS
||
WEB
||
MP
{
{
"path"
:
"pages/template/custom-long-list/custom-long-list"
,
"path"
:
"pages/template/custom-long-list/custom-long-list"
,
"style"
:
{
"style"
:
{
...
...
pages/component/text/text-props.uvue
浏览文件 @
ad35ce84
...
@@ -64,9 +64,7 @@
...
@@ -64,9 +64,7 @@
<text class="uni-subtitle-text">依次为lt gt amp apos nbsp ensp emsp效果</text>
<text class="uni-subtitle-text">依次为lt gt amp apos nbsp ensp emsp效果</text>
</view>
</view>
<view class="text-box">
<view class="text-box">
<!-- #ifndef MP-WEIXIN -->
<text :decode="true">< > & '</text>
<text :decode="true">< > & '</text>
<!-- #endif -->
<text :decode="true">uni-app x,终极跨平台方案</text>
<text :decode="true">uni-app x,终极跨平台方案</text>
<text :decode="true">uni-app x,终极跨平台方案</text>
<text :decode="true">uni-app x,终极跨平台方案</text>
<text :decode="true">uni-app x,终极跨平台方案</text>
<text :decode="true">uni-app x,终极跨平台方案</text>
...
...
pages/tabBar/template.uvue
浏览文件 @
ad35ce84
...
@@ -195,14 +195,16 @@
...
@@ -195,14 +195,16 @@
open: false,
open: false,
pages: [] as Page[],
pages: [] as Page[],
},
},
// #endif
// #endif
// #ifdef APP || WEB
{
{
id: 'schema',
id: 'schema',
url: 'schema',
url: 'schema',
name: '打开外部链接',
name: '打开外部链接',
open: false,
open: false,
pages: [] as Page[],
pages: [] as Page[],
},
},
// #endif
// #ifdef WEB
// #ifdef WEB
{
{
id: 'browser-element',
id: 'browser-element',
...
...
pages/template/half-screen/half-screen.uvue
浏览文件 @
ad35ce84
<template>
<template>
<view
id
="page" class="page">
<view
ref
="page" class="page">
<text
<text
style="margin: 10px">半屏弹窗,演示了弹出层内scroll-view滚动到顶时由滚变拖。本效果是通过监听TouchEvent实现,当半屏窗口移动时禁用scroll-view的滚动,避免两者的冲突。</text>
style="margin: 10px">半屏弹窗,演示了弹出层内scroll-view滚动到顶时由滚变拖。本效果是通过监听TouchEvent实现,当半屏窗口移动时禁用scroll-view的滚动,避免两者的冲突。</text>
<button class="bottomButton" @click="switchHalfScreen(true)">打开弹窗</button>
<button class="bottomButton" @click="switchHalfScreen(true)">打开弹窗</button>
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
//this.scrollNode?.setAttribute('scroll-y', 'false');
//this.scrollNode?.setAttribute('scroll-y', 'false');
this.scrollNode?.setAttribute('direction', 'none');
this.scrollNode?.setAttribute('direction', 'none');
// #endif
// #endif
// #ifdef WEB
// #ifdef WEB
|| MP
this.scrollDirection = 'none';
this.scrollDirection = 'none';
// #endif
// #endif
this.halfNode?.style?.setProperty('transform', 'translateY(' + offset.toFixed(2) + 'px)');
this.halfNode?.style?.setProperty('transform', 'translateY(' + offset.toFixed(2) + 'px)');
...
@@ -71,7 +71,7 @@
...
@@ -71,7 +71,7 @@
//this.scrollNode?.setAttribute('scroll-y', 'true');
//this.scrollNode?.setAttribute('scroll-y', 'true');
this.scrollNode?.setAttribute('direction', 'vertical');
this.scrollNode?.setAttribute('direction', 'vertical');
// #endif
// #endif
// #ifdef WEB
// #ifdef WEB
|| MP
this.scrollDirection = 'vertical';
this.scrollDirection = 'vertical';
// #endif
// #endif
this.halfNode?.style?.setProperty('transform', 'translateY(' + offset.toFixed(2) + 'px)');
this.halfNode?.style?.setProperty('transform', 'translateY(' + offset.toFixed(2) + 'px)');
...
@@ -110,7 +110,7 @@
...
@@ -110,7 +110,7 @@
//this.scrollNode?.setAttribute('scroll-y', 'true');
//this.scrollNode?.setAttribute('scroll-y', 'true');
this.scrollNode?.setAttribute('direction', 'vertical');
this.scrollNode?.setAttribute('direction', 'vertical');
// #endif
// #endif
// #ifdef WEB
// #ifdef WEB
|| MP
this.scrollDirection = 'vertical';
this.scrollDirection = 'vertical';
// #endif
// #endif
this.halfScreenY = 0;
this.halfScreenY = 0;
...
@@ -150,7 +150,7 @@
...
@@ -150,7 +150,7 @@
//this.scrollNode?.setAttribute('scroll-y', 'true');
//this.scrollNode?.setAttribute('scroll-y', 'true');
this.scrollNode?.setAttribute('direction', 'vertical');
this.scrollNode?.setAttribute('direction', 'vertical');
// #endif
// #endif
// #ifdef WEB
// #ifdef WEB
|| MP
this.scrollDirection = 'vertical';
this.scrollDirection = 'vertical';
// #endif
// #endif
this.halfScreenY = 0;
this.halfScreenY = 0;
...
@@ -164,24 +164,31 @@
...
@@ -164,24 +164,31 @@
},
},
onReady() {
onReady() {
this.halfNode = this.$refs['halfScreen'] as UniElement;//uni.getElementById('halfScreen');
this.halfNode = this.$refs['halfScreen'] as UniElement;//uni.getElementById('halfScreen');
this.scrollNode = this.$refs['halfScroll'] as UniElement;//uni.getElementById('halfScroll');
this.scrollNode = this.$refs['halfScroll'] as UniElement;//uni.getElementById('halfScroll');
this.halfNode!.getBoundingClientRectAsync().then((rect: DOMRect) => {
this.halfHeight = this.halfNode!.getBoundingClientRect().height;
this.halfHeight = rect.height
this.totalHeight = uni.getElementById('page')?.getBoundingClientRect()?.height ?? 0;//uni.getWindowInfo().windowHeight
});
this.halfNode?.style?.setProperty('top', this.totalHeight.toFixed(2)+'px');
(this.$refs['page'] as UniElement).getBoundingClientRectAsync().then((rect: DOMRect) => {
this.totalHeight = rect.height
this.halfNode?.style?.setProperty('top', this.totalHeight.toFixed(2)+'px');
});
},
},
onResize() {
onResize() {
this.halfHeight = this.halfNode?.getBoundingClientRect()?.height ?? 0;
this.halfNode?.getBoundingClientRectAsync().then((rect: DOMRect) => {
this.halfHeight = rect.height
});
this.totalHeight = uni.getWindowInfo().windowHeight;
this.totalHeight = uni.getWindowInfo().windowHeight;
this.halfNode?.style?.setProperty('top', this.totalHeight.toFixed(2)+'px');
this.halfNode?.style?.setProperty('top', this.totalHeight.toFixed(2)+'px');
this.halfNode?.style?.setProperty('visibility', 'hidden');
this.halfNode?.style?.setProperty('visibility', 'hidden');
},
},
onBackPress(): boolean {
onBackPress(): boolean {
// #ifndef MP
if('visible' == this.halfNode?.style?.getPropertyValue('visibility')){
if('visible' == this.halfNode?.style?.getPropertyValue('visibility')){
this.switchHalfScreen(false);
this.switchHalfScreen(false);
return true;
return true;
}
}
return false;
return false;
// #endif
}
}
}
}
</script>
</script>
...
...
pages/template/scroll-fold-nav/scroll-fold-nav.uvue
浏览文件 @
ad35ce84
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
}
}
},
},
onLoad() {
onLoad() {
// #ifdef APP
// #ifdef APP
|| MP
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
// #endif
// #endif
this.nviBarHeight = NAVIBARHEIGHT + this.statusBarHeight;
this.nviBarHeight = NAVIBARHEIGHT + this.statusBarHeight;
...
...
pages/template/swiper-vertical-video/swiper-vertical-video.uvue
浏览文件 @
ad35ce84
...
@@ -87,7 +87,7 @@
...
@@ -87,7 +87,7 @@
onReady() {
onReady() {
// 一启动完成,就播放第一个
// 一启动完成,就播放第一个
this.doPlay(0);
this.doPlay(0);
// #ifdef APP
// #ifdef APP
|| MP
//App端适配不同状态栏高度
//App端适配不同状态栏高度
let backElement = this.$refs['back'] as UniElement;
let backElement = this.$refs['back'] as UniElement;
backElement.style.setProperty('top', uni.getSystemInfoSync().statusBarHeight+'px');
backElement.style.setProperty('top', uni.getSystemInfoSync().statusBarHeight+'px');
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录