1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <template>
- <view class="content">
- <!-- #ifdef APP-PLUS -->
- <ad-content-page class="ad-content-page" ref="adContentPage" :adpid="adpid" @load="onadload" @error="onaderror"></ad-content-page>
- <!-- #endif -->
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- title: 'ad-content-page',
- adpid:''
- }
- },
- onShow() {
- // #ifdef APP-PLUS
- if(uni.getStorageSync("config")){
- this.adpid=uni.getStorageSync("config").site.appapi.dspadpid
- console.log(this.adpid)
- }
- this.$nextTick(() => {
- // 需要在页面显示时调用广告组件的 show 方法
- this.$refs.adContentPage.show();
- })
- // #endif
- },
- onUnload() {
- // #ifdef APP-PLUS
- // 需要在页面隐藏时调用广告组件的 hide 方法停止广告内容的声音
- this.$refs.adContentPage.hide();
- // #endif
- },
- onHide() {
- // #ifdef APP-PLUS
- // 需要在页面隐藏时调用广告组件的 hide 方法停止广告内容的声音
- this.$refs.adContentPage.hide();
- // #endif
- },
- methods: {
- onadload(e) {
- console.log("onadload",e);
- },
- onaderror(e) {
- console.log("onaderror",e);
- }
- }
- }
- </script>
- <style>
- .content {
- flex: 1
- }
- .ad-content-page {
- flex: 1
- }
- </style>
|