朱桂飞
2024-08-01 6959c1d4ee2244691603ab1f471b750ac517725d
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
91
92
93
94
95
96
97
98
99
<template>
    <view class="app">
        <cu-custom bgColor="bg-gradual-blue" :isBack="false">
            <block slot="content">中草药</block>
        </cu-custom>
 
        <view class="swiper-box">
            <z-swiper ref="zSwiper" v-model="list" @slideChange="onChange">
                <z-swiper-item v-for="(item,index) in list" :key="index">
                    <image class="image" :src="item" mode="aspectFill">
                    </image>
                 </z-swiper-item>
                <template #indicator>
                    <view class="custom-indicator-list1" v-show="true">
                        <view
                            :class="['custom-indicator-list-item1',index == current?'custom-indicator-list-item1-active':'']"
                            v-for="(item,index) in list" :key="index">
                        </view>
                    </view>
                </template>
            </z-swiper>
        </view>
    
    <view class="calendar-box">
     
    
        <lunc-calendar :showShrink="true" shrinkState="week" :signList="signList"></lunc-calendar>
    </view>
    
    
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                current:0,
                list: [
                    'https://cdn.zebraui.com/zebra-ui/images/swipe-demo/swipe2.jpg',
                    'https://cdn.zebraui.com/zebra-ui/images/swipe-demo/swipe3.jpg',
                    'https://cdn.zebraui.com/zebra-ui/images/swipe-demo/swipe4.jpg',
                    'https://cdn.zebraui.com/zebra-ui/images/swipe-demo/swipe5.jpg',
                ],
            }
        },
        methods: {
            onChange(){
                this.current = this.$refs.zSwiper.swiper.activeIndex;
            }
 
        }
    }
</script>
 
<style lang="scss" scoped>
    .app {}
    
    .swiper-box{
        width: 100%;
    }
    
 .image {
     height: 300rpx;
     width: 100%;
 }
 .calendar-box{
     margin-top: 20rpx;
     
 }
 
    .custom-indicator-list1 {
        position: absolute;
        bottom: 30rpx;
        left: 0;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
    
        .custom-indicator-list-item1 {
            margin: 0 5rpx;
            background-color: #e8f5ff;
            width: 20rpx;
            height: 10rpx;
            opacity: 1;
            border-radius: 5rpx;
            transition: opacity .3s, background-color .3s, width .3s;
    
            &-active {
                background-color: #3eb2f3;
                width: 35rpx;
            }
        }
    }
    
    
</style>