feat:增加税局链接

main
zhaoxingchang.sd 8 months ago
parent d56edab1f9
commit c83b03c980
  1. 34
      html/wxscaninvoice/Followorder.html
  2. 32
      js/wxscaninvoice/transferPage.js
  3. 11
      js/wxscaninvoice/writing.js

@ -66,6 +66,13 @@
display: none;
font-size: 0.25rem;
}
.url-link {
margin-top: 0.5rem;
color: #007BFF;
text-decoration: underline;
display: block; /* 确保块级元素 */
}
</style>
</head>
@ -75,12 +82,13 @@
<img alt="" src="../../image/wxscaninvoice/success.png" class="top_img" />
<p class="tip_name">发票开具申请已提交<br>请关注<span><br>
个人邮箱或微信卡包或联系商家</span><br>了解更多发票状态!</p>
<p class="url-link" id="ewm-url-sl"></p>
</div>
<div class="gzh">
<img alt="" src="../../image/wxscaninvoice/success.png" class="top_img" />
<p class="tip_name">请关注个人邮箱或微信卡包或联系商家<br>
了解更多发票状态!</p>
<p class="url-link" id="ewm-url-gzh"></p>
</div>
</div>
</body>
@ -91,9 +99,10 @@
<script type="text/javascript">
const subscribe = window.localStorage.getItem("subscribe");
const ewm = window.localStorage.getItem("ewm");
const ewmUrl = window.sessionStorage.getItem("ewm-URL");
const prePath = '../../image/wxscaninvoice/';
const defaultLogoPath = prePath + 'myfp_16.png';
if (ewm === "" || ewm == null || ewm === undefined) {
$(".EWMpng").attr("src", defaultLogoPath);
$('.gzh').css("display", "block");
@ -101,6 +110,27 @@
$('.sl').css("display", "block");
$(".EWMpng").attr("src", prePath + ewm);
}
if (ewmUrl) {
console.log('URL:', ewmUrl); // 添加调试信息
if ($('.sl').is(':visible')) {
$('#ewm-url-sl').html(`<a href="${ewmUrl.replace(/"/g, '')}" target="_blank">跳转税局发票下载</a>`);
} else if ($('.gzh').is(':visible')) {
$('#ewm-url-gzh').html(`<a href="${ewmUrl.replace(/"/g, '')}" target="_blank">跳转税局发票下载</a>`);
}
} else {
console.error('ewmUrl is not set or is empty');
}
// 确保点击链接时跳转到正确的 URL
$(document).on('click', '.url-link a', function(event) {
event.preventDefault();
if (ewmUrl) {
window.location.href = ewmUrl.replace(/"/g, '');
} else {
console.error('ewmUrl is not set or is empty');
}
});
</script>
</html>

@ -105,14 +105,14 @@ function getOrderInfoByTqm() {
}),
async: false,
success: function (data) {
alert_loading_close();
window.sessionStorage.setItem("fpzls", JSON.stringify(data.fpzls)); //发票类型
window.sessionStorage.setItem("orderInfo", JSON.stringify(data.orderInfo)); // 订单信息
window.sessionStorage.setItem("orderItemInfoList", JSON.stringify(data.orderItemList)); //开票项目
window.sessionStorage.setItem("titleInfo", JSON.stringify(data.titleInfo)) //抬头信息
console.log(data.titleInfo,'11111111111')
window.sessionStorage.setItem("ewmInfo", JSON.stringify(data.ewm)) //二维码信息
if (data.code === "0000") { //处理成功
getOrderEwm()
//判断是否是公众号,如果是公众号需要走授权逻辑,如果不是,直接到填开页
if(window.localStorage.getItem("routerType") === "1"){
toPage("/html/wxscaninvoice/writing.html");
@ -178,3 +178,31 @@ function getOrderInfoByTqm() {
}
});
}
function getOrderEwm() {
console.log('getOrderEwm','接口请求')
let ewm = JSON.parse(window.sessionStorage.getItem("ewmInfo")) //二维码信息
$.ajax({
type: "post",
url: config.projectUrl + '/FPGLXT/wb/queryEwmjfxz',
contentType: "application/json;charset=utf-8",
async: false,
data:JSON.stringify({
fphm: ewm.fphm,
kpf_nsrsbh:ewm.kpf_nsrsbh,
kprq:ewm.kprq?.replace(/[- :]/g, ''),// "2024-10-24 17:04:03" => "20241024170403"
nsrsbh:ewm.nsrsbh,
wjlx:'1'
}),
success: function (data) {
if(data.code === '0000'){
window.sessionStorage.setItem("ewm-URL", JSON.stringify(data.data));
}else {
window.sessionStorage.setItem("ewm-URL",'');
}
},
error: function (data) {
console.log(data,'error')
}
});
}

@ -1243,19 +1243,19 @@ function emailOnblur() {
function isValidEmail(email) {
// 定义不同的正则表达式
// 定义用于匹配QQ邮箱地址的正则表达式
const qqEmailRegex = /^[a-zA-Z0-9]+@qq\.com$/;
const qqEmailRegex = /^[^@ ]+@qq\.com$/;
// 定义用于匹配钉钉邮箱地址的正则表达式
const dingtalkEmailRegex = /^[a-zA-Z0-9]+@dingtalk\.com$/;
const dingtalkEmailRegex = /^[^@ ]+@dingtalk\.com$/;
// 定义用于匹配网易邮箱地址的正则表达式,包括163.com, 126.com, yeah.net
const neteaseEmailRegex = /^[a-zA-Z0-9]+@(163\.com|126\.com|yeah\.net)$/;
const neteaseEmailRegex = /^[^@ ]+@(163\.com|126\.com|yeah\.net)$/;
// 定义用于匹配阿里云邮箱地址的正则表达式
const aliyunEmailRegex = /^[a-zA-Z0-9]+@aliyun\.com$/;
const aliyunEmailRegex = /^[^@ ]+@aliyun\.com$/;
// 定义用于匹配微软邮箱地址的正则表达式,包括outlook.com, hotmail.com, live.com
const microsoftEmailRegex = /^[a-zA-Z0-9]+@(outlook\.com|hotmail\.com|live\.com)$/;
const microsoftEmailRegex = /^[^@ ]+@(outlook\.com|hotmail\.com|live\.com)$/;
// 检查是否符合任一邮箱格式
return (
@ -1267,6 +1267,7 @@ function isValidEmail(email) {
);
}
/*验证发票类型*/
function fplxOnblur() {
const fplx = $.trim($fpType.val());

Loading…
Cancel
Save