From 2a1b4b69fde3da9f4ce4a56b35e0886c59f8aa3c Mon Sep 17 00:00:00 2001 From: xiaochong0302 Date: Mon, 26 May 2025 10:41:17 +0800 Subject: [PATCH] =?UTF-8?q?fixbar=E5=A2=9E=E5=8A=A0=E7=94=B5=E8=AF=9D?= =?UTF-8?q?=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/home/js/fixbar.js | 36 +++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/public/static/home/js/fixbar.js b/public/static/home/js/fixbar.js index 831f471f..df01c3e5 100644 --- a/public/static/home/js/fixbar.js +++ b/public/static/home/js/fixbar.js @@ -1,4 +1,4 @@ -layui.use(['jquery', 'helper', 'util'], function () { +layui.use(['jquery', 'util'], function () { var $ = layui.jquery; var util = layui.util; @@ -47,6 +47,17 @@ layui.use(['jquery', 'helper', 'util'], function () { }); } + var showPhoneCode = function () { + var content = '
' + window.contact.phone + '
'; + layer.open({ + type: 1, + title: false, + closeBtn: 0, + shadeClose: true, + content: content, + }); + } + var bars = []; if (window.contact.wechat) { @@ -63,6 +74,13 @@ layui.use(['jquery', 'helper', 'util'], function () { }); } + if (window.contact.phone) { + bars.push({ + type: 'phone', + content: '', + }); + } + util.fixbar({ bars: bars, click: function (type) { @@ -70,24 +88,30 @@ layui.use(['jquery', 'helper', 'util'], function () { showWechatCode(); } else if (type === 'qq') { showQQCode(); + } else if (type === 'phone') { + showPhoneCode(); } } }); - $('.icon-wechat').on('click', function () { + $('.contact > .wechat').on('click', function () { showWechatCode(); }); - $('.icon-qq').on('click', function () { + $('.contact > .qq').on('click', function () { showQQCode(); }); - $('.icon-toutiao').on('click', function () { + $('.contact > .toutiao').on('click', function () { showTouTiaoCode(); }); - $('.icon-douyin').on('click', function () { + $('.contact > .douyin').on('click', function () { showDouYinCode(); }); -}); \ No newline at end of file + $('.contact > .phone').on('click', function () { + showPhoneCode(); + }); + +});