Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
306b1430
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6048
Star
92
Fork
165
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
306b1430
编写于
11月 29, 2024
作者:
W
wanganxp
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://gitcode.net/dcloud/hello-uni-app-x
into dev
上级
7c5c7934
9fe81f2e
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
62 addition
and
45 deletion
+62
-45
pages/API/get-background-audio-manager/get-background-audio-manager.uvue
...ackground-audio-manager/get-background-audio-manager.uvue
+6
-15
pages/component/grid-view/grid-view.test.js
pages/component/grid-view/grid-view.test.js
+5
-5
pages/component/list-view/list-view.test.js
pages/component/list-view/list-view.test.js
+2
-2
pages/component/map/map.test.js
pages/component/map/map.test.js
+22
-13
pages/component/map/map.uvue
pages/component/map/map.uvue
+15
-5
pages/component/rich-text/rich-text.uvue
pages/component/rich-text/rich-text.uvue
+4
-3
pages/component/textarea/textarea.uvue
pages/component/textarea/textarea.uvue
+8
-2
static/stop.png
static/stop.png
+0
-0
未找到文件。
pages/API/get-background-audio-manager/get-background-audio-manager.uvue
浏览文件 @
306b1430
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<view>
<view>
<page-head :title="title"></page-head>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap">
<view class="uni-padding-wrap">
<view class="uni-hello-text">注意:离开当前页面后背景音乐将保持播放
,但退出uni-app将停止
</view>
<view class="uni-hello-text">注意:离开当前页面后背景音乐将保持播放</view>
<view class="page-body-buttons">
<view class="page-body-buttons">
<block v-if="playing">
<block v-if="playing">
<view class="page-body-button" @tap="stop">
<view class="page-body-button" @tap="stop">
...
@@ -38,8 +38,7 @@
...
@@ -38,8 +38,7 @@
onLoad: function () {
onLoad: function () {
let bgAudioMannager = uni.getBackgroundAudioManager();
let bgAudioMannager = uni.getBackgroundAudioManager();
bgAudioMannager.title = '致爱丽丝';
bgAudioMannager.title = '致爱丽丝';
bgAudioMannager.epname = '致爱丽丝'
bgAudioMannager.singer = '路德维希·范·贝多芬';
bgAudioMannager.singer = '暂无';
bgAudioMannager.coverImgUrl = 'https://web-assets.dcloud.net.cn/unidoc/zh/Alice.jpeg';
bgAudioMannager.coverImgUrl = 'https://web-assets.dcloud.net.cn/unidoc/zh/Alice.jpeg';
bgAudioMannager.onPlay(() => {
bgAudioMannager.onPlay(() => {
...
@@ -52,14 +51,12 @@
...
@@ -52,14 +51,12 @@
})
})
bgAudioMannager.onEnded(() => {
bgAudioMannager.onEnded(() => {
this.playing = false;
this.playing = false;
// this.playTime = this.playTime = 0;
// thi.formatedPlayTime = this.formatedPlayTime
})
})
bgAudioMannager.onNext(() => {
bgAudioMannager.onNext(() => {
console.log("下一曲");
console.log("下一曲");
this.bgAudioMannager?.stop()
this.bgAudioMannager?.stop()
bgAudioMannager.title = '致爱丽丝' + this.count++;
bgAudioMannager.title = '致爱丽丝' + this.count++;
bgAudioMannager.singer = '
暂无2' + this.count++
;
bgAudioMannager.singer = '
路德维希·范·贝多芬'
;
bgAudioMannager.coverImgUrl = 'https://web-assets.dcloud.net.cn/unidoc/zh/Alice.jpeg';
bgAudioMannager.coverImgUrl = 'https://web-assets.dcloud.net.cn/unidoc/zh/Alice.jpeg';
this.bgAudioMannager!.src = this.dataUrl;
this.bgAudioMannager!.src = this.dataUrl;
this.bgAudioMannager?.play()
this.bgAudioMannager?.play()
...
@@ -68,17 +65,10 @@
...
@@ -68,17 +65,10 @@
console.log("上一曲");
console.log("上一曲");
this.bgAudioMannager?.stop()
this.bgAudioMannager?.stop()
bgAudioMannager.title = '致爱丽丝' + this.count--;
bgAudioMannager.title = '致爱丽丝' + this.count--;
bgAudioMannager.singer = '
暂无' + this.count--
;
bgAudioMannager.singer = '
路德维希·范·贝多芬'
;
this.bgAudioMannager!.src = this.dataUrl;
this.bgAudioMannager!.src = this.dataUrl;
this.bgAudioMannager?.play()
this.bgAudioMannager?.play()
})
})
// bgAudioMannager.onTimeUpdate((e) => {
// if (Math.floor(bgAudioMannager.currentTime) > Math.floor(this.playTime)) {
// this.$backgroundAudioData.formatedPlayTime = this.formatedPlayTime = util.formatTime(Math.floor(bgAudioMannager.currentTime));
// }
// this.$backgroundAudioData.playTime = this.playTime = bgAudioMannager.currentTime;
// })
this.bgAudioMannager = bgAudioMannager;
this.bgAudioMannager = bgAudioMannager;
},
},
methods: {
methods: {
...
@@ -142,5 +132,6 @@
...
@@ -142,5 +132,6 @@
.page-body-button {
.page-body-button {
flex-direction: row;
flex-direction: row;
justify-content: center;
justify-content: center;
margin-bottom: 10px;
}
}
</style>
</style>
pages/component/grid-view/grid-view.test.js
浏览文件 @
306b1430
...
@@ -2,7 +2,7 @@ const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
...
@@ -2,7 +2,7 @@ const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
describe
(
'
component-native-grid-view
'
,
()
=>
{
describe
(
'
component-native-grid-view
'
,
()
=>
{
if
(
isMP
)
{
if
(
isMP
||
platformInfo
.
indexOf
(
'
web
'
)
>
-
1
)
{
it
(
'
skip mp
'
,
()
=>
{
it
(
'
skip mp
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
expect
(
1
).
toBe
(
1
)
})
})
...
@@ -63,9 +63,9 @@ describe('component-native-grid-view', () => {
...
@@ -63,9 +63,9 @@ describe('component-native-grid-view', () => {
endPoint
:
{
x
:
100
,
y
:
100
},
endPoint
:
{
x
:
100
,
y
:
100
},
duration
:
100
duration
:
100
})
})
await
page
.
waitFor
(
6
00
)
await
page
.
waitFor
(
12
00
)
const
endDetail
=
await
page
.
data
(
'
scrollEndDetailTest
'
)
const
endDetail
=
await
page
.
data
(
'
scrollEndDetailTest
'
)
//
console.log('scrollEndDetailTest:', endDetail)
console
.
log
(
'
scrollEndDetailTest:
'
,
endDetail
)
expect
(
endDetail
.
deltaY
).
toBe
(
0
)
expect
(
endDetail
.
deltaY
).
toBe
(
0
)
expect
(
endDetail
.
deltaX
).
toBe
(
0
)
expect
(
endDetail
.
deltaX
).
toBe
(
0
)
expect
(
endDetail
.
scrollLeft
).
toBe
(
0
)
expect
(
endDetail
.
scrollLeft
).
toBe
(
0
)
...
@@ -81,7 +81,7 @@ describe('component-native-grid-view', () => {
...
@@ -81,7 +81,7 @@ describe('component-native-grid-view', () => {
expect
(
value
).
toBe
(
true
)
expect
(
value
).
toBe
(
true
)
})
})
//
//
检测下拉刷新 备注:iOS本地测试结果正确,但是自动化测试结果错误
//检测下拉刷新 备注:iOS本地测试结果正确,但是自动化测试结果错误
it
(
'
check_refresher
'
,
async
()
=>
{
it
(
'
check_refresher
'
,
async
()
=>
{
await
page
.
callMethod
(
'
confirm_scroll_top_input
'
,
0
)
await
page
.
callMethod
(
'
confirm_scroll_top_input
'
,
0
)
await
page
.
setData
({
await
page
.
setData
({
...
...
pages/component/list-view/list-view.test.js
浏览文件 @
306b1430
...
@@ -90,9 +90,9 @@ describe('component-native-list-view', () => {
...
@@ -90,9 +90,9 @@ describe('component-native-list-view', () => {
endPoint
:
{
x
:
100
,
y
:
100
},
endPoint
:
{
x
:
100
,
y
:
100
},
duration
:
100
duration
:
100
})
})
await
page
.
waitFor
(
600
)
await
page
.
waitFor
(
1
600
)
const
endDetail
=
await
page
.
data
(
'
scrollEndDetailTest
'
)
const
endDetail
=
await
page
.
data
(
'
scrollEndDetailTest
'
)
//
console.log('scrollEndDetailTest:', endDetail)
console
.
log
(
'
scrollEndDetailTest:
'
,
endDetail
)
expect
(
endDetail
.
deltaY
).
toBe
(
0
)
expect
(
endDetail
.
deltaY
).
toBe
(
0
)
expect
(
endDetail
.
deltaX
).
toBe
(
0
)
expect
(
endDetail
.
deltaX
).
toBe
(
0
)
expect
(
endDetail
.
scrollLeft
).
toBe
(
0
)
expect
(
endDetail
.
scrollLeft
).
toBe
(
0
)
...
...
pages/component/map/map.test.js
浏览文件 @
306b1430
let
page
;
let
page
;
describe
(
'
web-map
'
,
()
=>
{
describe
(
'
web-map
'
,
()
=>
{
if
(
!
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
web
'
))
{
it
(
'
app
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/map/map
'
)
page
=
await
program
.
reLaunch
(
'
/pages/component/map/map
'
)
await
page
.
waitFor
(
'
view
'
);
await
page
.
waitFor
(
'
view
'
);
...
@@ -16,6 +11,26 @@ describe('web-map', () => {
...
@@ -16,6 +11,26 @@ describe('web-map', () => {
await
page
.
callMethod
(
'
updateAutoTest
'
,
true
)
await
page
.
callMethod
(
'
updateAutoTest
'
,
true
)
});
});
it
(
'
handleMoveToLocation
'
,
async
()
=>
{
await
page
.
callMethod
(
'
handleMoveToLocation
'
)
await
page
.
waitFor
(
500
);
const
moveToLocationRes
=
await
page
.
data
(
'
jestResult
'
)
expect
(
moveToLocationRes
.
moveToLocationMsg
).
toBe
(
"
moveToLocation:ok
"
);
});
it
(
'
Check EventDetail JsonStringify
'
,
async
()
=>
{
const
res
=
await
page
.
data
(
'
jestResult
'
)
console
.
log
(
res
.
eventDetailJsonStringify
);
expect
(
res
.
eventDetailJsonStringify
).
not
.
toBe
(
"
{}
"
);
})
if
(
!
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
web
'
))
{
it
(
'
app
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
it
(
'
Check MapMethods
'
,
async
()
=>
{
it
(
'
Check MapMethods
'
,
async
()
=>
{
const
mapMethods
=
[
'
addControls
'
,
'
addMarkers
'
,
'
addMarkersLabel
'
,
'
removeMarker
'
,
'
addPolyline
'
,
'
removePolyline
'
,
'
addPolygons
'
,
'
removePolygon
'
,
'
addCircles
'
,
'
removeCircle
'
,
'
includePoint
'
]
const
mapMethods
=
[
'
addControls
'
,
'
addMarkers
'
,
'
addMarkersLabel
'
,
'
removeMarker
'
,
'
addPolyline
'
,
'
removePolyline
'
,
'
addPolygons
'
,
'
removePolygon
'
,
'
addCircles
'
,
'
removeCircle
'
,
'
includePoint
'
]
for
(
var
i
=
0
;
i
<
mapMethods
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
mapMethods
.
length
;
i
++
)
{
...
@@ -58,12 +73,7 @@ describe('web-map', () => {
...
@@ -58,12 +73,7 @@ describe('web-map', () => {
expect
(
translateMarkerRes
.
translateMarkerMsg
).
toBe
(
'
translateMarker:ok
'
);
expect
(
translateMarkerRes
.
translateMarkerMsg
).
toBe
(
'
translateMarker:ok
'
);
});
});
it
(
'
handleMoveToLocation
'
,
async
()
=>
{
await
page
.
callMethod
(
'
handleMoveToLocation
'
)
await
page
.
waitFor
(
500
);
const
moveToLocationRes
=
await
page
.
data
(
'
jestResult
'
)
expect
(
moveToLocationRes
.
moveToLocationMsg
).
toBe
(
"
moveToLocation:ok
"
);
});
it
(
'
handleGetScale
'
,
async
()
=>
{
it
(
'
handleGetScale
'
,
async
()
=>
{
await
page
.
callMethod
(
'
handleGetScale
'
)
await
page
.
callMethod
(
'
handleGetScale
'
)
...
@@ -73,5 +83,4 @@ describe('web-map', () => {
...
@@ -73,5 +83,4 @@ describe('web-map', () => {
expect
(
scaleRes
.
scale
).
toBeLessThanOrEqual
(
18
);
expect
(
scaleRes
.
scale
).
toBeLessThanOrEqual
(
18
);
console
.
log
(
"
jestResult
"
,
await
page
.
data
())
console
.
log
(
"
jestResult
"
,
await
page
.
data
())
});
});
});
});
pages/component/map/map.uvue
浏览文件 @
306b1430
...
@@ -59,7 +59,8 @@
...
@@ -59,7 +59,8 @@
southwest : LocationObject,
southwest : LocationObject,
northeast : LocationObject,
northeast : LocationObject,
moveToLocationMsg : string,
moveToLocationMsg : string,
scale : number
scale : number,
eventDetailJsonStringify: string,
}
}
const testMarkers :Marker[]= [{
const testMarkers :Marker[]= [{
...
@@ -345,6 +346,7 @@
...
@@ -345,6 +346,7 @@
},
},
moveToLocationMsg: "",
moveToLocationMsg: "",
scale: 0,
scale: 0,
eventDetailJsonStringify: "{}"
} as TypeJestResult);
} as TypeJestResult);
...
@@ -633,10 +635,17 @@
...
@@ -633,10 +635,17 @@
}
}
const maptap = (e : UniMapTapEvent) => {
const maptap = (e : UniMapTapEvent) => {
// #ifdef WEB
uni.showModal({
content: 'web端map组件tap事件不支持返回经纬度'
});
// #endif
// #ifndef WEB
// console.log('点击地图时触发',e)
// console.log('点击地图时触发',e)
uni.showModal({
uni.showModal({
content: JSON.stringify(e.detail)
content: JSON.stringify(e.detail)
});
});
// #endif
};
};
const onmarkertap = (e : UniMapMarkerTapEvent) => {
const onmarkertap = (e : UniMapMarkerTapEvent) => {
...
@@ -666,6 +675,7 @@
...
@@ -666,6 +675,7 @@
const onregionchange = (e : UniMapRegionChangeEvent) => {
const onregionchange = (e : UniMapRegionChangeEvent) => {
console.log('视野发生变化时触发', e.detail)
console.log('视野发生变化时触发', e.detail)
jestResult.eventDetailJsonStringify = JSON.stringify(e.detail)
};
};
const onpoitap = (e : UniMapPoiTapEvent) => {
const onpoitap = (e : UniMapPoiTapEvent) => {
...
...
pages/component/rich-text/rich-text.uvue
浏览文件 @
306b1430
...
@@ -68,9 +68,10 @@
...
@@ -68,9 +68,10 @@
},
},
updateRichTextHeight() {
updateRichTextHeight() {
if (this.richTextElement != null) {
if (this.richTextElement != null) {
const elRect = this.richTextElement!.getBoundingClientRect()
this.richTextElement!.getBoundingClientRectAsync().then((elRect: DOMRect) => {
this.richTextHeight = elRect.height
this.richTextHeight = elRect.height
console.log('richTextHeight:', this.richTextHeight)
console.log('richTextHeight:', this.richTextHeight)
})
}
}
},
},
// 自动化测试
// 自动化测试
...
...
pages/component/textarea/textarea.uvue
浏览文件 @
306b1430
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
selectionEnd: -1,
selectionEnd: -1,
hold_keyboard: false,
hold_keyboard: false,
adjust_position: false,
adjust_position: false,
disabled: false,
jest_result: false
jest_result: false
}
}
},
},
...
@@ -70,6 +71,9 @@
...
@@ -70,6 +71,9 @@
changeAdjustPosition(event : UniSwitchChangeEvent) {
changeAdjustPosition(event : UniSwitchChangeEvent) {
const checked = event.detail.value;
const checked = event.detail.value;
this.adjust_position = checked;
this.adjust_position = checked;
},
change_disabled_boolean(checked : boolean) {
this.disabled = checked
}
}
}
}
}
}
...
@@ -85,7 +89,7 @@
...
@@ -85,7 +89,7 @@
:show-confirm-bar="show_confirm_bar_boolean" :adjust-position="adjust_position_boolean"
:show-confirm-bar="show_confirm_bar_boolean" :adjust-position="adjust_position_boolean"
:cursor-color="cursor_color" :cursor="cursor" :placeholder="placeholder_value"
:cursor-color="cursor_color" :cursor="cursor" :placeholder="placeholder_value"
:inputmode="inputmode_enum[inputmode_enum_current].name"
:inputmode="inputmode_enum[inputmode_enum_current].name"
:confirm-type="confirm_type_list[confirm_type_current].name" @click="textarea_click"
:confirm-type="confirm_type_list[confirm_type_current].name"
:disabled="disabled"
@click="textarea_click"
@touchstart="textarea_touchstart" @touchmove="textarea_touchmove" @touchcancel="textarea_touchcancel"
@touchstart="textarea_touchstart" @touchmove="textarea_touchmove" @touchcancel="textarea_touchcancel"
@touchend="textarea_touchend" @tap="textarea_tap" @longpress="textarea_longpress" @confirm="textarea_confirm"
@touchend="textarea_touchend" @tap="textarea_tap" @longpress="textarea_longpress" @confirm="textarea_confirm"
@input="textarea_input" @linechange="textarea_linechange" @blur="textarea_blur"
@input="textarea_input" @linechange="textarea_linechange" @blur="textarea_blur"
...
@@ -100,6 +104,8 @@
...
@@ -100,6 +104,8 @@
<boolean-data :defaultValue="focus_boolean" title="获取焦点" @change="change_focus_boolean"></boolean-data>
<boolean-data :defaultValue="focus_boolean" title="获取焦点" @change="change_focus_boolean"></boolean-data>
<boolean-data :defaultValue="true" title="首次自动获取焦点" @change="change_auto_focus_boolean"></boolean-data>
<boolean-data :defaultValue="true" title="首次自动获取焦点" @change="change_auto_focus_boolean"></boolean-data>
<boolean-data :defaultValue="false" title="改变光标颜色为透明" @change="change_cursor_color_boolean"></boolean-data>
<boolean-data :defaultValue="false" title="改变光标颜色为透明" @change="change_cursor_color_boolean"></boolean-data>
<boolean-data :defaultValue="false" title="设置禁用输入框"
@change="change_disabled_boolean"></boolean-data>
<enum-data :items="confirm_type_list" title="confirm-type,设置键盘右下角按钮。(Android仅支持return)"
<enum-data :items="confirm_type_list" title="confirm-type,设置键盘右下角按钮。(Android仅支持return)"
@change="radio_change_confirm_type"></enum-data>
@change="radio_change_confirm_type"></enum-data>
<boolean-data :defaultValue="false" title="点击软键盘右下角按钮时是否保持键盘不收起(confirm-type为return时必然不收起)"
<boolean-data :defaultValue="false" title="点击软键盘右下角按钮时是否保持键盘不收起(confirm-type为return时必然不收起)"
...
...
static/stop.png
0 → 100644
浏览文件 @
306b1430
2.5 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录