Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
39ca006c
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5995
Star
90
Fork
162
代码
文件
提交
分支
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看板
提交
39ca006c
编写于
8月 15, 2024
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 优化部分示例及测试
上级
3c228579
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
391 addition
and
335 deletion
+391
-335
pages/API/compress-image/compress-image.uvue
pages/API/compress-image/compress-image.uvue
+27
-25
pages/API/compress-video/compress-video.uvue
pages/API/compress-video/compress-video.uvue
+24
-22
pages/API/get-current-pages/get-current-pages.uvue
pages/API/get-current-pages/get-current-pages.uvue
+43
-34
pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.uvue
...rrent-pages/set-page-style-disable-pull-down-refresh.uvue
+27
-27
pages/CSS/overflow/overflow-visible-event.uvue
pages/CSS/overflow/overflow-visible-event.uvue
+6
-2
pages/CSS/transform/rotate.uvue
pages/CSS/transform/rotate.uvue
+97
-83
pages/CSS/transform/scale.uvue
pages/CSS/transform/scale.uvue
+85
-76
pages/CSS/transform/translate.uvue
pages/CSS/transform/translate.uvue
+80
-65
pages/pages.test.js
pages/pages.test.js
+2
-1
未找到文件。
pages/API/compress-image/compress-image.uvue
浏览文件 @
39ca006c
...
...
@@ -2,6 +2,7 @@
<!-- #ifdef APP -->
<scroll-view style="flex:1">
<!-- #endif -->
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap">
<view class="image-container">
...
...
@@ -28,6 +29,7 @@
<input-data title="压缩后图片的宽度,单位px" type="string" @confirm="onCompressedWidthConfirm"></input-data>
<input-data title="压缩后图片的高度,单位px" type="string" @confirm="onCompressedHeightConfirm"></input-data>
<input-data defaultValue="0" title="旋转度数,范围0~360" type="number" @confirm="onRotateConfirm"></input-data>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
...
...
@@ -144,7 +146,7 @@
uni.getImageInfo({
src: res.tempFilePath,
success: (_res) => {
let beforeCompressSize
: number, afterComoressSize
: number;
let beforeCompressSize
: number, afterComoressSize
: number;
// #ifdef APP-ANDROID
beforeCompressSize = new FileInputStream(UTSAndroid.convert2AbsFullPath(this.imageSrcForTest)).available();
afterComoressSize = new FileInputStream(res.tempFilePath.substring("file://".length)).available();
...
...
pages/API/compress-video/compress-video.uvue
浏览文件 @
39ca006c
...
...
@@ -3,6 +3,7 @@
<scroll-view style="flex:1">
<!-- #endif -->
<page-head :title="title"></page-head>
<view>
<view class="uni-padding-wrap">
<video class="video" :src="beforeCompressPath" :controls="true"></video>
<view class="uni-title">
...
...
@@ -26,6 +27,7 @@
<slider :min="0.1" :max="1" :step="0.1" :show-value="true" @change="onResolutionChange"></slider>
</view>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
...
...
@@ -116,7 +118,7 @@
this.resolution = event.detail.value;
},
testCompressVideo() {
let beforeCompressSize
: number, afterComoressSize
: number;
let beforeCompressSize
: number, afterComoressSize
: number;
uni.compressVideo({
src: this.videoSrcForTest,
quality: 'medium',
...
...
pages/API/get-current-pages/get-current-pages.uvue
浏览文件 @
39ca006c
...
...
@@ -2,6 +2,7 @@
<!-- #ifdef APP -->
<scroll-view class="page-scroll-view">
<!-- #endif -->
<view>
<page-head title="getCurrentPages"></page-head>
<view class="uni-padding-wrap">
<button @click="_getCurrentPages">getCurrentPages</button>
...
...
@@ -31,11 +32,14 @@
</view>
<view class="set-value" v-else-if="item.type == 'string'">
<radio-group class="radio-set-value" @change="radioChange(item.key, $event as RadioGroupChangeEvent)">
<radio class="radio-value" v-for="(item2, index2) in item.value" :key="index2" :value="item2" >{{item2}}</radio>
<radio class="radio-value" v-for="(item2, index2) in item.value" :key="index2" :value="item2">{{item2}}
</radio>
</radio-group>
</view>
</view>
</template>
<button style='margin: 10px;' @click="goSetDisablePullDownRefresh">go set disable pullDownRefresh</button>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
...
...
@@ -117,6 +121,11 @@
const currentPage = pages[pages.length - 1];
currentPage.$setPageStyle(style);
},
goSetDisablePullDownRefresh() {
uni.navigateTo({
url: '/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh'
});
}
// getCurrentPage(): Page {
// const pages = getCurrentPages();
// const currentPage = pages[pages.length - 1];
...
...
pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.uvue
浏览文件 @
39ca006c
pages/CSS/overflow/overflow-visible-event.uvue
浏览文件 @
39ca006c
<template>
<!-- #ifdef APP -->
<scroll-view style="flex: 1;">
<!-- #endif -->
<view>
<text style="font-size: 15px;">overflow=visible 父view(绿色),子view(红色),点击超出父view区域的部分也可触发事件。</text>
<view class="backgroundview">
...
...
@@ -29,7 +31,9 @@
</view>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script>
...
...
pages/CSS/transform/rotate.uvue
浏览文件 @
39ca006c
<template>
<scroll-view class="page">
<!-- #ifdef APP -->
<scroll-view class="page">
<!-- #endif -->
<view class="rotate-container">
<view class="trace">
<view class="base reserve">
<text class="reserve-text">rotate(20deg)</text>
...
...
@@ -37,48 +39,60 @@
<text>转变后位置</text>
</view>
</scroll-view>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script lang="uts">
export default {
export default {
data() {
return {
}
},
methods: {
},
}
}
</script>
<style>
.page {
.page {
flex: 1;
}
.rotate-container {
display: flex;
align-items: center;
}
.trace {
}
.trace {
position: absolute;
top: 0px;
left: 0px;
width: 100%;
align-items: center;
}
.base {
}
.base {
margin: 10px;
width: 150px;
height: 150px;
align-items: center;
justify-content: center;
}
.reserve {
}
.reserve {
border: 1px dotted #588;
background-color: #DDD;
}
.reserve-text {
}
.reserve-text {
color: #CCC;
}
.transform {
}
.transform {
border: 1px solid #00F;
background-color: rgba(0,255,255,0.5);
}
background-color: rgba(0, 255, 255, 0.5);
}
</style>
pages/CSS/transform/scale.uvue
浏览文件 @
39ca006c
<template>
<!-- #ifdef APP -->
<scroll-view class="page">
<!-- #endif -->
<view class="scale-container">
<view class="trace">
<view class="base reserve">
<text class="reserve-text">scaleX(0.6)</text>
...
...
@@ -32,8 +35,10 @@
<text>通过scaleY(0.5)实现0.5px的线</text>
<view style="width: 150px; height: 1px; background-color: #000; transform: scaleY(0.5)"></view>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script lang="uts">
...
...
@@ -42,6 +47,10 @@
<style>
.page {
flex: 1;
}
.scale-container {
display: flex;
align-items: center;
}
...
...
pages/CSS/transform/translate.uvue
浏览文件 @
39ca006c
<template>
<scroll-view class="page">
<!-- #ifdef APP -->
<scroll-view class="page">
<!-- #endif -->
<view class="translate-container">
<view class="trace">
<view class="base reserve">
<text class="reserve-text">translateX(80%)</text>
...
...
@@ -27,48 +30,60 @@
<text>translate(-50%,50%)</text>
<text>转变后位置</text>
</view>
</scroll-view>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script lang="uts">
export default {
export default {
data() {
return {
}
},
methods: {
},
}
}
</script>
<style>
.page {
.page {
flex: 1;
}
.translate-container{
display: flex;
align-items: center;
}
.trace {
}
.trace {
position: absolute;
top: 0px;
left: 0px;
width: 100%;
align-items: center;
}
.base {
}
.base {
margin: 10px;
width: 150px;
height: 150px;
align-items: center;
justify-content: center;
}
.reserve {
}
.reserve {
border: 1px dotted #588;
background-color: #DDD;
}
.reserve-text {
}
.reserve-text {
color: #CCC;
}
.transform {
}
.transform {
border: 1px solid #00F;
background-color: rgba(0,255,255,
0.5);
}
background-color: rgba(0, 255, 255,
0.5);
}
</style>
pages/pages.test.js
浏览文件 @
39ca006c
...
...
@@ -80,7 +80,8 @@ const pages = [
// '/pages/component/unicloud-db/unicloud-db/contacts/edit',
// 动态内容
// '/pages/component/unicloud-db/unicloud-db/contacts/detail',
'
/pages/component/unicloud-db/unicloud-db/mixin-datacom/mixin-datacom
'
,
// 动态内容
// '/pages/component/unicloud-db/unicloud-db/mixin-datacom/mixin-datacom',
// 单独测试例截图
// '/pages/component/global-properties/global-properties',
'
/pages/component/global-events/global-events
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录