Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
524ab7d4
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6006
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看板
提交
524ab7d4
编写于
10月 28, 2024
作者:
zhaofengliang920817
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into dev-share
上级
eaeaa109
8b19183b
变更
22
展开全部
隐藏空白更改
内联
并排
Showing
22 changed file
with
572 addition
and
159 deletion
+572
-159
App.uvue
App.uvue
+39
-39
main.uts
main.uts
+12
-12
manifest.json
manifest.json
+2
-2
pages.json
pages.json
+381
-33
pages/API/dialog-page/dialog-page.test.js
pages/API/dialog-page/dialog-page.test.js
+7
-0
pages/API/dialog-page/next-page.uvue
pages/API/dialog-page/next-page.uvue
+2
-1
pages/API/privacy/privacy.uvue
pages/API/privacy/privacy.uvue
+8
-0
pages/component/button/button.uvue
pages/component/button/button.uvue
+9
-1
pages/component/button/privacy.uvue
pages/component/button/privacy.uvue
+7
-7
pages/component/native-view/native-view.uvue
pages/component/native-view/native-view.uvue
+13
-2
pages/component/rich-text/rich-text.test.js
pages/component/rich-text/rich-text.test.js
+18
-10
pages/component/rich-text/rich-text.uvue
pages/component/rich-text/rich-text.uvue
+26
-18
pages/component/video/video.uvue
pages/component/video/video.uvue
+2
-2
pages/pages.test.js
pages/pages.test.js
+7
-7
pages/tabBar/API.uvue
pages/tabBar/API.uvue
+2
-6
pages/tabBar/CSS.uvue
pages/tabBar/CSS.uvue
+1
-1
pages/tabBar/component.uvue
pages/tabBar/component.uvue
+15
-3
pages/tabBar/generateMenu.uts
pages/tabBar/generateMenu.uts
+0
-11
pages/tabBar/template.uvue
pages/tabBar/template.uvue
+1
-1
uni_modules/uni-upgrade-center-app/changelog.md
uni_modules/uni-upgrade-center-app/changelog.md
+4
-0
uni_modules/uni-upgrade-center-app/components/uni-upgrade-center-app/uni-upgrade-center-app.uvue
...onents/uni-upgrade-center-app/uni-upgrade-center-app.uvue
+11
-0
uni_modules/uni-upgrade-center-app/package.json
uni_modules/uni-upgrade-center-app/package.json
+5
-3
未找到文件。
App.uvue
浏览文件 @
524ab7d4
...
...
@@ -49,15 +49,15 @@
// 统计上报 - 应用启动
// #ifdef APP-ANDROID || APP-IOS || WEB
uni.report({
name: 'uni-app-launch',
options: res,
success(res_data) {
console.log(res_data);
}, fail(err) {
console.log(err);
}
})
//
uni.report({
//
name: 'uni-app-launch',
//
options: res,
//
success(res_data) {
//
console.log(res_data);
//
}, fail(err) {
//
console.log(err);
//
}
//
})
// #endif
// #ifdef APP
if (process.env.NODE_ENV !== 'development') { //真机运行可以注释此条件
...
...
@@ -90,14 +90,14 @@
// #ifdef APP-ANDROID || APP-IOS || WEB
// 统计上报 - 应用显示
uni.report({
name: 'uni-app-show',
success(res_data) {
console.log(res_data);
}, fail(err) {
console.log(err);
}
})
//
uni.report({
//
name: 'uni-app-show',
//
success(res_data) {
//
console.log(res_data);
//
}, fail(err) {
//
console.log(err);
//
}
//
})
// #endif
},
onHide: function () {
...
...
@@ -107,14 +107,14 @@
// #ifdef APP-ANDROID || APP-IOS || WEB
// 统计上报 - 应用进入后台
uni.report({
name: 'uni-app-hide',
success(res) {
console.log(res);
}, fail(err) {
console.log(err);
}
})
//
uni.report({
//
name: 'uni-app-hide',
//
success(res) {
//
console.log(res);
//
}, fail(err) {
//
console.log(err);
//
}
//
})
// #endif
},
// #ifdef APP-ANDROID
...
...
@@ -139,20 +139,20 @@
onExit() {
console.log('App Exit')
},
onError(err : any) {
// #ifdef APP-ANDROID || APP-IOS || WEB
// 统计上报 - 应用发生错误
uni.report({
name: 'uni-app-error',
options: err,
success(res) {
console.log(res);
}, fail(err) {
console.log(err);
}
})
// #endif
},
//
onError(err : any) {
//
// #ifdef APP-ANDROID || APP-IOS || WEB
//
// 统计上报 - 应用发生错误
//
uni.report({
//
name: 'uni-app-error',
//
options: err,
//
success(res) {
//
console.log(res);
//
}, fail(err) {
//
console.log(err);
//
}
//
})
//
// #endif
//
},
// #endif
methods: {
increasetLifeCycleNum() {
...
...
main.uts
浏览文件 @
524ab7d4
// 仅测试 console.log 时机问题
import './test-main-console.uts'
// #ifdef APP-ANDROID || APP-IOS || WEB
import { uniStat } from '@/uni_modules/uni-stat/plugin.uts'
//
import { uniStat } from '@/uni_modules/uni-stat/plugin.uts'
// #endif
import App from './App.uvue'
import { createSSRApp } from 'vue'
// 统计配置
const collectItems = {
uniStatPageLog: true
}
//
//
统计配置
//
const collectItems = {
//
uniStatPageLog: true
//
}
const statOptions = {
debug: false,
collectItems: collectItems,
}
//
const statOptions = {
//
debug: false,
//
collectItems: collectItems,
//
}
export function createApp() {
const app = createSSRApp(App)
// #ifdef APP-ANDROID || APP-IOS || WEB
app.use(uniStat, statOptions)
// #endif
//
//
#ifdef APP-ANDROID || APP-IOS || WEB
//
app.use(uniStat, statOptions)
//
//
#endif
// app.mixin({
// onReady() {
// setTimeout(() => {
...
...
manifest.json
浏览文件 @
524ab7d4
...
...
@@ -2,8 +2,8 @@
"name"
:
"Hello uni-app x"
,
"appid"
:
"__UNI__HelloUniAppX"
,
"description"
:
""
,
"versionName"
:
"1.6"
,
"versionCode"
:
1060
0
,
"versionName"
:
"1.6
.3
"
,
"versionCode"
:
1060
3
,
"uni-app-x"
:
{},
/*
快应用特有相关
*/
"quickapp"
:
{},
...
...
pages.json
浏览文件 @
524ab7d4
此差异已折叠。
点击以展开。
pages/API/dialog-page/dialog-page.test.js
浏览文件 @
524ab7d4
...
...
@@ -6,6 +6,13 @@ const FIRST_PAGE_PATH = '/pages/API/dialog-page/dialog-page'
const
NEXT_PAGE_PATH
=
'
/pages/API/dialog-page/next-page
'
describe
(
'
dialog page
'
,
()
=>
{
if
(
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
==
'
true
'
)
{
it
(
'
skip app-webview
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
let
page
;
let
initLifeCycleNum
;
let
lifecycleNum
;
...
...
pages/API/dialog-page/next-page.uvue
浏览文件 @
524ab7d4
...
...
@@ -90,6 +90,7 @@
url: '/pages/API/dialog-page/dialog-1?name=dialog1',
success(res) {
console.log('openDialogPage1ToHomePage success', res)
uni.showToast({title: '在首页打开了 dialogPage'})
},
fail(err) {
console.log('openDialogPage1ToHomePage fail', err)
...
...
@@ -107,4 +108,4 @@
}
}
}
</script>
</script>
pages/API/privacy/privacy.uvue
浏览文件 @
524ab7d4
...
...
@@ -15,6 +15,9 @@
<button class="privacy-button" type="primary" @tap="resetPrivacyAuthorization">
重置隐私协议授权状态
</button>
<button class="privacy-button" @tap="openPrivacyDialog">
显示隐私政策弹框
</button>
</view>
</view>
</template>
...
...
@@ -63,6 +66,11 @@
},
resetPrivacyAuthorization(){
uni.resetPrivacyAuthorization()
},
openPrivacyDialog(){
uni.openDialogPage({
url: '/pages/component/button/privacy',
})
}
}
}
...
...
pages/component/button/button.uvue
浏览文件 @
524ab7d4
...
...
@@ -38,6 +38,11 @@
uni.navigateTo({
url: 'buttonstatus',
})
},
openPrivacyDialog() {
uni.openDialogPage({
url: '/pages/component/button/privacy',
})
},
//用于自动化测试
checkUniButtonElement() : boolean {
...
...
@@ -71,7 +76,10 @@
<enum-data :items="type_enum" title="按钮的类型" @change="radio_change_type_enum"></enum-data>
<input-data :defaultValue="text" title="按钮的文案" type="text" @confirm="confirm_text_input"></input-data>
<view style="height: 10px;"></view>
<button @click="navigateToChild">更多示例</button>
<button @click="openPrivacyDialog">open-type实现隐私政策弹框</button>
<view style="height: 10px;"></view>
<button @click="navigateToChild">更多示例</button>
<view style="height: 10px;"></view>
</view>
</scroll-view>
</template>
...
...
pages/component/button/privacy.uvue
浏览文件 @
524ab7d4
<template>
<view class="dialog-container">
<view class="dialog-content">
<view style="width: 100%;justify-content: center;align-items: center;">
<view style="width: 100%;justify-content: center;align-items: center;
background-color: #fff;
">
<image src="../image/logo.png" style="margin-top: 25px;width: 60px;height: 60px;"></image>
</view>
<text style="text-align: center;
margin-top: 20px;font-size: 20px;color: black
;"> 个人信息保护指引</text>
<scroll-view
style="flex: 1;align-content: center;margin-top: 10px;margin-left: 25px;margin-right: 25px
;"
<text style="text-align: center;
padding-top: 20px;font-size: 20px;color: black;background-color: #fff
;"> 个人信息保护指引</text>
<scroll-view
style="flex: 1;align-content: center;padding-top: 10px;padding-left: 25px;padding-right: 25px;background-color: #fff
;"
show-scrollbar="false">
<rich-text style="font-size: 14px;color: red;" :nodes="htmlString" @itemclick="itemClick"></rich-text>
</scroll-view>
...
...
@@ -67,9 +67,9 @@
}
.dialog-content {
height:
43
%;
height:
60
%;
width: 80%;
background-color: #fff;
/* background-color: #fff; */
border-radius: 12px;
}
...
...
@@ -80,10 +80,10 @@
.button {
border: 0px;
border-radius: 0px;
font-size:
20
px;
font-size:
15
px;
color: lightgrey;
text-align: center;
line-height:
6
0px;
line-height:
4
0px;
}
.button-hover1 {
...
...
pages/component/native-view/native-view.uvue
浏览文件 @
524ab7d4
<template>
<view>
<view>
<text class="tips">说明:如果本地无 uts 插件编译环境请提交打包自定义基座查看效果</text>
<!-- native-button 通过 native-view 绑定原生button 实现的UTS插件-标准模式组件 -->
<native-button class="native-button" style="width: 200px; height: 100px;" :text="buttonText" @buttonTap="ontap"
@load="onload"></native-button>
<!-- native-time-picker 通过 native-view 绑定原生time-picker 实现的UTS插件-标准模式组件 -->
<native-time-picker class="native-time-picker" :hour=2 :minute=3 @changed="onChanged"></native-time-picker>
</view>
</template>
...
...
@@ -38,7 +41,15 @@
}
</script>
<style>
<style>
.tips {
font-size: 14px;
color: #BEBEBE;
margin: 25px auto 25px auto;
text-align: center;
}
.native-button {
height: 100px;
width: 100px;
...
...
pages/component/rich-text/rich-text.test.js
浏览文件 @
524ab7d4
const
PAGE_PATH
=
'
/pages/component/rich-text/rich-text
'
const
PAGE_PATH
=
'
/pages/component/rich-text/rich-text
'
describe
(
'
rich-text-test
'
,
()
=>
{
// 先屏蔽 android 及 web 平台
...
...
@@ -9,12 +9,12 @@ describe('rich-text-test', () => {
})
return
}
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
1500
);
})
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
1500
);
})
it
(
'
richt-text-height
'
,
async
()
=>
{
...
...
@@ -54,5 +54,13 @@ describe('rich-text-test', () => {
autoTest
:
false
});
});
})
it
(
'
rich-text parent click
'
,
async
()
=>
{
const
element
=
await
page
.
$
(
'
#rich-text-parent
'
)
await
element
.
tap
()
await
page
.
waitFor
(
500
)
const
element2
=
await
page
.
$
(
'
#rich-text-str
'
)
expect
(
await
element2
.
text
()).
toBe
(
"
true
"
)
})
})
pages/component/rich-text/rich-text.uvue
浏览文件 @
524ab7d4
...
...
@@ -16,12 +16,16 @@
<text class="uni-subtitle-text">selectable</text>
<button type="default" @click="changeText">修改文本内容</button>
</view>
<view class="text-box">
<view class="text-box"
id="rich-text-parent" @click="richTextParentClick"
>
<rich-text id="richtext" style="border: 1px; border-style: solid; border-color: red;" :selectable="true"
:nodes="text"></rich-text>
<view>
<text>rich-text-parent</text>
<text id='rich-text-str'>{{richTextStr}}</text>
</view>
</view>
</view>
</view>
</view>
<rich-text v-if="autoTest" id="test-rich-text" :nodes="testNodes" :selectable="true" @itemclick="itemClickForTest" style="position: fixed;width: 100px;height: 100px;"></rich-text>
</template>
...
...
@@ -31,11 +35,12 @@
return {
text: "<span>hello uni-app x!</span><br/><span>uni-app x,终极跨平台方案</span>",
richTextHeight: 0,
richTextElement: null as UniElement | null,
// 自动化测试
autoTest: false,
testNodes: '<img src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png"></img>',
isItemClickTrigger: false
richTextElement: null as UniElement | null,
// 自动化测试
autoTest: false,
testNodes: '<img src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png"></img>',
isItemClickTrigger: false,
richTextStr: false
}
},
onReady() {
...
...
@@ -61,16 +66,19 @@
this.richTextHeight = elRect.height
console.log('richTextHeight:', this.richTextHeight)
}
},
// 自动化测试
itemClickForTest(_ : RichTextItemClickEvent) {
this.isItemClickTrigger = true;
},
getBoundingClientRectForTest() : DOMRect {
return uni.getElementById('test-rich-text')?.getBoundingClientRect()!;
},
getWindowInfoForTest() : GetWindowInfoResult {
return uni.getWindowInfo();
},
// 自动化测试
itemClickForTest(_ : RichTextItemClickEvent) {
this.isItemClickTrigger = true;
},
getBoundingClientRectForTest() : DOMRect {
return uni.getElementById('test-rich-text')?.getBoundingClientRect()!;
},
getWindowInfoForTest() : GetWindowInfoResult {
return uni.getWindowInfo();
},
richTextParentClick() {
this.richTextStr = true;
}
}
}
...
...
@@ -81,4 +89,4 @@
padding: 20px 0;
background-color: white;
}
</style>
</style>
pages/component/video/video.uvue
浏览文件 @
524ab7d4
...
...
@@ -10,7 +10,7 @@
:http-cache="httpCache" :play-strategy="playStrategy" :danmu-list="danmuList" @play="onPlay" @pause="onPause"
@ended="onEnded" @timeupdate="onTimeUpdate" @waiting="onWaiting" @error="onError" @progress="onProgress"
@fullscreenclick="onFullScreenClick" @controlstoggle="onControlsToggle" @fullscreenchange="onFullScreenChange">
<!-- #ifdef APP
-ANDROID
-->
<!-- #ifdef APP -->
<image v-if="subCompEnable && subCompShow" class="img-fast-backward"
src="../../../static/test-video/fast-backward.png" @tap="fastBackward"></image>
<image v-if="subCompEnable && subCompShow" class="img-fast-forward"
...
...
@@ -26,7 +26,7 @@
<button type="primary" @click="pause">视频格式示例</button>
</navigator>
</view>
<!-- #ifdef APP
-ANDROID
-->
<!-- #ifdef APP -->
<view class="uni-flex uni-btn-v" style="justify-content: space-between;align-items: center;">
<text class="uni-title" style="width: 80%;">子组件实现快进、快退、发送弹幕功能(全屏后显示)</text>
<switch :checked="subCompEnable" @change="onSubCompEnableChange" />
...
...
pages/pages.test.js
浏览文件 @
524ab7d4
...
...
@@ -270,12 +270,12 @@ const pages = [
'
/pages/template/custom-long-list/custom-long-list
'
,
'
/pages/template/test-background-color-content/test-background-color-content
'
,
'
/pages/template/slider-100/slider-100
'
,
]
if
(
isAndroid
&&
isWeb
)
{
pages
.
push
(
'
/pages/API/get-battery-info/get-battery-info
'
,
)
]
if
(
isAndroid
&&
isWeb
)
{
pages
.
push
(
'
/pages/API/get-battery-info/get-battery-info
'
,
)
}
if
(
isApp
&&
!
isAppWebview
)
{
...
...
@@ -417,6 +417,6 @@ describe("page screenshot test", () => {
return
`__pages_test__/
${
currentPagePath
.
replace
(
/
\/
/g
,
"
-
"
).
substring
(
1
)}
`
}
})
await
page
.
waitFor
(
5
00
);
await
page
.
waitFor
(
8
00
);
});
});
pages/tabBar/API.uvue
浏览文件 @
524ab7d4
<template>
<!-- #ifdef APP -->
<scroll-view style="flex: 1;
background-color: #f8f8f8
" enable-back-to-top="true">
<scroll-view style="flex: 1;" enable-back-to-top="true">
<!-- #endif -->
<view class="uni-container">
<view v-if="!hasLeftWin" class="uni-header-logo">
...
...
@@ -79,11 +79,7 @@
goPage(url : string) {
if (url == '/set-tab-bar') {
this.showPop()
}else if (url == '/show-privacy-dialog') {
uni.openDialogPage({
url: '/pages/component/button/privacy',
})
} else {
}else {
if (this.hasLeftWin) {
uni.reLaunch({ url })
} else {
...
...
pages/tabBar/CSS.uvue
浏览文件 @
524ab7d4
<template>
<!-- #ifdef APP -->
<scroll-view style="flex: 1;
background-color: #f8f8f8
" enable-back-to-top="true">
<scroll-view style="flex: 1;" enable-back-to-top="true">
<!-- #endif -->
<view class="uni-container">
<view v-if="!hasLeftWin" class="uni-header-logo">
...
...
pages/tabBar/component.uvue
浏览文件 @
524ab7d4
<template>
<!-- #ifdef APP -->
<scroll-view style="flex: 1;
background-color: #f8f8f8
" enable-back-to-top="true">
<scroll-view style="flex: 1;" enable-back-to-top="true">
<!-- #endif -->
<view class="uni-container">
<view v-if="!hasLeftWin" class="uni-header-logo">
...
...
@@ -113,7 +113,19 @@
// #endif
onReady() {
// #ifdef UNI-APP-X && APP
checkUpdate(this.$refs['upgradePopup'] as UniUpgradeCenterAppComponentPublicInstance)
uni.getPrivacySetting({
success(res) {
if (res.needAuthorization) {
uni.onPrivacyAuthorizationChange((res) => {
if (!res.needAuthorization) {
checkUpdate(this.$refs['upgradePopup'] as UniUpgradeCenterAppComponentPublicInstance)
}
})
} else {
checkUpdate(this.$refs['upgradePopup'] as UniUpgradeCenterAppComponentPublicInstance)
}
}
})
// #endif
},
onShow() {
...
...
@@ -132,4 +144,4 @@
.item {
margin-bottom: 12px;
}
</style>
</style>
pages/tabBar/generateMenu.uts
浏览文件 @
524ab7d4
...
...
@@ -157,17 +157,6 @@ function addSetTabBarPage(menuItem : MenuItem) {
},
group: null,
items: []
} as MenuItem)
menuItem.items.push({
id: 'show-privacy-dialog',
name: '隐私政策',
index: 0,
path: 'show-privacy-dialog',
style: {
navigationBarTitleText: '隐私政策弹框'
},
group: null,
items: []
} as MenuItem)
}
}
pages/tabBar/template.uvue
浏览文件 @
524ab7d4
<template>
<!-- #ifdef APP -->
<scroll-view style="flex: 1;
background-color: #f8f8f8
" enable-back-to-top="true">
<scroll-view style="flex: 1;" enable-back-to-top="true">
<!-- #endif -->
<view class="uni-container">
<view v-if="!hasLeftWin" class="uni-header-logo">
...
...
uni_modules/uni-upgrade-center-app/changelog.md
浏览文件 @
524ab7d4
## 0.8.5(2024-10-26)
-
优化 去除不必要代码
## 0.8.4(2024-10-26)
-
修复 uni-app x 项目升级到 4.31 alpha 后中间有空隙的Bug
## 0.8.3(2024-07-31)
-
修复 部分类型报错
## 0.8.2(2024-07-15)
...
...
uni_modules/uni-upgrade-center-app/components/uni-upgrade-center-app/uni-upgrade-center-app.uvue
浏览文件 @
524ab7d4
...
...
@@ -8,6 +8,8 @@
src="/uni_modules/uni-upgrade-center-app/static/app/bg_top.png"></image>
</view>
<view class="content-space"></view>
<view class="content-body">
<view class="content-body-title">
<text class="text title">{{subTitle}}</text>
...
...
@@ -372,6 +374,15 @@
border-bottom-style: solid;
}
.content-space {
width: 100%;
height: 50px;
background-color: #fff;
position: absolute;
top: 140px;
z-index: -1;
}
.content-top-image {
width: 100%;
position: relative;
...
...
uni_modules/uni-upgrade-center-app/package.json
浏览文件 @
524ab7d4
{
"id"
:
"uni-upgrade-center-app"
,
"displayName"
:
"升级中心 uni-upgrade-center - App"
,
"version"
:
"0.8.
3
"
,
"version"
:
"0.8.
5
"
,
"description"
:
"uni升级中心 - 客户端检查更新"
,
"keywords"
:
[
"uniCloud"
,
...
...
@@ -47,8 +47,10 @@
},
"client"
:
{
"App"
:
{
"app-vue"
:
"y"
,
"app-nvue"
:
"y"
"app-vue"
:
"y"
,
"app-nvue"
:
"y"
,
"app-harmony"
:
"u"
,
"app-uvue"
:
"y"
},
"H5-mobile"
:
{
"Safari"
:
"n"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录