# 卡片-小卡片(Card-Small)
多用于功能选项或入口
# 示例
<template>
<div class="wrapper" bubble="true">
<dof-minibar title="5.6卡片-小卡片"></dof-minibar>
<scroller class="scroller">
<div class="title-box">
<text class="title-text">示例:一行两个</text>
</div>
<dof-row class="showItem" style="padding-top: 16px;">
<dof-col>
<dof-card :touchColor="'#333437'">
<div class="contentBox">
<div>
<text class="contentText">制冷</text>
</div>
<dof-iconfont :code="'\u4117'" :size="72"></dof-iconfont>
</div>
</dof-card>
</dof-col>
<dof-col>
<dof-card :touchColor="'#333437'">
<div class="contentBox">
<div>
<text class="contentText">制冷</text>
<text class="contentTip m-t-24">120分钟 I 30°</text>
</div>
<dof-iconfont :code="'\u4117'" :size="72"></dof-iconfont>
</div>
</dof-card>
</dof-col>
</dof-row>
<dof-row class="showItem">
<dof-col>
<dof-card :touchColor="'#333437'" :cardWrapperStyle="{ paddingTop: '20px', paddingBottom: '20px' }">
<div class="contentBox" style="height: 144px">
<div>
<text class="contentText">制冷</text>
<text class="contentTip m-t-16">70分钟 I 30°</text>
<text class="contentDesc m-t-16">猜你喜欢</text>
</div>
<dof-iconfont :code="'\u4117'" :size="72"></dof-iconfont>
</div>
</dof-card>
</dof-col>
<dof-col>
<dof-card :dotConfig="dotConfig" :touchColor="'#333437'" :clicked="true">
<div class="contentBox f-s">
<dof-iconfont :code="'\u4802'" :size="72"></dof-iconfont>
<div class="m-l-16">
<text class="contentText">保养</text>
</div>
</div>
</dof-card>
</dof-col>
</dof-row>
<dof-row class="showItem">
<dof-col>
<dof-card :dotConfig="dotConfig" :touchColor="'#333437'" :clicked="true">
<div class="contentBox f-s" style="padding-left: 0px;">
<dof-iconfont :code="'\u4802'" :size="72"></dof-iconfont>
<div class="m-l-16">
<text class="contentText">保养</text>
<text class="contentTip m-t-24">120分钟 I 30°</text>
</div>
</div>
</dof-card>
</dof-col>
<dof-col>
<dof-card :clicked="true">
<div class="contentBox">
<div class="contentText">
<div>
<text class="contentText">XXX | 60°</text>
</div>
<text class="contentTip m-t-24">已运行10天</text>
</div>
<image
class="contentIcon"
src="http://dolphin-weex-dev.msmartlife.cn/static/component/card/image/stop.png"
></image>
</div>
</dof-card>
</dof-col>
</dof-row>
<div class="title-box">
<text class="title-text">示例:一行三个</text>
</div>
<dof-row class="showItem" style="padding-top: 16px;">
<dof-col>
<dof-card
:dotConfig="dotConfig"
:touchColor="'#333437'"
:clicked="true"
:cardWrapperStyle="{ padding: '20px', height: '220px' }"
>
<div class="smallCard">
<dof-iconfont :code="'\u4802'" :size="72"></dof-iconfont>
<div class="smallCardTextBox">
<text class="contentText">容量预测</text>
</div>
</div>
</dof-card>
</dof-col>
<dof-col>
<dof-card
:dotConfig="dotConfig"
:touchColor="'#333437'"
:clicked="true"
:cardWrapperStyle="{ padding: '20px', height: '220px' }"
>
<div class="smallCard">
<dof-iconfont :code="'\u4802'" :size="72"></dof-iconfont>
<div class="smallCardTextBox">
<text class="contentText">冷藏室</text>
</div>
<text class="contentTip m-t-8">23:00开始运行</text>
</div>
</dof-card>
</dof-col>
<dof-col>
<dof-card
:dotConfig="dotConfig"
:touchColor="'#333437'"
:clicked="true"
:cardWrapperStyle="{ padding: '20px', height: '220px' }"
>
<div class="smallCard">
<dof-iconfont :code="'\u4802'" :size="72"></dof-iconfont>
<div class="smallCardTextBox">
<text class="contentText">微波</text>
</div>
<dof-button
class="m-t-8"
type="primary"
pattern="base"
size="small"
:btnStyle="{ width: '92px', height: '44px', backgroundColor: 'rgba(255,255,255,0.10)' }"
:textStyle="{ color: '#fff' }"
>
<text class="btn-text">保养</text>
<dof-iconfont
style="width: 18px"
:size="28"
:code="'\u4713'"
:color="'rgba(255,255,255,0.80)'"
></dof-iconfont>
</dof-button>
</div>
</dof-card>
</dof-col>
</dof-row>
<div class="title-box">
<text class="title-text">示例:一行四个</text>
</div>
<dof-row class="showItem" style="padding-top: 16px;">
<dof-col v-for="(item, i) in 4" :key="i">
<dof-card
:dotConfig="dotConfig"
:touchColor="'#333437'"
:clicked="true"
:cardWrapperStyle="{ height: '180px' }"
>
<div class="smallCard">
<dof-iconfont :code="'\u4802'" :size="72"></dof-iconfont>
<div class="smallCardTextBox">
<text class="contentTextSmall">AI识别</text>
</div>
</div>
</dof-card>
</dof-col>
</dof-row>
<div class="title-box">
<text class="title-text">示例:带单选</text>
</div>
<dof-card-group v-model="cv">
<dof-row class="showItem" style="padding-top: 16px;">
<dof-col>
<dof-card :touchColor="'#333437'" :value="1" @clicked="cv = 1">
<div class="contentBox">
<div>
<text class="contentText">制冷</text>
</div>
<dof-iconfont :code="'\u4117'" :size="72"></dof-iconfont>
</div>
</dof-card>
</dof-col>
<dof-col>
<dof-card :touchColor="'#333437'" :value="2" @clicked="cv = 2">
<div class="contentBox">
<div>
<text class="contentText">制冷</text>
</div>
<dof-iconfont :code="'\u4117'" :size="72"></dof-iconfont>
</div>
</dof-card>
</dof-col>
</dof-row>
</dof-card-group>
<dof-card-group v-model="cv">
<dof-row class="showItem">
<dof-col>
<dof-card :touchColor="'#333437'" :value="1" @clicked="cv = 1">
<div class="contentBox">
<div>
<text class="contentText">制冷</text>
<text class="contentTip m-t-24">120分钟 I 30°</text>
</div>
<dof-iconfont :code="'\u4117'" :size="72"></dof-iconfont>
</div>
</dof-card>
</dof-col>
<dof-col>
<dof-card :touchColor="'#333437'" :value="2" @clicked="cv = 2">
<div class="contentBox">
<div>
<text class="contentText">制冷</text>
<text class="contentTip m-t-24">120分钟 I 30°</text>
</div>
<dof-iconfont :code="'\u4117'" :size="72"></dof-iconfont>
</div>
</dof-card>
</dof-col>
</dof-row>
</dof-card-group>
<dof-card-group v-model="cv">
<dof-row class="showItem">
<dof-col>
<dof-card
:touchColor="'#333437'"
:cardWrapperStyle="{ paddingTop: '20px', paddingBottom: '20px', height: '186px' }"
:value="1"
@clicked="cv = 1"
>
<div class="contentBox">
<div>
<text class="contentText">制冷</text>
<text class="contentTip m-t-16">70分钟 I 30°</text>
<text class="contentDesc m-t-16">猜你喜欢</text>
</div>
<dof-iconfont :code="'\u4117'" :size="72"></dof-iconfont>
</div>
</dof-card>
</dof-col>
<dof-col>
<dof-card
:touchColor="'#333437'"
:cardWrapperStyle="{ paddingTop: '0px', paddingBottom: '0px', height: '186px' }"
:value="2"
@clicked="cv = 2"
>
<div class="contentBox contentBoxBig">
<div>
<text class="contentText">制冷</text>
<text class="contentTip m-t-16">70分钟 I 30°</text>
<dof-button
class="m-t-16"
type="primary"
pattern="base"
size="small"
:btnStyle="{ width: '132px', height: '44px', backgroundColor: 'rgba(255,255,255,0.10)' }"
:textStyle="{ color: '#fff' }"
>
<text class="btn-text">设置参数</text>
<dof-iconfont
style="width: 18px"
:size="28"
:code="'\u4713'"
:color="'rgba(255,255,255,0.80)'"
></dof-iconfont>
</dof-button>
</div>
<dof-iconfont :code="'\u4117'" :size="72"></dof-iconfont>
</div>
</dof-card>
</dof-col>
</dof-row>
</dof-card-group>
<div class="title-box">
<text class="title-text">示例:支持左右滑动</text>
</div>
<div>
<scroller scroll-direction="horizontal" style="flex-direction: row;">
<dof-row class="showItem" style="width: 1600px; padding-top: 16px;">
<dof-col v-for="(item, i) in 8" :key="i">
<dof-card
:dotConfig="dotConfig"
:touchColor="'#333437'"
:clicked="true"
:cardWrapperStyle="{ height: '180px' }"
>
<div class="smallCard">
<dof-iconfont :code="'\u4802'" :size="72"></dof-iconfont>
<div class="smallCardTextBox">
<text class="contentTextSmall">AI识别</text>
</div>
</div>
</dof-card>
</dof-col>
</dof-row>
</scroller>
</div>
</scroller>
</div>
</template>
<style scoped>
.wrapper {
background-color: #f9f9f9;
}
.title-box {
padding: 32px;
background-color: #e5e5e8;
}
.title-text {
font-family: PingFangSC-Medium;
font-size: 36px;
color: #000000;
font-weight: 500;
}
.m-b-16 {
margin-bottom: 16px;
}
.m-t-8 {
margin-top: 8px;
}
.m-t-16 {
margin-top: 16px;
}
.m-t-24 {
margin-top: 24px;
}
.m-l-16 {
margin-left: 16px;
}
.showItem {
padding-left: 32px;
padding-right: 32px;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
overflow: hidden;
margin-bottom: 16px;
}
.contentBox {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 120px;
padding: 0 8px;
}
.contentBoxBig {
height: 160px;
}
.f-s {
justify-content: flex-start;
}
.contentIcon {
width: 72px;
height: 72px;
}
.contentText {
font-family: PingFangSC-Regular;
font-size: 36px;
line-height: 36px;
color: rgba(255, 255, 255, 0.8);
font-weight: 400;
}
.contentTip {
font-family: PingFangSC-Regular;
font-size: 24px;
line-height: 24px;
color: rgba(255, 255, 255, 0.4);
}
.contentDesc {
font-family: PingFangSC-Regular;
font-size: 24px;
line-height: 24px;
color: #b35336;
}
.smallCard {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.smallCardTextBox {
margin: 10px 0;
}
.contentTextSmall {
font-family: PingFangSC-Regular;
font-size: 28px;
color: rgba(255, 255, 255, 0.8);
}
.btn-text {
font-family: PingFangSC-Light;
font-size: 24px;
color: rgba(255, 255, 255, 0.8);
font-weight: 200;
}
@media screen and (weex-theme: colmo) {
.wrapper {
background-color: #151617;
}
}
</style>
<script>
import { DofMinibar, DofCard, DofRow, DofCol, DofIconfont, DofButton, DofCardGroup } from 'dolphin-weex-ui'
export default {
components: { DofMinibar, DofCard, DofRow, DofCol, DofIconfont, DofButton, DofCardGroup },
data: () => ({
dotConfig: {
normalColor: '#71717A', // 卡片右上角圆点未点击颜色
clickedColor: '#b35336' // 卡片右上角圆点点击颜色
},
cv: 1
}),
computed: {},
created() {},
methods: {}
}
</script>
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
# Api
# Props
Prop | Type | Required | Default | Description |
---|---|---|---|---|
collapsable | Boolean | N | false | 是否可折叠 |
collapsed | Boolean | N | false | 是否折叠 |
selectable | Boolean | N | false | 是否可选择 |
selected (v-model) | Boolean | N | false | 是否选中 |
value | String | Number | N | `` | 当前卡片的值, 用于 card-group 组件单选功能 |
tagBg | String | N | '#3c7cf6' | 右上角标签背景颜色 |
cardStyle | Object | N | '{}' | 卡片容器样式 |
dotConfig | Object | N | '{}' | 右上角标记配置,normalColor常态颜色,clickedColor选中态颜色 |
clicked | Boolean | N | false | 是否选中态 |
touchColor | String | N | `` | 点击未松手背景颜色 |
# Events
事件名 | 说明 | 回调参数 |
---|---|---|
select | 可选择时,点击时触发 | e :Boolean |
collaspe | 可折叠式,点击折叠图标时触发 | e: Boolean |
clicked | 点击时触发 | e: Boolean |
# Slots
插槽名 | 说明 |
---|---|
default | 卡片内容 |
body | 卡片可折叠时, 卡的下拉内容 |
# DofCardItem
# Slots
插槽名 | 说明 |
---|---|
default | 卡片项内容 |
# DofCardGroup
# Props
Prop | Type | Required | Default | Description |
---|---|---|---|---|
value(v-model) | String | Number | Y | - | 选中的值 |
# Events
事件名 | 说明 | 回调参数 |
---|---|---|
change | card 组件选中时触发 | e :String | Number |
# Slots
插槽名 | 说明 |
---|---|
default | 卡片组内容 |
点我扫二维码 查看demo