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
<!-- 完工校验弹窗 -->
<template>
<view>
<u-popup
v-model="open"
:mask-close-able="false"
border-radius="12"
ref="checkPopup"
mode="center"
width="690rpx">
<view class="slot-content">
<view v-if="confirmButtonText !== '确定'">
<view class="check-status">
<u-image width="224rpx" height="224rpx" :src="statusImage"></u-image>
<text :class="['status-txt', { 'pass-color': pass }]">{{statusTxt}}</text>
</view>
<view class="check-list">
<view class="u-flex u-row-between list-title">
<view class="left-txt">验证项</view>
<view>已提交/需提交</view>
<view class="right-txt">结果</view>
</view>
<view class="u-flex u-row-between list-item"
v-for="(item, index) in listData" :key="index">
<view class="item-txt left-txt" style="width: 200rpx;text-align: left;">
<u-icon
:name="item.pass ? passIcon : noPassIcon"
:label="item.label"
margin-left="12"
label-color="#333333"
label-size="28"
size="32"></u-icon>
</view>
<view class="item-txt">{{item.submitted}}/{{item.required}}</view>
<view
:class="['item-txt', 'right-txt', item.pass ? 'pass-color' : 'no-pass-color']"
style="width: 160rpx;text-align: right;">
{{item.pass ? "通过" : "未通过"}}
</view>
</view>
</view>
</view>
<view v-else>
<view class="check-status">
<text class='status-txt' style="color: #333;">确认安装结果</text>
</view>
<view class="u-flex no-install">
<text class="tips">提交信息,确认安装结论为不安装</text>
</view>
</view>
<view class="check-bottom">
<view class="button cancel" v-show="cancelButtonText !== ''" @tap="cancel">{{ cancelButtonText }}</view>
<view class="button confirm" @tap="confirm">{{ confirmButtonText }}</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
/**
* modal 完工校验模态框
* @description 完工校验模态框,用于完工信息检查和提醒
* @property {Boolean} show 是否显示模态框
* @property {Boolean} pass 是否通过校验
* @property {Array} listData 完工信息项
* @event {Function} close 取消按钮被点击
* @event {Function} handle 去处理按钮被点击
* @event {Function} confirm 确认按钮被点击
* @example <u-modal :src="title" :content="content"></u-modal>
*/
export default {
name:"complete-check",
props: {
show: {
type: Boolean,
default: false
},
pass: {
type: Boolean,
default: false
},
listData: {
type: Array,
default(){
return [
{label: '基本信息', submitted: 3, required: 3, pass: true},
{label: '勘察信息', submitted: 20, required: 20, pass: true},
{label: '安装信息', submitted: 15, required: 20, pass: false}
]
}
},
confirmButtonText: {
type: String,
default: '确定'
},
cancelButtonText: {
type: String,
default: ''
}
},
data() {
return {
open: this.show
};
},
watch: {
// 如果是异步关闭时,外部修改v-model的值为false时,重置内部的loading状态
// 避免下次打开的时候,状态混乱
show(n) {
this.open = n
}
},
computed: {
statusImage() {
if(this.pass) {
return process.uniEnv.qn_base_url + 'successful.png'
} else {
return process.uniEnv.qn_base_url + 'failure.png'
}
},
statusTxt() {
return this.pass ? "完工校验已通过" : "完工校验未通过"
},
passIcon() { return process.uniEnv.qn_base_url + 'icon/pass.png'},
noPassIcon() { return process.uniEnv.qn_base_url + 'icon/no-pass.png'},
},
methods: {
cancel() {
this.$emit('close')
},
confirm() {
this.$emit('confirm')
}
},
}
</script>
<style lang="scss">
.slot-content {
padding: 40rpx 30rpx 0rpx 30rpx;
.check-status {
margin-bottom: 50rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.status-txt {
height: 46rpx;
font-size: 40rpx;
font-weight: bold;
color: #FA5A49;
line-height: 46rpx;
}
}
.check-list {
padding-top: 40rpx;
border-top: 2rpx solid #F4F5F7;
.list-title {
height: 28rpx;
font-size: 28rpx;
font-weight: 400;
color: #999999;
line-height: 28rpx;
margin-bottom: 42rpx;
}
.list-item {
margin-bottom: 40rpx;
}
}
.no-install {
justify-content: center;
align-items: center;
height: 200rpx;
border-top: 2rpx solid #F4F5F7;
.tips {
font-size: 28rpx;
}
}
.check-bottom {
display: flex;
justify-content: center;
align-items: center;
.button {
text-align: center;
height: 104rpx;
width: 300rpx;
border-radius: 52rpx;
font-size: 32rpx;
font-weight: 600;
line-height: 104rpx;
}
.cancel {
margin: 36rpx 15rpx 52rpx 30rpx;
border: 2px solid #2272FF;
color: #2272FF;
}
.confirm {
margin: 36rpx 30rpx 52rpx 15rpx;
background: #2272FF;
color: #FFFFFF;
}
}
}
.item-txt {
height: 32rpx;
font-size: 28rpx;
font-weight: 500;
color: #333333;
line-height: 32rpx;
}
.left-txt {
width: 200rpx;
text-align: left;
}
.right-txt {
width: 160rpx;
text-align: right;
}
.pass-color {
color: #2272FF !important;
}
.no-pass-color {
color: #FA5A49 !important;;
}
</style>