cert_duan_old.vue
5.81 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<template>
<el-row>
<el-col :lg="18" :sm="24">
<div class="wPanel">
<img class="forWei poimg" src="@/assets/h5/cx@2x.png">
<h2>国际段位证书查询</h2>
<el-form ref="queryRef" :model="queryParams" :rules="rules" label-width="120">
<el-form-item label="证件号码" prop="queryCode">
<el-input
v-model.trim="queryParams.queryCode"
placeholder="请输入证件号码"
size="large"
clearable
prefix-icon="Postcard"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="图形验证码" prop="code">
<captcha ref="codeRef" v-model="queryParams.code" v-model:uuid="queryParams.uuid" :auto-load="false" @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button class="search-btn" round type="default" plain @click="handleQuery">
<el-icon class="el-icon--left"><Search /></el-icon>查询
</el-button>
</el-form-item>
</el-form>
</div>
<el-divider class="forPc" />
<div class="wPanel mt20">
<img class="forWei poimg" src="@/assets/h5/jg@2x.png">
<h2>段位证书查询结果</h2>
<el-form label-width="120">
<el-form-item label="会员名称">
<el-input v-model="resultForm.name" readonly />
</el-form-item>
<el-form-item label="出生日期">
<el-input v-model="resultForm.birth" readonly />
</el-form-item>
<el-form-item label="证书编号">
<el-input v-model="resultForm.certCode" readonly />
</el-form-item>
<el-form-item label="段位/品位">
<el-input v-model="resultForm.level" readonly />
</el-form-item>
<el-form-item label="发证日期">
<el-input v-model="resultForm.certTime" readonly />
</el-form-item>
</el-form>
</div>
</el-col>
</el-row>
<div v-if="showCert" class="cert">
<div class="bg_certificate bg_c1">
<button type="button" class="close" @click="showCert=false">
<span aria-hidden="true">×</span>
</button>
<input readonly type="text" class="input_certificate c4_china_01" :value="resultForm.certCode">
<input readonly type="text" class="input_certificate c4_china_02" :value="resultForm.name">
<input readonly type="text" class="input_certificate c4_china_03" :value="resultForm.birth">
<input readonly type="text" class="input_certificate c4_china_04" :value="resultForm.level">
<input readonly type="text" class="input_certificate c4_china_05" :value="resultForm.certTime">
</div>
</div>
</template>
<script setup>
import { getCurrentInstance, reactive } from '@vue/runtime-core'
import { toRefs } from 'vue'
import Captcha from '@/views/login/components/captcha'
import * as authentic from '@/apiPc/authentic'
import { customMessageBox } from '@/utils/ruoyi'
const { proxy } = getCurrentInstance()
const data = reactive({
queryParams: {
queryCode: undefined,
code: undefined,
uuid: undefined
},
rules: {
queryCode: [{ required: true, trigger: 'blur', message: '请输入证件号码' }],
code: [{ required: true, trigger: 'blur', message: '请输入图形验证码' }]
},
resultForm: {},
showCert: false
})
const { queryParams, rules, resultForm, showCert } = toRefs(data)
function handleQuery() {
proxy.$refs['queryRef'].validate((valid) => {
if (valid) {
resultForm.value = {}
authentic.internationalDuanQuery(queryParams.value).then(res => {
if (res.data) {
resultForm.value = res.data
showCert.value = true
} else {
customMessageBox('没有查询到相应的数据')
}
}).finally(getCode)
}
})
}
function getCode() {
proxy.$refs['codeRef'].getCode()
}
function init() {
getCode()
}
defineExpose({
init
})
</script>
<style scoped lang="scss">
h2{color:var(--el-color-primary);font-size: 18px;text-align: center;margin:0 0 30px;}
:deep(.el-input__wrapper){background: #FBFCFD;}
.forWei {
display: none;
}
@media (max-width: 500px) {
h2{ color: #000; }
.forWei {display: block;}
.forPc{display: none}
.wPanel{position: relative;}
.poimg{width: 110px;position: absolute;right: 10px;top:0;}
.search-btn{background: var(--el-color-primary);color: #fff;border: none;
display: block;width: calc(100vw - 260px);}
}
.bg_c1 {
background: url("@/assets/v1/cert/guoji_duan.jpg") no-repeat;
}
.bg_certificate {
position: relative;
padding: 10px;
width: 800px;
height: 565px;
.close{ -webkit-appearance: none;
padding: 0; float: right;
cursor: pointer;
border: 0;
margin-top: 10px;
margin-right: 10px;
width: 24px;
height: 24px;
border-radius: 8px;
background-color: #900;
color: #fff;
font-size: 16px;
opacity: 1;
}
.input_certificate {
position: absolute;
font-size: 16px;
font-weight: bold;
font-family: "宋体";
border: none;
background: none;
}
.c_center{ position:relative; display:block; margin:0 auto; text-align:center;}
.c3_new_00_cn,.c3_old_00_cn,.c4_china_00_cn{ margin-top:170px; font-size:24px;}
.c3_new_00_en,.c3_old_00_en,.c4_china_00_en{ margin-top:-10px; font-size:14px; color:#666;}
.c4_china_01{top:220px; left:250px;}
.c4_china_02{top:280px; left:250px;}
.c4_china_03{top:340px; left:250px;}
.c4_china_04{top:220px; left:520px;}
.c4_china_05{top:280px; left:520px;}
}
.cert{position: fixed;height: 100vh;width: 100vw;overflow: auto;z-index: 2;
display: flex;align-items: center;justify-content: center;
top: 0;left: 0;background: rgba(0,0,0,0.6);
}
</style>