add 新增查看礼物详情列表

fix 调整礼物金额
This commit is contained in:
2024-11-29 17:56:02 +08:00
parent e4e5696b70
commit e450964cd8
10 changed files with 205 additions and 36 deletions

31
Web/html/body/config.html Normal file
View File

@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>系统设置</title>
<link rel="stylesheet" href="/layui/css/layui.css">
</head>
<body>
<div id="header"></div>
不想做了,鸽
</body>
<script src="/js/jquery-3.2.1.js"></script>
<script src="/js/CommonConfig.js"></script>
<script src="/js/httpUtils.js"></script>
<script src="/layui/layui.js"></script>
<script>
headerModel = 5;
$('#header').load("/html/header.html");
</script>
<script>
</script>
<style>
</style>
</html>

View File

@@ -222,7 +222,7 @@
});
}
});
</script>

View File

@@ -249,38 +249,60 @@
var lables = [];
var values = [];
data.data.guardInfo.forEach(item => {
lables.push(item.gift_name + "\n" + item.total_price / 100 + "¥")
lables.push(item.gift_name + "\n" + item.total_price + "¥")
values.push(item.total_num)
});
data.data.giftInfo.forEach(item => {
lables.push(item.gift_name + "\n" + item.total_price / 100 + "¥")
lables.push(item.gift_name + "\n" + item.total_price + "¥")
values.push(item.total_gift_num)
});
if (chartView !== null) {
chartView.destroy()
}
chartView = new Chart($('#giftChart').get(0), {
type: 'pie',
data: {
labels: lables,
datasets: [{
label: '礼物(总额:' + data.data.price / 100 + "¥)",
data: values,
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
setChart(lables, values, data)
})
}
function setChart(lables, values, data) {
if (chartView !== null) {
chartView.destroy()
}
chartView = new Chart($('#giftChart').get(0), {
type: 'pie',
data: {
labels: lables,
datasets: [{
label: '礼物(总额:' + data.data.price + "¥)",
data: values,
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
},
onClick: (e) => {
var giftName=e.chart.tooltip.title[0]
console.log(e.chart.tooltip.title)
layer.open({
type: 2, // page 层类型
area: ['650px', '400px'],
title: '礼物详情',
shade: 0.6, // 遮罩透明度
shadeClose: false, // 点击遮罩区域,关闭弹层
maxmin: true, // 允许全屏最小化
anim: 1, // 0-6 的动画形式,-1 不开启
// btn: ['确定', '取消'],
content: '/html/ui/videoGiftItem.html?roomId=' + roomId + "&videoId=" + videoId + "&giftName=" + giftName,
yes: function (index, layero) {
}
});
}
}
});
}
function initMenu(data) {
var view = $("#menuView").get(0);
laytpl($('#menulist').get(0).innerHTML).render(data, function (html) {
@@ -345,11 +367,11 @@
initSC(data.data.superChat)
$('#danmuSize').get(0).innerHTML = data.data.danmuCount;
barrageRenderer.setBarrages(data.data.danmu)
}else{
} else {
barrageRenderer.barrageLayoutCalculate.allBarrageInstances.push(...data.data.danmu);
}
if(data.data.nextDanmu){
loadDanmu(page+1)
if (data.data.nextDanmu) {
loadDanmu(page + 1)
}
// barrageRenderer.setBarrages(data.data.danmu);
})

View File

@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="/layui/css/layui.css">
</head>
<table class="layui-hide" id="giftList" lay-filter="followTable"></table>
<body>
</body>
<script src="/layui/layui.js"></script>
<script src="/js/jquery-3.2.1.js"></script>
<script src="/js/CommonConfig.js"></script>
<script src="/js/httpUtils.js"></script>
<script>
var roomId = getParam("roomId");
var videoId = getParam("videoId");
var giftName = getParam("giftName");
layui.use(function () {
var laytpl = layui.laytpl;
var table = layui.table;
table.render({
elem: '#giftList',
url: '/live/gift/info/item?roomId=' + roomId + "&videoId=" + videoId + "&giftName=" + giftName,
height: 'full',
totalRow: false, // 开启合计行
page: false,
response: {
statusCode: 100 // 重新规定成功的状态码为 200table 组件默认为 0
},
parseData: function (res) {
return {
"code": res.status, //解析接口状态
"msg": res.message, //解析提示文本
"data": res.data, //解析数据列表
"count": res.count
};
},
cols: [[
{ type: 'checkbox', fixed: 'left' },
{ field: 'icon', title: '礼物', width: 80, templet: '<div><image src="" onerror="showImage(\'{{= d.icon }}\',this);" style="width: 30px;height: 30px;"></div>' },
{ field: 'gift_id', title: '礼物ID', width: 80, sort: true },
{ field: 'sender_name', title: '用户名', width: 150, sort: true, templet: '<div><a href="https://space.bilibili.com/{{= d.sender_uid}}" target="_blank">{{= d.sender_name}}</a>' },
{ field: 'sender_face', title: '用户头像', width: 80, templet: '<div><image src="" onerror="showImage(\'{{= d.sender_face }}\',this);" style="width: 30px;height: 30px;"></div>' },
{ field: 'gift_num', title: '数量', width: 80, sort: true },
{ field: 'price', title: '价值(电池)', width: 80, sort: true },
{ field: 'sql_time', title: '时间', width: 180 }
]],
done: function () {
onDone()
},
error: function (res, msg) {
console.log(res, msg)
}
});
function onDone() {
}
})
</script>