Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yangkaifeng
uni-app
提交
5e032823
U
uni-app
项目概览
yangkaifeng
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
3
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,发现更多精彩内容 >>
提交
5e032823
编写于
9月 12, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build uni-app-plus-nvue
上级
82dac631
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
53 addition
and
27 deletion
+53
-27
packages/uni-app-plus-nvue/dist/index.js
packages/uni-app-plus-nvue/dist/index.js
+53
-27
未找到文件。
packages/uni-app-plus-nvue/dist/index.js
浏览文件 @
5e032823
...
@@ -161,7 +161,7 @@ var serviceContext = (function () {
...
@@ -161,7 +161,7 @@ var serviceContext = (function () {
return
false
return
false
}
}
return
page
.
$page
.
meta
.
isTabBar
return
page
.
$page
.
meta
.
isTabBar
}
}
const
route
=
__uniRoutes
.
find
(
route
=>
route
.
path
.
slice
(
1
)
===
path
);
const
route
=
__uniRoutes
.
find
(
route
=>
route
.
path
.
slice
(
1
)
===
path
);
return
route
&&
route
.
meta
.
isTabBar
return
route
&&
route
.
meta
.
isTabBar
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -174,6 +174,10 @@ var serviceContext = (function () {
...
@@ -174,6 +174,10 @@ var serviceContext = (function () {
function
base64ToArrayBuffer
(
data
)
{
function
base64ToArrayBuffer
(
data
)
{
return
base64Arraybuffer_2
(
data
)
return
base64Arraybuffer_2
(
data
)
}
function
arrayBufferToBase64
(
data
)
{
return
base64Arraybuffer_1
(
data
)
}
}
function
callApiSync
(
api
,
args
,
name
,
alias
)
{
function
callApiSync
(
api
,
args
,
name
,
alias
)
{
...
@@ -2025,7 +2029,7 @@ var serviceContext = (function () {
...
@@ -2025,7 +2029,7 @@ var serviceContext = (function () {
required
:
true
required
:
true
}];
}];
const
arrayBufferToBase64
=
[{
const
arrayBufferToBase64
$1
=
[{
name
:
'
arrayBuffer
'
,
name
:
'
arrayBuffer
'
,
type
:
[
ArrayBuffer
,
Uint8Array
],
type
:
[
ArrayBuffer
,
Uint8Array
],
required
:
true
required
:
true
...
@@ -2033,7 +2037,7 @@ var serviceContext = (function () {
...
@@ -2033,7 +2037,7 @@ var serviceContext = (function () {
var
require_context_module_0_0
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_0_0
=
/*#__PURE__*/
Object
.
freeze
({
base64ToArrayBuffer
:
base64ToArrayBuffer$1
,
base64ToArrayBuffer
:
base64ToArrayBuffer$1
,
arrayBufferToBase64
:
arrayBufferToBase64
arrayBufferToBase64
:
arrayBufferToBase64
$1
});
});
const
canIUse
=
[{
const
canIUse
=
[{
...
@@ -3713,13 +3717,13 @@ var serviceContext = (function () {
...
@@ -3713,13 +3717,13 @@ var serviceContext = (function () {
return
base64Arraybuffer_2
(
str
)
return
base64Arraybuffer_2
(
str
)
}
}
function
arrayBufferToBase64$
1
(
buffer
)
{
function
arrayBufferToBase64$
2
(
buffer
)
{
return
base64Arraybuffer_1
(
buffer
)
return
base64Arraybuffer_1
(
buffer
)
}
}
var
require_context_module_1_0
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_0
=
/*#__PURE__*/
Object
.
freeze
({
base64ToArrayBuffer
:
base64ToArrayBuffer$2
,
base64ToArrayBuffer
:
base64ToArrayBuffer$2
,
arrayBufferToBase64
:
arrayBufferToBase64$
1
arrayBufferToBase64
:
arrayBufferToBase64$
2
});
});
var
platformSchema
=
{};
var
platformSchema
=
{};
...
@@ -6079,53 +6083,64 @@ var serviceContext = (function () {
...
@@ -6079,53 +6083,64 @@ var serviceContext = (function () {
}
}
}
}
let
socketTaskId
=
0
;
const
socketTasks
=
{};
const
socketTasks
=
{};
const
publishStateChange$2
=
(
res
)
=>
{
const
publishStateChange$2
=
(
res
)
=>
{
publish
(
'
onSocketTaskStateChange
'
,
res
);
publish
(
'
onSocketTaskStateChange
'
,
res
);
};
};
const
createSocketTaskById
=
function
(
socketTaskId
,
{
let
socket
;
url
,
function
getSocket
()
{
data
,
if
(
socket
)
{
header
,
return
socket
method
,
}
protocols
socket
=
requireNativePlugin
(
'
uni-webSocket
'
);
}
=
{})
{
// fixed by hxy 需要测试是否支持 arraybuffer
const
socket
=
requireNativePlugin
(
'
webSocket
'
);
socket
.
WebSocket
(
url
,
Array
.
isArray
(
protocols
)
?
protocols
.
join
(
'
,
'
)
:
protocols
);
// socket.binaryType = 'arraybuffer'
socketTasks
[
socketTaskId
]
=
socket
;
socket
.
onopen
(
function
(
e
)
{
socket
.
onopen
(
function
(
e
)
{
publishStateChange$2
({
publishStateChange$2
({
socketTaskId
,
socketTaskId
:
e
.
id
,
state
:
'
open
'
state
:
'
open
'
});
});
});
});
socket
.
onmessage
(
function
(
e
)
{
socket
.
onmessage
(
function
(
e
)
{
const
data
=
e
.
data
;
publishStateChange$2
({
publishStateChange$2
({
socketTaskId
,
socketTaskId
:
e
.
id
,
state
:
'
message
'
,
state
:
'
message
'
,
data
:
e
.
data
data
:
typeof
data
===
'
object
'
?
base64ToArrayBuffer
(
data
.
base64
)
:
data
});
});
});
});
socket
.
onerror
(
function
(
e
)
{
socket
.
onerror
(
function
(
e
)
{
publishStateChange$2
({
publishStateChange$2
({
socketTaskId
,
socketTaskId
:
e
.
id
,
state
:
'
error
'
,
state
:
'
error
'
,
errMsg
:
e
.
message
errMsg
:
e
.
data
});
});
});
});
socket
.
onclose
(
function
(
e
)
{
socket
.
onclose
(
function
(
e
)
{
const
socketTaskId
=
e
.
id
;
delete
socketTasks
[
socketTaskId
];
delete
socketTasks
[
socketTaskId
];
publishStateChange$2
({
publishStateChange$2
({
socketTaskId
,
socketTaskId
,
state
:
'
close
'
state
:
'
close
'
});
});
});
});
return
socket
}
const
createSocketTaskById
=
function
(
socketTaskId
,
{
url
,
data
,
header
,
method
,
protocols
}
=
{})
{
const
socket
=
getSocket
();
socket
.
WebSocket
({
id
:
socketTaskId
,
url
,
protocol
:
Array
.
isArray
(
protocols
)
?
protocols
.
join
(
'
,
'
)
:
protocols
});
socketTasks
[
socketTaskId
]
=
socket
;
return
{
return
{
socketTaskId
,
socketTaskId
,
errMsg
:
'
createSocketTask:ok
'
errMsg
:
'
createSocketTask:ok
'
...
@@ -6133,13 +6148,14 @@ var serviceContext = (function () {
...
@@ -6133,13 +6148,14 @@ var serviceContext = (function () {
};
};
function
createSocketTask
(
args
)
{
function
createSocketTask
(
args
)
{
return
createSocketTaskById
(
++
socketTaskId
,
args
)
return
createSocketTaskById
(
String
(
Date
.
now
())
,
args
)
}
}
function
operateSocketTask
(
args
)
{
function
operateSocketTask
(
args
)
{
const
{
const
{
operationType
,
operationType
,
code
,
code
,
reason
,
data
,
data
,
socketTaskId
socketTaskId
}
=
unpack
(
args
);
}
=
unpack
(
args
);
...
@@ -6152,13 +6168,23 @@ var serviceContext = (function () {
...
@@ -6152,13 +6168,23 @@ var serviceContext = (function () {
switch
(
operationType
)
{
switch
(
operationType
)
{
case
'
send
'
:
case
'
send
'
:
if
(
data
)
{
if
(
data
)
{
socket
.
send
(
data
);
socket
.
send
({
id
:
socketTaskId
,
data
:
typeof
data
===
'
object
'
?
{
'
@type
'
:
'
binary
'
,
base64
:
arrayBufferToBase64
(
data
)
}
:
data
});
}
}
return
{
return
{
errMsg
:
'
operateSocketTask:ok
'
errMsg
:
'
operateSocketTask:ok
'
}
}
case
'
close
'
:
case
'
close
'
:
socket
.
close
(
code
);
socket
.
close
({
id
:
socketTaskId
,
code
,
reason
});
delete
socketTasks
[
socketTaskId
];
delete
socketTasks
[
socketTaskId
];
return
{
return
{
errMsg
:
'
operateSocketTask:ok
'
errMsg
:
'
operateSocketTask:ok
'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录