Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
Hello UTS
提交
9514d935
H
Hello UTS
项目概览
DCloud
/
Hello UTS
通知
1598
Star
27
Fork
9
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
2
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
Hello UTS
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
2
Issue
2
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
9514d935
编写于
7月 09, 2024
作者:
杜庆泉
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
uni-app x 增加lottie示例 & 更新语法测试示例
上级
8f162371
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
141 addition
and
144 deletion
+141
-144
pages/SDKIntegration/Lottie/index.uvue
pages/SDKIntegration/Lottie/index.uvue
+3
-3
pages/SDKIntegration/SDKIntegration.uvue
pages/SDKIntegration/SDKIntegration.uvue
+27
-12
pages/SyntaxCase/index.uvue
pages/SyntaxCase/index.uvue
+97
-115
uni_modules/uts-advance/utssdk/app-android/index.uts
uni_modules/uts-advance/utssdk/app-android/index.uts
+1
-1
uni_modules/uts-alert/utssdk/app-android/index.uts
uni_modules/uts-alert/utssdk/app-android/index.uts
+2
-2
uni_modules/uts-nativepage/utssdk/app-android/index.uts
uni_modules/uts-nativepage/utssdk/app-android/index.uts
+4
-4
uni_modules/uts-platform-api/utssdk/app-android/index.uts
uni_modules/uts-platform-api/utssdk/app-android/index.uts
+1
-1
uni_modules/uts-screenshot-listener/utssdk/app-android/index.uts
...ules/uts-screenshot-listener/utssdk/app-android/index.uts
+1
-1
uni_modules/uts-tencentgeolocation/utssdk/app-android/index.uts
...dules/uts-tencentgeolocation/utssdk/app-android/index.uts
+2
-2
uni_modules/uts-tests/utssdk/ForLoop.uts
uni_modules/uts-tests/utssdk/ForLoop.uts
+1
-1
uni_modules/uts-tests/utssdk/Number.uts
uni_modules/uts-tests/utssdk/Number.uts
+1
-1
uni_modules/uts-tests/utssdk/Type.uts
uni_modules/uts-tests/utssdk/Type.uts
+1
-1
未找到文件。
pages/SDKIntegration/Lottie/index.uvue
浏览文件 @
9514d935
<template>
<div>
<button @tap="changeUrl">播放本地动画资源</button>
<button @tap="changeServerUrl">播放远程动画资源</button>
<button @tap="changeServerUrl">播放远程动画资源</button>
<button @tap="changeAutoPlay">测试AutoPlay</button>
<button @tap="changeLoop">测试Loop</button>
<button @tap="changeAction(1)">测试action play</button>
<button @tap="changeAction(2)">测试action pause</button>
<button @tap="changeAction(3)">测试action stop</button>
<!--
<uts-animation-view ref="animView" :path="animUrl" :autoplay="autoplay" :loop="loop" :action="action"
<uts-animation-view ref="animView" :path="animUrl" :autoplay="autoplay" :loop="loop" :action="action"
:hidden="hidden" @bindended="testAnimEnd" @click="lottieClickTest" @longpress="lottieLongpressTest"
:style="{width:widthNum+'rpx',height:heightNum+'px',background:yanse}">
</uts-animation-view>
-->
</uts-animation-view>
</div>
</template>
...
...
pages/SDKIntegration/SDKIntegration.uvue
浏览文件 @
9514d935
...
...
@@ -11,13 +11,13 @@
</view>
</template>
<script lang="ts">
//
import {
//
checkHasIntegration
//
} from "@/uni_modules/uts-tencentgeolocation";
import {
checkHasIntegration
} from "@/uni_modules/uts-tencentgeolocation";
//
import {
//
checkHasLottieIntegration
//
} from "@/uni_modules/uts-animation-view";
import {
checkHasLottieIntegration
} from "@/uni_modules/uts-animation-view";
type ListItem = {
name : string,
...
...
@@ -66,14 +66,29 @@
})
},
gotoLottie: function () {
uni.showToast({
title:'暂时不支持uni-appx'
})
if (checkHasLottieIntegration()) {
uni.navigateTo({
url: '/pages/SDKIntegration/Lottie/index'
})
} else {
uni.showToast({
icon: 'none',
title: '需要在自定义基座中运行'
})
}
},
gotoTencentLocation: function () {
uni.showToast({
title:'暂时不支持uni-appx'
})
let ret = checkHasIntegration();
if (!ret) {
uni.showToast({
icon: 'none',
title: '需要在自定义基座中运行'
})
} else {
uni.navigateTo({
url: '/pages/SDKIntegration/TencentLocation/TencentLocation'
})
}
},
gotoTencentMap: function () {
uni.navigateTo({
...
...
pages/SyntaxCase/index.uvue
浏览文件 @
9514d935
...
...
@@ -173,38 +173,24 @@
this.testUtsSyncWithCallbackResult['return'] = false;
this.testUtsSyncWithCallbackResult['success'] = false;
this.testUtsSyncWithCallbackResult['complete'] = false;
let option = new AsyncOptions(
"success",
(res:string) => {
console.log("testSyncWithCallback.success.callback", res);
this.testUtsSyncWithCallbackResult['success'] = true;
},
(res:string) => {
console.log("testSyncWithCallback.fail.callback", res);
// testUtsSyncWithCallbackResult.fail = true;
},
(res:string) => {
console.log("testSyncWithCallback.complete.callback", res);
this.testUtsSyncWithCallbackResult['complete'] = true;
},
)
if (
testSyncWithCallback(
option)['name'] === "testSyncWithCallback"
// testSyncWithCallback({
// type: "success",
// success: (res:any) => {
// console.log("testSyncWithCallback.success.callback", res)
;
// this.testUtsSyncWithCallbackResult['success'] = true;
// },
// fail: (res:any) => {
// console.log("testSyncWithCallback.fail.callback", res)
;
// // testUtsSyncWithCallbackResult.fail = true;
// },
// complete: (res:any) => {
// console.log("testSyncWithCallback.complete.callback", res)
;
// this.testUtsSyncWithCallbackResult['complete'] = true;
// },
// }).name === "testSyncWithCallback"
testSyncWithCallback(
{
type: "success",
success: (res:any) => {
console.log("testSyncWithCallback.success.callback", res);
this.testUtsSyncWithCallbackResult['success'] = true
;
},
fail: (res:any) => {
console.log("testSyncWithCallback.fail.callback", res);
// testUtsSyncWithCallbackResult.fail = true
;
},
complete: (res:any) => {
console.log("testSyncWithCallback.complete.callback", res);
this.testUtsSyncWithCallbackResult['complete'] = true
;
},
} as AsyncOptions)['name'] === "testSyncWithCallback"
) {
this.testUtsSyncWithCallbackResult['return'] = true;
}
...
...
@@ -215,22 +201,22 @@
this.testUtsAsyncResult['success'] = false;
// testUtsAsyncResult.fail = false;
this.testUtsAsyncResult['complete'] = false;
let option = new AsyncOptions(
"success",
(res:any) => {
console.log("testAsync.success.callback", res);
this.testUtsAsyncResult['success'] = true;
},
(res:any) => {
console.log("testAsync.fail.callback", res);
},
(res:any) => {
console.log("testAsync.complete.callback", res);
this.testUtsAsyncResult['complete'] = true;
},
)
try {
const res = await testAsync(option);
const res = await testAsync({
type:"success",
success:(res:any) => {
console.log("testAsync.success.callback", res);
this.testUtsAsyncResult['success'] = true;
},
fail:(res:any) => {
console.log("testAsync.fail.callback", res);
},
complete:(res:any) => {
console.log("testAsync.complete.callback", res);
this.testUtsAsyncResult['complete'] = true;
},
} as AsyncOptions);
if (res.name === "testAsync") {
this.testUtsAsyncResult['return'] = true;
}
...
...
@@ -242,22 +228,22 @@
this.testUtsAsyncMulitParamResult['return'] = false;
this.testUtsAsyncMulitParamResult['success'] = false;
this.testUtsAsyncMulitParamResult['complete'] = false;
let option = AsyncOptions(
"success",
(res) => {
console.log("testUtsAsyncMulitParam.success.callback", res);
this.testUtsAsyncMulitParamResult['success'] = true;
},
(res) => {
console.log("testUtsAsyncMulitParam.fail.callback", res);
},
(res) => {
console.log("testUtsAsyncMulitParam.complete.callback", res);
this.testUtsAsyncMulitParamResult['complete'] = true;
},
)
try {
const res = await testAsyncParam3(100,"hello",option);
const res = await testAsyncParam3(100,"hello",{
type:"success",
success:(res) => {
console.log("testUtsAsyncMulitParam.success.callback", res);
this.testUtsAsyncMulitParamResult['success'] = true;
},
fail:(res) => {
console.log("testUtsAsyncMulitParam.fail.callback", res);
},
complete:(res) => {
console.log("testUtsAsyncMulitParam.complete.callback", res);
this.testUtsAsyncMulitParamResult['complete'] = true;
},
} as AsyncOptions);
if (res.name === "testUtsAsyncMulitParam") {
this.testUtsAsyncMulitParamResult['return'] = true;
}
...
...
@@ -288,23 +274,21 @@
this.testUtsClassStaticSyncWithCallbackResult['return'] = false;
this.testUtsClassStaticSyncWithCallbackResult['success'] = false;
this.testUtsClassStaticSyncWithCallbackResult['complete'] = false;
let option = AsyncOptions(
"success",
(res) => {
console.log("testStaticSyncWithCallback.success.callback", res);
this.testUtsClassStaticSyncWithCallbackResult['success'] = true;
},
(res) => {
console.log("testStaticSyncWithCallback.fail.callback", res);
// testUtsClassStaticSyncWithCallbackResult.fail = true;
},
(res) => {
console.log("testStaticSyncWithCallback.complete.callback", res);
this.testUtsClassStaticSyncWithCallbackResult['complete'] = true;
},
)
if (
Test.testClassStaticSyncWithCallback(option)['name'] === "testSyncWithCallback"
Test.testClassStaticSyncWithCallback({
type:"success",
success:(res) => {
console.log("testStaticSyncWithCallback.success.callback", res);
this.testUtsClassStaticSyncWithCallbackResult['success'] = true;
},
fail:(res) => {
console.log("testStaticSyncWithCallback.fail.callback", res);
},
complete:(res) => {
console.log("testStaticSyncWithCallback.complete.callback", res);
this.testUtsClassStaticSyncWithCallbackResult['complete'] = true;
},
} as AsyncOptions)['name'] === "testSyncWithCallback"
) {
this.testUtsClassStaticSyncWithCallbackResult['return'] = true;
}
...
...
@@ -314,22 +298,22 @@
this.testUtsClassStaticAsyncResult['return'] = false;
this.testUtsClassStaticAsyncResult['success'] = false;
this.testUtsClassStaticAsyncResult['complete'] = false;
let option = new AsyncOptions(
"success",
(res) => {
console.log("testAsync.success.callback", res);
this.testUtsClassStaticAsyncResult['success'] = true;
},
(res) => {
console.log("testAsync.fail.callback", res);
},
(res) => {
console.log("testAsync.complete.callback", res);
this.testUtsClassStaticAsyncResult['complete'] = true;
},
)
try {
const res = await Test.testClassStaticAsync(option);
const res = await Test.testClassStaticAsync({
type:"success",
success:(res:any) => {
console.log("testAsync.success.callback", res);
this.testUtsClassStaticAsyncResult['success'] = true;
},
fail:(res:any) => {
console.log("testAsync.fail.callback", res);
},
complete:(res:any) => {
console.log("testAsync.complete.callback", res);
this.testUtsClassStaticAsyncResult['complete'] = true;
},
} as AsyncOptions);
if (res.name === "testAsync") {
this.testUtsClassStaticAsyncResult['return'] = true;
}
...
...
@@ -383,23 +367,22 @@
this.testUtsClassAsyncResult['return'] = false;
this.testUtsClassAsyncResult['success'] = false;
this.testUtsClassAsyncResult['complete'] = false;
let option = AsyncOptions(
"success",
(res) => {
console.log("testAsync.success.callback", res);
this.testUtsClassAsyncResult['success'] = true;
},
(res) => {
console.log("testAsync.fail.callback", res);
},
(res) => {
console.log("testAsync.complete.callback", res);
this.testUtsClassAsyncResult['complete'] = true;
},
)
try {
const res = await test!.testClassAsync(option);
console.log('res', res)
const res = await test!.testClassAsync({
type:"success",
success:(res) => {
console.log("testAsync.success.callback", res);
this.testUtsClassAsyncResult['success'] = true;
},
fail:(res) => {
console.log("testAsync.fail.callback", res);
},
complete:(res) => {
console.log("testAsync.complete.callback", res);
this.testUtsClassAsyncResult['complete'] = true;
},
} as AsyncOptions);
if (res.name === "testAsync") {
this.testUtsClassAsyncResult['return'] = true;
}
...
...
@@ -426,20 +409,19 @@
this.testUtsClassInstanceResult['callback'] = true;
}
})
let option = SyncOptions(
(res) => {
const res = task.sync({
success:(res) => {
console.log("task.sync.success.callback", res);
this.testUtsClassInstanceResult['success'] = true;
},
(res) => {
fail:
(res) => {
console.log("task.sync.fail.callback", res);
},
(res) => {
complete:
(res) => {
console.log("task.sync.complete.callback", res);
this.testUtsClassInstanceResult['complete'] = true;
},
)
const res = task.sync(option)
}} as SyncOptions)
if (res === 'sync') {
this.testUtsClassInstanceResult['return'] = true;
}
...
...
uni_modules/uts-advance/utssdk/app-android/index.uts
浏览文件 @
9514d935
...
...
@@ -228,7 +228,7 @@ export function stopAssetAudio() {
}
@
Suppress("DEPRECATION")
//@UTSAndroid.
Suppress("DEPRECATION")
export function goOtherActivity(imageDone : (event : string) => void) : boolean {
// 检查相关权限是否已经具备
...
...
uni_modules/uts-alert/utssdk/app-android/index.uts
浏览文件 @
9514d935
...
...
@@ -3,13 +3,13 @@ import AlertDialog from 'android.app.AlertDialog';
import DialogInterface from 'android.content.DialogInterface';
import EditText from 'android.widget.EditText';
@
Suppress("UNUSED_PARAMETER")
//@UTSAndroid.
Suppress("UNUSED_PARAMETER")
export function showAlert(_title : string | null, _message : string | null, _result : (index : Number) => void) {
let uiRunable = new DialogUIRunnable(null, _title!, _message!, "", false);
UTSAndroid.getUniActivity()!.runOnUiThread(uiRunable)
}
@
Suppress("UNUSED_PARAMETER")
//@UTSAndroid.
Suppress("UNUSED_PARAMETER")
export function showPrompt(_title : string | null, _message : string | null, _placeholder : string | null, success : (content : string) => void) {
let uiRunable = new DialogUIRunnable(success, _title!, _message!, _placeholder!, true);
UTSAndroid.getUniActivity()!.runOnUiThread(uiRunable)
...
...
uni_modules/uts-nativepage/utssdk/app-android/index.uts
浏览文件 @
9514d935
...
...
@@ -78,7 +78,7 @@ export class AppHookProxy implements UTSAndroidHookProxy {
}
@
Suppress("DEPRECATION")
//@UTSAndroid.
Suppress("DEPRECATION")
class ForeService extends Service {
constructor (){
...
...
@@ -311,7 +311,7 @@ class FruitAdapter extends RecyclerView.Adapter<FruitAdapter.ViewHolder>{
}
@
Suppress("DEPRECATION")
//@UTSAndroid.
Suppress("DEPRECATION")
class DemoActivity extends Activity{
constructor (){
...
...
@@ -365,7 +365,7 @@ class DemoActivity extends Activity{
}
@
Suppress("DEPRECATION")
//@UTSAndroid.
Suppress("DEPRECATION")
class IntentRunable extends Runnable{
override run(){
console.log("IntentRunable = " + Thread.currentThread().getName())
...
...
@@ -418,7 +418,7 @@ function initShortCut() {
}
@
Suppress("DEPRECATION")
//@UTSAndroid.
Suppress("DEPRECATION")
export function gotoDemoActivity():boolean {
// 这里的逻辑是为了判断 当前的自定义activity 是否注册了,并以此为条件判断是否是自定义基座
let hasXActivityIntegration = true
...
...
uni_modules/uts-platform-api/utssdk/app-android/index.uts
浏览文件 @
9514d935
...
...
@@ -168,7 +168,7 @@ export function gotoSystemPermissionActivityTest() {
/**
* 跳转系统拍照界面,并触发相关生命周期测试
*/
@
Suppress("DEPRECATION")
//@UTSAndroid.
Suppress("DEPRECATION")
export function gotoCameraTake(imageDone : (event : string) => void) : boolean {
let permissionNeed = ["android.permission.CAMERA"]
...
...
uni_modules/uts-screenshot-listener/utssdk/app-android/index.uts
浏览文件 @
9514d935
...
...
@@ -79,7 +79,7 @@ class ScreenFileObserver extends FileObserver {
/**
* 开启截图监听
*/
@
Suppress("DEPRECATION")
//@UTSAndroid.
Suppress("DEPRECATION")
export function onUserCaptureScreen(callback: UserCaptureScreenCallback) {
// 检查相关权限是否已经具备
...
...
uni_modules/uts-tencentgeolocation/utssdk/app-android/index.uts
浏览文件 @
9514d935
...
...
@@ -187,7 +187,7 @@ export function getLocation(locationOptions: LocationOptions):boolean {
/**
* 持续监听位置变化
*/
@
Suppress("UNUSED_PARAMETER")
//@UTSAndroid.
Suppress("UNUSED_PARAMETER")
export function watchPosition(_locationOptions: LocationOptions) {
//todo
}
...
...
@@ -195,7 +195,7 @@ export function watchPosition(_locationOptions: LocationOptions) {
/**
* 关闭监听位置变化
*/
@
Suppress("UNUSED_PARAMETER")
//@UTSAndroid.
Suppress("UNUSED_PARAMETER")
export function clearWatch() {
//todo
}
\ No newline at end of file
uni_modules/uts-tests/utssdk/ForLoop.uts
浏览文件 @
9514d935
import { describe, test, expect, Result } from './tests.uts'
@
Suppress("IMPLICIT_BOXING_IN_IDENTITY_EQUALS")
//@UTSAndroid.
Suppress("IMPLICIT_BOXING_IN_IDENTITY_EQUALS")
export function testForLoop(): Result {
return describe('ForLoop', () => {
test('syntax', () => {
...
...
uni_modules/uts-tests/utssdk/Number.uts
浏览文件 @
9514d935
import { describe, test, expect, Result } from './tests.uts'
@
Suppress("IMPLICIT_BOXING_IN_IDENTITY_EQUALS")
//@UTSAndroid.
Suppress("IMPLICIT_BOXING_IN_IDENTITY_EQUALS")
export function testNumber() : Result {
return describe("Number", () => {
...
...
uni_modules/uts-tests/utssdk/Type.uts
浏览文件 @
9514d935
import { describe, test, expect, Result } from './tests.uts'
@UTSAndroid.Suppress("USELESS_IS_CHECK")
//
@UTSAndroid.Suppress("USELESS_IS_CHECK")
export function testType() : Result {
return describe("Type", () => {
test("Object literal to type instance", () => {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录