1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-21 19:22:45 +08:00

fixbar增加电话图标

This commit is contained in:
xiaochong0302 2025-05-26 10:41:17 +08:00
parent 123e1ec97f
commit 2a1b4b69fd

View File

@ -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 = '<div class="layui-font-32 layui-font-red layui-padding-5">' + window.contact.phone + '</div>';
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: '<i class="iconfont icon-phone layui-font-30"></i>',
});
}
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();
});
});
$('.contact > .phone').on('click', function () {
showPhoneCode();
});
});