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
| <template>
| <view :class="['app', theme]">
|
| <!-- <u-swiper :list="list6" height="500" @change="e => currentNum = e.current" :autoplay="false"
| indicatorStyle="right: 20px;top: 20px;"
| >
| <view slot="indicator" class="indicator-num">
| <text class="indicator-num__text">{{ currentNum + 1 }}/{{ list6.length }}</text>
| </view>
| </u-swiper> -->
|
| <view>
| <u-swiper :list="list6" height="500" @change="e => currentNum = e.current" :autoplay="false">
| <view slot="indicator" class="indicator">
| <view class="indicator__dot" v-for="(item, index) in list6" :key="index"
| :class="[index === currentNum && 'indicator__dot--active']">
| </view>
| </view>
| </u-swiper>
| </view>
|
|
| </view>
| </template>
| <script>
|
| export default {
| components: {
|
| },
| data() {
| return {
| current: 0,
| currentNum: 0,
| list6: [
| "https://ai-public.mastergo.com/ai/img_res/6a226f9e9652c51cd535c3490535dfeb.jpg",
| "https://img.yzcdn.cn/vant/cat.jpeg",
| "https://ai-public.mastergo.com/ai/img_res/6a226f9e9652c51cd535c3490535dfeb.jpg",
| ],
| list7: [
| "",
| "",
| "",
| ],
| }
| },
| onLoad(options) {
| // 尝试读取缓存设置的主题
| console.log("theme", uni.getStorageSync('theme'))
| const theme = uni.getStorageSync('theme') || 'light'
| this.theme = theme
|
|
| },
| methods: {
|
| }
| }
| </script>
| <style lang="scss">
| .indicator {
| @include flex(row);
| justify-content: center;
|
| &__dot {
| height: 6px;
| width: 6px;
| border-radius: 100px;
| background-color: rgba(255, 255, 255, 0.35);
| margin: 0 5px;
| transition: background-color 0.3s;
|
| &--active {
| background-color: red;
| }
| }
| }
|
| .indicator-num {
| padding: 2px 0;
| background-color: rgba(0, 0, 0, 0.35);
| border-radius: 100px;
| width: 35px;
| @include flex;
| justify-content: center;
|
| &__text {
| color: #ffffff;
| font-size: 12px;
| }
| }
| </style>
|
|