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
...
...
@@ -52,20 +52,18 @@ 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))
} 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?.()
}
function (options: CreateCanvasContextAsyncOptions) {
const currentPage: ComponentPublicInstance = options.component ?? (getCurrentPages()[getCurrentPages().length - 1]).vm as ComponentPublicInstance
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)
}
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,30 +351,37 @@
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
);
});
});
promise
.
then
((
res
)
=>
{
this
.
callUniMapCoErr
=
false
;
})
;
promise
.
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
this
.
callUniMapCoErr
=
true
;
});
return
promise
as
Promise
<
UTSJSONObject
>
;
...
...
@@ -404,7 +414,7 @@
}).
catch
((
err
)
=>
{
this
.
searchLoading
=
false
;
})
}
else
{
}
else
{
this
.
callUniMapCo
(
"
location2address
"
,
{
location
:
`
${
latitude
}
,
${
longitude
}
`
,
get_poi
:
1
,
...
...
@@ -579,7 +589,7 @@
poiSearch
(
type
:
string
)
{
this
.
clearSearchValueChangeTimer
();
this
.
pageIndex
=
1
;
this
.
selected
=
-
1
;
this
.
selected
=
-
1
;
this
.
getPoi
(
type
);
},
cancelSearch
()
{
...
...
@@ -604,7 +614,7 @@
this
.
scrollTop
=
scrollTop
;
},
10
);
},
selectPoi
(
item
:
Poi
,
index
:
number
)
{
selectPoi
(
item
:
Poi
,
index
:
number
)
{
this
.
isFocus
=
false
;
this
.
selected
=
index
;
this
.
latitude
=
item
.
location
.
latitude
;
...
...
@@ -626,7 +636,7 @@
this
.
pageIndex
++
;
this
.
getPoi
(
'
scrolltolower
'
);
},
mapReset
()
{
mapReset
()
{
this
.
isFocus
=
false
;
this
.
pageIndex
=
1
;
this
.
getLocation
();
...
...
@@ -644,7 +654,7 @@
})
// #endif
},
back
()
{
back
()
{
uni
.
$emit
(
this
.
failEventName
,
1
);
this
.
closeDialogPage
();
},
...
...
@@ -794,12 +804,12 @@
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.uni-choose-location-map-reset.uni-choose-location-vertical
{
transition-property
:
transform
;
transition-duration
:
0.25s
;
transition-timing-function
:
ease-out
;
}
.uni-choose-location-map-reset.uni-choose-location-vertical
{
transition-property
:
transform
;
transition-duration
:
0.25s
;
transition-timing-function
:
ease-out
;
}
.uni-choose-location-map-reset-icon
{
...
...
@@ -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
{
...
...
@@ -1075,16 +1085,19 @@
.uni-choose-location-dark
.uni-choose-location-map-reset-icon
{
color
:
#d1d1d1
;
}
.uni-choose-location-dark
.uni-choose-location-poi-search-error-text
{
color
:
#d1d1d1
;
}
/* 暗黑模式样式结束 */
/* 暗黑模式样式结束 */
/* #ifdef WEB */
uni-image
>
div
{
width
:
100%
;
height
:
100%
;
background-repeat
:
no-repeat
;
}
/* #endif */
</
style
>
</
style
>
uni_modules/uni-chooseLocation/utssdk/interface.uts
浏览文件 @
e9d0a0d7
...
...
@@ -2,14 +2,61 @@
* 错误码
*/
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,
...
...
@@ -30,28 +77,193 @@ type ChooseLocationCompleteCallback = (result : ChooseLocationComplete) => void
* uni.chooseLocation函数参数定义
*/
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,
/**
* 接口调用成功的回调函数
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,13 +278,13 @@ 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",
* "uniVer": "4.23",
...
...
@@ -148,13 +360,13 @@ export class ChooseLocationSuccessImpl extends AsyncApiSuccessResult implements
this.latitude = latitude
this.longitude = longitude
}
}
}
export class ChooseLocationFailImpl extends UniError implements ChooseLocationFail {
override errCode : ChooseLocationErrorCode
constructor(errMsg : string = 'chooseLocation:fail cancel', errCode : ChooseLocationErrorCode = 4) {
super(errMsg)
this.errCode = errCode
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录