Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lzb_79
uni-app
提交
ba742014
U
uni-app
项目概览
lzb_79
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ba742014
编写于
5月 18, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build uni runtime
上级
b0805960
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
242 addition
and
122 deletion
+242
-122
packages/uni-app-plus/dist/index.js
packages/uni-app-plus/dist/index.js
+23
-6
packages/uni-app-plus/package.json
packages/uni-app-plus/package.json
+1
-1
packages/uni-mp-alipay/dist/index.js
packages/uni-mp-alipay/dist/index.js
+42
-21
packages/uni-mp-alipay/package.json
packages/uni-mp-alipay/package.json
+1
-1
packages/uni-mp-baidu/dist/index.js
packages/uni-mp-baidu/dist/index.js
+37
-20
packages/uni-mp-baidu/package.json
packages/uni-mp-baidu/package.json
+1
-1
packages/uni-mp-toutiao/dist/index.js
packages/uni-mp-toutiao/dist/index.js
+37
-20
packages/uni-mp-toutiao/package.json
packages/uni-mp-toutiao/package.json
+1
-1
packages/uni-mp-weixin/dist/index.js
packages/uni-mp-weixin/dist/index.js
+37
-20
packages/uni-mp-weixin/package.json
packages/uni-mp-weixin/package.json
+1
-1
src/core/runtime/index.js
src/core/runtime/index.js
+37
-22
src/core/runtime/wrapper.js
src/core/runtime/wrapper.js
+6
-2
src/core/runtime/wrapper/create-app.js
src/core/runtime/wrapper/create-app.js
+1
-1
src/core/runtime/wrapper/create-component.js
src/core/runtime/wrapper/create-component.js
+1
-1
src/core/runtime/wrapper/create-page.js
src/core/runtime/wrapper/create-page.js
+1
-1
src/core/runtime/wrapper/util.js
src/core/runtime/wrapper/util.js
+10
-2
src/platforms/mp-alipay/runtime/wrapper/page-parser.js
src/platforms/mp-alipay/runtime/wrapper/page-parser.js
+5
-1
未找到文件。
packages/uni-app-plus/dist/index.js
浏览文件 @
ba742014
...
...
@@ -214,8 +214,12 @@ function wrapper (methodName, method) {
}
arg1
=
processArgs
(
methodName
,
arg1
,
options
.
args
,
options
.
returnValue
);
const
returnValue
=
wx
[
options
.
name
||
methodName
](
arg1
,
arg2
);
const
args
=
[
arg1
];
if
(
typeof
arg2
!==
'
undefined
'
)
{
args
.
push
(
arg2
);
}
const
returnValue
=
wx
[
options
.
name
||
methodName
].
apply
(
wx
,
args
);
if
(
isSyncApi
(
methodName
))
{
// 同步 api
return
processReturnValue
(
methodName
,
returnValue
,
options
.
returnValue
,
isContextApi
(
methodName
))
}
...
...
@@ -757,7 +761,15 @@ function handleEvent (event) {
eventsArray
.
forEach
(
eventArray
=>
{
const
methodName
=
eventArray
[
0
];
if
(
methodName
)
{
const
handler
=
this
.
$vm
[
methodName
];
let
handlerCtx
=
this
.
$vm
;
if
(
handlerCtx
.
$options
.
generic
&&
handlerCtx
.
$parent
&&
handlerCtx
.
$parent
.
$parent
)
{
// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx
=
handlerCtx
.
$parent
.
$parent
;
}
const
handler
=
handlerCtx
[
methodName
];
if
(
!
isFn
(
handler
))
{
throw
new
Error
(
` _vm.
${
methodName
}
is not a function`
)
}
...
...
@@ -767,7 +779,7 @@ function handleEvent (event) {
}
handler
.
once
=
true
;
}
handler
.
apply
(
this
.
$vm
,
processEventArgs
(
handler
.
apply
(
handlerCtx
,
processEventArgs
(
this
.
$vm
,
event
,
eventArray
[
1
],
...
...
@@ -1101,7 +1113,8 @@ todos.forEach(todoApi => {
});
canIUses
.
forEach
(
canIUseApi
=>
{
const
apiName
=
protocols
[
canIUseApi
]
&&
protocols
[
canIUseApi
].
name
?
protocols
[
canIUseApi
].
name
:
canIUseApi
;
const
apiName
=
protocols
[
canIUseApi
]
&&
protocols
[
canIUseApi
].
name
?
protocols
[
canIUseApi
].
name
:
canIUseApi
;
if
(
!
wx
.
canIUse
(
apiName
))
{
protocols
[
canIUseApi
]
=
false
;
}
...
...
@@ -1117,7 +1130,7 @@ if (typeof Proxy !== 'undefined') {
}
if
(
api
[
name
])
{
return
promisify
(
name
,
api
[
name
])
}
}
if
(
!
hasOwn
(
wx
,
name
)
&&
!
hasOwn
(
protocols
,
name
))
{
return
}
...
...
@@ -1138,6 +1151,10 @@ if (typeof Proxy !== 'undefined') {
});
}
wx
.
createApp
=
createApp
;
wx
.
createPage
=
createPage
;
wx
.
createComponent
=
createComponent
;
var
uni$1
=
uni
;
export
default
uni$1
;
...
...
packages/uni-app-plus/package.json
浏览文件 @
ba742014
{
"name"
:
"@dcloudio/uni-app-plus"
,
"version"
:
"0.0.23
5
"
,
"version"
:
"0.0.23
6
"
,
"description"
:
"uni-app app-plus"
,
"main"
:
"dist/index.js"
,
"scripts"
:
{
...
...
packages/uni-mp-alipay/dist/index.js
浏览文件 @
ba742014
...
...
@@ -580,8 +580,12 @@ function wrapper (methodName, method) {
}
arg1
=
processArgs
(
methodName
,
arg1
,
options
.
args
,
options
.
returnValue
);
const
returnValue
=
my
[
options
.
name
||
methodName
](
arg1
,
arg2
);
const
args
=
[
arg1
];
if
(
typeof
arg2
!==
'
undefined
'
)
{
args
.
push
(
arg2
);
}
const
returnValue
=
my
[
options
.
name
||
methodName
].
apply
(
my
,
args
);
if
(
isSyncApi
(
methodName
))
{
// 同步 api
return
processReturnValue
(
methodName
,
returnValue
,
options
.
returnValue
,
isContextApi
(
methodName
))
}
...
...
@@ -1067,7 +1071,15 @@ function handleEvent (event) {
eventsArray
.
forEach
(
eventArray
=>
{
const
methodName
=
eventArray
[
0
];
if
(
methodName
)
{
const
handler
=
this
.
$vm
[
methodName
];
let
handlerCtx
=
this
.
$vm
;
if
(
handlerCtx
.
$options
.
generic
&&
handlerCtx
.
$parent
&&
handlerCtx
.
$parent
.
$parent
)
{
// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx
=
handlerCtx
.
$parent
.
$parent
;
}
const
handler
=
handlerCtx
[
methodName
];
if
(
!
isFn
(
handler
))
{
throw
new
Error
(
` _vm.
${
methodName
}
is not a function`
)
}
...
...
@@ -1077,7 +1089,7 @@ function handleEvent (event) {
}
handler
.
once
=
true
;
}
handler
.
apply
(
this
.
$vm
,
processEventArgs
(
handler
.
apply
(
handlerCtx
,
processEventArgs
(
this
.
$vm
,
event
,
eventArray
[
1
],
...
...
@@ -1464,7 +1476,11 @@ function parsePage (vuePageOptions) {
__l
:
handleLink$1
};
initHooks
(
pageOptions
,
hooks$1
);
initHooks
(
pageOptions
,
hooks$1
);
if
(
vueOptions
.
methods
&&
vueOptions
.
methods
.
formReset
)
{
pageOptions
.
formReset
=
vueOptions
.
methods
.
formReset
;
}
return
pageOptions
}
...
...
@@ -1590,7 +1606,8 @@ todos.forEach(todoApi => {
});
canIUses
.
forEach
(
canIUseApi
=>
{
const
apiName
=
protocols
[
canIUseApi
]
&&
protocols
[
canIUseApi
].
name
?
protocols
[
canIUseApi
].
name
:
canIUseApi
;
const
apiName
=
protocols
[
canIUseApi
]
&&
protocols
[
canIUseApi
].
name
?
protocols
[
canIUseApi
].
name
:
canIUseApi
;
if
(
!
my
.
canIUse
(
apiName
))
{
protocols
[
canIUseApi
]
=
false
;
}
...
...
@@ -1606,14 +1623,14 @@ if (typeof Proxy !== 'undefined') {
}
if
(
api
[
name
])
{
return
promisify
(
name
,
api
[
name
])
}
{
if
(
extraApi
[
name
])
{
return
promisify
(
name
,
extraApi
[
name
])
}
if
(
todoApis
[
name
])
{
return
promisify
(
name
,
todoApis
[
name
])
}
}
{
if
(
extraApi
[
name
])
{
return
promisify
(
name
,
extraApi
[
name
])
}
if
(
todoApis
[
name
])
{
return
promisify
(
name
,
todoApis
[
name
])
}
}
if
(
!
hasOwn
(
my
,
name
)
&&
!
hasOwn
(
protocols
,
name
))
{
return
...
...
@@ -1624,13 +1641,13 @@ if (typeof Proxy !== 'undefined') {
}
else
{
uni
.
upx2px
=
upx2px
;
{
Object
.
keys
(
todoApis
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
extraApi
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
{
Object
.
keys
(
todoApis
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
extraApi
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
}
Object
.
keys
(
api
).
forEach
(
name
=>
{
...
...
@@ -1644,6 +1661,10 @@ if (typeof Proxy !== 'undefined') {
});
}
my
.
createApp
=
createApp
;
my
.
createPage
=
createPage
;
my
.
createComponent
=
createComponent
;
var
uni$1
=
uni
;
export
default
uni$1
;
...
...
packages/uni-mp-alipay/package.json
浏览文件 @
ba742014
{
"name"
:
"@dcloudio/uni-mp-alipay"
,
"version"
:
"0.0.80
5
"
,
"version"
:
"0.0.80
6
"
,
"description"
:
"uni-app mp-alipay"
,
"main"
:
"dist/index.js"
,
"scripts"
:
{
...
...
packages/uni-mp-baidu/dist/index.js
浏览文件 @
ba742014
...
...
@@ -337,8 +337,12 @@ function wrapper (methodName, method) {
}
arg1
=
processArgs
(
methodName
,
arg1
,
options
.
args
,
options
.
returnValue
);
const
returnValue
=
swan
[
options
.
name
||
methodName
](
arg1
,
arg2
);
const
args
=
[
arg1
];
if
(
typeof
arg2
!==
'
undefined
'
)
{
args
.
push
(
arg2
);
}
const
returnValue
=
swan
[
options
.
name
||
methodName
].
apply
(
swan
,
args
);
if
(
isSyncApi
(
methodName
))
{
// 同步 api
return
processReturnValue
(
methodName
,
returnValue
,
options
.
returnValue
,
isContextApi
(
methodName
))
}
...
...
@@ -884,7 +888,15 @@ function handleEvent (event) {
eventsArray
.
forEach
(
eventArray
=>
{
const
methodName
=
eventArray
[
0
];
if
(
methodName
)
{
const
handler
=
this
.
$vm
[
methodName
];
let
handlerCtx
=
this
.
$vm
;
if
(
handlerCtx
.
$options
.
generic
&&
handlerCtx
.
$parent
&&
handlerCtx
.
$parent
.
$parent
)
{
// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx
=
handlerCtx
.
$parent
.
$parent
;
}
const
handler
=
handlerCtx
[
methodName
];
if
(
!
isFn
(
handler
))
{
throw
new
Error
(
` _vm.
${
methodName
}
is not a function`
)
}
...
...
@@ -894,7 +906,7 @@ function handleEvent (event) {
}
handler
.
once
=
true
;
}
handler
.
apply
(
this
.
$vm
,
processEventArgs
(
handler
.
apply
(
handlerCtx
,
processEventArgs
(
this
.
$vm
,
event
,
eventArray
[
1
],
...
...
@@ -1237,7 +1249,8 @@ todos.forEach(todoApi => {
});
canIUses
.
forEach
(
canIUseApi
=>
{
const
apiName
=
protocols
[
canIUseApi
]
&&
protocols
[
canIUseApi
].
name
?
protocols
[
canIUseApi
].
name
:
canIUseApi
;
const
apiName
=
protocols
[
canIUseApi
]
&&
protocols
[
canIUseApi
].
name
?
protocols
[
canIUseApi
].
name
:
canIUseApi
;
if
(
!
swan
.
canIUse
(
apiName
))
{
protocols
[
canIUseApi
]
=
false
;
}
...
...
@@ -1253,14 +1266,14 @@ if (typeof Proxy !== 'undefined') {
}
if
(
api
[
name
])
{
return
promisify
(
name
,
api
[
name
])
}
{
if
(
extraApi
[
name
])
{
return
promisify
(
name
,
extraApi
[
name
])
}
if
(
todoApis
[
name
])
{
return
promisify
(
name
,
todoApis
[
name
])
}
}
{
if
(
extraApi
[
name
])
{
return
promisify
(
name
,
extraApi
[
name
])
}
if
(
todoApis
[
name
])
{
return
promisify
(
name
,
todoApis
[
name
])
}
}
if
(
!
hasOwn
(
swan
,
name
)
&&
!
hasOwn
(
protocols
,
name
))
{
return
...
...
@@ -1271,13 +1284,13 @@ if (typeof Proxy !== 'undefined') {
}
else
{
uni
.
upx2px
=
upx2px
;
{
Object
.
keys
(
todoApis
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
extraApi
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
{
Object
.
keys
(
todoApis
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
extraApi
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
}
Object
.
keys
(
api
).
forEach
(
name
=>
{
...
...
@@ -1291,6 +1304,10 @@ if (typeof Proxy !== 'undefined') {
});
}
swan
.
createApp
=
createApp
;
swan
.
createPage
=
createPage
;
swan
.
createComponent
=
createComponent
;
var
uni$1
=
uni
;
export
default
uni$1
;
...
...
packages/uni-mp-baidu/package.json
浏览文件 @
ba742014
{
"name"
:
"@dcloudio/uni-mp-baidu"
,
"version"
:
"0.0.83
3
"
,
"version"
:
"0.0.83
4
"
,
"description"
:
"uni-app mp-baidu"
,
"main"
:
"dist/index.js"
,
"scripts"
:
{
...
...
packages/uni-mp-toutiao/dist/index.js
浏览文件 @
ba742014
...
...
@@ -398,8 +398,12 @@ function wrapper (methodName, method) {
}
arg1
=
processArgs
(
methodName
,
arg1
,
options
.
args
,
options
.
returnValue
);
const
returnValue
=
tt
[
options
.
name
||
methodName
](
arg1
,
arg2
);
const
args
=
[
arg1
];
if
(
typeof
arg2
!==
'
undefined
'
)
{
args
.
push
(
arg2
);
}
const
returnValue
=
tt
[
options
.
name
||
methodName
].
apply
(
tt
,
args
);
if
(
isSyncApi
(
methodName
))
{
// 同步 api
return
processReturnValue
(
methodName
,
returnValue
,
options
.
returnValue
,
isContextApi
(
methodName
))
}
...
...
@@ -903,7 +907,15 @@ function handleEvent (event) {
eventsArray
.
forEach
(
eventArray
=>
{
const
methodName
=
eventArray
[
0
];
if
(
methodName
)
{
const
handler
=
this
.
$vm
[
methodName
];
let
handlerCtx
=
this
.
$vm
;
if
(
handlerCtx
.
$options
.
generic
&&
handlerCtx
.
$parent
&&
handlerCtx
.
$parent
.
$parent
)
{
// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx
=
handlerCtx
.
$parent
.
$parent
;
}
const
handler
=
handlerCtx
[
methodName
];
if
(
!
isFn
(
handler
))
{
throw
new
Error
(
` _vm.
${
methodName
}
is not a function`
)
}
...
...
@@ -913,7 +925,7 @@ function handleEvent (event) {
}
handler
.
once
=
true
;
}
handler
.
apply
(
this
.
$vm
,
processEventArgs
(
handler
.
apply
(
handlerCtx
,
processEventArgs
(
this
.
$vm
,
event
,
eventArray
[
1
],
...
...
@@ -1312,7 +1324,8 @@ todos.forEach(todoApi => {
});
canIUses
.
forEach
(
canIUseApi
=>
{
const
apiName
=
protocols
[
canIUseApi
]
&&
protocols
[
canIUseApi
].
name
?
protocols
[
canIUseApi
].
name
:
canIUseApi
;
const
apiName
=
protocols
[
canIUseApi
]
&&
protocols
[
canIUseApi
].
name
?
protocols
[
canIUseApi
].
name
:
canIUseApi
;
if
(
!
tt
.
canIUse
(
apiName
))
{
protocols
[
canIUseApi
]
=
false
;
}
...
...
@@ -1328,14 +1341,14 @@ if (typeof Proxy !== 'undefined') {
}
if
(
api
[
name
])
{
return
promisify
(
name
,
api
[
name
])
}
{
if
(
extraApi
[
name
])
{
return
promisify
(
name
,
extraApi
[
name
])
}
if
(
todoApis
[
name
])
{
return
promisify
(
name
,
todoApis
[
name
])
}
}
{
if
(
extraApi
[
name
])
{
return
promisify
(
name
,
extraApi
[
name
])
}
if
(
todoApis
[
name
])
{
return
promisify
(
name
,
todoApis
[
name
])
}
}
if
(
!
hasOwn
(
tt
,
name
)
&&
!
hasOwn
(
protocols
,
name
))
{
return
...
...
@@ -1346,13 +1359,13 @@ if (typeof Proxy !== 'undefined') {
}
else
{
uni
.
upx2px
=
upx2px
;
{
Object
.
keys
(
todoApis
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
extraApi
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
{
Object
.
keys
(
todoApis
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
extraApi
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
}
Object
.
keys
(
api
).
forEach
(
name
=>
{
...
...
@@ -1366,6 +1379,10 @@ if (typeof Proxy !== 'undefined') {
});
}
tt
.
createApp
=
createApp
;
tt
.
createPage
=
createPage
;
tt
.
createComponent
=
createComponent
;
var
uni$1
=
uni
;
export
default
uni$1
;
...
...
packages/uni-mp-toutiao/package.json
浏览文件 @
ba742014
{
"name"
:
"@dcloudio/uni-mp-toutiao"
,
"version"
:
"0.0.33
3
"
,
"version"
:
"0.0.33
4
"
,
"description"
:
"uni-app mp-toutiao"
,
"main"
:
"dist/index.js"
,
"scripts"
:
{
...
...
packages/uni-mp-weixin/dist/index.js
浏览文件 @
ba742014
...
...
@@ -250,8 +250,12 @@ function wrapper (methodName, method) {
}
arg1
=
processArgs
(
methodName
,
arg1
,
options
.
args
,
options
.
returnValue
);
const
returnValue
=
wx
[
options
.
name
||
methodName
](
arg1
,
arg2
);
const
args
=
[
arg1
];
if
(
typeof
arg2
!==
'
undefined
'
)
{
args
.
push
(
arg2
);
}
const
returnValue
=
wx
[
options
.
name
||
methodName
].
apply
(
wx
,
args
);
if
(
isSyncApi
(
methodName
))
{
// 同步 api
return
processReturnValue
(
methodName
,
returnValue
,
options
.
returnValue
,
isContextApi
(
methodName
))
}
...
...
@@ -760,7 +764,15 @@ function handleEvent (event) {
eventsArray
.
forEach
(
eventArray
=>
{
const
methodName
=
eventArray
[
0
];
if
(
methodName
)
{
const
handler
=
this
.
$vm
[
methodName
];
let
handlerCtx
=
this
.
$vm
;
if
(
handlerCtx
.
$options
.
generic
&&
handlerCtx
.
$parent
&&
handlerCtx
.
$parent
.
$parent
)
{
// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx
=
handlerCtx
.
$parent
.
$parent
;
}
const
handler
=
handlerCtx
[
methodName
];
if
(
!
isFn
(
handler
))
{
throw
new
Error
(
` _vm.
${
methodName
}
is not a function`
)
}
...
...
@@ -770,7 +782,7 @@ function handleEvent (event) {
}
handler
.
once
=
true
;
}
handler
.
apply
(
this
.
$vm
,
processEventArgs
(
handler
.
apply
(
handlerCtx
,
processEventArgs
(
this
.
$vm
,
event
,
eventArray
[
1
],
...
...
@@ -1072,7 +1084,8 @@ todos.forEach(todoApi => {
});
canIUses
.
forEach
(
canIUseApi
=>
{
const
apiName
=
protocols
[
canIUseApi
]
&&
protocols
[
canIUseApi
].
name
?
protocols
[
canIUseApi
].
name
:
canIUseApi
;
const
apiName
=
protocols
[
canIUseApi
]
&&
protocols
[
canIUseApi
].
name
?
protocols
[
canIUseApi
].
name
:
canIUseApi
;
if
(
!
wx
.
canIUse
(
apiName
))
{
protocols
[
canIUseApi
]
=
false
;
}
...
...
@@ -1088,14 +1101,14 @@ if (typeof Proxy !== 'undefined') {
}
if
(
api
[
name
])
{
return
promisify
(
name
,
api
[
name
])
}
{
if
(
extraApi
[
name
])
{
return
promisify
(
name
,
extraApi
[
name
])
}
if
(
todoApis
[
name
])
{
return
promisify
(
name
,
todoApis
[
name
])
}
}
{
if
(
extraApi
[
name
])
{
return
promisify
(
name
,
extraApi
[
name
])
}
if
(
todoApis
[
name
])
{
return
promisify
(
name
,
todoApis
[
name
])
}
}
if
(
!
hasOwn
(
wx
,
name
)
&&
!
hasOwn
(
protocols
,
name
))
{
return
...
...
@@ -1106,13 +1119,13 @@ if (typeof Proxy !== 'undefined') {
}
else
{
uni
.
upx2px
=
upx2px
;
{
Object
.
keys
(
todoApis
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
extraApi
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
{
Object
.
keys
(
todoApis
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
extraApi
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
}
Object
.
keys
(
api
).
forEach
(
name
=>
{
...
...
@@ -1126,6 +1139,10 @@ if (typeof Proxy !== 'undefined') {
});
}
wx
.
createApp
=
createApp
;
wx
.
createPage
=
createPage
;
wx
.
createComponent
=
createComponent
;
var
uni$1
=
uni
;
export
default
uni$1
;
...
...
packages/uni-mp-weixin/package.json
浏览文件 @
ba742014
{
"name"
:
"@dcloudio/uni-mp-weixin"
,
"version"
:
"0.0.95
5
"
,
"version"
:
"0.0.95
6
"
,
"description"
:
"uni-app mp-weixin"
,
"main"
:
"dist/index.js"
,
"scripts"
:
{
...
...
src/core/runtime/index.js
浏览文件 @
ba742014
...
...
@@ -13,19 +13,28 @@ import {
import
wrapper
from
'
./wrapper
'
import
todoApi
from
'
./todo
'
import
*
as
extraApi
from
'
./extra
'
import
*
as
extraApi
from
'
./extra
'
import
*
as
api
from
'
uni-platform/service/api/index.js
'
import
{
protocols
,
todos
,
canIUses
}
from
'
uni-platform/service/api/protocols
'
import
{
protocols
,
todos
,
canIUses
}
from
'
uni-platform/service/api/protocols
'
import
createApp
from
'
./wrapper/create-app
'
import
createPage
from
'
./wrapper/create-page
'
import
createComponent
from
'
./wrapper/create-component
'
todos
.
forEach
(
todoApi
=>
{
protocols
[
todoApi
]
=
false
})
canIUses
.
forEach
(
canIUseApi
=>
{
const
apiName
=
protocols
[
canIUseApi
]
&&
protocols
[
canIUseApi
].
name
?
protocols
[
canIUseApi
].
name
:
canIUseApi
const
apiName
=
protocols
[
canIUseApi
]
&&
protocols
[
canIUseApi
].
name
?
protocols
[
canIUseApi
].
name
:
canIUseApi
if
(
!
__GLOBAL__
.
canIUse
(
apiName
))
{
protocols
[
canIUseApi
]
=
false
}
...
...
@@ -41,14 +50,14 @@ if (typeof Proxy !== 'undefined') {
}
if
(
api
[
name
])
{
return
promisify
(
name
,
api
[
name
])
}
if
(
__PLATFORM__
!==
'
app-plus
'
)
{
if
(
extraApi
[
name
])
{
return
promisify
(
name
,
extraApi
[
name
])
}
if
(
todoApi
[
name
])
{
return
promisify
(
name
,
todoApi
[
name
])
}
}
if
(
__PLATFORM__
!==
'
app-plus
'
)
{
if
(
extraApi
[
name
])
{
return
promisify
(
name
,
extraApi
[
name
])
}
if
(
todoApi
[
name
])
{
return
promisify
(
name
,
todoApi
[
name
])
}
}
if
(
!
hasOwn
(
__GLOBAL__
,
name
)
&&
!
hasOwn
(
protocols
,
name
))
{
return
...
...
@@ -59,13 +68,13 @@ if (typeof Proxy !== 'undefined') {
}
else
{
uni
.
upx2px
=
upx2px
if
(
__PLATFORM__
!==
'
app-plus
'
)
{
Object
.
keys
(
todoApi
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApi
[
name
])
})
Object
.
keys
(
extraApi
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApi
[
name
])
})
if
(
__PLATFORM__
!==
'
app-plus
'
)
{
Object
.
keys
(
todoApi
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApi
[
name
])
})
Object
.
keys
(
extraApi
).
forEach
(
name
=>
{
uni
[
name
]
=
promisify
(
name
,
todoApi
[
name
])
})
}
Object
.
keys
(
api
).
forEach
(
name
=>
{
...
...
@@ -79,8 +88,14 @@ if (typeof Proxy !== 'undefined') {
})
}
export
*
from
'
./wrapper/create-app
'
export
*
from
'
./wrapper/create-page
'
export
*
from
'
./wrapper/create-component
'
__GLOBAL__
.
createApp
=
createApp
__GLOBAL__
.
createPage
=
createPage
__GLOBAL__
.
createComponent
=
createComponent
export
{
createApp
,
createPage
,
createComponent
}
export
default
uni
src/core/runtime/wrapper.js
浏览文件 @
ba742014
...
...
@@ -76,8 +76,12 @@ export default function wrapper (methodName, method) {
}
arg1
=
processArgs
(
methodName
,
arg1
,
options
.
args
,
options
.
returnValue
)
const
returnValue
=
__GLOBAL__
[
options
.
name
||
methodName
](
arg1
,
arg2
)
const
args
=
[
arg1
]
if
(
typeof
arg2
!==
'
undefined
'
)
{
args
.
push
(
arg2
)
}
const
returnValue
=
__GLOBAL__
[
options
.
name
||
methodName
].
apply
(
__GLOBAL__
,
args
)
if
(
isSyncApi
(
methodName
))
{
// 同步 api
return
processReturnValue
(
methodName
,
returnValue
,
options
.
returnValue
,
isContextApi
(
methodName
))
}
...
...
src/core/runtime/wrapper/create-app.js
浏览文件 @
ba742014
...
...
@@ -2,7 +2,7 @@ import 'uni-platform/runtime/index'
import
parseApp
from
'
uni-platform/runtime/wrapper/app-parser
'
export
function
createApp
(
vm
)
{
export
default
function
createApp
(
vm
)
{
App
(
parseApp
(
vm
))
return
vm
}
src/core/runtime/wrapper/create-component.js
浏览文件 @
ba742014
import
parseComponent
from
'
uni-platform/runtime/wrapper/component-parser
'
export
function
createComponent
(
vueOptions
)
{
export
default
function
createComponent
(
vueOptions
)
{
if
(
__PLATFORM__
===
'
mp-alipay
'
)
{
return
my
.
createComponent
(
parseComponent
(
vueOptions
))
}
else
{
...
...
src/core/runtime/wrapper/create-page.js
浏览文件 @
ba742014
import
parsePage
from
'
uni-platform/runtime/wrapper/page-parser
'
export
function
createPage
(
vuePageOptions
)
{
export
default
function
createPage
(
vuePageOptions
)
{
if
(
__PLATFORM__
===
'
mp-alipay
'
)
{
return
Page
(
parsePage
(
vuePageOptions
))
}
else
{
...
...
src/core/runtime/wrapper/util.js
浏览文件 @
ba742014
...
...
@@ -418,7 +418,15 @@ export function handleEvent (event) {
eventsArray
.
forEach
(
eventArray
=>
{
const
methodName
=
eventArray
[
0
]
if
(
methodName
)
{
const
handler
=
this
.
$vm
[
methodName
]
let
handlerCtx
=
this
.
$vm
if
(
handlerCtx
.
$options
.
generic
&&
handlerCtx
.
$parent
&&
handlerCtx
.
$parent
.
$parent
)
{
// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx
=
handlerCtx
.
$parent
.
$parent
}
const
handler
=
handlerCtx
[
methodName
]
if
(
!
isFn
(
handler
))
{
throw
new
Error
(
` _vm.
${
methodName
}
is not a function`
)
}
...
...
@@ -428,7 +436,7 @@ export function handleEvent (event) {
}
handler
.
once
=
true
}
handler
.
apply
(
this
.
$vm
,
processEventArgs
(
handler
.
apply
(
handlerCtx
,
processEventArgs
(
this
.
$vm
,
event
,
eventArray
[
1
],
...
...
src/platforms/mp-alipay/runtime/wrapper/page-parser.js
浏览文件 @
ba742014
...
...
@@ -67,7 +67,11 @@ export default function parsePage (vuePageOptions) {
__l
:
handleLink
}
initHooks
(
pageOptions
,
hooks
)
initHooks
(
pageOptions
,
hooks
)
if
(
vueOptions
.
methods
&&
vueOptions
.
methods
.
formReset
)
{
pageOptions
.
formReset
=
vueOptions
.
methods
.
formReset
}
return
pageOptions
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录