basisCellCard.vue
3.93 KB
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
<template>
<view>
<view v-if="showTopFalg" :class="[bottleStatus=='green'?'greenSty':bottleStatus=='yellow'?'yellowSty':'redSty','showTopFlagSty']">
<span v-if="bottleStatus == 'green'">绿码按规使用</span>
<span v-if="bottleStatus == 'yellow'">黄码转绿再使用</span>
<span v-else>红码禁止使用</span>
</view>
<view :class="['basisCellCardCss','usuallyCard',showTopFalg?bottleStatus=='green'?'greenBg':bottleStatus=='yellow'?'yellowBg':'redBg':'']">
<view class="flex justify-between">
<view class="text-lg">
{{title}}
</view>
<view v-if="showTopFalg" class="hideSty">
隐藏健康码
</view>
</view>
<slot></slot>
<view class="flex justify-between margin-top" v-for="(item,index) in list" :key="`${$assignKeys(item.key)}`">
<view class="w40 text-gray">
{{item.name}}
</view>
<view class="w80 flex justify-end">
<view class="" v-if="item.type === 'tag' && item.value">
<u-tag :text="item.value" :bgColor="item.bgColor" :color="item.color" :borderColor="item.borderColor"></u-tag>
</view>
<view class="" v-else-if="item.type === 'avatar'">
<u-avatar size="30" :src="item.src"></u-avatar>
</view>
<view class="" v-else-if="item.type === 'photoList'">
<u-upload
:fileList="item.value"
name="4"
width="55"
:height="'60px'"
:deletable = "false"
multiple
:maxCount="item.value.length"
></u-upload>
</view>
<view class="" v-else>
{{item.value}}
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import greenImg from '@/static/images/appList/qpxx/greenBottle.png'
export default {
name: "basisCellCard",
props: {
list: {
type: Array,
default: () => [],
require: true
},
title: {
type: String,
default: "",
},
showTopFalg:{
type:Boolean,
default:false
},
bottleStatus:{
type:String,
default:''
}
},
data() {
return {
imgSrc :greenImg
};
},
methods:{
},
}
</script>
<style lang="scss" scoped>
.showTopFlagSty{
width: 100%;
height: 64rpx;
color: #ffffff;
font-family: '苹方 中等', '苹方', sans-serif;
font-weight: 400;
text-align: center;
line-height: 64rpx;
font-style: normal;
font-size: 30rpx;
border-top-left-radius:15px ;
border-top-right-radius: 15px;
}
.hideSty{
background-color: rgba(234, 85, 4, 0.09803921568627451);
width: 160rpx;
height: 40rpx;
border-radius: 6rpx;
text-align: center;
display: none;
font-family: '苹方 中等', '苹方', sans-serif;
font-weight: 400;
font-style: normal;
font-size: 24rpx;
padding: 4rpx 20rpx 4rpx 20rpx;
color: #EA5504;
}
.greenSty{
background-color: #29d34c;
}
.yellowSty{
background-color: #f39c22;
}
.redSty{
background-color: #ff544a;
}
.basisCellCardCss {
padding: 20px;
}
.greenBg{
background-image: url("../../static/images/appList/qpxx/greenBottle.png");
background-position: center center; /* 设置背景图片居中 */
background-size: 40% 80%; /* 设置背景图片覆盖整个容器 */
background-repeat: no-repeat; /* 设置背景图片不重复 */
}
.yellowBg{
background-image: url("../../static/images/appList/qpxx/yellowBottle.png");
background-position: center center; /* 设置背景图片居中 */
background-size: 40% 80%; /* 设置背景图片覆盖整个容器 */
background-repeat: no-repeat; /* 设置背景图片不重复 */
}
.redBg{
background-image: url("../../static/images/appList/qpxx/redBottle.png");
background-position: center center; /* 设置背景图片居中 */
background-size: 40% 80%; /* 设置背景图片覆盖整个容器 */
background-repeat: no-repeat; /* 设置背景图片不重复 */
}
</style>