Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
c8dad44e
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6048
Star
92
Fork
165
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
c8dad44e
编写于
12月 04, 2024
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(chooseLocation): 补充 ios uts 插件中调用示例及测试
上级
69f93989
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
137 addition
and
0 deletion
+137
-0
pages/API/choose-location/choose-location.test.js
pages/API/choose-location/choose-location.test.js
+11
-0
pages/API/choose-location/choose-location.uvue
pages/API/choose-location/choose-location.uvue
+8
-0
uni_modules/uni-chooseLocation-plugin/changelog.md
uni_modules/uni-chooseLocation-plugin/changelog.md
+0
-0
uni_modules/uni-chooseLocation-plugin/package.json
uni_modules/uni-chooseLocation-plugin/package.json
+96
-0
uni_modules/uni-chooseLocation-plugin/readme.md
uni_modules/uni-chooseLocation-plugin/readme.md
+6
-0
uni_modules/uni-chooseLocation-plugin/utssdk/app-ios/index.uts
...odules/uni-chooseLocation-plugin/utssdk/app-ios/index.uts
+16
-0
未找到文件。
pages/API/choose-location/choose-location.test.js
浏览文件 @
c8dad44e
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
const
isIos
=
platformInfo
.
startsWith
(
'
ios
'
)
describe
(
'
dialog page
'
,
()
=>
{
if
(
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
==
'
true
'
)
{
...
...
@@ -36,6 +37,16 @@ describe('dialog page', () => {
const
lifecycleNum
=
await
page
.
callMethod
(
'
getLifeCycleNum
'
)
expect
(
lifecycleNum
).
toBe
(
originLifeCycleNum
-
1
)
})
if
(
isIos
)
{
it
(
'
call chooseLocation in uts plugin
'
,
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/API/choose-location/choose-location
'
)
await
page
.
waitFor
(
'
view
'
);
await
page
.
callMethod
(
'
chooseLocationByPlugin
'
)
await
page
.
waitFor
(
1000
)
const
lifecycleNum
=
await
page
.
callMethod
(
'
getLifeCycleNum
'
)
expect
(
lifecycleNum
).
toBe
(
originLifeCycleNum
-
1
)
})
}
afterAll
(
async
()
=>
{
await
page
.
callMethod
(
'
setLifeCycleNum
'
,
originLifeCycleNum
)
...
...
pages/API/choose-location/choose-location.uvue
浏览文件 @
c8dad44e
...
...
@@ -21,6 +21,9 @@
<boolean-data :defaultValue="false" title="是否携带payload参数" @change="changePayloadBoolean"></boolean-data>
<button class="btn" type="primary" @tap="chooseLocation">选择位置</button>
<button class="btn" @tap="clear">清空</button>
<!-- #ifdef APP-IOS -->
<button class="btn" type="primary" @tap="chooseLocationByPlugin">通过 uts 插件调用 chooseLocation</button>
<!-- #endif -->
</view>
</view>
</view>
...
...
@@ -117,6 +120,11 @@
changePayloadBoolean(checked : boolean) {
this.hoverPayload = checked
},
// #ifdef APP-IOS
chooseLocationByPlugin(){
uni.chooseLocationPlugin()
},
// #endif
// 自动化测试
test() {
const pages = getCurrentPages()
...
...
uni_modules/uni-chooseLocation-plugin/changelog.md
0 → 100644
浏览文件 @
c8dad44e
uni_modules/uni-chooseLocation-plugin/package.json
0 → 100644
浏览文件 @
c8dad44e
{
"id"
:
"uni-chooseLocation-plugin"
,
"displayName"
:
"uni-chooseLocation-plugin"
,
"version"
:
"1.0.0"
,
"description"
:
"uni-chooseLocation-plugin"
,
"keywords"
:
[
"uni-chooseLocation-plugin"
],
"repository"
:
""
,
"engines"
:
{
"HBuilderX"
:
"^3.6.8"
},
"dcloudext"
:
{
"type"
:
"uts"
,
"sale"
:
{
"regular"
:
{
"price"
:
"0.00"
},
"sourcecode"
:
{
"price"
:
"0.00"
}
},
"contact"
:
{
"qq"
:
""
},
"declaration"
:
{
"ads"
:
""
,
"data"
:
""
,
"permissions"
:
""
},
"npmurl"
:
""
},
"uni_modules"
:
{
"dependencies"
:
[
"uni-chooseLocation"
],
"uni-ext-api"
:
{
"uni"
:
{
"chooseLocationPlugin"
:
{
"name"
:
"chooseLocationPlugin"
,
"app"
:
{
"js"
:
false
,
"kotlin"
:
false
,
"swift"
:
true
,
"arkts"
:
false
}
}
}
},
"encrypt"
:
[],
"platforms"
:
{
"cloud"
:
{
"tcb"
:
"u"
,
"aliyun"
:
"u"
},
"client"
:
{
"Vue"
:
{
"vue2"
:
"u"
,
"vue3"
:
"u"
},
"App"
:
{
"app-android"
:
"u"
,
"app-ios"
:
"u"
},
"H5-mobile"
:
{
"Safari"
:
"u"
,
"Android Browser"
:
"u"
,
"微信浏览器(Android)"
:
"u"
,
"QQ浏览器(Android)"
:
"u"
},
"H5-pc"
:
{
"Chrome"
:
"u"
,
"IE"
:
"u"
,
"Edge"
:
"u"
,
"Firefox"
:
"u"
,
"Safari"
:
"u"
},
"小程序"
:
{
"微信"
:
"u"
,
"阿里"
:
"u"
,
"百度"
:
"u"
,
"字节跳动"
:
"u"
,
"QQ"
:
"u"
,
"钉钉"
:
"u"
,
"快手"
:
"u"
,
"飞书"
:
"u"
,
"京东"
:
"u"
},
"快应用"
:
{
"华为"
:
"u"
,
"联盟"
:
"u"
}
}
}
}
}
uni_modules/uni-chooseLocation-plugin/readme.md
0 → 100644
浏览文件 @
c8dad44e
# uni-actionSheet
### 开发文档
[
UTS 语法
](
https://uniapp.dcloud.net.cn/tutorial/syntax-uts.html
)
[
UTS API插件
](
https://uniapp.dcloud.net.cn/plugin/uts-plugin.html
)
[
UTS 组件插件
](
https://uniapp.dcloud.net.cn/plugin/uts-component.html
)
[
Hello UTS
](
https://gitcode.net/dcloud/hello-uts
)
\ No newline at end of file
uni_modules/uni-chooseLocation-plugin/utssdk/app-ios/index.uts
0 → 100644
浏览文件 @
c8dad44e
export const chooseLocationPlugin = () => {
uni.chooseLocation({
latitude: 39.951372,
longitude: 116.39747,
keyword: '公园',
success(res){
console.log('chooseLocation in plugin complete success', res);
},
fail(err){
console.log('chooseLocation in plugin complete fail', err);
},
complete(res){
console.log('chooseLocation in plugin complete res', res);
}
})
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录