如洲 陈
16 分钟以前 45d758cf21d83d1d01166caa5c0cde9eab79be6a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<template>
    <!-- #ifdef APP-NVUE -->
    <cell>
        <!-- #endif -->
        <view class="uni-list-ad">
            <view v-if="borderShow" :class="{'uni-list--border':border,'uni-list-item--first':isFirstChild}"></view>
            <ad style="width: 200px;height: 300px;border-width: 1px;border-color: red;border-style: solid;" adpid="1111111111" unit-id="" appid="" apid="" type="feed" @error="aderror" @close="closeAd"></ad>
        </view>
        <!-- #ifdef APP-NVUE -->
    </cell>
    <!-- #endif -->
 
</template>
 
<script>
    // #ifdef APP-NVUE
    const dom = uni.requireNativePlugin('dom');
    // #endif
    export default {
        name: 'UniListAd',
        props: {
            title: {
                type: String,
                default: '',
 
            }
        },
        inject: ['list'],
        data() {
            return {
                isFirstChild: false,
                border: false,
                borderShow: true,
            }
        },
 
        mounted() {
            if (!this.list.firstChildAppend) {
                this.list.firstChildAppend = true
                this.isFirstChild = true
            }
            this.border = this.list.border
        },
        methods: {
            aderror(e) {
                console.log("aderror: " + JSON.stringify(e.detail));
            },
            closeAd(e) {
                this.borderShow = false
            }
        }
    }
</script>
 
<style scoped>
    .uni-list-ad {
        position: relative;
        border: 1px red solid;
    }
 
    .uni-list--border {
        position: relative;
        padding-bottom: 1px;
        /* #ifdef APP-PLUS */
        border-top-color: #e5e5e5;
        border-top-style: solid;
        border-top-width: 0.5px;
        /* #endif */
        margin-left: 15px;
    }
 
    /* #ifndef APP-NVUE */
    .uni-list--border:after {
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        height: 1px;
        content: '';
        -webkit-transform: scaleY(0.5);
        transform: scaleY(0.5);
        background-color: #e5e5e5;
    }
 
    .uni-list-item--first:after {
        height: 0px;
    }
 
    /* #endif */
</style>