Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-api
提交
e9d0a0d7
U
uni-api
项目概览
DCloud
/
uni-api
通知
679
Star
23
Fork
12
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-api
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
e9d0a0d7
编写于
11月 29, 2024
作者:
DCloud-yyl
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'alpha'
上级
bb369211
98e495f4
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
290 addition
and
67 deletion
+290
-67
uni_modules/uni-canvas/utssdk/app-android/index.uts
uni_modules/uni-canvas/utssdk/app-android/index.uts
+15
-17
uni_modules/uni-chooseLocation/pages/chooseLocation/chooseLocation.vue
...ni-chooseLocation/pages/chooseLocation/chooseLocation.vue
+37
-24
uni_modules/uni-chooseLocation/utssdk/interface.uts
uni_modules/uni-chooseLocation/utssdk/interface.uts
+237
-25
uni_modules/uni-loadFontFace/utssdk/interface.uts
uni_modules/uni-loadFontFace/utssdk/interface.uts
+1
-1
未找到文件。
uni_modules/uni-canvas/utssdk/app-android/index.uts
浏览文件 @
e9d0a0d7
...
...
@@ -54,18 +54,16 @@ class CanvasContextImpl implements CanvasContext {
export const createCanvasContextAsync =
function (options: CreateCanvasContextAsyncOptions) {
const currentPage: ComponentPublicInstance = options.component ?? (getCurrentPages()[getCurrentPages().length - 1]).vm as ComponentPublicInstance
if (currentPage != null) {
const element = currentPage.$el?.querySelector('#' + options.id)
if (element != null) {
const canvas = element as UniCanvasElement
options.success?.(new CanvasContextImpl(canvas))
currentPage.createSelectorQuery().select('#' + options.id).fields({
node: true
} as NodeField, (ret) => {
const node = (ret as NodeInfo).node
if (node != null) {
options.success?.(new CanvasContextImpl(node as UniCanvasElement))
} else {
const uniError = new UniError('uni-createCanvasContextAsync', -1, 'canvas id invalid.')
options.fail?.(uniError)
}
} else {
const uniError = new UniError('uni-createCanvasContextAsync', -1, 'No found current page.')
options.fail?.(uniError)
}
options.complete?.()
}).exec()
}
uni_modules/uni-chooseLocation/pages/chooseLocation/chooseLocation.vue
浏览文件 @
e9d0a0d7
...
...
@@ -260,6 +260,9 @@
}
else
{
this
.
chooseLocationOptions
.
keyword
=
""
;
}
if
(
data
[
'
payload
'
]
!=
null
)
{
this
.
chooseLocationOptions
.
payload
=
data
[
'
payload
'
]
as
UTSJSONObject
;
}
});
uni
.
$emit
(
this
.
readyEventName
,
{});
},
...
...
@@ -348,21 +351,28 @@
customUI
:
true
,
});
// #endif
uniMapCo
.
chooseLocation
(
{
let
chooseLocationData
=
{
action
:
action
,
data
:
data
}).
then
((
res
:
UTSJSONObject
)
=>
{
}
as
UTSJSONObject
;
if
(
this
.
chooseLocationOptions
.
payload
!=
null
)
{
chooseLocationData
[
'
payload
'
]
=
this
.
chooseLocationOptions
.
payload
;
}
uniMapCo
.
chooseLocation
(
chooseLocationData
).
then
((
res
:
UTSJSONObject
)
=>
{
resolve
(
res
);
}).
catch
((
err
)
=>
{
if
(
err
instanceof
UniCloudError
)
{
const
errCode
=
(
err
as
UniCloudError
).
errCode
;
const
errMsg
=
(
err
as
UniCloudError
).
errMsg
;
const
cloudError
=
err
as
UniCloudError
;
const
errCode
=
cloudError
.
errCode
;
const
errMsg
=
cloudError
.
errMsg
;
const
errSubject
=
cloudError
.
errSubject
;
if
(
errMsg
.
indexOf
(
"
在云端不存在
"
)
>
-
1
||
errMsg
.
indexOf
(
"
未匹配
"
)
>
-
1
)
{
this
.
errMsg
=
"
uni.chooseLocation 依赖 uniCloud 的 uni-map-common 插件,请安装 uni-map-common 插件,插件地址:https://ext.dcloud.net.cn/plugin?id=13872
"
;
console
.
error
(
this
.
errMsg
);
}
else
{
this
.
errMsg
=
errMsg
;
console
.
error
(
"
获取POI信息失败,
"
+
JSON
.
stringify
({
errCode
,
errMsg
}));
console
.
error
(
"
获取POI信息失败,
"
+
JSON
.
stringify
({
errCode
,
errMsg
,
errSubject
}));
}
}
reject
(
err
);
...
...
@@ -370,8 +380,8 @@
});
promise
.
then
((
res
)
=>
{
this
.
callUniMapCoErr
=
false
;
})
;
promise
.
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
this
.
callUniMapCoErr
=
true
;
});
return
promise
as
Promise
<
UTSJSONObject
>
;
...
...
@@ -1037,7 +1047,7 @@
}
.uni-choose-location-dark
.uni-choose-location-poi-search-box
{
background-color
:
#1
81818
;
background-color
:
#1
11111
;
}
.uni-choose-location-dark
.uni-choose-location-search-icon
{
...
...
@@ -1077,6 +1087,10 @@
color
:
#d1d1d1
;
}
.uni-choose-location-dark
.uni-choose-location-poi-search-error-text
{
color
:
#d1d1d1
;
}
/* 暗黑模式样式结束 */
/* #ifdef WEB */
...
...
@@ -1085,6 +1099,5 @@
height
:
100%
;
background-repeat
:
no-repeat
;
}
/* #endif */
</
style
>
uni_modules/uni-chooseLocation/utssdk/interface.uts
浏览文件 @
e9d0a0d7
...
...
@@ -4,12 +4,59 @@
export type ChooseLocationErrorCode =
/**
* 取消
* @uniPlatform {
* "app": {
* "android": {
* "osVer": "5.0",
* "uniVer": "√",
* "unixVer": "4.34"
* },
* "ios": {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.34"
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "x",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
* "unixVer": "4.34"
* }
* }
*/
1 |
/**
* 框架内部错误
* @uniPlatform {
* "app": {
* "android": {
* "osVer": "5.0",
* "uniVer": "√",
* "unixVer": "4.34"
* },
* "ios": {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.34"
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "x",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
* "unixVer": "4.34"
* }
* }
*/
4;
export interface ChooseLocationSuccess extends AsyncApiSuccessResult {
name : string,
address : string,
...
...
@@ -32,26 +79,191 @@ type ChooseLocationCompleteCallback = (result : ChooseLocationComplete) => void
export type ChooseLocationOptions = {
/**
* 指示位置的经度
* @uniPlatform {
* "app": {
* "android": {
* "osVer": "5.0",
* "uniVer": "√",
* "unixVer": "4.33"
* },
* "ios": {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.33"
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
* "unixVer": "4.0"
* }
* }
*/
latitude ?: number | null,
/**
* 指示位置的纬度
* @uniPlatform {
* "app": {
* "android": {
* "osVer": "5.0",
* "uniVer": "√",
* "unixVer": "4.33"
* },
* "ios": {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.33"
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
* "unixVer": "4.0"
* }
* }
*/
longitude ?: number | null,
/**
* 指示位置的名称
* @uniPlatform {
* "app": {
* "android": {
* "osVer": "5.0",
* "uniVer": "√",
* "unixVer": "4.33"
* },
* "ios": {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.33"
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
* "unixVer": "4.0"
* }
* }
*/
keyword ?: string | null,
/**
* 用户自定义参数
* @uniPlatform {
* "app": {
* "android": {
* "osVer": "5.0",
* "uniVer": "√",
* "unixVer": "4.35"
* },
* "ios": {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.35"
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
* "unixVer": "4.35"
* }
* }
*/
payload ?: UTSJSONObject | null,
/**
* 接口调用成功的回调函数
* @uniPlatform {
* "app": {
* "android": {
* "osVer": "5.0",
* "uniVer": "√",
* "unixVer": "4.33"
* },
* "ios": {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.33"
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
* "unixVer": "4.0"
* }
* }
*/
success ?: ChooseLocationSuccessCallback | null,
/**
* 接口调用失败的回调函数
* @uniPlatform {
* "app": {
* "android": {
* "osVer": "5.0",
* "uniVer": "√",
* "unixVer": "4.33"
* },
* "ios": {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.33"
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
* "unixVer": "4.0"
* }
* }
*/
fail ?: ChooseLocationFailCallback | null,
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
* @uniPlatform {
* "app": {
* "android": {
* "osVer": "5.0",
* "uniVer": "√",
* "unixVer": "4.33"
* },
* "ios": {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.33"
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
* "unixVer": "4.0"
* }
* }
*/
complete ?: ChooseLocationCompleteCallback | null
};
...
...
@@ -66,12 +278,12 @@ export type ChooseLocationOptions = {
* "android": {
* "osVer": "5.0",
* "uniVer": "√",
* "unixVer": "
3.9.0
"
* "unixVer": "
4.33
"
* },
* "ios": {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.
11
"
* "unixVer": "4.
33
"
* },
* "harmony": {
* "osVer": "3.0",
...
...
@@ -151,10 +363,10 @@ export class ChooseLocationSuccessImpl extends AsyncApiSuccessResult implements
}
export class ChooseLocationFailImpl extends UniError implements ChooseLocationFail {
override errCode : ChooseLocationErrorCode
constructor(errMsg : string = 'chooseLocation:fail cancel', errCode : ChooseLocationErrorCode =
4
) {
super(
errMsg
)
constructor(errMsg : string = 'chooseLocation:fail cancel', errCode : ChooseLocationErrorCode =
1
) {
super()
this.errCode = errCode
this.errMsg = errMsg
}
}
// #endif
uni_modules/uni-loadFontFace/utssdk/interface.uts
浏览文件 @
e9d0a0d7
...
...
@@ -235,7 +235,7 @@ export type LoadFontFaceOptions = {
* }
* }
*/
source: string
source: string
.FontURIString
/**
* 可选的字体描述符
* @uniPlatform {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录