Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
64442b00
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5977
Star
89
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
64442b00
编写于
7月 16, 2024
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 公共属性和事件调整为全局属性和事件
上级
ad2b6884
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
96 addition
and
92 deletion
+96
-92
pages.json
pages.json
+49
-45
pages/component/global-events/global-events.test.js
pages/component/global-events/global-events.test.js
+1
-1
pages/component/global-events/global-events.uvue
pages/component/global-events/global-events.uvue
+2
-2
pages/component/global-events/touch-events.uvue
pages/component/global-events/touch-events.uvue
+0
-0
pages/component/global-events/transition-events.test.js
pages/component/global-events/transition-events.test.js
+1
-1
pages/component/global-events/transition-events.uvue
pages/component/global-events/transition-events.uvue
+0
-0
pages/component/global-properties/global-properties.test.js
pages/component/global-properties/global-properties.test.js
+1
-1
pages/component/global-properties/global-properties.uvue
pages/component/global-properties/global-properties.uvue
+1
-1
pages/pages.test.js
pages/pages.test.js
+5
-5
store/index.uts
store/index.uts
+31
-31
windows/left-window.uvue
windows/left-window.uvue
+2
-2
windows/top-window.uvue
windows/top-window.uvue
+3
-3
未找到文件。
pages.json
浏览文件 @
64442b00
{
"leftWindow"
:
{
"path"
:
"windows/left-window.uvue"
,
"style"
:
{
"width"
:
"350px"
}
},
"topWindow"
:
{
"path"
:
"windows/top-window.uvue"
,
"style"
:
{
"height"
:
"60px"
}
},
"leftWindow"
:
{
"path"
:
"windows/left-window.uvue"
,
"style"
:
{
"width"
:
"350px"
}
},
"topWindow"
:
{
"path"
:
"windows/top-window.uvue"
,
"style"
:
{
"height"
:
"60px"
}
},
"pages"
:
[
{
"path"
:
"pages/tabBar/component"
,
...
...
@@ -343,28 +343,28 @@
}
},
{
"path"
:
"pages/component/
public-properties/public
-properties"
,
"path"
:
"pages/component/
global-properties/global
-properties"
,
"group"
:
"0,0"
,
"style"
:
{
"navigationBarTitleText"
:
"
公共
属性"
"navigationBarTitleText"
:
"
全局
属性"
}
},
{
"path"
:
"pages/component/
public-events/public
-events"
,
"path"
:
"pages/component/
global-events/global
-events"
,
"group"
:
"0,0"
,
"style"
:
{
"navigationBarTitleText"
:
"
公共
事件"
"navigationBarTitleText"
:
"
全局
事件"
}
},
{
"path"
:
"pages/component/
public
-events/transition-events"
,
"path"
:
"pages/component/
global
-events/transition-events"
,
"group"
:
"0,0"
,
"style"
:
{
"navigationBarTitleText"
:
"Transition Events"
}
},
{
"path"
:
"pages/component/
public
-events/touch-events"
,
"path"
:
"pages/component/
global
-events/touch-events"
,
"group"
:
"0,0"
,
"style"
:
{
"navigationBarTitleText"
:
"Touch Events"
...
...
@@ -488,6 +488,16 @@
"navigationBarTitleText"
:
"ball"
}
},
//
#ifndef
WEB
{
"path"
:
"pages/component/animation-view/animation-view"
,
"group"
:
"0,5,3"
,
"style"
:
{
"navigationBarTitleText"
:
"animation-view | Lottie动画"
,
"enablePullDownRefresh"
:
false
}
},
//
#endif
{
"path"
:
"pages/tabBar/API"
,
"style"
:
{
...
...
@@ -982,16 +992,16 @@
"enablePullDownRefresh"
:
false
}
},
//
#ifdef
APP-IOS
{
"path"
:
"pages/API/virtual-payment/virtual-payment"
,
"group"
:
"1,14
"
,
"style"
:
{
"navigationBarTitleText"
:
"virtualPayment | 苹果内购"
,
"enablePullDownRefresh"
:
false
}
},
//
#endif
//
#ifdef
APP-IOS
{
"path"
:
"pages/API/virtual-payment/virtual-payment"
,
"group"
:
"1,14,1
"
,
"style"
:
{
"navigationBarTitleText"
:
"virtualPayment | 苹果内购"
,
"enablePullDownRefresh"
:
false
}
},
//
#endif
{
"path"
:
"pages/API/request-payment/request-payment/order-detail"
,
"style"
:
{
...
...
@@ -1694,16 +1704,6 @@
}
},
//
#endif
//
#ifndef
WEB
{
"path"
:
"pages/component/animation-view/animation-view"
,
"group"
:
"0,5,3"
,
"style"
:
{
"navigationBarTitleText"
:
"lottie动画-需要自定义基座"
,
"enablePullDownRefresh"
:
false
}
},
//
#endif
//
#ifdef
APP
||
WEB
{
"path"
:
"uni_modules/uni-pay-x/pages/success/success"
,
...
...
@@ -1801,8 +1801,8 @@
"name"
:
"组件"
,
"children"
:
[
{
"id"
:
"component.
public
-properties-events"
,
"name"
:
"
公共
属性和事件"
"id"
:
"component.
global
-properties-events"
,
"name"
:
"
全局
属性和事件"
},
{
"id"
:
"component.view-container"
,
...
...
@@ -1972,10 +1972,10 @@
"id"
:
"component.media.video"
,
"name"
:
"video"
},
{
"id"
:
"component.media.animation-view"
,
"name"
:
"animation-view"
}
{
"id"
:
"component.media.animation-view"
,
"name"
:
"animation-view"
}
]
},
{
...
...
@@ -2320,6 +2320,10 @@
{
"id"
:
"api.payment.requestPayment"
,
"name"
:
"requestPayment"
},
{
"id"
:
"api.payment.virtualPayment"
,
"name"
:
"virtualPayment"
}
]
},
...
...
@@ -2677,4 +2681,4 @@
]
}
]
}
}
\ No newline at end of file
pages/component/
public-events/public
-events.test.js
→
pages/component/
global-events/global
-events.test.js
浏览文件 @
64442b00
const
PAGE_PATH
=
'
/pages/component/
public-events/public
-events
'
const
PAGE_PATH
=
'
/pages/component/
global-events/global
-events
'
describe
(
'
event trigger
'
,
()
=>
{
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
...
...
pages/component/
public-events/public
-events.uvue
→
pages/component/
global-events/global
-events.uvue
浏览文件 @
64442b00
...
...
@@ -433,7 +433,7 @@
export default {
data() {
return {
title: '
public
-events',
title: '
global
-events',
touchStartEvent: null as TouchEvent | null,
touchCancelEvent: null as TouchEvent | null,
touchMoveEvent: null as TouchEvent | null,
...
...
@@ -502,4 +502,4 @@
margin-top: 5px;
font-size: 16px;
}
</style>
</style>
pages/component/
public
-events/touch-events.uvue
→
pages/component/
global
-events/touch-events.uvue
浏览文件 @
64442b00
文件已移动
pages/component/
public
-events/transition-events.test.js
→
pages/component/
global
-events/transition-events.test.js
浏览文件 @
64442b00
...
...
@@ -3,7 +3,7 @@
describe
(
'
transition event
'
,
()
=>
{
let
page
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/
public
-events/transition-events
'
)
page
=
await
program
.
reLaunch
(
'
/pages/component/
global
-events/transition-events
'
)
await
page
.
waitFor
(
3000
);
});
...
...
pages/component/
public
-events/transition-events.uvue
→
pages/component/
global
-events/transition-events.uvue
浏览文件 @
64442b00
文件已移动
pages/component/
public-properties/public
-properties.test.js
→
pages/component/
global-properties/global
-properties.test.js
浏览文件 @
64442b00
const
PAGE_PATH
=
'
/pages/component/
public-properties/public
-properties
'
const
PAGE_PATH
=
'
/pages/component/
global-properties/global
-properties
'
describe
(
'
general attribute
'
,
()
=>
{
let
page
...
...
pages/component/
public-properties/public
-properties.uvue
→
pages/component/
global-properties/global
-properties.uvue
浏览文件 @
64442b00
...
...
@@ -55,7 +55,7 @@
export default {
data() {
return {
title: '
public
-properties',
title: '
global
-properties',
generalId: 'general-id',
generalClass: 'general-class',
generalName: 'general-name',
...
...
pages/pages.test.js
浏览文件 @
64442b00
...
...
@@ -82,10 +82,10 @@ const pages = [
// '/pages/component/unicloud-db/unicloud-db/contacts/detail',
'
/pages/component/unicloud-db/unicloud-db/mixin-datacom/mixin-datacom
'
,
// 单独测试例截图
// '/pages/component/
public-properties/public
-properties',
'
/pages/component/
public-events/public
-events
'
,
'
/pages/component/
public
-events/transition-events
'
,
'
/pages/component/
public
-events/touch-events
'
,
// '/pages/component/
global-properties/global
-properties',
'
/pages/component/
global-events/global
-events
'
,
'
/pages/component/
global
-events/transition-events
'
,
'
/pages/component/
global
-events/touch-events
'
,
// 单独测试例截图
// '/pages/component/nested-scroll-header/nested-scroll-header',
// 单独测试例截图
...
...
@@ -344,7 +344,7 @@ function getWaitForTagName(pagePath) {
return
'
video
'
}
if
(
pagePath
===
'
/pages/component/
public
-events/transition-events
'
||
pagePath
===
'
/pages/component/
global
-events/transition-events
'
||
pagePath
===
'
/pages/component/list-view/list-view-refresh
'
||
pagePath
===
'
/pages/API/env/env
'
)
{
...
...
store/index.uts
浏览文件 @
64442b00
export type SafeArea = {
top : number,
right : number,
bottom : number,
left : number,
width : number,
height : number,
}
export type SafeArea = {
top : number,
right : number,
bottom : number,
left : number,
width : number,
height : number,
}
type State = {
lifeCycleNum : number,
// 状态栏高度
...
...
@@ -15,22 +15,22 @@ type State = {
// 设备像素比
devicePixelRatio : number
// 事件判断回调
eventCallbackNum: number
// 是否匹配左侧窗口
noMatchLeftWindow:boolean
// 当前激活的tab页
active: string
eventCallbackNum: number
// 是否匹配左侧窗口
noMatchLeftWindow:boolean
// 当前激活的tab页
active: string
leftWinActive:string
}
export const state = reactive({
lifeCycleNum: 0,
statusBarHeight: 0,
devicePixelRatio: 1,
eventCallbackNum: 0,
noMatchLeftWindow: true,
active: 'componentPage',
leftWinActive: '/pages/component/
public-properties/public
-properties',
devicePixelRatio: 1,
eventCallbackNum: 0,
noMatchLeftWindow: true,
active: 'componentPage',
leftWinActive: '/pages/component/
global-properties/global
-properties',
safeArea: {
top: 0,
right: 0,
...
...
@@ -43,33 +43,33 @@ export const state = reactive({
export const setLifeCycleNum = (num : number) => {
state.lifeCycleNum = num
}
}
export const setEventCallbackNum = (num : number) => {
state.eventCallbackNum = num
}
export const setStatusBarHeight = (height : number) => {
state.statusBarHeight = height
}
}
export const setSafeArea = (value : SafeArea) => {
state.safeArea = value
}
export const setDevicePixelRatio = (devicePixelRatio : number) => {
state.devicePixelRatio = devicePixelRatio
}
}
export const setMatchLeftWindow = (matchLeftWindow:boolean) => {
state.noMatchLeftWindow = !matchLeftWindow
}
}
export const setActive = (tabPage:string) => {
state.active = tabPage
}
}
export const setLeftWinActive = (leftWinActive:string) => {
state.leftWinActive = leftWinActive
}
}
windows/left-window.uvue
浏览文件 @
64442b00
...
...
@@ -56,7 +56,7 @@
const pageName = this.$route.path.split('/')[4]
if(pageUrl === '/'){
uni.reLaunch({
url: "/pages/component/
public-properties/public
-properties"
url: "/pages/component/
global-properties/global
-properties"
})
}else{
uni.reLaunch({
...
...
@@ -103,7 +103,7 @@
if (this.isPC) {
if (newRoute.path === '/') {
uni.redirectTo({
url: '/pages/component/
public-properties/public
-properties'
url: '/pages/component/
global-properties/global
-properties'
})
} else if (!newRoute.matched.length) {
uni.redirectTo({
...
...
windows/top-window.uvue
浏览文件 @
64442b00
<template>
<view class="top-window-header">
<view class="left-header">
<navigator class="left-header" open-type="reLaunch" url="/pages/component/
public-properties/public
-properties">
<navigator class="left-header" open-type="reLaunch" url="/pages/component/
global-properties/global
-properties">
<image src="/static/logo.png" class="logo" mode="heightFix"></image>
<text>hello uni-app</text>
</navigator>
...
...
@@ -28,7 +28,7 @@
current: 0,
indexPage: [{
tabBar: '/pages/tabBar/component',
index: '/pages/component/
public-properties/public
-properties'
index: '/pages/component/
global-properties/global
-properties'
}, {
tabBar: '/pages/tabBar/API',
index: '/pages/API/get-app/get-app'
...
...
@@ -51,7 +51,7 @@
let comp
if (path === '/') {
comp = 'component'
path = '/pages/component/
public-properties/public
-properties'
path = '/pages/component/
global-properties/global
-properties'
} else {
comp = path.split('/')[2]
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录