Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yangkaifeng
uni-app
提交
22ce471a
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,发现更多精彩内容 >>
提交
22ce471a
编写于
1月 08, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://github.com/dcloudio/uni-app
into alpha
上级
b2711a00
3ecbc789
变更
12
展开全部
显示空白变更内容
内联
并排
Showing
12 changed file
with
173 addition
and
71 deletion
+173
-71
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+31
-12
packages/uni-app-plus/dist/service.runtime.esm.js
packages/uni-app-plus/dist/service.runtime.esm.js
+48
-0
packages/uni-cli-shared/lib/pages.js
packages/uni-cli-shared/lib/pages.js
+22
-9
packages/vue-cli-plugin-uni/lib/env.js
packages/vue-cli-plugin-uni/lib/env.js
+8
-5
packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.common.js
...ugin-uni/packages/h5-vue-router/dist/vue-router.common.js
+2
-3
packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.esm.js
...-plugin-uni/packages/h5-vue-router/dist/vue-router.esm.js
+2
-3
packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.js
...-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.js
+2
-3
packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.min.js
...-plugin-uni/packages/h5-vue-router/dist/vue-router.min.js
+2
-2
packages/vue-cli-plugin-uni/packages/webpack-uni-app-loader/plugin/index.js
...lugin-uni/packages/webpack-uni-app-loader/plugin/index.js
+3
-1
packages/webpack-uni-pages-loader/lib/index-new.js
packages/webpack-uni-pages-loader/lib/index-new.js
+2
-1
src/core/helpers/hidpi.js
src/core/helpers/hidpi.js
+19
-19
src/core/service/api/context/audio.js
src/core/service/api/context/audio.js
+32
-13
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
22ce471a
...
...
@@ -8962,7 +8962,7 @@ var serviceContext = (function () {
'
pause
'
,
'
stop
'
,
'
ended
'
,
'
time
u
pdate
'
,
'
time
U
pdate
'
,
'
error
'
,
'
waiting
'
,
'
seeking
'
,
...
...
@@ -9022,7 +9022,7 @@ var serviceContext = (function () {
this
.
_callbacks
=
{};
this
.
_options
=
{};
eventNames
.
forEach
(
name
=>
{
this
.
_callbacks
[
name
]
=
[];
this
.
_callbacks
[
name
.
toLowerCase
()
]
=
[];
});
props
.
forEach
(
item
=>
{
const
name
=
item
.
name
;
...
...
@@ -9056,11 +9056,12 @@ var serviceContext = (function () {
this
.
_operate
(
'
stop
'
);
}
seek
(
position
)
{
this
.
_operate
(
'
play
'
,
{
currentTime
:
position
this
.
_operate
(
'
seek
'
,
{
currentTime
:
position
*
1
e3
});
}
destroy
()
{
clearInterval
(
this
.
__timing
);
invokeMethod
(
'
destroyAudioInstance
'
,
{
audioId
:
this
.
id
});
...
...
@@ -9076,6 +9077,7 @@ var serviceContext = (function () {
eventNames
.
forEach
(
item
=>
{
const
name
=
item
[
0
].
toUpperCase
()
+
item
.
substr
(
1
);
item
=
item
.
toLowerCase
();
InnerAudioContext
.
prototype
[
`on
${
name
}
`
]
=
function
(
callback
)
{
this
.
_callbacks
[
item
].
push
(
callback
);
};
...
...
@@ -9088,6 +9090,17 @@ var serviceContext = (function () {
};
});
function
emit
(
audio
,
state
,
errMsg
,
errCode
)
{
audio
.
_callbacks
[
state
].
forEach
(
callback
=>
{
if
(
typeof
callback
===
'
function
'
)
{
callback
(
state
===
'
error
'
?
{
errMsg
,
errCode
}
:
{});
}
});
}
onMethod
(
'
onAudioStateChange
'
,
({
state
,
audioId
,
...
...
@@ -9095,14 +9108,20 @@ var serviceContext = (function () {
errCode
})
=>
{
const
audio
=
innerAudioContexts
[
audioId
];
audio
&&
audio
.
_callbacks
[
state
].
forEach
(
callback
=>
{
if
(
typeof
callback
===
'
function
'
)
{
callback
(
state
===
'
error
'
?
{
errMsg
,
errCode
}
:
{});
if
(
audio
)
{
emit
(
audio
,
state
,
errMsg
,
errCode
);
if
(
state
===
'
play
'
)
{
const
oldCurrentTime
=
audio
.
currentTime
;
audio
.
__timing
=
setInterval
(()
=>
{
const
currentTime
=
audio
.
currentTime
;
if
(
currentTime
!==
oldCurrentTime
)
{
emit
(
audio
,
'
timeupdate
'
);
}
},
200
);
}
else
if
(
state
===
'
pause
'
||
state
===
'
stop
'
||
state
===
'
error
'
)
{
clearInterval
(
audio
.
__timing
);
}
}
});
});
const
innerAudioContexts
=
Object
.
create
(
null
);
...
...
packages/uni-app-plus/dist/service.runtime.esm.js
浏览文件 @
22ce471a
...
...
@@ -6642,6 +6642,53 @@ var baseModules = [
directives
];
/* */
function
updateWxsProps
(
oldVnode
,
vnode
)
{
if
(
isUndef
(
oldVnode
.
data
.
wxsProps
)
&&
isUndef
(
vnode
.
data
.
wxsProps
)
)
{
return
}
var
oldWxsWatches
=
oldVnode
.
$wxsWatches
;
var
wxsPropsKey
=
Object
.
keys
(
vnode
.
data
.
wxsProps
);
if
(
!
oldWxsWatches
&&
!
wxsPropsKey
.
length
)
{
return
}
if
(
!
oldWxsWatches
)
{
oldWxsWatches
=
{};
}
var
wxsProps
=
vnode
.
data
.
wxsProps
;
vnode
.
$wxsWatches
=
{};
Object
.
keys
(
wxsProps
).
forEach
(
function
(
prop
)
{
var
watchProp
=
wxsProps
[
prop
];
vnode
.
$wxsWatches
[
prop
]
=
oldWxsWatches
[
prop
]
||
vnode
.
context
.
$watch
(
watchProp
,
function
()
{
this
.
$forceUpdate
();
},
{
deep
:
true
});
});
Object
.
keys
(
oldWxsWatches
).
forEach
(
function
(
oldName
)
{
if
(
!
vnode
.
$wxsWatches
[
oldName
])
{
oldWxsWatches
[
oldName
]();
delete
oldWxsWatches
[
oldName
];
}
});
}
var
wxs
=
{
create
:
updateWxsProps
,
update
:
updateWxsProps
};
function
parseDataset
(
attrs
)
{
var
dataset
=
Object
.
create
(
null
);
Object
.
keys
(
attrs
).
forEach
(
function
(
name
)
{
...
...
@@ -6765,6 +6812,7 @@ var events = {
};
var
platformModules
=
[
wxs
,
attrs
,
events
];
...
...
packages/uni-cli-shared/lib/pages.js
浏览文件 @
22ce471a
...
...
@@ -352,7 +352,17 @@ function initAutoImportScanComponents () {
refreshAutoComponentMap
()
}
function
initAutoImportComponents
(
usingAutoImportComponents
=
{})
{
const
_toString
=
Object
.
prototype
.
toString
function
isPlainObject
(
obj
)
{
return
_toString
.
call
(
obj
)
===
'
[object Object]
'
}
function
initAutoImportComponents
(
easycom
=
{})
{
let
usingAutoImportComponents
=
easycom
.
custom
||
easycom
||
{}
if
(
!
isPlainObject
(
usingAutoImportComponents
))
{
usingAutoImportComponents
=
{}
}
// 目前仅 mp-weixin 内置支持 page-meta 等组件
if
(
process
.
env
.
UNI_PLATFORM
!==
'
mp-weixin
'
)
{
if
(
!
usingAutoImportComponents
[
'
^page-meta$
'
])
{
...
...
@@ -415,10 +425,13 @@ function parseUsingAutoImportComponents (usingAutoImportComponents) {
const
autoImportComponents
=
[]
if
(
usingAutoImportComponents
)
{
Object
.
keys
(
usingAutoImportComponents
).
forEach
(
pattern
=>
{
const
replacement
=
usingAutoImportComponents
[
pattern
]
if
(
replacement
&&
typeof
replacement
===
'
string
'
)
{
autoImportComponents
.
push
({
pattern
:
new
RegExp
(
pattern
),
replacement
:
usingAutoImportComponents
[
pattern
]
replacement
:
replacement
})
}
})
}
return
autoImportComponents
...
...
packages/vue-cli-plugin-uni/lib/env.js
浏览文件 @
22ce471a
...
...
@@ -316,8 +316,11 @@ const {
initAutoImportScanComponents
}
=
require
(
'
@dcloudio/uni-cli-shared/lib/pages
'
)
initAutoImportScanComponents
(
)
process
.
UNI_AUTO_SCAN_COMPONENTS
=
!
(
pagesJsonObj
.
easycom
&&
pagesJsonObj
.
easycom
.
autoscan
===
false
)
initAutoImportComponents
(
pagesJsonObj
.
easycom
)
if
(
process
.
UNI_AUTO_SCAN_COMPONENTS
)
{
initAutoImportScanComponents
()
}
runByHBuilderX
&&
console
.
log
(
`正在编译中...`
)
...
...
packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.common.js
浏览文件 @
22ce471a
/*!
* vue-router v3.0.1
* (c) 20
19
Evan You
* (c) 20
20
Evan You
* @license MIT
*/
'
use strict
'
;
...
...
@@ -1325,7 +1325,6 @@ function normalizeLocation (
/* */
function
createMatcher
(
routes
,
router
...
...
@@ -1495,7 +1494,7 @@ function createMatcher (
if
(
record
.
meta
.
id
)
{
record
.
components
.
default
.
name
=
record
.
meta
.
name
+
'
-
'
+
location
.
params
.
__id__
;
}
else
{
record
=
Object
.
assign
({},
record
);
record
=
extend
({},
record
);
record
.
components
=
{
'
default
'
:
{
name
:
record
.
meta
.
name
+
'
-
'
+
location
.
params
.
__id__
,
...
...
packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.esm.js
浏览文件 @
22ce471a
/*!
* vue-router v3.0.1
* (c) 20
19
Evan You
* (c) 20
20
Evan You
* @license MIT
*/
/* */
...
...
@@ -1323,7 +1323,6 @@ function normalizeLocation (
/* */
function
createMatcher
(
routes
,
router
...
...
@@ -1493,7 +1492,7 @@ function createMatcher (
if
(
record
.
meta
.
id
)
{
record
.
components
.
default
.
name
=
record
.
meta
.
name
+
'
-
'
+
location
.
params
.
__id__
;
}
else
{
record
=
Object
.
assign
({},
record
);
record
=
extend
({},
record
);
record
.
components
=
{
'
default
'
:
{
name
:
record
.
meta
.
name
+
'
-
'
+
location
.
params
.
__id__
,
...
...
packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.js
浏览文件 @
22ce471a
/*!
* vue-router v3.0.1
* (c) 20
19
Evan You
* (c) 20
20
Evan You
* @license MIT
*/
(
function
(
global
,
factory
)
{
...
...
@@ -1329,7 +1329,6 @@ function normalizeLocation (
/* */
function
createMatcher
(
routes
,
router
...
...
@@ -1499,7 +1498,7 @@ function createMatcher (
if
(
record
.
meta
.
id
)
{
record
.
components
.
default
.
name
=
record
.
meta
.
name
+
'
-
'
+
location
.
params
.
__id__
;
}
else
{
record
=
Object
.
assign
({},
record
);
record
=
extend
({},
record
);
record
.
components
=
{
'
default
'
:
{
name
:
record
.
meta
.
name
+
'
-
'
+
location
.
params
.
__id__
,
...
...
packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.min.js
浏览文件 @
22ce471a
此差异已折叠。
点击以展开。
packages/vue-cli-plugin-uni/packages/webpack-uni-app-loader/plugin/index.js
浏览文件 @
22ce471a
...
...
@@ -13,9 +13,11 @@ class WebpackUniAppPlugin {
compiler
.
hooks
.
invalid
.
tap
(
'
webpack-uni-app-invalid
'
,
(
fileName
,
changeTime
)
=>
{
if
(
fileName
&&
typeof
fileName
===
'
string
'
)
{
if
(
fileName
.
indexOf
(
'
.vue
'
)
!==
-
1
||
fileName
.
indexOf
(
'
.nvue
'
)
!==
-
1
)
{
if
(
process
.
UNI_AUTO_SCAN_COMPONENTS
)
{
initAutoImportScanComponents
()
}
}
}
})
}
}
...
...
packages/webpack-uni-pages-loader/lib/index-new.js
浏览文件 @
22ce471a
...
...
@@ -56,6 +56,7 @@ module.exports = function (content) {
})
// 组件自动导入配置
process
.
UNI_AUTO_SCAN_COMPONENTS
=
!
(
pagesJson
.
easycom
&&
pagesJson
.
easycom
.
autoscan
===
false
)
initAutoImportComponents
(
pagesJson
.
easycom
)
// TODO 与 usingComponents 放在一块读取设置
...
...
src/core/helpers/hidpi.js
浏览文件 @
22ce471a
...
...
@@ -36,9 +36,9 @@ const ratioArgs = {
'
createLinearGradient
'
:
'
all
'
,
'
setTransform
'
:
[
4
,
5
]
}
if
(
pixelRatio
!==
1
)
{
const
proto
=
CanvasRenderingContext2D
.
prototype
const
proto
=
CanvasRenderingContext2D
.
prototype
if
(
pixelRatio
!==
1
)
{
forEach
(
ratioArgs
,
function
(
value
,
key
)
{
proto
[
key
]
=
(
function
(
_super
)
{
return
function
()
{
...
...
@@ -129,7 +129,19 @@ if (pixelRatio !== 1) {
}
})(
proto
.
strokeText
)
proto
.
drawImageByCanvas
=
(
function
(
_super
)
{
proto
.
drawImage
=
(
function
(
_super
)
{
return
function
()
{
if
(
!
this
.
__hidpi__
)
{
return
_super
.
apply
(
this
,
arguments
)
}
this
.
scale
(
pixelRatio
,
pixelRatio
)
_super
.
apply
(
this
,
arguments
)
this
.
scale
(
1
/
pixelRatio
,
1
/
pixelRatio
)
}
})(
proto
.
drawImage
)
}
proto
.
drawImageByCanvas
=
(
function
(
_super
)
{
return
function
(
canvas
,
srcx
,
srcy
,
srcw
,
srch
,
desx
,
desy
,
desw
,
desh
,
isScale
)
{
if
(
!
this
.
__hidpi__
)
{
return
_super
.
apply
(
this
,
arguments
)
...
...
@@ -144,19 +156,7 @@ if (pixelRatio !== 1) {
desh
=
isScale
?
desh
*
pixelRatio
:
desh
_super
.
call
(
this
,
canvas
,
srcx
,
srcy
,
srcw
,
srch
,
desx
,
desy
,
desw
,
desh
)
}
})(
proto
.
drawImage
)
proto
.
drawImage
=
(
function
(
_super
)
{
return
function
()
{
if
(
!
this
.
__hidpi__
)
{
return
_super
.
apply
(
this
,
arguments
)
}
this
.
scale
(
pixelRatio
,
pixelRatio
)
_super
.
apply
(
this
,
arguments
)
this
.
scale
(
1
/
pixelRatio
,
1
/
pixelRatio
)
}
})(
proto
.
drawImage
)
}
})(
proto
.
drawImage
)
export
function
wrapper
(
canvas
)
{
canvas
.
width
=
canvas
.
offsetWidth
*
pixelRatio
...
...
src/core/service/api/context/audio.js
浏览文件 @
22ce471a
...
...
@@ -9,7 +9,7 @@ const eventNames = [
'
pause
'
,
'
stop
'
,
'
ended
'
,
'
time
u
pdate
'
,
'
time
U
pdate
'
,
'
error
'
,
'
waiting
'
,
'
seeking
'
,
...
...
@@ -69,7 +69,7 @@ class InnerAudioContext {
this
.
_callbacks
=
{}
this
.
_options
=
{}
eventNames
.
forEach
(
name
=>
{
this
.
_callbacks
[
name
]
=
[]
this
.
_callbacks
[
name
.
toLowerCase
()
]
=
[]
})
props
.
forEach
(
item
=>
{
const
name
=
item
.
name
...
...
@@ -103,11 +103,12 @@ class InnerAudioContext {
this
.
_operate
(
'
stop
'
)
}
seek
(
position
)
{
this
.
_operate
(
'
play
'
,
{
currentTime
:
position
this
.
_operate
(
'
seek
'
,
{
currentTime
:
position
*
1
e3
})
}
destroy
()
{
clearInterval
(
this
.
__timing
)
invokeMethod
(
'
destroyAudioInstance
'
,
{
audioId
:
this
.
id
})
...
...
@@ -123,6 +124,7 @@ class InnerAudioContext {
eventNames
.
forEach
(
item
=>
{
const
name
=
item
[
0
].
toUpperCase
()
+
item
.
substr
(
1
)
item
=
item
.
toLowerCase
()
InnerAudioContext
.
prototype
[
`on
${
name
}
`
]
=
function
(
callback
)
{
this
.
_callbacks
[
item
].
push
(
callback
)
}
...
...
@@ -135,6 +137,17 @@ eventNames.forEach(item => {
}
})
function
emit
(
audio
,
state
,
errMsg
,
errCode
)
{
audio
.
_callbacks
[
state
].
forEach
(
callback
=>
{
if
(
typeof
callback
===
'
function
'
)
{
callback
(
state
===
'
error
'
?
{
errMsg
,
errCode
}
:
{})
}
})
}
onMethod
(
'
onAudioStateChange
'
,
({
state
,
audioId
,
...
...
@@ -142,14 +155,20 @@ onMethod('onAudioStateChange', ({
errCode
})
=>
{
const
audio
=
innerAudioContexts
[
audioId
]
audio
&&
audio
.
_callbacks
[
state
].
forEach
(
callback
=>
{
if
(
typeof
callback
===
'
function
'
)
{
callback
(
state
===
'
error
'
?
{
errMsg
,
errCode
}
:
{})
if
(
audio
)
{
emit
(
audio
,
state
,
errMsg
,
errCode
)
if
(
state
===
'
play
'
)
{
const
oldCurrentTime
=
audio
.
currentTime
audio
.
__timing
=
setInterval
(()
=>
{
const
currentTime
=
audio
.
currentTime
if
(
currentTime
!==
oldCurrentTime
)
{
emit
(
audio
,
'
timeupdate
'
)
}
},
200
)
}
else
if
(
state
===
'
pause
'
||
state
===
'
stop
'
||
state
===
'
error
'
)
{
clearInterval
(
audio
.
__timing
)
}
}
})
})
const
innerAudioContexts
=
Object
.
create
(
null
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录