ad.uvue 984 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <view>
  3. <page-head title="信息流广告"></page-head>
  4. <!-- #ifndef MP -->
  5. <ad adpid="1111111111" style="width: 100%;" @load="loadFun" @error="errorFun"></ad>
  6. <!-- #endif -->
  7. <!-- #ifdef MP -->
  8. <view class="uni-center">微信小程序平台暂不支持测试广告位,需要开通uni-ad后可测试</view>
  9. <!-- #endif -->
  10. <view v-if="tips" class="uni-center">信息流广告加载失败,请退出当前页面重试。</view>
  11. <button @click="pushList">列表-信息流</button>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {
  18. tips: false
  19. }
  20. },
  21. methods: {
  22. pushList(){
  23. uni.navigateTo({
  24. url: '/pages/component/ad/list-view-ad',
  25. })
  26. },
  27. loadFun() {
  28. uni.showToast({
  29. position: "bottom",
  30. title: "信息流广告加载成功"
  31. })
  32. },
  33. errorFun() {
  34. this.tips = true;
  35. }
  36. }
  37. }
  38. </script>