Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ChenYFan_OHHH
uni-app
提交
e5f2aae5
U
uni-app
项目概览
ChenYFan_OHHH
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e5f2aae5
编写于
9月 15, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(uts): swift
上级
bc0576ff
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
38 addition
and
31 deletion
+38
-31
packages/playground/uts/uni_modules/test-uniplugin/app-android/index.uts
...ound/uts/uni_modules/test-uniplugin/app-android/index.uts
+6
-0
packages/playground/uts/uni_modules/test-uniplugin/app-ios/index.uts
...ayground/uts/uni_modules/test-uniplugin/app-ios/index.uts
+1
-7
packages/playground/uts/unpackage/dist/app/uni_modules/test-uniplugin/app-android/index.kt
.../dist/app/uni_modules/test-uniplugin/app-android/index.kt
+6
-1
packages/playground/uts/unpackage/dist/app/uni_modules/test-uniplugin/app-android/index.kt.map
...t/app/uni_modules/test-uniplugin/app-android/index.kt.map
+1
-1
packages/playground/uts/unpackage/dist/app/uni_modules/test-uniplugin/app-ios/index.swift
...e/dist/app/uni_modules/test-uniplugin/app-ios/index.swift
+21
-20
packages/playground/uts/unpackage/dist/app/uni_modules/test-uniplugin/app-ios/index.swift.map
...st/app/uni_modules/test-uniplugin/app-ios/index.swift.map
+1
-1
packages/uni-uts-vite/src/utils/compiler/swift.ts
packages/uni-uts-vite/src/utils/compiler/swift.ts
+1
-1
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
+1
-0
未找到文件。
packages/playground/uts/uni_modules/test-uniplugin/app-android/index.uts
浏览文件 @
e5f2aae5
...
...
@@ -4,6 +4,12 @@ import View from 'android.view.View'
import { IUser } from './interface.uts'
import { login } from './login.uts'
import logo from '../static/logo.png'
type GetBatteryInfoOptions = {
success?: (res: UTSJSONObject) => void
fail?: (res: UTSJSONObject) => void
complete?: (res: UTSJSONObject) => void
}
export class User implements IUser {
async login(name: string, pwd: string) {
setTimeout(() => {
...
...
packages/playground/uts/uni_modules/test-uniplugin/app-ios/index.uts
浏览文件 @
e5f2aae5
...
...
@@ -18,10 +18,4 @@ export default async function getBatteryInfo(options: GetBatteryInfoOptions) {
if
(
options
.
complete
!=
null
)
{
options
.
complete
!
(
res
)
}
}
class
Test1
{}
export
class
Test
{
constructor
(){
new
Test1
()
}
}
}
\ No newline at end of file
packages/playground/uts/unpackage/dist/app/uni_modules/test-uniplugin/app-android/index.kt
浏览文件 @
e5f2aae5
...
...
@@ -16,10 +16,15 @@ fun login(name: String, pwd: String): UTSJSONObject {
};
}
val
__default
=
getResourcePath
(
"uni_modules/test-uniplugin/static/logo.png"
);
open
class
GetBatteryInfoOptions
:
UTSJSONObject
()
{
open
var
success
:
UTSCallback
?
=
null
;
open
var
fail
:
UTSCallback
?
=
null
;
open
var
complete
:
UTSCallback
?
=
null
;
}
open
class
User
:
IUser
{
open
suspend
fun
login
(
name
:
String
,
pwd
:
String
)
=
CoroutineScope
(
Dispatchers
.
Default
).
async
{
setTimeout
(
fun
(){
console
.
log
(
"timeout"
,
" at uni_modules/test-uniplugin/app-android/index.uts:1
0
"
);
console
.
log
(
"timeout"
,
" at uni_modules/test-uniplugin/app-android/index.uts:1
6
"
);
}
,
1000
);
login
(
name
,
pwd
);
...
...
packages/playground/uts/unpackage/dist/app/uni_modules/test-uniplugin/app-android/index.kt.map
浏览文件 @
e5f2aae5
{"version":3,"sources":["/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/static/logo.png","/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-android/index.uts","/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-android/interface.uts","/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-android/login.uts"],"sourcesContent":["import { getResourcePath } from 'io.dcloud.uts.android'\nexport default getResourcePath('uni_modules/test-uniplugin/static/logo.png')\n ","import Log from 'android.util.Log'\nimport FrameLayout from 'android.widget.FrameLayout'\nimport View from 'android.view.View'\nimport { IUser } from './interface.uts'\nimport { login } from './login.uts'\nimport logo from '../static/logo.png'\nexport class User implements IUser {\n async login(name: string, pwd: string) {\n setTimeout(() => {\n console.log('timeout')\n }, 1000)\n login(name, pwd)\n Log.info('123')\n Log.info(logo)\n }\n register(name: string, callback: () => void) {\n Log.info(logo as FrameLayout)\n }\n test(view: View) {}\n}\nfunction login(name: string, callback: () => void) {}\nexport function register(name: string, callback: () => void) {}\n","export interface IUser {\n register(name: string): void\n}\n","export function login(name: string, pwd: string) {\n console.log('login')\n return { name, pwd }\n}\n"],"names":[],"mappings":";;;AAAA;ACAA,OAAgB,gBAAkB,CAAA;AAClC,OAAwB,0BAA4B,CAAA;AACpD,OAAiB,iBAAmB,CAAA;UCFnB,KAAK;QACpB,QAAQ,CAAC,IAAY,EAAN,MAAM,GAAG,IAAI;;ACDvB,IAAS,KAAK,CAAC,IAAY,EAAN,MAAM,EAAE,GAAW,EAAN,MAAM,iBAAE;IAC/C,OAAO,CAAC,GAAG,CAAC,OAAO,2DAAC;IACpB,OAAO;QAAE,IAAA,IAAI,GAAJ,IAAI;QAAE,IAAA,GAAG,GAAH,GAAG;KAAE,CAAA;AACtB;gBHFe,eAAe,CAAC,4CAA4C,CAAC;ACKrE,WAAM,IAAI,GAAY,KAAK;qBAC1B,KAAK,CAAC,IAAY,EAAN,MAAM,EAAE,GAAW,EAAN,MAAM,8CAAE;QACrC,UAAU,CAAC,KAAM;YACf,OAAO,CAAC,GAAG,CAAC,SAAS,4DAAC;QACxB;QAAC,EAAE,IAAI,CAAC;QACR,MAAM,IAAI,EAAE,GAAG,CAAC;QAChB,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;QACf,GAAG,CAAC,IAAI,WAAM;IAChB;iBACA,QAAQ,CAAC,IAAY,EAAN,MAAM,EAAE,QAAoB,aAAA,EAAE;QAC3C,GAAG,CAAC,IAAI,cAAS,WAAW,CAAC;IAC/B;aACA,IAAI,CAAC,IAAU,EAAJ,IAAI,EAAE,CAAC;CACnB;AACD,UAAe,IAAY,EAAN,MAAM,EAAE,QAAoB,QAAJ,IAAI,EAAE,CAAC,CAAC;AAC9C,IAAS,QAAQ,CAAC,IAAY,EAAN,MAAM,EAAE,QAAoB,aAAA,EAAE,CAAC,CAAC"}
\ No newline at end of file
{"version":3,"sources":["/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/static/logo.png","/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-android/index.uts","/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-android/interface.uts","/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-android/login.uts"],"sourcesContent":["import { getResourcePath } from 'io.dcloud.uts.android'\nexport default getResourcePath('uni_modules/test-uniplugin/static/logo.png')\n ","import Log from 'android.util.Log'\nimport FrameLayout from 'android.widget.FrameLayout'\nimport View from 'android.view.View'\nimport { IUser } from './interface.uts'\nimport { login } from './login.uts'\nimport logo from '../static/logo.png'\n\ntype GetBatteryInfoOptions = {\n success?: (res: UTSJSONObject) => void\n fail?: (res: UTSJSONObject) => void\n complete?: (res: UTSJSONObject) => void\n}\nexport class User implements IUser {\n async login(name: string, pwd: string) {\n setTimeout(() => {\n console.log('timeout')\n }, 1000)\n login(name, pwd)\n Log.info('123')\n Log.info(logo)\n }\n register(name: string, callback: () => void) {\n Log.info(logo as FrameLayout)\n }\n test(view: View) {}\n}\nfunction login(name: string, callback: () => void) {}\nexport function register(name: string, callback: () => void) {}\n","export interface IUser {\n register(name: string): void\n}\n","export function login(name: string, pwd: string) {\n console.log('login')\n return { name, pwd }\n}\n"],"names":[],"mappings":";;;AAAA;ACAA,OAAgB,gBAAkB,CAAA;AAClC,OAAwB,0BAA4B,CAAA;AACpD,OAAiB,iBAAmB,CAAA;UCFnB,KAAK;QACpB,QAAQ,CAAC,IAAY,EAAN,MAAM,GAAG,IAAI;;ACDvB,IAAS,KAAK,CAAC,IAAY,EAAN,MAAM,EAAE,GAAW,EAAN,MAAM,iBAAE;IAC/C,OAAO,CAAC,GAAG,CAAC,OAAO,2DAAC;IACpB,OAAO;QAAE,IAAA,IAAI,GAAJ,IAAI;QAAE,IAAA,GAAG,GAAH,GAAG;KAAE,CAAA;AACtB;gBHFe,eAAe,CAAC,4CAA4C,CAAC;ACM/C,WAAxB,qBAAqB;IACxB,SAAA,OAAO,EAAC,WAA8B,SAAA;IACtC,SAAA,IAAI,EAAC,WAA8B,SAAA;IACnC,SAAA,QAAQ,EAAC,WAA8B,SAAA;CACxC;AACM,WAAM,IAAI,GAAY,KAAK;qBAC1B,KAAK,CAAC,IAAY,EAAN,MAAM,EAAE,GAAW,EAAN,MAAM,8CAAE;QACrC,UAAU,CAAC,KAAM;YACf,OAAO,CAAC,GAAG,CAAC,SAAS,4DAAC;QACxB;QAAC,EAAE,IAAI,CAAC;QACR,MAAM,IAAI,EAAE,GAAG,CAAC;QAChB,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;QACf,GAAG,CAAC,IAAI,WAAM;IAChB;iBACA,QAAQ,CAAC,IAAY,EAAN,MAAM,EAAE,QAAoB,aAAA,EAAE;QAC3C,GAAG,CAAC,IAAI,cAAS,WAAW,CAAC;IAC/B;aACA,IAAI,CAAC,IAAU,EAAJ,IAAI,EAAE,CAAC;CACnB;AACD,UAAe,IAAY,EAAN,MAAM,EAAE,QAAoB,QAAJ,IAAI,EAAE,CAAC,CAAC;AAC9C,IAAS,QAAQ,CAAC,IAAY,EAAN,MAAM,EAAE,QAAoB,aAAA,EAAE,CAAC,CAAC"}
\ No newline at end of file
packages/playground/uts/unpackage/dist/app/uni_modules/test-uniplugin/app-ios/index.swift
浏览文件 @
e5f2aae5
import
DCUTSPlugin
;
import
UIKit
;
typealias
GetBatteryInfoOptions
=
{
var
success
?:
(
_
res
:
UTSJSONObject
)
->
Void
;
var
fail
?:
(
_
res
:
UTSJSONObject
)
->
Void
;
var
complete
?:
(
_
res
:
UTSJSONObject
)
->
Void
;
};
async
func
getBatteryInfo
(
_
options
:
GetBatteryInfoOptions
)
{
var
res
=
[
"errMsg"
:
"getBatteryInfo:ok"
,
"level"
:
UIDevice
.
current
.
batteryLevel
*
100
,
"isCharging"
:
UIDevice
.
current
.
batteryState
==
UIDevice
.
BatteryState
.
charging
];
if
(
options
.
success
!=
nil
)
options
.
success
!
(
res
);
if
(
options
.
complete
!=
nil
)
options
.
complete
!
(
res
);
}
class
Test1
:
NSObject
{
class
GetBatteryInfoOptions
:
UTSJSONObject
{
var
success
:
UTSCallback
?;
var
fail
:
UTSCallback
?;
var
complete
:
UTSCallback
?;
init
(
_
success
:
UTSCallback
,
_
fail
:
UTSCallback
,
_
complete
:
UTSCallback
){
self
.
success
=
success
;
self
.
fail
=
fail
;
self
.
complete
=
complete
;
}
}
@objc
(
UTSSDKModulesTestUniPluginTest
)
@
@objcMembers
class
Test
:
NSObject
{
override
init
(){
Test1
();
@objc
(
UTSSDKModulesTestUniPluginIndexSwift
)
@objcMembers
class
IndexSwift
:
NSObject
{
static
func
async
getBatteryInfo
(
_
options
:
GetBatteryInfoOptions
)
{
var
res
=
[
"errMsg"
:
"getBatteryInfo:ok"
,
"level"
:
UIDevice
.
current
.
batteryLevel
*
100
,
"isCharging"
:
UIDevice
.
current
.
batteryState
==
UIDevice
.
BatteryState
.
charging
]
as
[
String
:
Any
];
if
(
options
.
success
!=
nil
)
options
.
success
!
(
res
);
if
(
options
.
complete
!=
nil
)
options
.
complete
!
(
res
);
}
}
packages/playground/uts/unpackage/dist/app/uni_modules/test-uniplugin/app-ios/index.swift.map
浏览文件 @
e5f2aae5
{
"version"
:
3
,
"sources"
:
[
"/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-ios/index.uts"
],
"sourcesContent"
:
[
"import { UIDevice } from 'UIKit'
\n\n
type GetBatteryInfoOptions = {\n success?: (res: UTSJSONObject) => void
\n
fail?: (res: UTSJSONObject) => void
\n
complete?: (res: UTSJSONObject) => void
\n
}
\n\n
export default async function getBatteryInfo(options: GetBatteryInfoOptions) {\n const res = {\n errMsg: 'getBatteryInfo:ok',
\n
level: UIDevice.current.batteryLevel * 100,
\n
isCharging: UIDevice.current.batteryState == UIDevice.BatteryState.charging,
\n
}
\n
if (options.success != null) {\n options.success!(res)
\n
}
\n
if (options.complete != null) {\n options.complete!(res)
\n
}
\n
}
\n
class Test1 {}
\n
export class Test {\n constructor(){\n new Test1()
\n
}
\n
}
\n
"
],
"names"
:
[],
"mappings"
:
"AAAA;UAEK,qBAAqB;QACxB,OAAO,MAAI,GAAkB,EAAb,aAAa,KAAK,IAAI;QACtC,IAAI,MAAI,GAAkB,EAAb,aAAa,KAAK,IAAI;QACnC,QAAQ,MAAI,GAAkB,EAAb,aAAa,KAAK,IAAI;;AAG1B,WAAe,cAAc,CAAC,EAAA,OAA8B,EAArB,qBAAqB,EAAE;IAC3E,IAAM,GAAG,GAAG;QACV,CAAA,MAAM,GAAE,mBAAmB;QAC3B,CAAA,KAAK,GAAE,QAAQ,CAAC,OAAO,CAAC,YAAY,GAAG,GAAG;QAC1C,CAAA,UAAU,GAAE,QAAQ,CAAC,OAAO,CAAC,YAAY,IAAI,QAAQ,CAAC,YAAY,CAAC,QAAQ;KAC5E;IACD,IAAI,OAAO,CAAC,OAAO,IAAI,GAAI,EACzB,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;IAEvB,IAAI,OAAO,CAAC,QAAQ,IAAI,GAAI,EAC1B,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;AAE1B;AACA,MAAM,KAAK;CAAG;AACP;;MAAM,IAAI;IACf,eAAa;QACX,AAAI,KAAK,EAAE;IACb;CACD"
}
\ No newline at end of file
{
"version"
:
3
,
"sources"
:
[
"/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/uni_modules/test-uniplugin/app-ios/index.uts"
],
"sourcesContent"
:
[
"import { UIDevice } from 'UIKit'
\n\n
type GetBatteryInfoOptions = {\n success?: (res: UTSJSONObject) => void
\n
fail?: (res: UTSJSONObject) => void
\n
complete?: (res: UTSJSONObject) => void
\n
}
\n\n
export default async function getBatteryInfo(options: GetBatteryInfoOptions) {\n const res = {\n errMsg: 'getBatteryInfo:ok',
\n
level: UIDevice.current.batteryLevel * 100,
\n
isCharging: UIDevice.current.batteryState == UIDevice.BatteryState.charging,
\n
}
\n
if (options.success != null) {\n options.success!(res)
\n
}
\n
if (options.complete != null) {\n options.complete!(res)
\n
}
\n
}"
],
"names"
:
[],
"mappings"
:
";AAAA;AAE6B,MAAxB,qBAAqB;IACxB,IAAA,OAAO,EAAC,WAA8B,EAAA;IACtC,IAAA,IAAI,EAAC,WAA8B,EAAA;IACnC,IAAA,QAAQ,EAAC,WAA8B,EAAA;WAFvC,OAAO,EAAC,WAA8B,IACtC,IAAI,EAAC,WAA8B,IACnC,QAAQ,EAAC,WAA8B;;;;;CACxC;;;;sBAE6B,cAAc,CAAC,EAAA,OAA8B,EAArB,qBAAqB,EAAE;QAC3E,IAAM,GAAG,GAAG;YACV,CAAA,MAAM,GAAE,mBAAmB;YAC3B,CAAA,KAAK,GAAE,QAAQ,CAAC,OAAO,CAAC,YAAY,GAAG,GAAG;YAC1C,CAAA,UAAU,GAAE,QAAQ,CAAC,OAAO,CAAC,YAAY,IAAI,QAAQ,CAAC,YAAY,CAAC,QAAQ;0BAC5E;QACD,IAAI,OAAO,CAAC,OAAO,IAAI,GAAI,EACzB,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;QAEvB,IAAI,OAAO,CAAC,QAAQ,IAAI,GAAI,EAC1B,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;IAE1B"
}
\ No newline at end of file
packages/uni-uts-vite/src/utils/compiler/swift.ts
浏览文件 @
e5f2aae5
...
...
@@ -32,7 +32,7 @@ export async function compileSwift(filename: string) {
package
:
''
,
sourceMap
:
resolveSourceMapPath
(),
extname
:
'
swift
'
,
imports
:
[],
imports
:
[
'
DCUTSPlugin
'
],
logFilename
:
true
,
noColor
:
isInHBuilderX
(),
},
...
...
packages/uts-darwin-arm64/uts.darwin-arm64.node
浏览文件 @
e5f2aae5
无法预览此类型文件
packages/uts-darwin-x64/uts.darwin-x64.node
浏览文件 @
e5f2aae5
无法预览此类型文件
packages/uts-win32-ia32-msvc/uts.win32-ia32-msvc.node
浏览文件 @
e5f2aae5
无法预览此类型文件
packages/uts-win32-x64-msvc/uts.win32-x64-msvc.node
浏览文件 @
e5f2aae5
无法预览此类型文件
scripts/test.js
浏览文件 @
e5f2aae5
...
...
@@ -63,6 +63,7 @@ function testSwift() {
output
:
{
outDir
:
path
.
resolve
(
projectDir
,
'
unpackage/dist/app
'
),
package
:
'
UTSSDKModulesTestUniPlugin
'
,
imports
:
[
'
DCUTSPlugin
'
],
sourceMap
:
true
,
extname
:
'
swift
'
,
logFilename
:
true
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录