Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uniapp_vedio
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
uniapp_vedio
Commits
881d45d5
Commit
881d45d5
authored
Mar 06, 2024
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加抖音广告
parent
c18ad65a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
ttVideoDetail.vue
vedio/pagesC/ttvideo/ttVideoDetail.vue
+37
-0
No files found.
vedio/pagesC/ttvideo/ttVideoDetail.vue
View file @
881d45d5
...
@@ -143,6 +143,40 @@
...
@@ -143,6 +143,40 @@
this
.
getData
()
this
.
getData
()
// 创建实例
this
.
ad
=
tt
.
createRewardedVideoAd
({
adUnitId
:
"5owlrx99qby0ephhco"
,
});
// 监听错误
this
.
ad
.
onError
((
err
)
=>
{
tt
.
hideLoading
();
switch
(
err
.
errCode
)
{
case
1004
:
// 无合适的广告
break
;
default
:
// 更多请参考错误码文档
}
});
// 监听视频播放完成
this
.
ad
.
onClose
((
data
)
=>
{
tt
.
hideLoading
();
if
(
data
.
isEnded
)
{
console
.
log
(
"观看了"
,
data
.
count
,
"个视频"
);
}
else
{
console
.
log
(
"未观看完视频"
);
}
});
// do other thing
// 卸载 close 事件监听
this
.
ad
.
offClose
(
closeHandler
);
// 预加载资源
this
.
ad
.
load
();
},
},
onShow
()
{
onShow
()
{
// 从VIP页面返回关闭弹框
// 从VIP页面返回关闭弹框
...
@@ -435,6 +469,9 @@
...
@@ -435,6 +469,9 @@
this
.
isqp
=
e
.
detail
.
show
this
.
isqp
=
e
.
detail
.
show
},
},
collect
(
vedioId
,
index
)
{
collect
(
vedioId
,
index
)
{
tt
.
showLoading
();
this
.
ad
.
show
();
this
.
data
.
collect
=
1
this
.
data
.
collect
=
1
// 收藏
// 收藏
this
.
post
({
this
.
post
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment