当前位置:网站首页>Uni-app 小程序 App 的广告变现之路:全屏视频广告
Uni-app 小程序 App 的广告变现之路:全屏视频广告
2022-08-04 04:45:00 【智密科技】
全屏视频广告是一个原生组件,层级比普通组件高。全屏视频广告每次创建都会返回一个全新的实例,默认是隐藏的,需要调用 FullScreenVideoAd.show() 将其显示。
App | H5 | 微信小程序 | 支付宝小程序 | 百度小程序 | 字节跳动小程序 | QQ小程序 | 快应用 | 360小程序 | 快手小程序 | 京东小程序 |
---|---|---|---|---|---|---|---|---|---|---|
√(3.4.8+) | x | √(3.4.8+) | x | x | x | x | x | x | x | x |
- app端的广告源由腾讯优量汇、头条穿山甲、快手等广告联盟提供,DCloud负责聚合
- 小程序端的广告由小程序平台提供
语法
<ad-fullscreen-video adpid=""></ad-fullscreen-video>
属性说明
属性名 | 类型 | 默认值 | 说明 | 平台差异 |
---|---|---|---|---|
adpid | String|Number|Array | 广告位id,如果传入的是数组,会从索引0开始请求失败后继续下一个,适用于已配置底价的逻辑 | ||
preload | Boolean | true | 页面就绪后加载广告数据 | |
loadnext | Boolean | false | 自动加载下一条广告数据 | |
v-slot:default="{loading, error}" | 作用域插槽可以获取组件内部广告加载状态和加载错误信息 | |||
@load | EventHandle | 加载事件 | ||
@close | EventHandle | 关闭事件 | ||
@error | EventHandle | 错误事件 |
方法说明
方法名 | 说明 |
---|---|
load | 加载广告数据 |
show | 显示广告 |
简单示例
<template>
<view>
<ad-fullscreen-video adpid="1507000611" :loadnext="true" v-slot:default="{loading, error}">
<button :disabled="loading" :loading="loading">显示广告</button>
<view v-if="error">{
{error}}</view>
</ad-fullscreen-video>
</view>
</template>
完整示例
<template>
<view class="content">
<ad-fullscreen-video adpid="1507000611" :loadnext="true" v-slot:default="{loading, error}" @load="onadload" @close="onadclose" @error="onaderror">
<button :disabled="loading" :loading="loading">显示广告</button>
<view v-if="error">{
{error}}</view>
</ad-fullscreen-video>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
onadload(e) {
console.log('广告数据加载成功');
},
onadclose(e) {
console.log("onadclose",e);
},
onaderror(e) {
// 广告加载失败
console.log("onerror: ", e.detail);
}
}
}
</script>
边栏推荐
- 2003. 每棵子树内缺失的最小基因值 DFS
- manipulation of file contents
- Deep learning -- CNN clothing image classification, for example, discussed how to evaluate neural network model
- 元宇宙“吹鼓手”Unity:疯狂扩局,悬念犹存
- The Shell function
- 看DevExpress丰富图表样式,如何为基金公司业务创新赋能
- OpenGL绘制圆
- Introduction and application of go module
- 【技巧】借助Sentinel实现请求的优先处理
- How to simplify the automation of modern e-procurement?
猜你喜欢
There is an 8 hour difference between the docker installation of mysql and the host.
看DevExpress丰富图表样式,如何为基金公司业务创新赋能
7.LVS负载均衡群集之原理叙述
How to keep the source code confidential in the development under the burning scenario
【Ryerson情感说话/歌唱视听数据集(RAVDESS) 】
The Shell function
劝退背后。
10 Convolutional Neural Networks for Deep Learning 3
转:管理是对可能性的热爱,管理者要有闯进未知的勇气
获取单选框选中内容
随机推荐
附加:对于“与数据表对应的实体类“,【面对MongoDB时,使用的@Id等注解】和【以前面对MySQL时,使用的@Id等注解】,是不同的;
go module的介绍与应用
劝退背后。
Embedded database development programming MySQL (full)
企业直播风起:目睹聚焦产品,微赞拥抱生态
JVM的内存模型简介
See how DevExpress enriches chart styles and how it empowers fund companies to innovate their business
【云原生--Kubernetes】Pod资源管理与探针检测
商城App开发都有哪些功能呢
System design. Seckill system
2022年软件测试——精选金融银行面试真题
震惊,99.9% 的同学没有真正理解字符串的不可变性
PHP高级开发案例(1):使用MYSQL语句跨表查询无法导出全部记录的解决方案
数据治理平台项目总结和分析
There is an 8 hour difference between the docker installation of mysql and the host.
类如何只能静态分配和只能动态分配
SQL query String field less than 10 how to check
mq应用场景介绍
如何简化现代电子采购的自动化?
How to automatically export or capture abnormal login ip and logs in elastic to the database?