Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yangkaifeng
uni-app
提交
97a3d8e2
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,发现更多精彩内容 >>
提交
97a3d8e2
编写于
4月 08, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
# Conflicts: # packages/uni-h5/dist/index.umd.min.js
上级
abcb9b27
e7e2d1e0
变更
14
展开全部
显示空白变更内容
内联
并排
Showing
14 changed file
with
106 addition
and
57 deletion
+106
-57
packages/uni-h5/dist/index.umd.min.js
packages/uni-h5/dist/index.umd.min.js
+1
-1
packages/uni-mp-weixin/dist/index.js
packages/uni-mp-weixin/dist/index.js
+10
-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-template-compiler/__tests__/compiler-extra.spec.js
...es/uni-template-compiler/__tests__/compiler-extra.spec.js
+10
-0
packages/uni-template-compiler/lib/script/traverse/visitor.js
...ages/uni-template-compiler/lib/script/traverse/visitor.js
+5
-0
packages/webpack-uni-mp-loader/lib/babel/global-component-traverse.js
...pack-uni-mp-loader/lib/babel/global-component-traverse.js
+2
-5
packages/webpack-uni-mp-loader/lib/babel/scoped-component-traverse.js
...pack-uni-mp-loader/lib/babel/scoped-component-traverse.js
+3
-6
src/core/service/api/context/background-audio.js
src/core/service/api/context/background-audio.js
+24
-19
src/core/service/api/context/inner-audio.js
src/core/service/api/context/inner-audio.js
+13
-9
src/platforms/app-plus/service/api/context/background-audio.js
...latforms/app-plus/service/api/context/background-audio.js
+10
-3
src/platforms/app-plus/service/api/context/inner-audio.js
src/platforms/app-plus/service/api/context/inner-audio.js
+16
-10
src/platforms/mp-weixin/helpers/show-action-sheet.js
src/platforms/mp-weixin/helpers/show-action-sheet.js
+7
-0
src/platforms/mp-weixin/runtime/api/protocols.js
src/platforms/mp-weixin/runtime/api/protocols.js
+3
-1
未找到文件。
packages/uni-h5/dist/index.umd.min.js
浏览文件 @
97a3d8e2
此差异已折叠。
点击以展开。
packages/uni-mp-weixin/dist/index.js
浏览文件 @
97a3d8e2
...
...
@@ -579,6 +579,14 @@ var getSystemInfo = {
}
};
var
showActionSheet
=
{
args
(
fromArgs
)
{
if
(
typeof
fromArgs
===
'
object
'
)
{
fromArgs
.
alertText
=
fromArgs
.
title
;
}
}
};
// import navigateTo from 'uni-helpers/navigate-to'
const
protocols
=
{
...
...
@@ -586,7 +594,8 @@ const protocols = {
// navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
previewImage
,
getSystemInfo
,
getSystemInfoSync
:
getSystemInfo
getSystemInfoSync
:
getSystemInfo
,
showActionSheet
};
const
todos
=
[
'
vibrate
'
,
...
...
packages/uni-quickapp-native/dist/vue.dev.js
浏览文件 @
97a3d8e2
此差异已折叠。
点击以展开。
packages/uni-quickapp-native/dist/vue.prod.js
浏览文件 @
97a3d8e2
此差异已折叠。
点击以展开。
packages/uni-template-compiler/__tests__/compiler-extra.spec.js
浏览文件 @
97a3d8e2
...
...
@@ -797,6 +797,16 @@ describe('mp:compiler-extra', () => {
'
<block wx:if="{{$root.m0}}"><view>{{$root.m1}}</view></block>
'
,
'
with(this){var m0=test1(key)&&test2(key);var m1=m0?getValue(key):null;$mp.data=Object.assign({},{$root:{m0:m0,m1:m1}})}
'
)
assertCodegen
(
'
<view v-if="test.test(key)&&test2(key)">{{getValue(key)}}</view>
'
,
'
<block wx:if="{{$root.g0}}"><view>{{$root.m0}}</view></block>
'
,
'
with(this){var g0=test.test(key)&&test2(key);var m0=g0?getValue(key):null;$mp.data=Object.assign({},{$root:{g0:g0,m0:m0}})}
'
)
assertCodegen
(
'
<view v-if="show"><view v-if="test.test(key)&&test2(key)">{{getValue(key)}}</view></view>
'
,
'
<block wx:if="{{show}}"><view><block wx:if="{{$root.g0}}"><view>{{$root.m0}}</view></block></view></block>
'
,
'
with(this){var g0=show?test.test(key)&&test2(key):null;var m0=show&&g0?getValue(key):null;$mp.data=Object.assign({},{$root:{g0:g0,m0:m0}})}
'
)
assertCodegen
(
'
<view v-for="(item,index) in list" :key="index"><view v-if="item">{{getValue(item)}}</view></view>
'
,
'
<block wx:for="{{$root.l0}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view><block wx:if="{{item.$orig}}"><view>{{item.m0}}</view></block></view></block>
'
,
...
...
packages/uni-template-compiler/lib/script/traverse/visitor.js
浏览文件 @
97a3d8e2
...
...
@@ -251,6 +251,11 @@ module.exports = {
t
.
isMemberExpression
(
callee
)
// message.split('').reverse().join('')
)
{
// Object.assign...
path
=
path
.
findParent
((
path
)
=>
path
.
isLogicalExpression
())
||
path
path
.
skip
()
if
(
path
.
findParent
((
path
)
=>
path
.
shouldSkip
))
{
return
}
path
.
replaceWith
(
getMemberExpr
(
path
,
IDENTIFIER_GLOBAL
,
path
.
node
,
this
))
}
},
...
...
packages/webpack-uni-mp-loader/lib/babel/global-component-traverse.js
浏览文件 @
97a3d8e2
const
path
=
require
(
'
path
'
)
const
t
=
require
(
'
@babel/types
'
)
const
babelTraverse
=
require
(
'
@babel/traverse
'
).
default
const
{
normalizePath
}
=
require
(
'
@dcloudio/uni-cli-shared
'
)
const
{
parseComponents
}
=
require
(
'
./util
'
)
...
...
@@ -58,7 +55,7 @@ module.exports = function (ast, state = {}) {
}
}
catch
(
e
)
{
if
(
state
.
filename
)
{
console
.
error
(
'
at
'
+
normalizePath
(
path
.
relative
(
process
.
env
.
UNI_INPUT_DIR
,
state
.
filename
))
+
'
:1
'
)
console
.
error
(
'
at
'
+
require
(
'
@dcloudio/uni-cli-shared
'
).
normalizePath
(
path
.
relative
(
process
.
env
.
UNI_INPUT_DIR
,
state
.
filename
))
+
'
:1
'
)
}
throw
e
}
...
...
packages/webpack-uni-mp-loader/lib/babel/scoped-component-traverse.js
浏览文件 @
97a3d8e2
const
path
=
require
(
'
path
'
)
const
t
=
require
(
'
@babel/types
'
)
const
babelTraverse
=
require
(
'
@babel/traverse
'
).
default
const
{
normalizePath
}
=
require
(
'
@dcloudio/uni-cli-shared
'
)
const
{
parseComponents
}
=
require
(
'
./util
'
)
...
...
@@ -185,7 +182,7 @@ module.exports = function (ast, state = {
})
}
catch
(
e
)
{
if
(
state
.
filename
)
{
console
.
error
(
'
at
'
+
normalizePath
(
path
.
relative
(
process
.
env
.
UNI_INPUT_DIR
,
state
.
filename
))
+
'
:1
'
)
console
.
error
(
'
at
'
+
require
(
'
@dcloudio/uni-cli-shared
'
).
normalizePath
(
path
.
relative
(
process
.
env
.
UNI_INPUT_DIR
,
state
.
filename
))
+
'
:1
'
)
}
throw
e
}
...
...
src/core/service/api/context/background-audio.js
浏览文件 @
97a3d8e2
...
...
@@ -70,6 +70,11 @@ const props = [
name
:
'
protocol
'
,
readonly
:
true
,
default
:
'
http
'
},
{
name
:
'
playbackRate
'
,
default
:
1
,
cache
:
true
}
]
...
...
@@ -114,7 +119,7 @@ class BackgroundAudioManager {
this
.
_options
[
name
]
=
value
invokeMethod
(
'
setBackgroundAudioState
'
,
Object
.
assign
({},
this
.
_options
,
{
audioId
:
this
.
id
}))
})
,
name
)
}
}
Object
.
defineProperty
(
this
,
name
,
data
)
...
...
src/core/service/api/context/inner-audio.js
浏览文件 @
97a3d8e2
...
...
@@ -63,6 +63,10 @@ const props = [
},
{
name
:
'
sessionCategory
'
},
{
name
:
'
playbackRate
'
,
cache
:
true
}
]
...
...
src/platforms/app-plus/service/api/context/background-audio.js
浏览文件 @
97a3d8e2
...
...
@@ -86,9 +86,16 @@ function stopTimeUpdateTimer () {
}
}
function
setMusicState
(
args
)
{
function
setMusicState
(
args
,
name
)
{
initMusic
()
const
props
=
[
'
src
'
,
'
startTime
'
,
'
coverImgUrl
'
,
'
webUrl
'
,
'
singer
'
,
'
epname
'
,
'
title
'
]
if
(
name
&&
name
===
'
playbackRate
'
)
{
const
val
=
args
[
name
]
audio
.
playbackRate
&&
audio
.
playbackRate
(
parseFloat
(
val
))
return
}
const
style
=
{}
Object
.
keys
(
args
).
forEach
(
key
=>
{
if
(
props
.
indexOf
(
key
)
>=
0
)
{
...
...
@@ -150,8 +157,8 @@ export function operateMusicPlayer ({
errMsg
:
`
${
api
}
:ok`
}
}
export
function
setBackgroundAudioState
(
args
)
{
setMusicState
(
args
)
export
function
setBackgroundAudioState
(
args
,
name
)
{
setMusicState
(
args
,
name
)
return
{
errMsg
:
'
setBackgroundAudioState:ok
'
}
...
...
src/platforms/app-plus/service/api/context/inner-audio.js
浏览文件 @
97a3d8e2
...
...
@@ -82,7 +82,8 @@ export function setAudioState ({
loop
=
false
,
obeyMuteSwitch
,
volume
,
sessionCategory
=
AUDIO_DEFAULT_SESSION_CATEGORY
sessionCategory
=
AUDIO_DEFAULT_SESSION_CATEGORY
,
playbackRate
})
{
const
audio
=
audios
[
audioId
]
if
(
audio
)
{
...
...
@@ -91,7 +92,9 @@ export function setAudioState ({
autoplay
}
if
(
src
)
{
audio
.
src
=
style
.
src
=
getRealPath
(
src
)
// iOS 设置 src 会重新播放
const
realSrc
=
getRealPath
(
src
)
if
(
audio
.
src
!==
realSrc
)
audio
.
src
=
style
.
src
=
realSrc
}
if
(
startTime
)
{
audio
.
startTime
=
style
.
startTime
=
startTime
...
...
@@ -103,6 +106,9 @@ export function setAudioState ({
if
(
sessionCategory
)
{
audio
.
setSessionCategory
(
sessionCategory
)
}
if
(
playbackRate
&&
audio
.
playbackRate
)
{
audio
.
playbackRate
(
playbackRate
)
}
initStateChage
(
audioId
)
}
return
{
...
...
src/platforms/mp-weixin/helpers/show-action-sheet.js
0 → 100644
浏览文件 @
97a3d8e2
export
default
{
args
(
fromArgs
)
{
if
(
typeof
fromArgs
===
'
object
'
)
{
fromArgs
.
alertText
=
fromArgs
.
title
}
}
}
src/platforms/mp-weixin/runtime/api/protocols.js
浏览文件 @
97a3d8e2
...
...
@@ -2,13 +2,15 @@
import
redirectTo
from
'
../../helpers/redirect-to
'
import
previewImage
from
'
../../helpers/normalize-preview-image
'
import
getSystemInfo
from
'
../../helpers/system-info
'
import
showActionSheet
from
'
../../helpers/show-action-sheet
'
export
const
protocols
=
{
redirectTo
,
// navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
previewImage
,
getSystemInfo
,
getSystemInfoSync
:
getSystemInfo
getSystemInfoSync
:
getSystemInfo
,
showActionSheet
}
export
const
todos
=
[
'
vibrate
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录