Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
f7dfad36
U
uni-app
项目概览
DCloud
/
uni-app
6 个月 前同步成功
通知
751
Star
38709
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
8
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
8
Issue
8
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
f7dfad36
编写于
5月 11, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: build
上级
07ac6620
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
162 addition
and
3 deletion
+162
-3
package.json
package.json
+1
-1
packages/playground/uts/nativeplugins/test-uniplugin/android/src/io/dcloud/uniplugin/TestModule.uts
...-uniplugin/android/src/io/dcloud/uniplugin/TestModule.uts
+34
-0
packages/playground/uts/nativeplugins/test-uniplugin/android/src/io/dcloud/uniplugin/log.uts
...ns/test-uniplugin/android/src/io/dcloud/uniplugin/log.uts
+4
-0
packages/playground/uts/nativeplugins/test-uniplugin/package.json
.../playground/uts/nativeplugins/test-uniplugin/package.json
+31
-0
packages/playground/uts/unpackage/nativeplugins/test-uniplugin/android/src/io/dcloud/uniplugin/TestModule.kt
...t-uniplugin/android/src/io/dcloud/uniplugin/TestModule.kt
+36
-0
packages/playground/uts/unpackage/nativeplugins/test-uniplugin/android/src/io/dcloud/uniplugin/TestModule.kt.map
...iplugin/android/src/io/dcloud/uniplugin/TestModule.kt.map
+1
-0
packages/playground/uts/unpackage/nativeplugins/test-uniplugin/android/src/io/dcloud/uniplugin/log.kt
...ins/test-uniplugin/android/src/io/dcloud/uniplugin/log.kt
+5
-0
packages/playground/uts/unpackage/nativeplugins/test-uniplugin/android/src/io/dcloud/uniplugin/log.kt.map
...test-uniplugin/android/src/io/dcloud/uniplugin/log.kt.map
+1
-0
packages/playground/uts/unpackage/nativeplugins/test-uniplugin/package.json
...d/uts/unpackage/nativeplugins/test-uniplugin/package.json
+31
-0
packages/uni-app-plus/dist/uni.runtime.esm.js
packages/uni-app-plus/dist/uni.runtime.esm.js
+2
-2
packages/uts-darwin-arm64/uts.darwin-arm64.node
packages/uts-darwin-arm64/uts.darwin-arm64.node
+0
-0
packages/uts-darwin-x64/uts.darwin-x64.node
packages/uts-darwin-x64/uts.darwin-x64.node
+0
-0
packages/uts-win32-ia32-msvc/uts.win32-ia32-msvc.node
packages/uts-win32-ia32-msvc/uts.win32-ia32-msvc.node
+0
-0
packages/uts-win32-x64-msvc/uts.win32-x64-msvc.node
packages/uts-win32-x64-msvc/uts.win32-x64-msvc.node
+0
-0
scripts/test.js
scripts/test.js
+16
-0
未找到文件。
package.json
浏览文件 @
f7dfad36
...
...
@@ -13,7 +13,7 @@
"size"
:
"npm run build size-check"
,
"lint"
:
"eslint packages/*/src/**/*.ts"
,
"format"
:
"prettier --write --parser typescript
\"
packages/**/*.ts?(x)
\"
"
,
"test"
:
"tsc -p ./test-dts/tsconfig.json && jest"
,
"test"
:
"tsc -p ./test-dts/tsconfig.json && jest
&& node scripts/test.js
"
,
"test-dts"
:
"tsc -p ./test-dts/tsconfig.json && tsc -p ./test-dts/tsconfig.build.json"
,
"preinstall"
:
"node ./scripts/preinstall.js"
,
"e2e:ssr:dev"
:
"cd packages/playground/ssr && npm run dev:ssr"
,
...
...
packages/playground/uts/nativeplugins/test-uniplugin/android/src/io/dcloud/uniplugin/TestModule.uts
0 → 100644
浏览文件 @
f7dfad36
import Intent from "android.content.Intent";
import JSONObject from "com.alibaba.fastjson.JSONObject";
import UniModule from "io.dcloud.feature.uniapp.common.UniModule";
import UniJSMethod from "io.dcloud.feature.uniapp.annotation.UniJSMethod";
import UniJSCallback from "io.dcloud.feature.uniapp.bridge.UniJSCallback";
import log from "./log";
export default class TestModule extends UniModule() {
TAG = "TestModule";
static REQUEST_CODE = 1000;
//run ui thread
@UniJSMethod({ uiThread: true })
testAsyncFunc(options: JSONObject, callback?: UniJSCallback) {
log(this.TAG, "testAsyncFunc--$options");
if (callback != null) {
const data = new JSONObject();
data["code"] = "success12312";
callback.invoke(data);
}
}
//run JS thread
@UniJSMethod({ uiThread: false })
testSyncFunc(options: JSONObject): JSONObject {
const data = new JSONObject();
data["code"] = "success456";
return data;
}
override onActivityResult(requestCode: Int, resultCode: Int, data: Intent) {
if (requestCode == TestModule.REQUEST_CODE && data.hasExtra("respond")) {
log(this.TAG, "原生页面返回----" + data.getStringExtra("respond"));
} else {
super.onActivityResult(requestCode, resultCode, data);
}
}
}
packages/playground/uts/nativeplugins/test-uniplugin/android/src/io/dcloud/uniplugin/log.uts
0 → 100644
浏览文件 @
f7dfad36
import Log from "android.util.Log";
export default function log(tag: string, msg: string) {
Log.e(tag, msg);
}
packages/playground/uts/nativeplugins/test-uniplugin/package.json
0 → 100644
浏览文件 @
f7dfad36
{
"name"
:
"UTS Plugin"
,
"id"
:
"DCloud-UTSPlugin"
,
"version"
:
"0.0.1"
,
"description"
:
"UTS示例插件"
,
"_dp_type"
:
"nativeplugin"
,
"_dp_nativeplugin"
:{
"android"
:
{
"plugins"
:
[
{
"type"
:
"module"
,
"name"
:
"DCloud-UTSPlugin"
,
"class"
:
"io.dcloud.uniplugin.TestModule"
},
{
"type"
:
"component"
,
"name"
:
"uts-richtext"
,
"class"
:
"io.dcloud.uniplugin.TestComponent"
}
],
"integrateType"
:
"uts"
,
"dependencies"
:[
{
"id"
:
"com.zzhoujay.richtext:richtext"
,
"source"
:
"implementation 'com.zzhoujay.richtext:richtext:3.0.7'"
}
],
"minSdkVersion"
:
21
}
}
}
\ No newline at end of file
packages/playground/uts/unpackage/nativeplugins/test-uniplugin/android/src/io/dcloud/uniplugin/TestModule.kt
0 → 100644
浏览文件 @
f7dfad36
package
io.dcloud.uniplugin.TestModule;
import
android.content.Intent;
import
com.alibaba.fastjson.JSONObject;
import
io.dcloud.feature.uniapp.common.UniModule;
import
io.dcloud.feature.uniapp.annotation.UniJSMethod;
import
io.dcloud.feature.uniapp.bridge.UniJSCallback;
import
io.dcloud.uniplugin.log.log;
open
class
TestModule
:
UniModule
()
{
open
var
TAG
=
"TestModule"
;
@UniJSMethod
(
uiThread
=
true
)
open
fun
testAsyncFunc
(
options
:
JSONObject
,
callback
:
UniJSCallback
?)
{
log
(
this
.
TAG
,
"testAsyncFunc--$options"
);
if
(
callback
!=
null
)
{
val
data
=
JSONObject
();
data
[
"code"
]
=
"success12312"
;
callback
.
invoke
(
data
);
}
}
@UniJSMethod
(
uiThread
=
false
)
open
fun
testSyncFunc
(
options
:
JSONObject
):
JSONObject
{
val
data
=
JSONObject
();
data
[
"code"
]
=
"success456"
;
return
data
;
}
override
open
fun
onActivityResult
(
requestCode
:
Int
,
resultCode
:
Int
,
data
:
Intent
)
{
if
(
requestCode
==
TestModule
.
REQUEST_CODE
&&
data
.
hasExtra
(
"respond"
))
{
log
(
this
.
TAG
,
"原生页面返回----"
+
data
.
getStringExtra
(
"respond"
));
}
else
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
}
}
companion
object
{
var
REQUEST_CODE
=
1000
;
}
}
packages/playground/uts/unpackage/nativeplugins/test-uniplugin/android/src/io/dcloud/uniplugin/TestModule.kt.map
0 → 100644
浏览文件 @
f7dfad36
{"version":3,"sources":["/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/nativeplugins/test-uniplugin/android/src/io/dcloud/uniplugin/TestModule.uts"],"names":["TestModule","UniModule","TAG","UniJSMethod","uiThread","testAsyncFunc","options","callback","log","data","JSONObject","invoke","testSyncFunc","onActivityResult","requestCode","resultCode","REQUEST_CODE","hasExtra","getSt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MAAM;YACL,KAAK,CAACL,gBAAgB,CAACC,WAAW,EAAEC,UAAU,EAAEN,IAAI,CAAC,CAAC;;;;QAtB1D,IAAOO,YAAY,GAAG,IAAI,CAAC;;CAyB5B"}
\ No newline at end of file
packages/playground/uts/unpackage/nativeplugins/test-uniplugin/android/src/io/dcloud/uniplugin/log.kt
0 → 100644
浏览文件 @
f7dfad36
package
io.dcloud.uniplugin.log;
import
android.util.Log;
fun
log
(
tag
:
String
,
msg
:
String
)
{
Log
.
e
(
tag
,
msg
);
}
packages/playground/uts/unpackage/nativeplugins/test-uniplugin/android/src/io/dcloud/uniplugin/log.kt.map
0 → 100644
浏览文件 @
f7dfad36
{"version":3,"sources":["/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/nativeplugins/test-uniplugin/android/src/io/dcloud/uniplugin/log.uts"],"names":["log","tag","msg","Log","e"],"mappings":"AAAA;AAAA,OAAgB,gBAAkB,CAAC;AACpB,IAASA,GAAG,CAACC,GAAW,EAAN,MAAM,EAAEC,GAAW,EAAN,MAAM,EAAE;IACpDC,GAAG,CAACC,CAAC,CAACH,GAAG,EAAEC,GAAG,CAAC,CAAC"}
\ No newline at end of file
packages/playground/uts/unpackage/nativeplugins/test-uniplugin/package.json
0 → 100644
浏览文件 @
f7dfad36
{
"name"
:
"UTS Plugin"
,
"id"
:
"DCloud-UTSPlugin"
,
"version"
:
"0.0.1"
,
"description"
:
"UTS示例插件"
,
"_dp_type"
:
"nativeplugin"
,
"_dp_nativeplugin"
:{
"android"
:
{
"plugins"
:
[
{
"type"
:
"module"
,
"name"
:
"DCloud-UTSPlugin"
,
"class"
:
"io.dcloud.uniplugin.TestModule"
},
{
"type"
:
"component"
,
"name"
:
"uts-richtext"
,
"class"
:
"io.dcloud.uniplugin.TestComponent"
}
],
"integrateType"
:
"uts"
,
"dependencies"
:[
{
"id"
:
"com.zzhoujay.richtext:richtext"
,
"source"
:
"implementation 'com.zzhoujay.richtext:richtext:3.0.7'"
}
],
"minSdkVersion"
:
21
}
}
}
\ No newline at end of file
packages/uni-app-plus/dist/uni.runtime.esm.js
浏览文件 @
f7dfad36
...
...
@@ -14095,7 +14095,7 @@ const publishRecorderStateChange = (state, res = {}) => {
const Recorder = {
start({ duration = 60000, sampleRate, numberOfChannels, encodeBitRate, format = 'mp3', frameSize,
// audioSource = 'auto',
}) {
}
= {}
) {
if (recording) {
return publishRecorderStateChange('start');
}
...
...
@@ -14178,7 +14178,7 @@ class RecorderManager {
resume() {
Recorder.resume();
}
start(options) {
start(options
= {}
) {
Recorder.start(options);
}
stop() {
...
...
packages/uts-darwin-arm64/uts.darwin-arm64.node
浏览文件 @
f7dfad36
无法预览此类型文件
packages/uts-darwin-x64/uts.darwin-x64.node
浏览文件 @
f7dfad36
无法预览此类型文件
packages/uts-win32-ia32-msvc/uts.win32-ia32-msvc.node
浏览文件 @
f7dfad36
无法预览此类型文件
packages/uts-win32-x64-msvc/uts.win32-x64-msvc.node
浏览文件 @
f7dfad36
无法预览此类型文件
scripts/test.js
0 → 100644
浏览文件 @
f7dfad36
const
path
=
require
(
'
path
'
)
const
{
runBuild
,
UtsTarget
}
=
require
(
'
../packages/uts/dist
'
)
const
projectDir
=
path
.
resolve
(
__dirname
,
'
../packages/playground/uts
'
)
// uts
runBuild
(
UtsTarget
.
KOTLIN
,
{
silent
:
false
,
input
:
{
dir
:
path
.
resolve
(
projectDir
,
'
nativeplugins/test-uniplugin
'
),
extname
:
'
.uts
'
,
},
output
:
{
dir
:
path
.
resolve
(
projectDir
,
'
unpackage/nativeplugins/test-uniplugin
'
),
sourceMap
:
true
,
inlineSourcesContent
:
false
,
},
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录