xuxy
2024-07-27 ba2450ef22684abf5606ab570e72b8eda5bec209
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
<template>
    <view class=" home-banner-imgs">
        <view class="flex" v-if="list&&list.length>=3">
            <view class="flex1 m-r-5">
                <image class="p1 img100" :src="list[0].url">
                </image>
            </view>
            <view class="flex1 m-l-5">
                <image class="p2 img100" :src="list[1].url">
                </image>
                <image class="p3 img100" :src="list[2].url">
                </image>
            </view>
        </view>
        <view class="flex" v-else-if="list&&list.length>=2">
            <view class="flex1 m-r-5">
                <image class="p1 img100" :src="list[0].url">
                </image>
            </view>
            <view class="flex1 m-l-5">
                <image class="p1 img100" :src="list[1].url">
                </image>
            </view>
        </view>
        <view class="flex" v-else-if="list&&list.length>=1">
            <view class="flex1 m-r-5">
                <image class="p1 img100" :src="list[0].url">
                </image>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                list: [],
            };
        },
        async mounted() {
            const {
                data,
                code
            } = await this.$http.request('get', '/api/pub/banner/list', {
 
            })
            if (code === 0) {
                this.list = data || []
            }
 
        }
    }
</script>
 
<style lang="scss">
    .home-banner-imgs {
        .p1 {
            // width: 334rpx;
            height: 308rpx;
            width: 100%;
        }
 
        .p2 {
            // width: 334rpx;
            width: 100%;
            height: 142rpx;
        }
 
        .p3 {
            width: 100%;
            margin-top: 18rpx;
            // width: 334rpx;
            height: 142rpx;
        }
    }
</style>