Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yangkaifeng
uni-app
提交
026cf64a
U
uni-app
项目概览
yangkaifeng
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
026cf64a
编写于
4月 22, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: popup
上级
65d74e8b
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
151 addition
and
47 deletion
+151
-47
packages/uni-api/src/index.ts
packages/uni-api/src/index.ts
+7
-2
packages/uni-api/src/protocols/ui/hideLoading.ts
packages/uni-api/src/protocols/ui/hideLoading.ts
+2
-0
packages/uni-api/src/protocols/ui/hideToast.ts
packages/uni-api/src/protocols/ui/hideToast.ts
+2
-0
packages/uni-api/src/protocols/ui/showActionSheet.ts
packages/uni-api/src/protocols/ui/showActionSheet.ts
+14
-0
packages/uni-api/src/protocols/ui/showLoading.ts
packages/uni-api/src/protocols/ui/showLoading.ts
+12
-0
packages/uni-api/src/protocols/ui/showModal.ts
packages/uni-api/src/protocols/ui/showModal.ts
+42
-0
packages/uni-api/src/protocols/ui/showToast.ts
packages/uni-api/src/protocols/ui/showToast.ts
+28
-0
packages/uni-h5/dist/uni-h5.esm.js
packages/uni-h5/dist/uni-h5.esm.js
+44
-45
未找到文件。
packages/uni-api/src/index.ts
浏览文件 @
026cf64a
...
...
@@ -45,10 +45,15 @@ export * from './protocols/location/getLocation'
export
*
from
'
./protocols/route/route
'
export
*
from
'
./protocols/ui/hideLoading
'
export
*
from
'
./protocols/ui/hideToast
'
export
*
from
'
./protocols/ui/loadFontFace
'
export
*
from
'
./protocols/ui/pageScrollTo
'
export
*
from
'
./protocols/ui/navigationBar
'
export
*
from
'
./protocols/ui/popup
'
export
*
from
'
./protocols/ui/pageScrollTo
'
export
*
from
'
./protocols/ui/showActionSheet
'
export
*
from
'
./protocols/ui/showLoading
'
export
*
from
'
./protocols/ui/showModal
'
export
*
from
'
./protocols/ui/showToast
'
export
*
from
'
./protocols/ui/startPullDownRefresh
'
export
*
from
'
./protocols/ui/stopPullDownRefresh
'
export
*
from
'
./protocols/ui/tabBar
'
...
...
packages/uni-api/src/protocols/ui/hideLoading.ts
0 → 100644
浏览文件 @
026cf64a
export
const
API_HIDE_LOADING
=
'
hideLoading
'
export
type
API_TYPE_HIDE_LOADING
=
typeof
uni
.
hideLoading
packages/uni-api/src/protocols/ui/hideToast.ts
0 → 100644
浏览文件 @
026cf64a
export
const
API_HIDE_TOAST
=
'
hideToast
'
export
type
API_TYPE_HIDE_TOAST
=
typeof
uni
.
hideToast
packages/uni-api/src/protocols/ui/showActionSheet.ts
0 → 100644
浏览文件 @
026cf64a
export
const
API_SHOW_ACTION_SHEET
=
'
showActionSheet
'
export
type
API_TYPE_SHOW_ACTION_SHEET
=
typeof
uni
.
showActionSheet
export
const
ShowActionSheetProtocol
:
ApiProtocol
<
API_TYPE_SHOW_ACTION_SHEET
>
=
{
itemList
:
{
type
:
Array
,
required
:
true
,
},
itemColor
:
String
,
}
export
const
ShowActionSheetOptions
:
ApiOptions
<
API_TYPE_SHOW_ACTION_SHEET
>
=
{
formatArgs
:
{
itemColor
:
'
#000
'
,
},
}
packages/uni-api/src/protocols/ui/showLoading.ts
0 → 100644
浏览文件 @
026cf64a
export
const
API_SHOW_LOADING
=
'
showLoading
'
export
type
API_TYPE_SHOW_LOADING
=
typeof
uni
.
showLoading
export
const
ShowLoadingProtocol
:
ApiProtocol
<
API_TYPE_SHOW_LOADING
>
=
{
title
:
String
,
mask
:
Boolean
,
}
export
const
ShowLoadingOptions
:
ApiOptions
<
API_TYPE_SHOW_LOADING
>
=
{
formatArgs
:
{
title
:
''
,
mask
:
false
,
},
}
packages/uni-api/src/protocols/ui/
popup
.ts
→
packages/uni-api/src/protocols/ui/
showModal
.ts
浏览文件 @
026cf64a
import
{
hasOwn
}
from
'
@vue/shared
'
import
{
useI18n
,
initI18nShowModalMsgsOnce
}
from
'
@dcloudio/uni-core
'
import
{
PRIMARY_COLOR
}
from
'
@dcloudio//uni-shared
'
import
{
getRealPath
}
from
'
@dcloudio/uni-platform
'
import
{
PRIMARY_COLOR
}
from
'
@dcloudio/uni-shared
'
import
{
initI18nShowModalMsgsOnce
,
useI18n
}
from
'
@dcloudio/uni-core
'
export
const
API_SHOW_MODAL
=
'
showModal
'
export
type
API_TYPE_SHOW_MODAL
=
typeof
uni
.
showModal
...
...
@@ -40,61 +40,3 @@ export const ShowModalOptions: ApiOptions<API_TYPE_SHOW_MODAL> = {
confirmColor
:
PRIMARY_COLOR
,
},
}
export
const
API_SHOW_TOAST
=
'
showToast
'
export
type
API_TYPE_SHOW_TOAST
=
typeof
uni
.
showToast
export
const
ShowToastProtocol
:
ApiProtocol
<
API_TYPE_SHOW_TOAST
>
=
{
title
:
String
,
icon
:
String
as
any
,
image
:
String
,
duration
:
Number
,
mask
:
Boolean
,
}
export
const
ShowToastOptions
:
ApiOptions
<
API_TYPE_SHOW_TOAST
>
=
{
formatArgs
:
{
title
:
''
,
icon
(
value
,
params
)
{
if
([
'
success
'
,
'
loading
'
,
'
none
'
].
indexOf
(
value
!
)
===
-
1
)
{
params
.
icon
=
'
success
'
}
},
image
(
value
,
params
)
{
if
(
value
)
{
params
.
image
=
getRealPath
(
value
)
}
},
duration
:
1500
,
mask
:
false
,
},
}
export
const
API_SHOW_LOADING
=
'
showLoading
'
export
type
API_TYPE_SHOW_LOADING
=
typeof
uni
.
showLoading
export
const
ShowLoadingProtocol
:
ApiProtocol
<
API_TYPE_SHOW_LOADING
>
=
{
title
:
String
,
mask
:
Boolean
,
}
export
const
ShowLoadingOptions
:
ApiOptions
<
API_TYPE_SHOW_LOADING
>
=
{
formatArgs
:
{
title
:
''
,
mask
:
false
,
},
}
export
const
API_SHOW_ACTION_SHEET
=
'
showActionSheet
'
export
type
API_TYPE_SHOW_ACTION_SHEET
=
typeof
uni
.
showActionSheet
export
const
ShowActionSheetProtocol
:
ApiProtocol
<
API_TYPE_SHOW_ACTION_SHEET
>
=
{
itemList
:
{
type
:
Array
,
required
:
true
,
},
itemColor
:
String
,
}
export
const
ShowActionSheetOptions
:
ApiOptions
<
API_TYPE_SHOW_ACTION_SHEET
>
=
{
formatArgs
:
{
itemColor
:
'
#000
'
,
},
}
export
const
API_HIDE_TOAST
=
'
hideToast
'
export
type
API_TYPE_HIDE_TOAST
=
typeof
uni
.
hideToast
export
const
API_HIDE_LOADING
=
'
hideLoading
'
export
type
API_TYPE_HIDE_LOADING
=
typeof
uni
.
hideLoading
packages/uni-api/src/protocols/ui/showToast.ts
0 → 100644
浏览文件 @
026cf64a
import
{
getRealPath
}
from
'
@dcloudio/uni-platform
'
export
const
API_SHOW_TOAST
=
'
showToast
'
export
type
API_TYPE_SHOW_TOAST
=
typeof
uni
.
showToast
export
const
ShowToastProtocol
:
ApiProtocol
<
API_TYPE_SHOW_TOAST
>
=
{
title
:
String
,
icon
:
String
as
any
,
image
:
String
,
duration
:
Number
,
mask
:
Boolean
,
}
export
const
ShowToastOptions
:
ApiOptions
<
API_TYPE_SHOW_TOAST
>
=
{
formatArgs
:
{
title
:
''
,
icon
(
value
,
params
)
{
if
([
'
success
'
,
'
loading
'
,
'
none
'
].
indexOf
(
value
!
)
===
-
1
)
{
params
.
icon
=
'
success
'
}
},
image
(
value
,
params
)
{
if
(
value
)
{
params
.
image
=
getRealPath
(
value
)
}
},
duration
:
1500
,
mask
:
false
,
},
}
packages/uni-h5/dist/uni-h5.esm.js
浏览文件 @
026cf64a
import
{
isFunction
,
extend
,
isPlainObject
,
isString
,
isArray
,
hasOwn
as
hasOwn$1
,
isObject
as
isObject$1
,
capitalize
,
toRawType
,
makeMap
as
makeMap$1
,
isPromise
,
invokeArrayFns
as
invokeArrayFns$1
,
hyphenate
}
from
"
@vue/shared
"
;
import
{
injectHook
,
createVNode
,
inject
,
provide
,
reactive
,
computed
,
nextTick
,
getCurrentInstance
,
onBeforeMount
,
onMounted
,
onBeforeActivate
,
onBeforeDeactivate
,
openBlock
,
createBlock
,
mergeProps
,
toDisplayString
,
ref
,
defineComponent
,
resolveComponent
,
toHandlers
,
renderSlot
,
watch
,
onActivated
,
onBeforeUnmount
,
withModifiers
,
withDirectives
,
vShow
,
vModelDynamic
,
createTextVNode
,
createCommentVNode
,
Fragment
,
renderList
,
vModelText
,
onDeactivated
,
onUnmounted
,
watchEffect
,
withCtx
,
KeepAlive
,
resolveDynamicComponent
}
from
"
vue
"
;
import
{
once
,
passive
,
normalizeTarget
,
invokeArrayFns
,
NAVBAR_HEIGHT
,
parseQuery
,
removeLeadingSlash
,
getLen
,
ON_REACH_BOTTOM_DISTANCE
,
decodedQuery
,
plusReady
,
debounce
,
PRIMARY_COLOR
as
PRIMARY_COLOR$1
,
updateElementStyle
,
addFont
,
scrollTo
}
from
"
@dcloudio/uni-shared
"
;
import
{
once
,
passive
,
normalizeTarget
,
invokeArrayFns
,
NAVBAR_HEIGHT
,
parseQuery
,
PRIMARY_COLOR
,
removeLeadingSlash
,
getLen
,
ON_REACH_BOTTOM_DISTANCE
,
decodedQuery
,
plusReady
,
debounce
,
updateElementStyle
,
addFont
,
scrollTo
}
from
"
@dcloudio/uni-shared
"
;
import
{
useRoute
,
createRouter
,
createWebHistory
,
createWebHashHistory
,
useRouter
,
isNavigationFailure
,
RouterView
}
from
"
vue-router
"
;
function
applyOptions
(
options
,
instance2
,
publicThis
)
{
Object
.
keys
(
options
).
forEach
((
name
)
=>
{
...
...
@@ -2627,6 +2627,8 @@ function createNormalizeUrl(type) {
}
};
}
const
API_HIDE_LOADING
=
"
hideLoading
"
;
const
API_HIDE_TOAST
=
"
hideToast
"
;
const
API_LOAD_FONT_FACE
=
"
loadFontFace
"
;
const
LoadFontFaceProtocol
=
{
family
:
{
...
...
@@ -2639,20 +2641,6 @@ const LoadFontFaceProtocol = {
},
desc
:
Object
};
const
API_PAGE_SCROLL_TO
=
"
pageScrollTo
"
;
const
PageScrollToProtocol
=
{
scrollTop
:
Number
,
selector
:
String
,
duration
:
Number
};
const
DEFAULT_DURATION
=
300
;
const
PageScrollToOptions
=
{
formatArgs
:
{
duration
(
value
,
params
)
{
params
.
duration
=
Math
.
max
(
0
,
parseInt
(
value
+
""
)
||
DEFAULT_DURATION
);
}
}
};
const
FRONT_COLORS
=
[
"
#ffffff
"
,
"
#000000
"
];
const
API_SET_NAVIGATION_BAR_COLOR
=
"
setNavigationBarColor
"
;
const
SetNavigationBarColorOptions
=
{
...
...
@@ -2693,7 +2681,44 @@ const SetNavigationBarTitleProtocol = {
};
const
API_SHOW_NAVIGATION_BAR_LOADING
=
"
showNavigationBarLoading
"
;
const
API_HIDE_NAVIGATION_BAR_LOADING
=
"
hideNavigationBarLoading
"
;
const
PRIMARY_COLOR
=
"
#007aff
"
;
const
API_PAGE_SCROLL_TO
=
"
pageScrollTo
"
;
const
PageScrollToProtocol
=
{
scrollTop
:
Number
,
selector
:
String
,
duration
:
Number
};
const
DEFAULT_DURATION
=
300
;
const
PageScrollToOptions
=
{
formatArgs
:
{
duration
(
value
,
params
)
{
params
.
duration
=
Math
.
max
(
0
,
parseInt
(
value
+
""
)
||
DEFAULT_DURATION
);
}
}
};
const
API_SHOW_ACTION_SHEET
=
"
showActionSheet
"
;
const
ShowActionSheetProtocol
=
{
itemList
:
{
type
:
Array
,
required
:
true
},
itemColor
:
String
};
const
ShowActionSheetOptions
=
{
formatArgs
:
{
itemColor
:
"
#000
"
}
};
const
API_SHOW_LOADING
=
"
showLoading
"
;
const
ShowLoadingProtocol
=
{
title
:
String
,
mask
:
Boolean
};
const
ShowLoadingOptions
=
{
formatArgs
:
{
title
:
""
,
mask
:
false
}
};
const
API_SHOW_MODAL
=
"
showModal
"
;
const
ShowModalProtocol
=
{
title
:
String
,
...
...
@@ -2753,32 +2778,6 @@ const ShowToastOptions = {
mask
:
false
}
};
const
API_SHOW_LOADING
=
"
showLoading
"
;
const
ShowLoadingProtocol
=
{
title
:
String
,
mask
:
Boolean
};
const
ShowLoadingOptions
=
{
formatArgs
:
{
title
:
""
,
mask
:
false
}
};
const
API_SHOW_ACTION_SHEET
=
"
showActionSheet
"
;
const
ShowActionSheetProtocol
=
{
itemList
:
{
type
:
Array
,
required
:
true
},
itemColor
:
String
};
const
ShowActionSheetOptions
=
{
formatArgs
:
{
itemColor
:
"
#000
"
}
};
const
API_HIDE_TOAST
=
"
hideToast
"
;
const
API_HIDE_LOADING
=
"
hideLoading
"
;
const
API_START_PULL_DOWN_REFRESH
=
"
startPullDownRefresh
"
;
const
API_STOP_PULL_DOWN_REFRESH
=
"
stopPullDownRefresh
"
;
const
IndexProtocol
=
{
...
...
@@ -5981,11 +5980,11 @@ const CANCEL_COLOR = "#f43530";
const
ICONS
=
{
success
:
{
d
:
ICON_PATH_SUCCESS
,
c
:
PRIMARY_COLOR
$1
c
:
PRIMARY_COLOR
},
success_no_circle
:
{
d
:
ICON_PATH_SUCCESS_NO_CIRCLE
,
c
:
PRIMARY_COLOR
$1
c
:
PRIMARY_COLOR
},
info
:
{
d
:
ICON_PATH_INFO
,
...
...
@@ -6005,7 +6004,7 @@ const ICONS = {
},
download
:
{
d
:
ICON_PATH_DOWNLOAD
,
c
:
PRIMARY_COLOR
$1
c
:
PRIMARY_COLOR
},
search
:
{
d
:
ICON_PATH_SEARCH
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录