1
0
Fork 0
mirror of https://github.com/yunluo/gdk.git synced 2024-05-11 18:56:50 +02:00

增加生成二维码功能

支付功能增加浏览器日志
替换意见反馈页面
This commit is contained in:
云落 2020-03-21 22:10:55 +08:00
parent 4d65314d59
commit 3168271cfe
4 changed files with 3336 additions and 2 deletions

View file

@ -1,5 +1,8 @@
jQuery(function ($) { /**声明加载jQuery */
function glog(a){
console.log(a);
}
/**
* 展示被隐藏的内容,适用于密码可见,付费可见,积分可见
* @param {string} a 内容div的 id或者class
@ -74,6 +77,7 @@ jQuery(function ($) { /**声明加载jQuery */
c = $.trim(c); /**Ajax返回有空行,这里处理一下.妈的花了老子3个小时 */
if (c !== '400') {
show_hide_content('.pass_viewbox', c);
glog('加密内容已展示');
localStorage.setItem('gdk_pass_' + ajax_data['id'], c); /**隐藏内容直接存入浏览器缓存,下次直接读取,ps.有个问题,内容更新会略坑,不管了 */
} else {
swal("查看失败", "您的密码错误,请重试", "error");
@ -199,6 +203,7 @@ jQuery(function ($) { /**声明加载jQuery */
check_pay_points(c, f[1]); /**用户id,订单号,积分充值检测 */
}
});
glog('二维码内容为:' + f[3]);
new QRious({
element: document.getElementById("pqrious"),
size: 300,
@ -291,6 +296,7 @@ jQuery(function ($) { /**声明加载jQuery */
closeOnClickOutside: false,
content: "input",
}).then((d) => { /**提取码 */
glog('提取码为:' + d );
get_content(a);
add_code(a, `${d}`);
}); //ok

3311
class/qrcode.class.php Normal file

File diff suppressed because it is too large Load diff

View file

@ -401,7 +401,7 @@ $(".feedback-btn").click(function() {
function() {
$(".feedback-load").hide();
$.fancybox.open({
src: 'https://wj.qq.com/s2/5705098/515f/',
src: 'https://support.qq.com/products/51158/',
type: 'iframe',
opts: {
afterShow: function(instance, current) {

View file

@ -1279,4 +1279,21 @@ function base64img($image_file)
$image_data = file_get_contents($image_file);
$base64_image = 'data:' . $image_info['mime'] . ';base64,' . base64_encode($image_data);
return $base64_image;
}
}
//生成二维码
function getQrcode($url)
{
//引入phpqrcode类库
require_once GDK_ROOT_PATH . '/class/qrcode.class.php';
$errorCorrectionLevel = 'L'; //容错级别
$matrixPointSize = 6; //生成图片大小
ob_start();
QRcode::png($url, false, $errorCorrectionLevel, $matrixPointSize, 2);
$data = ob_get_contents();
ob_end_clean();
$imageString = base64_encode($data);
header("content-type:application/json; charset=utf-8");
return 'data:image/jpeg;base64,' . $imageString;
}