Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
c3a3f49c
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6005
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看板
提交
c3a3f49c
编写于
1月 10, 2024
作者:
DCloud-yyl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
适配web端,setProperty的属性名称参数由驼峰字符调整使用"-"连接字符
上级
13a20d2b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
11 deletion
+11
-11
pages/template/half-screen/half-screen.uvue
pages/template/half-screen/half-screen.uvue
+11
-11
未找到文件。
pages/template/half-screen/half-screen.uvue
浏览文件 @
c3a3f49c
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
},
},
methods: {
methods: {
onHalfTouchStart(_ : TouchEvent) {
onHalfTouchStart(_ : TouchEvent) {
this.halfNode?.style?.setProperty('transition
D
uration', 0);
this.halfNode?.style?.setProperty('transition
-d
uration', 0);
},
},
onHalfTouchMove(e : TouchEvent) {
onHalfTouchMove(e : TouchEvent) {
if (this.bAnimation) {//容错处理
if (this.bAnimation) {//容错处理
...
@@ -98,30 +98,30 @@
...
@@ -98,30 +98,30 @@
if (show) {
if (show) {
top = this.totalHeight * 30 / 100; //计算显示的位置
top = this.totalHeight * 30 / 100; //计算显示的位置
this.halfNode?.style?.setProperty('visibility', 'visible');
this.halfNode?.style?.setProperty('visibility', 'visible');
this.halfNode?.style?.setProperty('transition
TimingF
unction', 'ease-in-out');
this.halfNode?.style?.setProperty('transition
-timing-f
unction', 'ease-in-out');
} else {
} else {
this.halfNode?.style?.setProperty('transition
TimingF
unction', 'linear');
this.halfNode?.style?.setProperty('transition
-timing-f
unction', 'linear');
time *= (this.halfHeight / this.totalHeight); //计算关闭动画时间
time *= (this.halfHeight / this.totalHeight); //计算关闭动画时间
}
}
this.halfNode?.style?.setProperty('transition
D
uration', time.toFixed(0)+"ms");
this.halfNode?.style?.setProperty('transition
-d
uration', time.toFixed(0)+"ms");
this.halfNode?.style?.setProperty('transition
P
roperty', 'top');
this.halfNode?.style?.setProperty('transition
-p
roperty', 'top');
this.halfNode?.style?.setProperty('top', top.toFixed(2));
this.halfNode?.style?.setProperty('top', top.toFixed(2));
setTimeout(() => {
setTimeout(() => {
if (!show) {
if (!show) {
this.halfNode?.style?.setProperty('visibility', 'hidden');
this.halfNode?.style?.setProperty('visibility', 'hidden');
this.halfNode?.style?.setProperty('transition
D
uration', 0);
this.halfNode?.style?.setProperty('transition
-d
uration', 0);
this.halfNode?.style?.setProperty('transform', '');
this.halfNode?.style?.setProperty('transform', '');
}
}
this.halfNode?.style?.setProperty('transition
P
roperty', '');
this.halfNode?.style?.setProperty('transition
-p
roperty', '');
this.bAnimation = false;
this.bAnimation = false;
}, time)
}, time)
this.bAnimation = true;
this.bAnimation = true;
},
},
resumeHalfScreen() {
resumeHalfScreen() {
let time = 300;//(500*this.halfOffset/this.halfHeight).toFixed(0); //回弹动画时间
let time = 300;//(500*this.halfOffset/this.halfHeight).toFixed(0); //回弹动画时间
this.halfNode?.style?.setProperty('transition
D
uration', time.toFixed(0)+"ms");
this.halfNode?.style?.setProperty('transition
-d
uration', time.toFixed(0)+"ms");
this.halfNode?.style?.setProperty('transition
TimingF
unction', 'ease-in-out');
this.halfNode?.style?.setProperty('transition
-timing-f
unction', 'ease-in-out');
this.halfNode?.style?.setProperty('transition
P
roperty', 'transform');
this.halfNode?.style?.setProperty('transition
-p
roperty', 'transform');
this.halfNode?.style?.setProperty('transform', 'translateY(0px)');
this.halfNode?.style?.setProperty('transform', 'translateY(0px)');
this.halfMove = false;
this.halfMove = false;
this.scrollNode?.setAttribute('scroll-y', 'true');
this.scrollNode?.setAttribute('scroll-y', 'true');
...
@@ -129,7 +129,7 @@
...
@@ -129,7 +129,7 @@
this.halfOffset = 0;
this.halfOffset = 0;
setTimeout(() => {
setTimeout(() => {
this.bAnimation = false;
this.bAnimation = false;
this.halfNode?.style?.setProperty('transition
P
roperty', '');
this.halfNode?.style?.setProperty('transition
-p
roperty', '');
}, time)
}, time)
this.bAnimation = true;
this.bAnimation = true;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录