1. 优化数据库结构,增强兼容性

2. 添加手机浏览器跳转支付宝收银
3. 添加手机浏览器跳转微信支付提示信息
This commit is contained in:
技术老胡
2025-03-18 11:49:00 +08:00
parent b3dd6ba3f0
commit a05a5710af
4 changed files with 98 additions and 69 deletions

View File

@@ -134,6 +134,12 @@
</span><span></span></div>
<div class="qrcode"><img id="qrcode" src="/static/img/loading.gif">
</div>
<!-- 添加跳转按钮 -->
<div style="margin: 16px auto;display: none;">
<button id="openApp" class="layui-btn layui-btn-normal">
打开支付应用
</button>
</div>
<div class="msg">
<p>请付款 <span class="note">
<?php echo htmlentities($really_price); ?>
@@ -284,6 +290,29 @@
} else if (payType === 'alipay' && environment === 'wxphone') {
layer.alert('请使用支付宝打开此页面');
}
// 添加按钮控制逻辑
const openAppBtn = document.getElementById('openApp');
if (environment === 'phone') {
openAppBtn.parentNode.style.display = 'block';
if (payType === 'wxpay') {
openAppBtn.innerText = '截图并打开微信';
openAppBtn.className = 'layui-btn layui-btn-green';
openAppBtn.onclick = function () {
window.location.href = 'weixin://';
};
} else if (payType === 'alipay') {
openAppBtn.innerText = '打开支付宝付款';
openAppBtn.className = 'layui-btn layui-btn-normal';
openAppBtn.onclick = function () {
if (codeType == 0) {
window.location.href = 'alipays://platformapi/startapp?appId=20000067&&url=' + payCode;
} else {
const currentUrl = window.location.href;
window.location.href = 'alipays://platformapi/startapp?appId=20000067&&url=' + currentUrl;
}
};
}
}
// 生成二维码
async function getQrcode(text, QR) {
const qrcodeUrl = await new Promise((resolve) => {