ExamSubmitPopup.vue
3.24 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<template>
<view class="exam-submit-popup-wrapper">
<!-- 标题 -->
<view :class="['exam-title', { 'title-loading': isLoading }]">是否已提交考试</view>
<!-- 加载状态 -->
<template v-if="isLoading">
<view class="loading-text">正在查询考试结果,请稍后...</view>
<image
class="loading-gif"
:src="require('@/assets/images/common/loadding.gif')"
/>
</template>
<template v-if="showError">
<view class="error-text">未查询到考试结果,请重新确认</view>
</template>
<!-- 按钮组(始终显示) -->
<view class="button-group">
<view class="cancel-button" @click="handleCancel">
未提交
</view>
<view class="confirm-button" v-if="!isLoading" @click="handleConfirm">
{{ confirmText }}
</view>
<view class="confirm-button confirm-button-loading" v-else> {{ confirmText }}</view>
</view>
</view>
</template>
<script>
export default {
name: 'ExamSubmitPopup',
props: {
isLoading: {
type: Boolean,
default: false
},
showError: {
type: Boolean,
default: false
},
confirmText: {
type: String,
default: '确认'
}
},
watch: {
isLoading(newVal) {
console.log('ExamSubmitPopup isLoading changed:', newVal)
}
},
methods: {
handleCancel() {
this.$emit('cancel')
},
handleConfirm() {
console.log('handleConfirm clicked')
this.$emit('confirm')
},
}
}
</script>
<style lang="scss" scoped>
.exam-submit-popup-wrapper {
position: relative;
width: 100%;
min-height: toRpx(400);
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: toRpx(48);
}
.exam-title {
width: toRpx(280);
height: toRpx(48);
color: #333333;
font-size: toRpx(40);
font-weight: 500;
font-family: "HarmonyOSSansSC";
text-align: center;
margin-top: toRpx(48);
}
.exam-title.title-loading {
margin-bottom: toRpx(40);
margin-top: toRpx(0);
}
.loading-text {
height: toRpx(48);
color: #6c6f75;
font-size: toRpx(32);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(48);
margin-bottom: toRpx(40);
}
.loading-gif {
width: toRpx(64);
height: toRpx(64);
margin-bottom: toRpx(76);
}
.error-text {
color: #6c6f75;
font-size: toRpx(32);
font-weight: 400;
line-height: toRpx(48);
margin-top: toRpx(48);
}
.button-group {
display: flex;
align-items: center;
justify-content: center;
gap: toRpx(16);
margin-top: auto;
}
.cancel-button {
width: toRpx(344);
height: toRpx(80);
border-radius: toRpx(64);
background: #f0f1f5;
color: #1a1a1a;
font-size: toRpx(28);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(80);
}
.confirm-button {
width: toRpx(360);
height: toRpx(80);
border-radius: toRpx(48);
border: toRpx(2) solid #979797;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #ffffff;
font-size: toRpx(28);
font-weight: 500;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(80);
&-loading {
opacity: 0.5;
}
&:active {
opacity: 0.8;
}
}
</style>