Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ripplebb
uni-app
提交
7f60e239
U
uni-app
项目概览
ripplebb
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
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,发现更多精彩内容 >>
提交
7f60e239
编写于
4月 24, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
yarn: build
上级
6f0510e2
变更
21
展开全部
隐藏空白更改
内联
并排
Showing
21 changed file
with
273 addition
and
240 deletion
+273
-240
packages/uni-app-plus/dist/index.js
packages/uni-app-plus/dist/index.js
+1
-1
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+26
-1
packages/uni-app-plus/dist/view.umd.min.js
packages/uni-app-plus/dist/view.umd.min.js
+1
-1
packages/uni-cli-shared/components/ad-interactive.vue
packages/uni-cli-shared/components/ad-interactive.vue
+117
-114
packages/uni-cli-shared/components/ad.mixin.js
packages/uni-cli-shared/components/ad.mixin.js
+81
-83
packages/uni-cli-shared/components/ad.mixin.mp.js
packages/uni-cli-shared/components/ad.mixin.mp.js
+13
-13
packages/uni-cli-shared/components/uniad.vue
packages/uni-cli-shared/components/uniad.vue
+16
-9
packages/uni-h5/dist/index.umd.min.js
packages/uni-h5/dist/index.umd.min.js
+1
-1
packages/uni-mp-alipay/dist/index.js
packages/uni-mp-alipay/dist/index.js
+1
-1
packages/uni-mp-baidu/dist/index.js
packages/uni-mp-baidu/dist/index.js
+1
-1
packages/uni-mp-jd/dist/index.js
packages/uni-mp-jd/dist/index.js
+1
-1
packages/uni-mp-kuaishou/dist/index.js
packages/uni-mp-kuaishou/dist/index.js
+1
-1
packages/uni-mp-lark/dist/index.js
packages/uni-mp-lark/dist/index.js
+1
-1
packages/uni-mp-qq/dist/index.js
packages/uni-mp-qq/dist/index.js
+1
-1
packages/uni-mp-toutiao/dist/index.js
packages/uni-mp-toutiao/dist/index.js
+1
-1
packages/uni-mp-weixin/dist/index.js
packages/uni-mp-weixin/dist/index.js
+1
-1
packages/uni-mp-xhs/dist/index.js
packages/uni-mp-xhs/dist/index.js
+1
-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-quickapp-webview/dist/index.js
packages/uni-quickapp-webview/dist/index.js
+1
-1
packages/webpack-uni-pages-loader/lib/platforms/mp-weixin/app.json.uniad.js
...ni-pages-loader/lib/platforms/mp-weixin/app.json.uniad.js
+5
-5
未找到文件。
packages/uni-app-plus/dist/index.js
浏览文件 @
7f60e239
...
...
@@ -314,7 +314,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|
requireGlobal|
getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
7f60e239
...
...
@@ -248,6 +248,7 @@ var serviceContext = (function () {
'requireNativePlugin',
'upx2px',
'restoreGlobal',
'requireGlobal',
'getSubNVueById',
'getCurrentSubNVue',
'setPageMeta',
...
...
@@ -837,7 +838,7 @@ var serviceContext = (function () {
};
const SYNC_API_RE =
/^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/;
/^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|
requireGlobal|
getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/;
const CONTEXT_API_RE = /^create|Manager$/;
...
...
@@ -8563,6 +8564,29 @@ var serviceContext = (function () {
__uniConfig.serviceReady = true;
}
function requireGlobal () {
const list = [
'ArrayBuffer',
'Int8Array',
'Uint8Array',
'Uint8ClampedArray',
'Int16Array',
'Uint16Array',
'Int32Array',
'Uint32Array',
'Float32Array',
'Float64Array',
'BigInt64Array',
'BigUint64Array'
];
const object = {};
for (let i = 0; i < list.length; i++) {
const key = list[i];
object[key] = global[key];
}
return object
}
function wrapper$1 (webview) {
webview.$processed = true;
...
...
@@ -12027,6 +12051,7 @@ var serviceContext = (function () {
share: share,
shareWithSystem: shareWithSystem,
restoreGlobal: restoreGlobal,
requireGlobal: requireGlobal,
getSubNVueById: getSubNVueById,
getCurrentSubNVue: getCurrentSubNVue,
onHostEventReceive: onHostEventReceive,
...
...
packages/uni-app-plus/dist/view.umd.min.js
浏览文件 @
7f60e239
此差异已折叠。
点击以展开。
packages/uni-cli-shared/components/ad-interactive.vue
浏览文件 @
7f60e239
<
template
>
<view
@
click=
"onclick"
>
<slot
:options=
"options"
:data=
"adData"
/>
<slot
:options=
"options"
:data=
"adData"
/>
</view>
</
template
>
<
script
>
const
AD_URL
=
'
https://wxac1.dcloud.net.cn/tuiaApplet/acs
'
const
AD_REPORT_URL
=
'
https://wxac1.dcloud.net.cn/tuiaApplet/acs
'
const
WEBVIEW_PATH
=
'
/uni_modules/uni-ad-interactive/pages/uni-ad-interactive/uni-ad-interactive
'
const
AD_URL
=
'
https://wxac1.dcloud.net.cn/tuiaApplet/acs
'
const
AD_REPORT_URL
=
'
https://wxac1.dcloud.net.cn/tuiaApplet/acs
'
const
WEBVIEW_PATH
=
'
/uni_modules/uni-ad-interactive/pages/uni-ad-interactive/uni-ad-interactive
'
const
events
=
{
load
:
'
load
'
,
close
:
'
close
'
,
error
:
'
error
'
}
const
events
=
{
load
:
'
load
'
,
close
:
'
close
'
,
error
:
'
error
'
}
const
OpenTypes
=
{
Interactive
:
'
interactive
'
}
const
OpenTypes
=
{
Interactive
:
'
interactive
'
}
export
default
{
name
:
'
AdInteractive
'
,
props
:
{
options
:
{
type
:
[
Object
,
Array
],
default
()
{
return
{}
}
},
adpid
:
{
type
:
[
Number
,
String
],
default
:
''
},
openUrl
:
{
type
:
String
,
default
:
WEBVIEW_PATH
export
default
{
name
:
'
AdInteractive
'
,
props
:
{
options
:
{
type
:
[
Object
,
Array
],
default
()
{
return
{}
}
},
data
()
{
return
{
adData
:
{}
}
adpid
:
{
type
:
[
Number
,
String
],
default
:
''
},
created
()
{
this
.
_uniAdPlugin
=
null
this
.
_interactiveUrl
=
null
if
(
this
.
openType
==
OpenTypes
.
Interactive
)
{
this
.
getAdData
()
openUrl
:
{
type
:
String
,
default
:
WEBVIEW_PATH
}
},
data
()
{
return
{
adData
:
{}
}
},
created
()
{
this
.
_uniAdPlugin
=
null
this
.
_interactiveUrl
=
null
if
(
this
.
openType
==
OpenTypes
.
Interactive
)
{
this
.
getAdData
()
}
},
methods
:
{
show
()
{
if
(
this
.
_uniAdPlugin
==
null
)
{
this
.
_uniAdPlugin
=
this
.
selectComponent
(
'
.uni-ad-plugin
'
)
}
this
.
_uniAdPlugin
.
show
()
},
methods
:
{
show
()
{
if
(
this
.
_uniAdPlugin
==
null
)
{
this
.
_uniAdPlugin
=
this
.
selectComponent
(
'
.uni-ad-plugin
'
)
}
this
.
_uniAdPlugin
.
show
()
},
getAdData
()
{
if
(
!
this
.
adpid
)
{
this
.
$emit
(
events
.
error
,
{
code
:
-
5002
,
message
:
'
invalid adpid
'
})
return
}
uni
.
request
({
url
:
AD_URL
,
method
:
'
POST
'
,
data
:
{
adpid
:
this
.
adpid
},
timeout
:
5000
,
dataType
:
'
json
'
,
success
:
(
res
)
=>
{
console
.
log
(
res
.
data
)
if
(
res
.
statusCode
!==
200
)
{
this
.
$emit
(
events
.
error
,
{
code
:
res
.
statusCode
,
message
:
res
.
statusCode
})
return
}
const
responseData
=
res
.
data
;
if
(
responseData
.
ret
==
0
)
{
this
.
_interactiveUrl
=
responseData
.
data
.
adp_url
this
.
adData
.
imgUrl
=
responseData
.
data
.
icon_url
this
.
adData
.
openUrl
=
this
.
openUrl
+
"
?url=
"
+
encodeURIComponent
(
this
.
_interactiveUrl
)
this
.
$emit
(
events
.
load
,
{})
}
else
{
this
.
$emit
(
events
.
error
,
{
code
:
responseData
.
ret
,
message
:
responseData
.
msg
})
}
},
fail
:
(
err
)
=>
{
getAdData
()
{
if
(
!
this
.
adpid
)
{
this
.
$emit
(
events
.
error
,
{
code
:
-
5002
,
message
:
'
invalid adpid
'
})
return
}
uni
.
request
({
url
:
AD_URL
,
method
:
'
POST
'
,
data
:
{
adpid
:
this
.
adpid
},
timeout
:
5000
,
dataType
:
'
json
'
,
success
:
(
res
)
=>
{
console
.
log
(
res
.
data
)
if
(
res
.
statusCode
!==
200
)
{
this
.
$emit
(
events
.
error
,
{
code
:
''
,
message
:
err
.
errMsg
code
:
res
.
statusCode
,
message
:
res
.
statusCode
})
return
}
})
},
onclick
()
{
if
(
this
.
openType
!=
OpenTypes
.
Interactive
||
!
this
.
_interactiveUrl
)
{
return
}
uni
.
navigateTo
({
url
:
this
.
adData
.
openUrl
})
this
.
_report
()
},
_report
()
{
uni
.
request
({
url
:
AD_REPORT_URL
,
data
:
{
adpid
:
this
.
adpid
,
t
:
'
10019
'
},
timeout
:
5000
,
dataType
:
'
json
'
,
success
:
(
res
)
=>
{
},
fail
:
(
err
)
=>
{
const
responseData
=
res
.
data
if
(
responseData
.
ret
==
0
)
{
this
.
_interactiveUrl
=
responseData
.
data
.
adp_url
this
.
adData
.
imgUrl
=
responseData
.
data
.
icon_url
this
.
adData
.
openUrl
=
this
.
openUrl
+
'
?url=
'
+
encodeURIComponent
(
this
.
_interactiveUrl
)
this
.
$emit
(
events
.
load
,
{})
}
else
{
this
.
$emit
(
events
.
error
,
{
code
:
responseData
.
ret
,
message
:
responseData
.
msg
})
}
})
},
fail
:
(
err
)
=>
{
this
.
$emit
(
events
.
error
,
{
code
:
''
,
message
:
err
.
errMsg
})
}
})
},
onclick
()
{
if
(
this
.
openType
!=
OpenTypes
.
Interactive
||
!
this
.
_interactiveUrl
)
{
return
}
uni
.
navigateTo
({
url
:
this
.
adData
.
openUrl
})
this
.
_report
()
},
_report
()
{
uni
.
request
({
url
:
AD_REPORT_URL
,
data
:
{
adpid
:
this
.
adpid
,
t
:
'
10019
'
},
timeout
:
5000
,
dataType
:
'
json
'
,
success
:
(
res
)
=>
{
},
fail
:
(
err
)
=>
{
}
})
}
}
}
</
script
>
<
style
>
...
...
packages/uni-cli-shared/components/ad.mixin.js
浏览文件 @
7f60e239
const
ADType
=
{
RewardedVideo
:
"
RewardedVideo
"
,
FullScreenVideo
:
"
FullScreenVideo
"
,
Interstitial
:
"
Interstitial
"
RewardedVideo
:
'
RewardedVideo
'
,
FullScreenVideo
:
'
FullScreenVideo
'
,
Interstitial
:
'
Interstitial
'
}
const
EventType
=
{
...
...
@@ -19,8 +19,7 @@ const ProviderType = {
const
RETRY_COUNT
=
1
class
AdBase
{
constructor
(
adInstance
,
options
=
{},
interstitial
)
{
constructor
(
adInstance
,
options
=
{},
interstitial
)
{
this
.
_isLoad
=
false
this
.
_isLoading
=
false
this
.
_isPlaying
=
false
...
...
@@ -80,23 +79,23 @@ class AdBase {
})
}
get
isExpired
()
{
get
isExpired
()
{
return
(
this
.
_lastLoadTime
!==
0
&&
(
Math
.
abs
(
Date
.
now
()
-
this
.
_lastLoadTime
)
>
EXPIRED_TIME
))
}
get
isLoad
()
{
get
isLoad
()
{
return
this
.
_isLoad
}
get
isLoading
()
{
get
isLoading
()
{
return
this
.
_isLoading
}
getProvider
()
{
getProvider
()
{
return
this
.
_ad
.
getProvider
()
}
load
(
onload
,
onerror
)
{
load
(
onload
,
onerror
)
{
this
.
_loadCallback
=
onload
this
.
_errorCallback
=
onerror
...
...
@@ -119,7 +118,7 @@ class AdBase {
this
.
_loadAd
()
}
show
(
onclose
,
onshow
)
{
show
(
onclose
,
onshow
)
{
this
.
_closeCallback
=
onclose
if
(
this
.
_isLoading
||
this
.
_isPlaying
||
!
this
.
_isLoad
)
{
...
...
@@ -155,13 +154,13 @@ class AdBase {
}
}
onLoad
(
e
)
{
onLoad
(
e
)
{
if
(
this
.
_loadCallback
!=
null
)
{
this
.
_loadCallback
()
}
}
onClose
(
e
)
{
onClose
(
e
)
{
if
(
this
.
_closeCallback
!=
null
)
{
this
.
_closeCallback
({
isEnded
:
e
.
isEnded
...
...
@@ -169,17 +168,17 @@ class AdBase {
}
}
onError
(
e
)
{
onError
(
e
)
{
if
(
this
.
_errorCallback
!=
null
)
{
this
.
_errorCallback
(
e
)
}
}
destroy
()
{
destroy
()
{
this
.
_ad
.
destroy
()
}
_loadAd
()
{
_loadAd
()
{
this
.
_isLoad
=
false
this
.
_isLoading
=
true
this
.
_lastError
=
null
...
...
@@ -188,31 +187,30 @@ class AdBase {
}
class
RewardedVideo
extends
AdBase
{
constructor
(
options
=
{})
{
constructor
(
options
=
{})
{
super
(
plus
.
ad
.
createRewardedVideoAd
(
options
),
options
)
}
}
class
FullScreenVideo
extends
AdBase
{
constructor
(
options
=
{})
{
constructor
(
options
=
{})
{
super
(
plus
.
ad
.
createFullScreenVideoAd
(
options
),
options
)
}
}
class
Interstitial
extends
AdBase
{
constructor
(
options
=
{},
interstitial
)
{
constructor
(
options
=
{},
interstitial
)
{
super
(
plus
.
ad
.
createInterstitialAd
(
options
),
options
,
interstitial
)
}
}
class
AdHelper
{
constructor
(
adType
)
{
constructor
(
adType
)
{
this
.
_ads
=
{}
this
.
_adType
=
adType
}
load
(
options
,
onload
,
onerror
)
{
load
(
options
,
onload
,
onerror
)
{
if
(
!
options
.
adpid
||
this
.
isBusy
(
options
.
adpid
))
{
return
}
...
...
@@ -220,8 +218,8 @@ class AdHelper {
this
.
get
(
options
).
load
(
onload
,
onerror
)
}
show
(
options
,
onload
,
onerror
,
onclose
,
onshow
)
{
le
t
ad
=
this
.
get
(
options
)
show
(
options
,
onload
,
onerror
,
onclose
,
onshow
)
{
cons
t
ad
=
this
.
get
(
options
)
if
(
ad
.
isLoad
)
{
ad
.
show
((
e
)
=>
{
...
...
@@ -244,8 +242,8 @@ class AdHelper {
}
// 底价预载逻辑
loadWaterfall
(
options
,
onload
,
onfail
,
index
=
0
)
{
le
t
{
loadWaterfall
(
options
,
onload
,
onfail
,
index
=
0
)
{
cons
t
{
adpid
,
urlCallback
}
=
options
...
...
@@ -253,28 +251,28 @@ class AdHelper {
return
}
le
t
options2
=
{
cons
t
options2
=
{
adpid
:
adpid
[
index
],
urlCallback
,
retry
:
false
}
;
}
this
.
load
(
options2
,
(
res
)
=>
{
onload
(
options2
)
;
onload
(
options2
)
},
(
err
)
=>
{
index
++
;
index
++
if
(
index
>=
adpid
.
length
)
{
onfail
(
err
)
;
onfail
(
err
)
}
else
{
console
.
log
(
'
loadWaterfall::index=
'
+
index
)
;
this
.
loadWaterfall
(
options
,
onload
,
onfail
,
index
)
;
console
.
log
(
'
loadWaterfall::index=
'
+
index
)
this
.
loadWaterfall
(
options
,
onload
,
onfail
,
index
)
}
})
;
})
}
// 底价逻辑,失败后下一个,无重试机制
showWaterfall
(
options
,
onload
,
onfail
,
onclose
,
onshow
,
index
=
0
)
{
le
t
{
showWaterfall
(
options
,
onload
,
onfail
,
onclose
,
onshow
,
index
=
0
)
{
cons
t
{
adpid
,
urlCallback
}
=
options
...
...
@@ -282,70 +280,70 @@ class AdHelper {
return
}
le
t
options2
=
{
cons
t
options2
=
{
adpid
:
adpid
[
index
],
urlCallback
,
retry
:
false
}
;
}
this
.
show
(
options2
,
()
=>
{
onload
()
;
onload
()
},
(
err
)
=>
{
index
++
;
index
++
if
(
index
>=
adpid
.
length
)
{
onfail
(
err
)
;
onfail
(
err
)
}
else
{
this
.
showWaterfall
(
options
,
onload
,
onfail
,
onclose
,
onshow
,
index
)
;
this
.
showWaterfall
(
options
,
onload
,
onfail
,
onclose
,
onshow
,
index
)
}
},
(
res
)
=>
{
onclose
(
res
)
;
onclose
(
res
)
},
()
=>
{
onshow
()
;
})
;
onshow
()
})
}
// 预载底价瀑布流
preloadWaterfall
(
options
,
index
=
0
,
step
=
1
)
{
preloadWaterfall
(
options
,
index
=
0
,
step
=
1
)
{
if
(
step
===
1
)
{
this
.
loadWaterfall
(
options
,
(
res
)
=>
{
console
.
log
(
"
preloadWaterfall.success::
"
,
res
);
console
.
log
(
'
preloadWaterfall.success::
'
,
res
)
},
(
err
)
=>
{
console
.
log
(
"
loadWaterfall.fail
"
,
err
);
console
.
log
(
'
loadWaterfall.fail
'
,
err
)
})
return
;
return
}
le
t
{
cons
t
{
adpid
,
urlCallback
}
=
options
let
ads
=
[];
const
ads
=
[]
for
(
let
i
=
0
;
i
<
step
;
i
++
)
{
if
(
index
<
adpid
.
length
)
{
le
t
options2
=
{
cons
t
options2
=
{
adpid
:
adpid
[
index
],
urlCallback
}
;
}
this
.
loadWaterfall
(
options2
,
(
res
)
=>
{
console
.
log
(
"
preloadWaterfall.success::
"
,
res
);
console
.
log
(
'
preloadWaterfall.success::
'
,
res
)
},
(
err
)
=>
{
console
.
log
(
"
loadWaterfall.fail
"
,
err
);
this
.
preloadWaterfall
(
options
,
index
,
step
)
;
console
.
log
(
'
loadWaterfall.fail
'
,
err
)
this
.
preloadWaterfall
(
options
,
index
,
step
)
})
index
++
;
index
++
}
else
{
break
;
break
}
}
}
isBusy
(
adpid
)
{
isBusy
(
adpid
)
{
return
(
this
.
_ads
[
adpid
]
&&
this
.
_ads
[
adpid
].
isLoading
)
}
get
(
options
)
{
get
(
options
)
{
const
{
adpid
,
adpid
}
=
options
if
(
!
this
.
_ads
[
adpid
])
{
...
...
@@ -355,18 +353,18 @@ class AdHelper {
return
this
.
_ads
[
adpid
]
}
remove
(
adpid
)
{
remove
(
adpid
)
{
if
(
this
.
_ads
[
adpid
])
{
this
.
_ads
[
adpid
].
destroy
()
delete
this
.
_ads
[
adpid
]
}
}
_createInstance
(
options
)
{
_createInstance
(
options
)
{
const
adType
=
options
.
adType
||
this
.
_adType
delete
options
.
adType
let
ad
=
null
;
let
ad
=
null
if
(
adType
===
ADType
.
RewardedVideo
)
{
ad
=
new
RewardedVideo
(
options
)
}
else
if
(
adType
===
ADType
.
FullScreenVideo
)
{
...
...
@@ -410,25 +408,25 @@ export default {
}
}
},
data
()
{
data
()
{
return
{
loading
:
false
,
errorMessage
:
null
}
},
watch
:
{
adpid
(
newValue
,
oldValue
)
{
adpid
(
newValue
,
oldValue
)
{
this
.
_removeInstance
(
oldValue
)
if
(
this
.
preload
)
{
this
.
_loadAd
()
}
},
// 服务器回调透传参数,仅在创建广告实例时可传递参数,如果发生变化需要重新创建广告实例
urlCallback
()
{
urlCallback
()
{
this
.
_removeInstance
()
}
},
created
()
{
created
()
{
this
.
_adHelper
=
new
AdHelper
(
this
.
adType
)
setTimeout
(()
=>
{
...
...
@@ -438,9 +436,9 @@ export default {
},
100
)
},
methods
:
{
load
()
{
load
()
{
this
.
_startLoading
()
const
invoke
=
this
.
_isWaterfall
()
?
"
loadWaterfall
"
:
"
load
"
const
invoke
=
this
.
_isWaterfall
()
?
'
loadWaterfall
'
:
'
load
'
this
.
_adHelper
[
invoke
](
this
.
_getAdOptions
(),
()
=>
{
this
.
_onLoad
()
},
(
err
)
=>
{
...
...
@@ -448,9 +446,9 @@ export default {
})
},
show
()
{
show
()
{
this
.
_startLoading
()
const
invoke
=
this
.
_isWaterfall
()
?
"
showWaterfall
"
:
"
show
"
const
invoke
=
this
.
_isWaterfall
()
?
'
showWaterfall
'
:
'
show
'
this
.
_adHelper
[
invoke
](
this
.
_getAdOptions
(),
()
=>
{
this
.
_onLoad
()
},
(
err
)
=>
{
...
...
@@ -467,30 +465,30 @@ export default {
})
},
_loadAd
()
{
_loadAd
()
{
if
(
this
.
_canCreateAd
())
{
this
.
load
()
}
},
_onclick
()
{
_onclick
()
{
if
(
!
this
.
disabled
)
{
this
.
show
()
}
},
_getAdOptions
()
{
_getAdOptions
()
{
return
{
adpid
:
this
.
adpid
,
urlCallback
:
this
.
urlCallback
}
},
_isWaterfall
()
{
_isWaterfall
()
{
return
(
Array
.
isArray
(
this
.
adpid
)
&&
this
.
adpid
.
length
>
0
)
},
_canCreateAd
()
{
_canCreateAd
()
{
let
result
=
false
if
(
Array
.
isArray
(
this
.
adpid
)
&&
this
.
adpid
.
length
>
0
)
{
result
=
true
...
...
@@ -502,8 +500,8 @@ export default {
return
result
},
_removeInstance
(
adpid
)
{
le
t
id
=
adpid
||
this
.
adpid
_removeInstance
(
adpid
)
{
cons
t
id
=
adpid
||
this
.
adpid
if
(
Array
.
isArray
(
id
))
{
id
.
forEach
((
item
)
=>
{
this
.
_adHelper
.
remove
(
item
)
...
...
@@ -513,23 +511,23 @@ export default {
}
},
_startLoading
()
{
_startLoading
()
{
this
.
loading
=
true
this
.
errorMessage
=
null
},
_onLoad
(
err
)
{
_onLoad
(
err
)
{
this
.
loading
=
false
this
.
_dispatchEvent
(
EventType
.
Load
,
{})
},
_onLoadFail
(
err
)
{
_onLoadFail
(
err
)
{
this
.
loading
=
false
this
.
errorMessage
=
JSON
.
stringify
(
err
)
this
.
_dispatchEvent
(
EventType
.
Error
,
err
)
},
_dispatchEvent
(
type
,
data
)
{
_dispatchEvent
(
type
,
data
)
{
this
.
$emit
(
type
,
{
detail
:
data
})
...
...
packages/uni-cli-shared/components/ad.mixin.mp.js
浏览文件 @
7f60e239
...
...
@@ -29,56 +29,56 @@ export default {
default
:
false
}
},
data
()
{
data
()
{
return
{
loading
:
false
,
errorMessage
:
null
}
},
created
()
{
created
()
{
this
.
_ad
=
null
setTimeout
(()
=>
{
if
(
this
.
preload
&&
this
.
_canCreateAd
())
{
this
.
load
()
;
this
.
load
()
}
},
100
)
},
methods
:
{
load
()
{
load
()
{
this
.
errorMessage
=
null
},
show
()
{
show
()
{
this
.
errorMessage
=
null
this
.
_ad
=
this
.
selectComponent
(
'
.uni-ad
'
)
;
this
.
_ad
.
show
()
;
this
.
_ad
=
this
.
selectComponent
(
'
.uni-ad
'
)
this
.
_ad
.
show
()
},
_onclick
()
{
_onclick
()
{
this
.
show
()
},
_startLoading
()
{
_startLoading
()
{
this
.
loading
=
true
this
.
errorMessage
=
null
},
_onmpload
(
e
)
{
_onmpload
(
e
)
{
this
.
loading
=
false
this
.
_dispatchEvent
(
EventType
.
Load
,
{})
},
_onmpclose
(
e
)
{
_onmpclose
(
e
)
{
this
.
_dispatchEvent
(
EventType
.
Close
,
e
.
detail
)
},
_onmperror
(
e
)
{
_onmperror
(
e
)
{
this
.
loading
=
false
this
.
errorMessage
=
JSON
.
stringify
(
e
.
detail
)
this
.
_dispatchEvent
(
EventType
.
Error
,
e
.
detail
)
},
_dispatchEvent
(
type
,
data
)
{
_dispatchEvent
(
type
,
data
)
{
this
.
$emit
(
type
,
{
detail
:
data
})
...
...
packages/uni-cli-shared/components/uniad.vue
浏览文件 @
7f60e239
<
template
>
<view
@
click=
"onclick"
>
<uni-ad-plugin
class=
"uni-ad-plugin"
:adpid=
"adpid"
:unit-id=
"unitId"
@
load=
"_onmpload"
@
close=
"_onmpclose"
@
error=
"_onmperror"
></uni-ad-plugin>
<uni-ad-plugin
class=
"uni-ad-plugin"
:adpid=
"adpid"
:unit-id=
"unitId"
@
load=
"_onmpload"
@
close=
"_onmpclose"
@
error=
"_onmperror"
/>
</view>
</
template
>
<
script
>
import
adMixin
from
"
./ad.mixin.mp.js
"
export
default
{
name
:
'
UniAd
'
,
mixins
:
[
adMixin
],
props
:
{
},
methods
:
{
}
import
adMixin
from
'
./ad.mixin.mp.js
'
export
default
{
name
:
'
UniAd
'
,
mixins
:
[
adMixin
],
props
:
{
},
methods
:
{
}
}
</
script
>
packages/uni-h5/dist/index.umd.min.js
浏览文件 @
7f60e239
此差异已折叠。
点击以展开。
packages/uni-mp-alipay/dist/index.js
浏览文件 @
7f60e239
...
...
@@ -314,7 +314,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|
requireGlobal|
getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-mp-baidu/dist/index.js
浏览文件 @
7f60e239
...
...
@@ -314,7 +314,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|
requireGlobal|
getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-mp-jd/dist/index.js
浏览文件 @
7f60e239
...
...
@@ -314,7 +314,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|
requireGlobal|
getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-mp-kuaishou/dist/index.js
浏览文件 @
7f60e239
...
...
@@ -314,7 +314,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|
requireGlobal|
getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-mp-lark/dist/index.js
浏览文件 @
7f60e239
...
...
@@ -314,7 +314,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|
requireGlobal|
getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-mp-qq/dist/index.js
浏览文件 @
7f60e239
...
...
@@ -314,7 +314,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|
requireGlobal|
getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-mp-toutiao/dist/index.js
浏览文件 @
7f60e239
...
...
@@ -314,7 +314,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|
requireGlobal|
getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-mp-weixin/dist/index.js
浏览文件 @
7f60e239
...
...
@@ -314,7 +314,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|
requireGlobal|
getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-mp-xhs/dist/index.js
浏览文件 @
7f60e239
...
...
@@ -314,7 +314,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|
requireGlobal|
getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-quickapp-native/dist/vue.dev.js
浏览文件 @
7f60e239
此差异已折叠。
点击以展开。
packages/uni-quickapp-native/dist/vue.prod.js
浏览文件 @
7f60e239
此差异已折叠。
点击以展开。
packages/uni-quickapp-webview/dist/index.js
浏览文件 @
7f60e239
...
...
@@ -314,7 +314,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|
requireGlobal|
getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/webpack-uni-pages-loader/lib/platforms/mp-weixin/app.json.uniad.js
浏览文件 @
7f60e239
module
.
exports
=
function
(
appJson
)
{
module
.
exports
=
function
(
appJson
)
{
if
(
!
appJson
.
plugins
)
{
appJson
.
plugins
=
{}
}
if
(
!
appJson
.
plugins
[
'
uni-ad
'
])
{
appJson
.
plugins
[
'
uni-ad
'
]
=
{
"
version
"
:
"
1.0.2
"
,
"
provider
"
:
"
wx999bf02c8e05dfc9
"
version
:
'
1.0.2
'
,
provider
:
'
wx999bf02c8e05dfc9
'
}
}
if
(
!
appJson
.
plugins
[
'
coral-adv
'
])
{
appJson
.
plugins
[
'
coral-adv
'
]
=
{
"
version
"
:
"
1.0.7
"
,
"
provider
"
:
"
wx0e203209e27b1e66
"
version
:
'
1.0.7
'
,
provider
:
'
wx0e203209e27b1e66
'
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录