Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小浣熊撸代码
uni-app
提交
072967ba
U
uni-app
项目概览
小浣熊撸代码
/
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,发现更多精彩内容 >>
提交
072967ba
编写于
9月 18, 2020
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build runtime
上级
dcf421ac
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
463 addition
and
21 deletion
+463
-21
packages/uni-mp-alipay/dist/index.js
packages/uni-mp-alipay/dist/index.js
+94
-1
packages/uni-mp-baidu/dist/index.js
packages/uni-mp-baidu/dist/index.js
+94
-1
packages/uni-mp-kuaishou/dist/index.js
packages/uni-mp-kuaishou/dist/index.js
+85
-15
packages/uni-mp-qq/dist/index.js
packages/uni-mp-qq/dist/index.js
+94
-1
packages/uni-mp-toutiao/dist/index.js
packages/uni-mp-toutiao/dist/index.js
+94
-1
packages/uni-quickapp-native/dist/vue.dev.js
packages/uni-quickapp-native/dist/vue.dev.js
+1
-1
packages/uni-quickapp-native/dist/vue.prod.js
packages/uni-quickapp-native/dist/vue.prod.js
+1
-1
未找到文件。
packages/uni-mp-alipay/dist/index.js
浏览文件 @
072967ba
...
...
@@ -1167,6 +1167,98 @@ var eventApi = /*#__PURE__*/Object.freeze({
$emit
:
$emit
});
function
createMediaQueryObserver
()
{
const
mediaQueryObserver
=
{};
const
{
windowWidth
,
windowHeight
}
=
my
.
getSystemInfoSync
();
const
orientation
=
windowWidth
<
windowHeight
?
'
portrait
'
:
'
landscape
'
;
mediaQueryObserver
.
observe
=
(
options
,
callback
)
=>
{
let
matches
=
false
;
for
(
const
item
in
options
)
{
const
itemValue
=
item
===
'
orientation
'
?
options
[
item
]
:
Number
(
options
[
item
]);
if
(
options
[
item
]
!==
''
)
{
if
(
item
===
'
width
'
)
{
if
(
itemValue
===
windowWidth
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
minWidth
'
)
{
if
(
windowWidth
>=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
maxWidth
'
)
{
if
(
windowWidth
<=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
height
'
)
{
if
(
itemValue
===
windowHeight
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
minHeight
'
)
{
if
(
windowHeight
>=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
maxHeight
'
)
{
if
(
windowHeight
<=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
orientation
'
)
{
if
(
options
[
item
]
===
orientation
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
}
}
callback
(
matches
);
return
matches
};
mediaQueryObserver
.
disconnect
=
()
=>
{
};
return
mediaQueryObserver
}
function
setStorageSync
(
key
,
data
)
{
return
my
.
setStorageSync
({
key
,
...
...
@@ -1276,7 +1368,8 @@ var api = /*#__PURE__*/Object.freeze({
removeStorageSync
:
removeStorageSync
,
startGyroscope
:
startGyroscope
,
createSelectorQuery
:
createSelectorQuery
,
createIntersectionObserver
:
createIntersectionObserver
createIntersectionObserver
:
createIntersectionObserver
,
createMediaQueryObserver
:
createMediaQueryObserver
});
const
PAGE_EVENT_HOOKS
=
[
...
...
packages/uni-mp-baidu/dist/index.js
浏览文件 @
072967ba
...
...
@@ -845,6 +845,98 @@ var eventApi = /*#__PURE__*/Object.freeze({
$emit
:
$emit
});
function
createMediaQueryObserver
()
{
const
mediaQueryObserver
=
{};
const
{
windowWidth
,
windowHeight
}
=
swan
.
getSystemInfoSync
();
const
orientation
=
windowWidth
<
windowHeight
?
'
portrait
'
:
'
landscape
'
;
mediaQueryObserver
.
observe
=
(
options
,
callback
)
=>
{
let
matches
=
false
;
for
(
const
item
in
options
)
{
const
itemValue
=
item
===
'
orientation
'
?
options
[
item
]
:
Number
(
options
[
item
]);
if
(
options
[
item
]
!==
''
)
{
if
(
item
===
'
width
'
)
{
if
(
itemValue
===
windowWidth
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
minWidth
'
)
{
if
(
windowWidth
>=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
maxWidth
'
)
{
if
(
windowWidth
<=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
height
'
)
{
if
(
itemValue
===
windowHeight
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
minHeight
'
)
{
if
(
windowHeight
>=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
maxHeight
'
)
{
if
(
windowHeight
<=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
orientation
'
)
{
if
(
options
[
item
]
===
orientation
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
}
}
callback
(
matches
);
return
matches
};
mediaQueryObserver
.
disconnect
=
()
=>
{
};
return
mediaQueryObserver
}
function
requestPayment
(
params
)
{
let
parseError
=
false
;
if
(
typeof
params
.
orderInfo
===
'
string
'
)
{
...
...
@@ -865,7 +957,8 @@ function requestPayment (params) {
var
api
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
requestPayment
:
requestPayment
requestPayment
:
requestPayment
,
createMediaQueryObserver
:
createMediaQueryObserver
});
const
MPPage
=
Page
;
...
...
packages/uni-mp-kuaishou/dist/index.js
浏览文件 @
072967ba
...
...
@@ -1317,7 +1317,9 @@ const hooks = [
'
onShow
'
,
'
onHide
'
,
'
onError
'
,
'
onPageNotFound
'
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onUnhandledRejection
'
];
function
parseBaseApp
(
vm
,
{
...
...
@@ -1393,17 +1395,19 @@ function parseBaseApp (vm, {
return
appOptions
}
/* 快手也使用__wxExparserNodeId__和__wxWebviewId__ */
const
mocks
=
[
'
__route__
'
,
'
__wxExparserNodeId__
'
,
'
__wxWebviewId__
'
];
function
findVmByVueId
(
vm
,
vuePid
)
{
const
$children
=
vm
.
$children
;
// 优先查找直属
let
parentVm
=
$children
.
find
(
childVm
=>
childVm
.
$scope
.
_$vueId
===
vuePid
);
if
(
parentVm
)
{
return
parentVm
// 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
for
(
let
i
=
$children
.
length
-
1
;
i
>=
0
;
i
--
)
{
const
childVm
=
$children
[
i
];
if
(
childVm
.
$scope
.
_$vueId
===
vuePid
)
{
return
childVm
}
}
// 反向递归查找
let
parentVm
;
for
(
let
i
=
$children
.
length
-
1
;
i
>=
0
;
i
--
)
{
parentVm
=
findVmByVueId
(
$children
[
i
],
vuePid
);
if
(
parentVm
)
{
...
...
@@ -1473,6 +1477,10 @@ function parseApp (vm) {
})
}
function
parseApp$1
(
vm
)
{
return
parseApp
(
vm
)
}
function
createApp
(
vm
)
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
if
(
!
this
.
__eventChannel__
)
{
...
...
@@ -1488,10 +1496,53 @@ function createApp (vm) {
}
return
callHook
.
call
(
this
,
hook
,
args
)
};
App
(
parseApp
(
vm
));
App
(
parseApp
$1
(
vm
));
return
vm
}
const
encodeReserveRE
=
/
[
!'()*
]
/g
;
const
encodeReserveReplacer
=
c
=>
'
%
'
+
c
.
charCodeAt
(
0
).
toString
(
16
);
const
commaRE
=
/%2C/g
;
// fixed encodeURIComponent which is more conformant to RFC3986:
// - escapes [!'()*]
// - preserve commas
const
encode
=
str
=>
encodeURIComponent
(
str
)
.
replace
(
encodeReserveRE
,
encodeReserveReplacer
)
.
replace
(
commaRE
,
'
,
'
);
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
?
Object
.
keys
(
obj
).
map
(
key
=>
{
const
val
=
obj
[
key
];
if
(
val
===
undefined
)
{
return
''
}
if
(
val
===
null
)
{
return
encodeStr
(
key
)
}
if
(
Array
.
isArray
(
val
))
{
const
result
=
[];
val
.
forEach
(
val2
=>
{
if
(
val2
===
undefined
)
{
return
}
if
(
val2
===
null
)
{
result
.
push
(
encodeStr
(
key
));
}
else
{
result
.
push
(
encodeStr
(
key
)
+
'
=
'
+
encodeStr
(
val2
));
}
});
return
result
.
join
(
'
&
'
)
}
return
encodeStr
(
key
)
+
'
=
'
+
encodeStr
(
val
)
}).
filter
(
x
=>
x
.
length
>
0
).
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
}
function
parseBaseComponent
(
vueComponentOptions
,
{
isPage
,
initRelation
...
...
@@ -1500,7 +1551,8 @@ function parseBaseComponent (vueComponentOptions, {
const
options
=
{
multipleSlots
:
true
,
addGlobalClass
:
true
addGlobalClass
:
true
,
...(
vueOptions
.
options
||
{})
};
const
componentOptions
=
{
...
...
@@ -1545,7 +1597,7 @@ function parseBaseComponent (vueComponentOptions, {
}
},
detached
()
{
this
.
$vm
.
$destroy
();
this
.
$vm
&&
this
.
$vm
.
$destroy
();
}
},
pageLifetimes
:
{
...
...
@@ -1564,6 +1616,10 @@ function parseBaseComponent (vueComponentOptions, {
__e
:
handleEvent
}
};
// externalClasses
if
(
vueOptions
.
externalClasses
)
{
componentOptions
.
externalClasses
=
vueOptions
.
externalClasses
;
}
if
(
Array
.
isArray
(
vueOptions
.
wxsCallMethods
))
{
vueOptions
.
wxsCallMethods
.
forEach
(
callMethod
=>
{
...
...
@@ -1586,6 +1642,10 @@ function parseComponent (vueComponentOptions) {
})
}
function
parseComponent$1
(
vueComponentOptions
)
{
return
parseComponent
(
vueComponentOptions
)
}
const
hooks$1
=
[
'
onShow
'
,
'
onHide
'
,
...
...
@@ -1598,13 +1658,19 @@ function parseBasePage (vuePageOptions, {
isPage
,
initRelation
})
{
const
pageOptions
=
parseComponent
(
vuePageOptions
);
const
pageOptions
=
parseComponent
$1
(
vuePageOptions
);
initHooks
(
pageOptions
.
methods
,
hooks$1
,
vuePageOptions
);
pageOptions
.
methods
.
onLoad
=
function
(
args
)
{
this
.
$vm
.
$mp
.
query
=
args
;
// 兼容 mpvue
this
.
$vm
.
__call_hook
(
'
onLoad
'
,
args
);
pageOptions
.
methods
.
onLoad
=
function
(
query
)
{
this
.
options
=
query
;
const
copyQuery
=
Object
.
assign
({},
query
);
delete
copyQuery
.
__id__
;
this
.
$page
=
{
fullPath
:
'
/
'
+
(
this
.
route
||
this
.
is
)
+
stringifyQuery
(
copyQuery
)
};
this
.
$vm
.
$mp
.
query
=
query
;
// 兼容 mpvue
this
.
$vm
.
__call_hook
(
'
onLoad
'
,
query
);
};
return
pageOptions
...
...
@@ -1617,15 +1683,19 @@ function parsePage (vuePageOptions) {
})
}
function
parsePage$1
(
vuePageOptions
)
{
return
parsePage
(
vuePageOptions
)
}
function
createPage
(
vuePageOptions
)
{
{
return
Component
(
parsePage
(
vuePageOptions
))
return
Component
(
parsePage
$1
(
vuePageOptions
))
}
}
function
createComponent
(
vueOptions
)
{
{
return
Component
(
parseComponent
(
vueOptions
))
return
Component
(
parseComponent
$1
(
vueOptions
))
}
}
...
...
packages/uni-mp-qq/dist/index.js
浏览文件 @
072967ba
...
...
@@ -803,8 +803,101 @@ var eventApi = /*#__PURE__*/Object.freeze({
$emit
:
$emit
});
function
createMediaQueryObserver
()
{
const
mediaQueryObserver
=
{};
const
{
windowWidth
,
windowHeight
}
=
wx
.
getSystemInfoSync
();
const
orientation
=
windowWidth
<
windowHeight
?
'
portrait
'
:
'
landscape
'
;
mediaQueryObserver
.
observe
=
(
options
,
callback
)
=>
{
let
matches
=
false
;
for
(
const
item
in
options
)
{
const
itemValue
=
item
===
'
orientation
'
?
options
[
item
]
:
Number
(
options
[
item
]);
if
(
options
[
item
]
!==
''
)
{
if
(
item
===
'
width
'
)
{
if
(
itemValue
===
windowWidth
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
minWidth
'
)
{
if
(
windowWidth
>=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
maxWidth
'
)
{
if
(
windowWidth
<=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
height
'
)
{
if
(
itemValue
===
windowHeight
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
minHeight
'
)
{
if
(
windowHeight
>=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
maxHeight
'
)
{
if
(
windowHeight
<=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
orientation
'
)
{
if
(
options
[
item
]
===
orientation
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
}
}
callback
(
matches
);
return
matches
};
mediaQueryObserver
.
disconnect
=
()
=>
{
};
return
mediaQueryObserver
}
var
api
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
__proto__
:
null
,
createMediaQueryObserver
:
createMediaQueryObserver
});
const
MPPage
=
Page
;
...
...
packages/uni-mp-toutiao/dist/index.js
浏览文件 @
072967ba
...
...
@@ -895,8 +895,101 @@ var eventApi = /*#__PURE__*/Object.freeze({
$emit
:
$emit
});
function
createMediaQueryObserver
()
{
const
mediaQueryObserver
=
{};
const
{
windowWidth
,
windowHeight
}
=
tt
.
getSystemInfoSync
();
const
orientation
=
windowWidth
<
windowHeight
?
'
portrait
'
:
'
landscape
'
;
mediaQueryObserver
.
observe
=
(
options
,
callback
)
=>
{
let
matches
=
false
;
for
(
const
item
in
options
)
{
const
itemValue
=
item
===
'
orientation
'
?
options
[
item
]
:
Number
(
options
[
item
]);
if
(
options
[
item
]
!==
''
)
{
if
(
item
===
'
width
'
)
{
if
(
itemValue
===
windowWidth
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
minWidth
'
)
{
if
(
windowWidth
>=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
maxWidth
'
)
{
if
(
windowWidth
<=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
height
'
)
{
if
(
itemValue
===
windowHeight
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
minHeight
'
)
{
if
(
windowHeight
>=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
maxHeight
'
)
{
if
(
windowHeight
<=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
orientation
'
)
{
if
(
options
[
item
]
===
orientation
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
}
}
callback
(
matches
);
return
matches
};
mediaQueryObserver
.
disconnect
=
()
=>
{
};
return
mediaQueryObserver
}
var
api
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
__proto__
:
null
,
createMediaQueryObserver
:
createMediaQueryObserver
});
const
MPPage
=
Page
;
...
...
packages/uni-quickapp-native/dist/vue.dev.js
浏览文件 @
072967ba
此差异已折叠。
点击以展开。
packages/uni-quickapp-native/dist/vue.prod.js
浏览文件 @
072967ba
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录