Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
a847f5f0
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看板
提交
a847f5f0
编写于
2月 28, 2024
作者:
W
WOSHIMAHAIFENG
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://gitcode.net/dcloud/hello-uni-app-x
into dev-payment
上级
62e46961
0bf5470b
变更
16
展开全部
隐藏空白更改
内联
并排
Showing
16 changed file
with
1391 addition
and
1369 deletion
+1391
-1369
pages.json
pages.json
+1274
-1265
pages/component/list-view/list-view-refresh.test.js
pages/component/list-view/list-view-refresh.test.js
+24
-0
pages/component/list-view/list-view-refresh.uvue
pages/component/list-view/list-view-refresh.uvue
+49
-0
pages/component/list-view/list-view.uvue
pages/component/list-view/list-view.uvue
+5
-1
pages/component/text/text-props.test.js
pages/component/text/text-props.test.js
+8
-0
pages/component/text/text-props.uvue
pages/component/text/text-props.uvue
+7
-2
pages/tabBar/template.uvue
pages/tabBar/template.uvue
+2
-4
pages/template/long-list/long-list.uvue
pages/template/long-list/long-list.uvue
+6
-2
pages/template/long-list2/long-list2.uvue
pages/template/long-list2/long-list2.uvue
+7
-1
pages/template/swiper-list/swiper-list.uvue
pages/template/swiper-list/swiper-list.uvue
+1
-0
pages/template/swiper-list2/swiper-list2.uvue
pages/template/swiper-list2/swiper-list2.uvue
+1
-0
uni_modules/uni-loading/changelog.md
uni_modules/uni-loading/changelog.md
+2
-0
uni_modules/uni-loading/components/uni-loading/loading-circle.uvue
...es/uni-loading/components/uni-loading/loading-circle.uvue
+0
-0
uni_modules/uni-loading/components/uni-loading/snow.uvue
uni_modules/uni-loading/components/uni-loading/snow.uvue
+0
-89
uni_modules/uni-loading/components/uni-loading/uni-loading.uvue
...dules/uni-loading/components/uni-loading/uni-loading.uvue
+4
-4
uni_modules/uni-loading/package.json
uni_modules/uni-loading/package.json
+1
-1
未找到文件。
pages.json
浏览文件 @
a847f5f0
此差异已折叠。
点击以展开。
pages/component/list-view/list-view-refresh.test.js
0 → 100644
浏览文件 @
a847f5f0
describe
(
'
component-native-list-view-refresh
'
,
()
=>
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
web
'
))
{
it
(
'
dummyTest
'
,
async
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
let
page
beforeAll
(
async
()
=>
{
//打开list-view测试页
page
=
await
program
.
reLaunch
(
'
/pages/component/list-view/list-view-refresh
'
)
await
page
.
waitFor
(
600
)
})
it
(
'
check_list_view_refresh
'
,
async
()
=>
{
await
page
.
waitFor
(
async
()
=>
{
return
await
page
.
data
(
'
refresherTriggered
'
)
===
false
;
});
//等待下拉刷新结束
await
page
.
waitFor
(
500
)
const
image
=
await
program
.
screenshot
();
expect
(
image
).
toMatchImageSnapshot
();
})
})
pages/component/list-view/list-view-refresh.uvue
0 → 100644
浏览文件 @
a847f5f0
<template>
<list-view v-if="list_show" id="listview" style="flex: 1;" show-scrollbar=false :refresher-enabled="true"
:refresher-triggered="refresherTriggered" @refresherrefresh="onRefresherrefresh">
<list-item class="item">
<text>向下滑动触发下拉刷新</text>
</list-item>
<list-item v-for="index in item_count" class="item">
<text>item-------{{index}}</text>
</list-item>
</list-view>
</template>
<script>
export default {
data() {
return {
item_count: 20,
list_show: false,
refresherTriggered: true
}
},
onLoad() {
//延迟显示list-view
setTimeout(() => {
this.list_show = true;
}, 500)
},
methods: {
onRefresherrefresh() {
this.refresherTriggered = true;
setTimeout(() => {
this.refresherTriggered = false;
}, 1000)
}
}
}
</script>
<style>
.item {
padding: 15px;
margin: 0 0 5px 0;
background-color: #fff;
border-radius: 5px;
}
.button_item {
width: 200px;
}
</style>
pages/component/list-view/list-view.uvue
浏览文件 @
a847f5f0
...
...
@@ -182,7 +182,11 @@
@confirm="confirm_refresher_background_input"></input-data>
<enum-data :items="size_enum" title="通过id位置跳转" @change="item_change_size_enum"></enum-data>
<navigator url="/pages/component/list-view/list-view-refresh" hover-class="none">
<button type="primary" class="button">
list-view 下拉刷新
</button>
</navigator>
<navigator url="/pages/component/list-view/list-view-multiplex" hover-class="none">
<button type="primary" class="button">
list-view 对list-item复用测试
...
...
pages/component/text/text-props.test.js
浏览文件 @
a847f5f0
...
...
@@ -20,4 +20,12 @@ describe('text-props', () => {
expect
(
height
).
toBe
(
0
)
}
})
it
(
'
text nested
'
,
async
()
=>
{
page
.
callMethod
(
"
setTextNested
"
)
const
element
=
await
page
.
$
(
'
#text-nested
'
)
if
(
element
!=
null
)
{
expect
(
await
element
.
text
()).
toBe
(
"
二级节点文字红色且背景色黄色
"
)
}
})
})
pages/component/text/text-props.uvue
浏览文件 @
a847f5f0
...
...
@@ -78,7 +78,7 @@
<view class="text-box">
<text
>一级节点黑色
<text style="color: red;background-color: yellow;"
<text
id="text-nested" ref="text-nested"
style="color: red;background-color: yellow;"
>二级节点红色且背景色黄色
<text>三级节点不继承二级的颜色</text>
</text>
...
...
@@ -114,7 +114,12 @@ export default {
singleLineText: 'uni-app x,终极跨平台方案',
}
},
methods: {},
methods: {
// 自动化测试
setTextNested() {
(this.$refs["text-nested"] as UniTextElement).value = "二级节点文字红色且背景色黄色";
}
}
}
</script>
...
...
pages/tabBar/template.uvue
浏览文件 @
a847f5f0
...
...
@@ -54,8 +54,7 @@
export default {
data() {
return {
list: [
// #ifdef APP
list: [
{
id: 'long-list',
url: 'long-list',
...
...
@@ -72,8 +71,7 @@
url: 'long-list2'
},
] as Page[],
},
// #endif
},
{
id: 'list-news',
url: 'list-news',
...
...
pages/template/long-list/long-list.uvue
浏览文件 @
a847f5f0
...
...
@@ -7,7 +7,7 @@
<view class="swiper-list">
<scroll-view ref="tabScroll" class="swiper-tabs" direction="horizontal" :show-scrollbar="false">
<view class="flex-row" style="align-self: flex-start;">
<text ref="swipertab" class="swiper-tabs-item" :class="swiperIndex==index ? 'swiper-tabs-item-active' : ''"
<text ref="swipertab"
space="nbsp"
class="swiper-tabs-item" :class="swiperIndex==index ? 'swiper-tabs-item-active' : ''"
v-for="(item, index) in swiperList" :key="index" @click="onTabClick(index)">
{{item.name}}
</text>
...
...
@@ -209,7 +209,7 @@
// 滚动到水平中心位置
const scroll_x = x - this.swiperWidth / 2
if(this.tabScrollView !=
=
null){
if(this.tabScrollView != null){
this.tabScrollView!.scrollLeft = scroll_x
}
},
...
...
@@ -238,6 +238,9 @@
.swiper-list {
height: 100%;
/* #ifdef WEB */
flex: 1;
/* #endif */
}
.swiper-tabs {
...
...
@@ -249,6 +252,7 @@
color: #555;
font-size: 16px;
padding: 12px 25px;
white-space: nowrap;
}
.swiper-tabs-item-active {
...
...
pages/template/long-list2/long-list2.uvue
浏览文件 @
a847f5f0
...
...
@@ -165,7 +165,9 @@
const percentage = Math.abs(current_offset_x) / this.swiperWidth
// 通知更新指示线
this.updateTabIndicator(current_index, move_to_index, percentage)
if (current_index != move_to_index) {
this.updateTabIndicator(current_index, move_to_index, percentage)
}
// 首次可见时初始化数据
this.initSwiperItemData(move_to_index)
...
...
@@ -242,6 +244,9 @@
.swiper-list {
height: 100%;
/* #ifdef WEB */
flex: 1;
/* #endif */
}
.swiper-tabs {
...
...
@@ -253,6 +258,7 @@
color: #555;
font-size: 16px;
padding: 12px 25px;
white-space: nowrap;
}
.swiper-tabs-item-active {
...
...
pages/template/swiper-list/swiper-list.uvue
浏览文件 @
a847f5f0
...
...
@@ -191,6 +191,7 @@
color: #555;
font-size: 16px;
padding: 12px 25px;
white-space: nowrap;
}
.swiper-tabs-item-active {
...
...
pages/template/swiper-list2/swiper-list2.uvue
浏览文件 @
a847f5f0
...
...
@@ -143,6 +143,7 @@
color: #555;
font-size: 16px;
margin: 15px 25px 5px 25px;
white-space: nowrap;
}
.swiper-tabs-item-active {
...
...
uni_modules/uni-loading/changelog.md
浏览文件 @
a847f5f0
## 1.0.6(2024-02-28)
-
更新 Circle 组件名称,防止与内置组件名冲突
## 1.0.5(2024-01-12)
-
优化 删除组件内无用日志输出
## 1.0.4(2024-01-10)
...
...
uni_modules/uni-loading/components/uni-loading/circle.uvue
→
uni_modules/uni-loading/components/uni-loading/
loading-
circle.uvue
浏览文件 @
a847f5f0
文件已移动
uni_modules/uni-loading/components/uni-loading/snow.uvue
已删除
100644 → 0
浏览文件 @
62e46961
<template>
<view :ref="elId" class="block" :style="{width:size+'px',height:size+'px'}"></view>
</template>
<script>
import { hexToRgba } from './util'
export default {
name: "uni-snow",
props: {
speed: {
type: Number,
default: 16,
},
size: {
type: Number,
default: 20,
},
color: {
type: String,
default: '',
}
},
data() {
const elId = `Uni_${(Math.random() * 10e5).toInt().toString(36)}`
return {
elId: elId,
timer: 0,
};
},
mounted() {
const refs = this.$refs[this.elId] as UniElement
let ctx = refs.getDrawableContext()!
this.spinner(ctx)
},
unmounted() {
clearInterval(this.timer)
},
methods: {
spinner(ctx : DrawableContext) {
const steps = 12;
let step = 0;
const width = this.size;
const lineWidth = width / 12;
// 线长度和距离圆心距离
const length = width / 4 - lineWidth;
const offset = width / 4;
function draw() {
ctx.reset();
for (let i = 0; i < steps; i++) {
const stepAngle = 360 / steps;
const angle = stepAngle * i;
// 计算透明度
const opacity = ((steps - (step % steps)) * stepAngle + angle) % 360 + 30;
// 计算正余弦值
const sin = Math.sin((angle / 180) * Math.PI);
const cos = Math.cos((angle / 180) * Math.PI);
// 开始绘制线条
ctx.lineWidth = lineWidth;
ctx.lineCap = 'round';
ctx.beginPath();
ctx.moveTo(width / 2 + offset * cos, width / 2 + offset * sin);
ctx.lineTo(
width / 2 + (offset + length) * cos,
width / 2 + (offset + length) * sin
);
// 获取填充颜色
const fillColor = this.color !== '' ? this.color : '#333333';
// 转换透明度并设置颜色
ctx.strokeStyle = hexToRgba(fillColor, Math.round((opacity / 360) * 255));
ctx.stroke();
}
step += 1;
ctx.update();
}
draw()
// 每隔一段时间执行绘制函数
this.timer = setInterval(() => draw(), this.speed + 76);
}
}
}
</script>
<style scoped>
.block {
width: 50px;
height: 50px;
}
</style>
uni_modules/uni-loading/components/uni-loading/uni-loading.uvue
浏览文件 @
a847f5f0
...
...
@@ -4,12 +4,12 @@
<template v-if="loading">
<slot></slot>
<template v-if="$slots['default'] == null">
<
Circle :speed="16" :size="loadWidth" :color="color"></
Circle>
<
LoadingCircle :speed="16" :size="loadWidth" :color="color"></Loading
Circle>
<text v-if="text" class="inline-text" :style=" { color: color }">{{text}}</text>
</template>
<template v-else>
<view class="uni-loading-mask" :style="{backgroundColor:background}">
<
Circle :speed="16" :size="loadWidth" :color="color"></
Circle>
<
LoadingCircle :speed="16" :size="loadWidth" :color="color"></Loading
Circle>
<text v-if="text" class="block-text" :style=" { color: color }">{{text}}</text>
</view>
</template>
...
...
@@ -20,7 +20,7 @@
</view>
</template>
<script>
import
Circle from './
circle.uvue'
import
LoadingCircle from './loading-
circle.uvue'
// TODO 性能问题,其他类型暂时不对外开放
// import Icon from './icon.uvue'
// import UniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.uvue'
...
...
@@ -45,7 +45,7 @@
export default {
name: "uni-loading",
components: { Circle },
components: {
Loading
Circle },
props: {
loading: {
type: Boolean,
...
...
uni_modules/uni-loading/package.json
浏览文件 @
a847f5f0
{
"id"
:
"uni-loading"
,
"displayName"
:
"uni-loading"
,
"version"
:
"1.0.
5
"
,
"version"
:
"1.0.
6
"
,
"description"
:
"加载动画组件多用在页面内数据加载时,提供一个loading动画,列表的上拉加载,下拉刷新等都需要加载动画"
,
"keywords"
:
[
"loading"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录