萤火虫001
萤火虫001
  • 发布:2022-07-19 16:03
  • 更新:2023-11-30 10:32
  • 阅读:802

【报Bug】对接uni-ad 广告 其中只申请了微信小程序广告,然后对接ad-rewarded-video激励视频报错

分类:uni-app

产品分类: uniapp/小程序/微信

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: Windows 10 专业版

HBuilderX类型: 正式

HBuilderX版本号: 3.4.18

第三方开发者工具版本号: 1.05.22

基础库版本号: 2.25.0

项目创建方式: HBuilderX

示例代码:
<template>  
  <view>  
    <ad-rewarded-video ref="adRewardedVideo" adpid="1796261502" :preload="true" :loadnext="false" :disabled="true"  
      v-slot:default="{loading, error}" @load="onadload" @close="onadclose" @error="onaderror">  
      <view class="ad-error" v-if="error">{{error}}</view>  
    </ad-rewarded-video>  
    <button type="primary" :disabled="isLoading" :loading="isLoading" @click="showAd">显示广告</button>  
  </view>  
</template>  

<script>  
  export default {  
    data() {  
      return {  
        isLoading: false  
      }  
    },  
    onReady() {  
      this.isLoading = true;  
      this.$refs.adRewardedVideo.load();  
    },  
    methods: {  
      showAd() {  
        if (this.isLoading) {  
          return  
        }  
        this.$refs.adRewardedVideo.show();  
      },  
      onadload(e) {  
        this.isLoading = false;  
        console.log('广告数据加载成功');  
      },  
      onadclose(e) {  
        const detail = e.detail  
        // 用户点击了【关闭广告】按钮  
        if (detail && detail.isEnded) {  
          // 正常播放结束  
          console.log("onClose " + detail.isEnded);  
        } else {  
          // 播放中途退出  
          console.log("onClose " + detail.isEnded);  
        }  
        //this.isLoading = true;  
        //this.$refs.adRewardedVideo.load();  
      },  
      onaderror(e) {  
        // 广告加载失败  
        console.log(e.detail);  
        this.isLoading = false;  
      }  
    }  
  }  
</script>  

<style>  
  .ad-error {  
    color: orangered;  
    margin-top: 5px;  
  }  
</style>

操作步骤:

预期结果:

应该显示视频

实际结果:
VM9 asdebug.js:1 POST https://wxac1.dcloud.net.cn/applet/acs 500 (Internal Server Error)(env: Windows,mp,1.05.2204250; lib: 2.25.0)  

errCode: undefined  
errMsg: undefined

bug描述:

对接ad小程序广告的时候 ad小程序广告已经申请成功

对接到页面上 调取的是<ad-rewarded-video></ad-rewarded-video> 激励视频广告

对应链接报500错误

VM9 asdebug.js:1 POST https://wxac1.dcloud.net.cn/applet/acs 500 (Internal Server Error)(env: Windows,mp,1.05.2204250; lib: 2.25.0)

2022-07-19 16:03 负责人:无 分享
已邀请:
DCloud_UNI_Anne

DCloud_UNI_Anne

请升级HBuilderX3.5.1-alpha版本,其次你的广告位是格子广告位,需要填激励视频的广告位

  • 萤火虫001 (作者)

    感谢已经按照您说的问题解决了

    2022-07-20 09:08

萤火虫001

萤火虫001 (作者) - 一个过时的程序

已经尝试<ad adpid="我的广告位id" @load="adLoad" @error="adError"></ad> 等其他广告都是https://wxac1.dcloud.net.cn/applet/acs这个地址报500错误

CrazyAz

CrazyAz - 14届毕业的废材

在哪可以接到广告?需要找到广告商?

要回复问题请先登录注册