Houjie
2025-04-11 1bf977929dd324f3ac64b70debd8a79443c54392
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<template>
    <view>
        <cu-custom bgColor="bg-gradual-blue" :isBack="true"><block slot="backText">返回</block><block slot="content">进度条</block></cu-custom>
        <view class="cu-bar bg-white solid-bottom">
            <view class="action">
                <text class="cuIcon-title text-blue"></text>进度条形状
            </view>
        </view>
        <view class="padding bg-white">
            <view class="cu-progress">
                <view class="bg-red" :style="[{ width:loading?'61.8%':''}]">61.8%</view>
            </view>
            <view class="cu-progress radius margin-top">
                <view class="bg-red" :style="[{ width:loading?'61.8%':''}]">61.8%</view>
            </view>
            <view class="cu-progress round margin-top">
                <view class="bg-red" :style="[{ width:loading?'61.8%':''}]">61.8%</view>
            </view>
        </view>
        <view class="cu-bar bg-white solid-bottom margin-top">
            <view class="action">
                <text class="cuIcon-title text-blue"></text>进度条尺寸
            </view>
        </view>
        <view class="padding bg-white">
            <view class="cu-progress round">
                <view class="bg-red" :style="[{ width:loading?'61.8%':''}]"></view>
            </view>
            <view class="cu-progress round margin-top sm">
                <view class="bg-red" :style="[{ width:loading?'61.8%':''}]"></view>
            </view>
            <view class="cu-progress round margin-top xs">
                <view class="bg-red" :style="[{ width:loading?'61.8%':''}]"></view>
            </view>
        </view>
 
        <view class="cu-bar bg-white solid-bottom margin-top" @tap="showModal" data-target="ColorModal">
            <view class="action">
                <text class="cuIcon-title text-blue"></text>进度条颜色
            </view>
            <view class="action">
                <view class="padding solid radius shadow-blur" :class="'bg-' + color"></view>
            </view>
        </view>
        <view class="padding" :class="color=='white'?'bg-grey':'bg-white'">
            <view class="cu-progress round">
                <view :class="'bg-' + color" :style="[{ width:loading?'61.8%':''}]"></view>
            </view>
        </view>
 
 
        <view class="cu-bar bg-white solid-bottom margin-top">
            <view class="action">
                <text class="cuIcon-title text-blue"></text>进度条条纹
            </view>
            <switch class="margin-right-sm" :class="active?'checked':''" @change="SetActive"></switch>
        </view>
        <view class="padding bg-white">
            <view class="cu-progress round sm striped" :class="active?'active':''">
                <view class="bg-green" :style="[{ width:loading?'60%':''}]"></view>
            </view>
            <view class="cu-progress round sm margin-top-sm striped" :class="active?'active':''">
                <view class="bg-black" :style="[{ width:loading?'40%':''}]"></view>
            </view>
        </view>
        <view class="cu-bar bg-white solid-bottom margin-top">
            <view class="action">
                <text class="cuIcon-title text-blue"></text>进度条比例
            </view>
        </view>
        <view class="padding bg-white">
            <view class="cu-progress radius striped active">
                <view class="bg-red" :style="[{ width:loading?'30%':''}]">30%</view>
                <view class="bg-olive" :style="[{ width:loading?'45%':''}]">45%</view>
                <view class="bg-cyan" :style="[{ width:loading?'25%':''}]">25%</view>
            </view>
        </view>
        <view class="cu-bar bg-white solid-bottom margin-top">
            <view class="action">
                <text class="cuIcon-title text-blue"></text>进度条布局
            </view>
        </view>
        <view class="padding bg-white ">
            <view class="flex">
                <view class="cu-progress round">
                    <view class="bg-green" :style="[{ width:loading?'100%':''}]"></view>
                </view>
                <text class="cuIcon-roundcheckfill text-green margin-left-sm"></text>
            </view>
            <view class="flex margin-top">
                <view class="cu-progress round">
                    <view class="bg-green" :style="[{ width:loading?'80%':''}]"></view>
                </view>
                <text class="margin-left">80%</text>
            </view>
        </view>
 
        <view class="cu-modal" :class="modalName=='ColorModal'?'show':''">
            <view class="cu-dialog">
                <view class="cu-bar justify-end solid-bottom">
                    <view class="content">选择颜色</view>
                    <view class="action" @tap="hideModal">
                        <text class="cuIcon-close text-red"></text>
                    </view>
                </view>
                <view class="grid col-5 padding">
                    <view class="padding-xs" v-for="(item,index) in ColorList" :key="index" @tap="SetColor" :data-color="item.name" v-if="item.name!='gray' && item.name!='white'">
                        <view class="padding-tb radius" :class="'bg-' + item.name"> {{item.title}} </view>
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                ColorList: this.ColorList,
                color: 'red',
                loading: false,
                modalName: '',
                active: false
            };
        },
        onLoad: function() {
            let that = this;
            setTimeout(function() {
                that.loading = true
            }, 500)
        },
        methods: {
            showModal(e) {
                this.modalName = e.currentTarget.dataset.target
            },
            hideModal(e) {
                this.modalName = null
            },
            SetColor(e) {
                this.color = e.currentTarget.dataset.color;
                this.modalName = null
            },
            SetActive(e) {
                this.active = e.detail.value
            },
        }
    }
</script>
 
<style>
 
</style>