From 4171039f16cd1475296c74e0bac052dd5daf9af9 Mon Sep 17 00:00:00 2001 From: xiaochong0302 Date: Tue, 23 Apr 2024 22:12:23 +0800 Subject: [PATCH] =?UTF-8?q?contact=E6=94=B9QQ=E4=B8=8A=E4=BC=A0=E4=BA=8C?= =?UTF-8?q?=E7=BB=B4=E7=A0=81=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Admin/Views/setting/contact.volt | 35 +++++++++++++++----- app/Http/Home/Views/partials/footer.volt | 7 ++-- public/static/home/js/fixbar.js | 39 +++++++++++++++-------- 3 files changed, 55 insertions(+), 26 deletions(-) diff --git a/app/Http/Admin/Views/setting/contact.volt b/app/Http/Admin/Views/setting/contact.volt index 10d1e673..07b4e455 100644 --- a/app/Http/Admin/Views/setting/contact.volt +++ b/app/Http/Admin/Views/setting/contact.volt @@ -19,7 +19,16 @@
- + +
+ +
+ +
+ +
+
+
@@ -28,13 +37,7 @@
- -
- -
- -
- +
@@ -103,6 +106,22 @@ } }); + upload.render({ + elem: '#upload-qq', + url: '/admin/upload/icon/img', + exts: 'gif|jpg|png', + before: function () { + layer.load(); + }, + done: function (res, index, upload) { + $('input[name=qq]').val(res.data.url); + layer.closeAll('loading'); + }, + error: function (index, upload) { + layer.msg('上传文件失败', {icon: 2}); + } + }); + upload.render({ elem: '#upload-toutiao', url: '/admin/upload/icon/img', diff --git a/app/Http/Home/Views/partials/footer.volt b/app/Http/Home/Views/partials/footer.volt index 594fc247..7c4a8713 100644 --- a/app/Http/Home/Views/partials/footer.volt +++ b/app/Http/Home/Views/partials/footer.volt @@ -24,13 +24,12 @@
{% if contact_info.enabled == 1 %}
- {% if contact_info.qq %} - {% set link_url = 'https://wpa.qq.com/msgrd?v=3&uin=%s&site=qq&menu=yes'|format(contact_info.qq) %} - - {% endif %} {% if contact_info.wechat %} {% endif %} + {% if contact_info.qq %} + + {% endif %} {% if contact_info.toutiao %} {% endif %} diff --git a/public/static/home/js/fixbar.js b/public/static/home/js/fixbar.js index d3617241..11e3159e 100644 --- a/public/static/home/js/fixbar.js +++ b/public/static/home/js/fixbar.js @@ -3,10 +3,6 @@ layui.use(['jquery', 'helper', 'util'], function () { var $ = layui.jquery; var util = layui.util; - var showQQDialog = function () { - window.open('https://wpa.qq.com/msgrd?v=3&uin=' + window.contact.qq + '&site=qq&menu=yes'); - } - var showWechatCode = function () { var content = '
扫码关注
'; layer.open({ @@ -18,6 +14,17 @@ layui.use(['jquery', 'helper', 'util'], function () { }); } + var showQQCode = function () { + var content = '
扫码关注
'; + layer.open({ + type: 1, + title: false, + closeBtn: 0, + shadeClose: true, + content: content, + }); + } + var showTouTiaoCode = function () { var content = '
扫码关注
'; layer.open({ @@ -31,13 +38,6 @@ layui.use(['jquery', 'helper', 'util'], function () { var bars = []; - if (window.contact.qq) { - bars.push({ - type: 'qq', - icon: 'layui-icon-login-qq', - }); - } - if (window.contact.wechat) { bars.push({ type: 'wechat', @@ -45,13 +45,20 @@ layui.use(['jquery', 'helper', 'util'], function () { }); } + if (window.contact.qq) { + bars.push({ + type: 'qq', + icon: 'layui-icon-login-qq', + }); + } + util.fixbar({ bars: bars, click: function (type) { - if (type === 'qq') { - showQQDialog(); - } else if (type === 'wechat') { + if (type === 'wechat') { showWechatCode(); + } else if (type === 'qq') { + showQQCode(); } } }); @@ -60,6 +67,10 @@ layui.use(['jquery', 'helper', 'util'], function () { showWechatCode(); }); + $('.icon-qq').on('click', function () { + showQQCode(); + }); + $('.icon-toutiao').on('click', function () { showTouTiaoCode(); });