|
@@ -71,7 +71,7 @@
|
|
|
|
|
|
<li data-id="8">预约看现场</li>
|
|
<li data-id="8">预约看现场</li>
|
|
|
|
|
|
- <li data-id="9">项目分享</li>
|
|
|
|
|
|
+ <li data-id="9">共享项目</li>
|
|
|
|
|
|
</ul>
|
|
</ul>
|
|
|
|
|
|
@@ -1105,38 +1105,38 @@
|
|
$('#filesBox2').on('click', '.file-del', function () {
|
|
$('#filesBox2').on('click', '.file-del', function () {
|
|
layer.msg("不可删除")
|
|
layer.msg("不可删除")
|
|
})
|
|
})
|
|
- const WECHAT_APPID = 'wx60064e1cac4296e6';
|
|
|
|
- const WECHAT_SECRET = 'bce94d361402cc535559a9bbdb908de8';
|
|
|
|
- let access_token;
|
|
|
|
- $(document).ready(function() {
|
|
|
|
- var urlParams = new URLSearchParams(window.location.search);
|
|
|
|
- var code = urlParams.get('code');
|
|
|
|
-
|
|
|
|
- if (!code) {
|
|
|
|
- // 没有code,重定向到微信授权页面获取code
|
|
|
|
- var WECHAT_APPID = 'your_appid'; // 替换为你的APPID
|
|
|
|
- var REDIRECT_URI = encodeURIComponent(window.location.href);
|
|
|
|
- var authUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + WECHAT_APPID +
|
|
|
|
- '&redirect_uri=' + REDIRECT_URI +
|
|
|
|
- '&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect';
|
|
|
|
- window.location.href = authUrl;
|
|
|
|
- } else {
|
|
|
|
- // 使用code换取access_token和openid
|
|
|
|
- $.ajax({
|
|
|
|
- url: '/wechat/callback',
|
|
|
|
- method: 'GET',
|
|
|
|
- data: { code: code },
|
|
|
|
- success: function(response) {
|
|
|
|
- alert(response);
|
|
|
|
- // 这里可以根据返回的响应进一步处理页面显示
|
|
|
|
- },
|
|
|
|
- error: function(xhr, status, error) {
|
|
|
|
- console.error('Error: ', error);
|
|
|
|
- alert('An error occurred while processing your request.');
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ // const WECHAT_APPID = 'wx60064e1cac4296e6';
|
|
|
|
+ // const WECHAT_SECRET = 'bce94d361402cc535559a9bbdb908de8';
|
|
|
|
+ // let access_token;
|
|
|
|
+ // $(document).ready(function() {
|
|
|
|
+ // var urlParams = new URLSearchParams(window.location.search);
|
|
|
|
+ // var code = urlParams.get('code');
|
|
|
|
+
|
|
|
|
+ // if (!code) {
|
|
|
|
+ // // 没有code,重定向到微信授权页面获取code
|
|
|
|
+ // var WECHAT_APPID = 'your_appid'; // 替换为你的APPID
|
|
|
|
+ // var REDIRECT_URI = encodeURIComponent(window.location.href);
|
|
|
|
+ // var authUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + WECHAT_APPID +
|
|
|
|
+ // '&redirect_uri=' + REDIRECT_URI +
|
|
|
|
+ // '&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect';
|
|
|
|
+ // window.location.href = authUrl;
|
|
|
|
+ // } else {
|
|
|
|
+ // // 使用code换取access_token和openid
|
|
|
|
+ // $.ajax({
|
|
|
|
+ // url: '/wechat/callback',
|
|
|
|
+ // method: 'GET',
|
|
|
|
+ // data: { code: code },
|
|
|
|
+ // success: function(response) {
|
|
|
|
+ // alert(response);
|
|
|
|
+ // // 这里可以根据返回的响应进一步处理页面显示
|
|
|
|
+ // },
|
|
|
|
+ // error: function(xhr, status, error) {
|
|
|
|
+ // console.error('Error: ', error);
|
|
|
|
+ // alert('An error occurred while processing your request.');
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
@@ -1164,15 +1164,20 @@
|
|
});
|
|
});
|
|
|
|
|
|
document.getElementById('saveBtn').addEventListener('click', function() {
|
|
document.getElementById('saveBtn').addEventListener('click', function() {
|
|
- // 获取生成的二维码的canvas元素
|
|
|
|
var canvas = document.querySelector('#qrcode canvas');
|
|
var canvas = document.querySelector('#qrcode canvas');
|
|
|
|
|
|
if (canvas) {
|
|
if (canvas) {
|
|
- // 创建一个临时的下载链接
|
|
|
|
- var link = document.createElement('a');
|
|
|
|
- link.href = canvas.toDataURL('image/png'); // 将canvas内容转换为图片URL
|
|
|
|
- link.download = 'qrcode.png'; // 设置下载的文件名
|
|
|
|
- link.click(); // 自动触发下载
|
|
|
|
|
|
+ var img = document.createElement('img');
|
|
|
|
+ img.src = canvas.toDataURL('image/png');
|
|
|
|
+ img.alt = '二维码';
|
|
|
|
+
|
|
|
|
+ var downloadTip = document.createElement('div');
|
|
|
|
+ downloadTip.innerText = '长按图片保存';
|
|
|
|
+
|
|
|
|
+ var qrContainer = document.querySelector('.code-img');
|
|
|
|
+ qrContainer.innerHTML = ''; // 清空现有内容
|
|
|
|
+ qrContainer.appendChild(img); // 插入图片
|
|
|
|
+ qrContainer.appendChild(downloadTip); // 添加保存提示
|
|
} else {
|
|
} else {
|
|
alert('请先生成二维码');
|
|
alert('请先生成二维码');
|
|
}
|
|
}
|