Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
D-GSQ
uni-app
提交
39bd6ad6
U
uni-app
项目概览
D-GSQ
/
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,发现更多精彩内容 >>
提交
39bd6ad6
编写于
9月 07, 2022
作者:
L
lixu
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of github.com:dcloudio/uni-app into dev
上级
fa37075c
80a57faa
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
82 addition
and
17 deletion
+82
-17
packages/uni-cli-shared/components/ad.mixin.mp.js
packages/uni-cli-shared/components/ad.mixin.mp.js
+61
-1
packages/webpack-uni-mp-loader/lib/plugin/mp-weixin-uniad-app.json.js
...pack-uni-mp-loader/lib/plugin/mp-weixin-uniad-app.json.js
+2
-2
src/core/runtime/wrapper/util.js
src/core/runtime/wrapper/util.js
+13
-11
src/core/service/api/ui/create-selector-query.js
src/core/service/api/ui/create-selector-query.js
+6
-3
未找到文件。
packages/uni-cli-shared/components/ad.mixin.mp.js
浏览文件 @
39bd6ad6
...
...
@@ -27,6 +27,12 @@ export default {
loadnext
:
{
type
:
[
Boolean
,
String
],
default
:
false
},
urlCallback
:
{
type
:
Object
,
default
()
{
return
{}
}
}
},
data
()
{
...
...
@@ -58,7 +64,31 @@ export default {
show
()
{
this
.
errorMessage
=
null
this
.
_ad
=
this
.
selectComponent
(
'
.uniad-plugin
'
)
this
.
_ad
.
show
()
if
(
this
.
_hasCallback
())
{
const
userCryptoManager
=
wx
.
getUserCryptoManager
()
userCryptoManager
.
getLatestUserKey
({
success
:
({
encryptKey
,
iv
,
version
,
expireTime
})
=>
{
this
.
_ad
.
show
({
userId
:
this
.
urlCallback
.
userId
||
''
,
extra
:
this
.
urlCallback
.
extra
||
''
,
encryptKey
,
iv
,
version
,
expireTime
})
},
fail
:
(
err
)
=>
{
this
.
_dispatchEvent
(
EventType
.
Error
,
err
)
}
})
}
else
{
this
.
_ad
.
show
()
}
},
_onclick
()
{
...
...
@@ -80,6 +110,11 @@ export default {
return
result
},
_hasCallback
()
{
return
false
// return (typeof this.urlCallback === 'object' && Object.keys(this.urlCallback).length > 0)
},
_onmpload
(
e
)
{
this
.
loading
=
false
this
.
_dispatchEvent
(
EventType
.
Load
,
{})
...
...
@@ -87,6 +122,31 @@ export default {
_onmpclose
(
e
)
{
this
.
_dispatchEvent
(
EventType
.
Close
,
e
.
detail
)
if
(
e
.
detail
.
adsdata
)
{
const
adv
=
e
.
detail
.
adv
const
adsdata
=
e
.
detail
.
adsdata
const
version
=
e
.
detail
.
version
/* eslint-disable no-undef */
uniCloud
.
callFunction
({
name
:
'
uniAdCallback
'
,
data
:
{
adv
:
adv
,
adsdata
:
adsdata
,
version
:
version
},
secretType
:
'
both
'
,
success
:
(
res
)
=>
{
},
fail
:
(
err
)
=>
{
this
.
_dispatchEvent
(
EventType
.
Error
,
err
)
}
})
delete
e
.
detail
.
adv
delete
e
.
detail
.
adsdata
delete
e
.
detail
.
version
}
},
_onmperror
(
e
)
{
...
...
packages/webpack-uni-mp-loader/lib/plugin/mp-weixin-uniad-app.json.js
浏览文件 @
39bd6ad6
...
...
@@ -4,8 +4,8 @@ module.exports = function (appJson) {
}
if
(
!
appJson
.
plugins
[
'
uni-ad
'
])
{
appJson
.
plugins
[
'
uni-ad
'
]
=
{
version
:
'
1.
1
.0
'
,
provider
:
'
wx
999bf02c8e05dfc9
'
version
:
'
1.
0
.0
'
,
provider
:
'
wx
f72d316417b6767f
'
}
}
if
(
!
appJson
.
plugins
[
'
coral-adv
'
])
{
...
...
src/core/runtime/wrapper/util.js
浏览文件 @
39bd6ad6
...
...
@@ -142,7 +142,7 @@ export function initData (vueOptions, context) {
try
{
// 对 data 格式化
data
=
JSON
.
parse
(
JSON
.
stringify
(
data
))
}
catch
(
e
)
{}
}
catch
(
e
)
{
}
}
if
(
!
isPlainObject
(
data
))
{
...
...
@@ -332,7 +332,7 @@ function wrapper (event) {
// TODO 又得兼容 mpvue 的 mp 对象
try
{
event
.
mp
=
JSON
.
parse
(
JSON
.
stringify
(
event
))
}
catch
(
e
)
{}
}
catch
(
e
)
{
}
event
.
stopPropagation
=
noop
event
.
preventDefault
=
noop
...
...
@@ -413,7 +413,7 @@ function getExtraValue (vm, dataPathsArray) {
return
context
}
function
processEventExtra
(
vm
,
extra
,
event
)
{
function
processEventExtra
(
vm
,
extra
,
event
,
__args__
)
{
const
extraObj
=
{}
if
(
Array
.
isArray
(
extra
)
&&
extra
.
length
)
{
...
...
@@ -436,11 +436,7 @@ function processEventExtra (vm, extra, event) {
if
(
dataPath
===
'
$event
'
)
{
// $event
extraObj
[
'
$
'
+
index
]
=
event
}
else
if
(
dataPath
===
'
arguments
'
)
{
if
(
event
.
detail
&&
event
.
detail
.
__args__
)
{
extraObj
[
'
$
'
+
index
]
=
event
.
detail
.
__args__
}
else
{
extraObj
[
'
$
'
+
index
]
=
[
event
]
}
extraObj
[
'
$
'
+
index
]
=
event
.
detail
?
event
.
detail
.
__args__
||
__args__
:
__args__
}
else
if
(
dataPath
.
indexOf
(
'
$event.
'
)
===
0
)
{
// $event.target.value
extraObj
[
'
$
'
+
index
]
=
vm
.
__get_value
(
dataPath
.
replace
(
'
$event.
'
,
''
),
event
)
}
else
{
...
...
@@ -467,6 +463,12 @@ function getObjByArray (arr) {
function
processEventArgs
(
vm
,
event
,
args
=
[],
extra
=
[],
isCustom
,
methodName
)
{
let
isCustomMPEvent
=
false
// wxcomponent 组件,传递原始 event 对象
// fixed 用户直接触发 mpInstance.triggerEvent
const
__args__
=
isPlainObject
(
event
.
detail
)
?
event
.
detail
.
__args__
||
[
event
.
detail
]
:
[
event
.
detail
]
if
(
isCustom
)
{
// 自定义事件
isCustomMPEvent
=
event
.
currentTarget
&&
event
.
currentTarget
.
dataset
&&
...
...
@@ -475,11 +477,11 @@ function processEventArgs (vm, event, args = [], extra = [], isCustom, methodNam
if
(
isCustomMPEvent
)
{
return
[
event
]
}
return
event
.
detail
.
__args__
||
event
.
detail
return
__args__
}
}
const
extraObj
=
processEventExtra
(
vm
,
extra
,
event
)
const
extraObj
=
processEventExtra
(
vm
,
extra
,
event
,
__args__
)
const
ret
=
[]
args
.
forEach
(
arg
=>
{
...
...
@@ -488,7 +490,7 @@ function processEventArgs (vm, event, args = [], extra = [], isCustom, methodNam
ret
.
push
(
event
.
target
.
value
)
}
else
{
if
(
isCustom
&&
!
isCustomMPEvent
)
{
ret
.
push
(
event
.
detail
.
__args__
[
0
])
ret
.
push
(
__args__
[
0
])
}
else
{
// wxcomponent 组件或内置组件
ret
.
push
(
event
)
}
...
...
src/core/service/api/ui/create-selector-query.js
浏览文件 @
39bd6ad6
...
...
@@ -92,6 +92,7 @@ class SelectorQuery {
this
.
_page
=
page
this
.
_queue
=
[]
this
.
_queueCb
=
[]
this
.
_nodesRef
=
null
}
exec
(
callback
)
{
...
...
@@ -110,6 +111,8 @@ class SelectorQuery {
})
isFn
(
callback
)
&&
callback
.
call
(
this
,
res
)
})
return
this
.
_nodesRef
}
[
'
in
'
]
(
component
)
{
...
...
@@ -119,15 +122,15 @@ class SelectorQuery {
}
select
(
selector
)
{
return
new
NodesRef
(
this
,
this
.
_component
,
selector
,
true
)
return
(
this
.
_nodesRef
=
new
NodesRef
(
this
,
this
.
_component
,
selector
,
true
)
)
}
selectAll
(
selector
)
{
return
new
NodesRef
(
this
,
this
.
_component
,
selector
,
false
)
return
(
this
.
_nodesRef
=
new
NodesRef
(
this
,
this
.
_component
,
selector
,
false
)
)
}
selectViewport
()
{
return
new
NodesRef
(
this
,
0
,
''
,
true
)
return
(
this
.
_nodesRef
=
new
NodesRef
(
this
,
0
,
''
,
true
)
)
}
_push
(
selector
,
component
,
single
,
fields
,
callback
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录