Browse Source

优化二维码标识:为邀请二维码和导出信息二维码添加清晰的标识和作用说明,修复联系方式重复显示问题

master
Default User 1 month ago
parent
commit
2eb03d29f5
  1. 38
      certificate.html
  2. 7
      invite.html
  3. 8
      view.html

38
certificate.html

@ -429,9 +429,9 @@
</div>
</div>
<button class="verify-btn" id="verifyBtn" onclick="checkSubmissionStatus()">经销商查验</button>
<button class="verify-btn" id="verifyBtn" onclick="checkSubmissionStatus()">提交信息</button>
<button class="verify-btn" id="exportBtn" onclick="exportCertificate()" style="margin-top: 10px;">导出信息</button>
<button class="verify-btn" id="resetBtn" onclick="resetSubmissionStatus()" style="margin-top: 10px; background-color: #6c757d;">重置提交</button>
<button class="verify-btn" id="resetBtn" onclick="resetSubmissionStatus()" style="display: none; margin-top: 10px; background-color: #6c757d;">重置提交</button>
</div>
<div class="hint">
@ -552,6 +552,12 @@
return dateValue;
}
// 隐藏电话号码中间四位
function hidePhoneNumber(phone) {
if (!phone || phone.length !== 11) return phone;
return phone.substring(0, 3) + '****' + phone.substring(7);
}
// 显示合格证信息
function displayCertificate(certificate) {
const container = document.getElementById('certificateInfo');
@ -580,7 +586,7 @@
</div>
<div class="info-item">
<span class="label">联系方式:</span>
<span class="value">${certificate.contact || ''}</span>
<span class="value">${hidePhoneNumber(certificate.contact) || ''}</span>
</div>
<div class="info-item">
<span class="label">开具日期:</span>
@ -839,6 +845,15 @@
padding: 20px;
`;
// 创建二维码标题
const qrTitle = document.createElement('h3');
qrTitle.style.cssText = `
color: #28a745;
margin-bottom: 15px;
font-size: 20px;
`;
qrTitle.innerHTML = '📋 导出信息二维码';
// 创建二维码图片
const qrImage = document.createElement('img');
qrImage.id = 'qrCodeImage';
@ -859,8 +874,11 @@
text-align: center;
margin-bottom: 20px;
max-width: 90%;
background-color: rgba(40, 167, 69, 0.1);
padding: 15px;
border-radius: 8px;
`;
qrText.innerHTML = '扫描二维码查看完整信息<br>长按保存二维码';
qrText.innerHTML = '<p style="font-weight: 500; margin-bottom: 10px;">作用:查看完整的合格证信息</p><p>扫描二维码查看完整信息<br>长按保存二维码</p>';
// 创建关闭按钮
const closeBtn = document.createElement('button');
@ -900,6 +918,7 @@
qrImage.src = qrCodeUrl;
// 组装容器
qrContainer.appendChild(qrTitle);
qrContainer.appendChild(qrImage);
qrContainer.appendChild(qrText);
qrContainer.appendChild(closeBtn);
@ -1027,6 +1046,17 @@
window.onload = function() {
loadCertificate();
setupDateInput();
// 自动检查提交状态,如果未提交则弹出填写窗口
setTimeout(function() {
const sessionId = getSessionId();
const hasSubmitted = sessionStorage.getItem('certificateSubmitted_' + sessionId);
if (!hasSubmitted) {
// 未提交过,自动打开填写弹窗
openModal();
}
}, 500); // 延迟执行,确保页面完全加载
};
</script>
</body>

7
invite.html

@ -168,9 +168,12 @@
</div>
<div class="qr-container">
<h3>邀请二维码</h3>
<h3 style="color: #28a745;">📝 邀请二维码</h3>
<img id="qrCodeImage" src="" alt="邀请二维码">
<p style="margin-top: 10px; color: #666;">扫描此二维码进入信息填写页面</p>
<div style="margin-top: 15px; padding: 10px; background-color: #e6f7ee; border-radius: 8px;">
<p style="color: #28a745; font-weight: 500;">作用:邀请他人填写合格证信息</p>
<p style="color: #666; font-size: 14px; margin-top: 5px;">扫描此二维码进入信息填写页面</p>
</div>
</div>
<div class="action-buttons">

8
view.html

@ -258,7 +258,7 @@
</div>
<div class="info-item">
<span class="label">联系方式:</span>
<span class="value">${certificate.contact || ''}</span>
<span class="value">${hidePhoneNumber(certificate.contact) || ''}</span>
</div>
<div class="info-item">
<span class="label">开具日期:</span>
@ -299,6 +299,12 @@
return dateValue;
}
// 隐藏电话号码中间四位
function hidePhoneNumber(phone) {
if (!phone || phone.length !== 11) return phone;
return phone.substring(0, 3) + '****' + phone.substring(7);
}
// 页面加载时加载信息
window.onload = function() {
loadCertificate();

Loading…
Cancel
Save