diff --git a/server/CoreCms.Net.Web.Admin/wwwroot/views/sq/sqroompricing/date-details.html b/server/CoreCms.Net.Web.Admin/wwwroot/views/sq/sqroompricing/date-details.html
new file mode 100644
index 0000000..204af3e
--- /dev/null
+++ b/server/CoreCms.Net.Web.Admin/wwwroot/views/sq/sqroompricing/date-details.html
@@ -0,0 +1,271 @@
+
+
diff --git a/server/CoreCms.Net.Web.Admin/wwwroot/views/sq/sqroompricing/index.html b/server/CoreCms.Net.Web.Admin/wwwroot/views/sq/sqroompricing/index.html
index 34f91f1..d5113c1 100644
--- a/server/CoreCms.Net.Web.Admin/wwwroot/views/sq/sqroompricing/index.html
+++ b/server/CoreCms.Net.Web.Admin/wwwroot/views/sq/sqroompricing/index.html
@@ -1325,252 +1325,21 @@
});
var roomName = selectedRoom ? selectedRoom.name : '未知房间';
- // 请求详细数据
- coreHelper.Get("Api/SQRoomPricing/GetDateDetails?date=" + encodeURIComponent(dateStr) + "&roomId=" + selectedRoomId, function (e) {
- if (e.code === 0 && e.data) {
- var data = e.data;
-
- // 构建弹窗内容
- var content = '
';
-
- // 日期和房间信息
- content += '
';
- content += '
';
- content += '
';
- content += ' ';
- content += '
';
- content += '
';
- content += '
';
- content += '
日期:' + dateStr + '
';
- content += '
房间:' + roomName + '
';
- content += '
';
- content += '
';
- content += '
星期:' + getWeekDay(dateStr) + '
';
- content += '
';
- content += '
';
- content += '
';
- content += '
';
- content += '
';
- content += '
';
-
- // 时段详情
- if (data.time_slots && data.time_slots.length > 0) {
- content += '
';
- content += '
';
- content += '
';
- content += ' ';
- content += '
';
- content += '
';
- content += '
';
- content += '
';
- content += '
';
- content += '
';
- }
-
- // 预约详情列表(按时段分组)
- content += '
';
-
- content += '
';
-
- // 弹出窗口
- layer.open({
- type: 1,
- title: roomName + ' - ' + dateStr + ' 详情',
- area: ['1200px', '90%'],
- content: content,
- success: function (layero, index) {
- // 渲染时段详情表格
- if (data.time_slots && data.time_slots.length > 0) {
- var tableData = data.time_slots.map(function (slot) {
- return {
- slot_name: slot.slot_name || '',
- status: slot.status || '',
- price_desc_standard: slot.price_desc_standard || '',
- price_desc_member: slot.price_desc_member || '',
- participant_avatars: slot.participant_avatars || [],
- reservation_count: slot.reservation_count || 0
- };
- });
-
- table.render({
- elem: '#dateDetailsTable',
- data: tableData,
- page: false,
- cols: [[
- { field: 'slot_name', title: '时段', width: 100 },
- {
- field: 'status',
- title: '状态',
- width: 100,
- templet: function (d) {
- var statusText = '';
- var statusColor = '';
- if (d.status === 'available') {
- statusText = '可用';
- statusColor = '#5FB878';
- } else if (d.status === 'reserved') {
- statusText = '已预约';
- statusColor = '#FFB800';
- } else if (d.status === 'using') {
- statusText = '使用中';
- statusColor = '#999';
- } else if (d.status === 'unavailable') {
- statusText = '不可用';
- statusColor = '#FF5722';
- } else {
- statusText = d.status;
- statusColor = '#999';
- }
- return '' + statusText + '';
- }
- },
- { field: 'price_desc_standard', title: '普通价格描述', width: 150 },
- { field: 'price_desc_member', title: '会员价格描述', width: 150 },
- {
- field: 'participant_avatars',
- title: '预约人头像',
- width: 200,
- templet: function (d) {
- if (!d.participant_avatars || d.participant_avatars.length === 0) {
- return '无';
- }
- var html = '';
- d.participant_avatars.forEach(function (avatar) {
- html += '

';
- });
- html += '
';
- return html;
- }
- },
- { field: 'reservation_count', title: '预约人数', width: 100 }
- ]]
- });
- }
-
- // 渲染按时段分组的预约详情
- if (data.reservations_by_slot) {
- var slotNames = ['凌晨', '上午', '下午', '晚上'];
- var reservationsBySlotContainer = $('#reservationsBySlot');
-
- for (var slotType = 0; slotType <= 3; slotType++) {
- var slotReservations = data.reservations_by_slot[slotType];
-
- if (slotReservations && slotReservations.length > 0) {
- // 时段标题
- var slotHtml = '';
- slotHtml += '
';
- slotHtml += '
预约详情列表(' + slotNames[slotType] + ')
';
-
- // 遍历该时段的每个预约
- slotReservations.forEach(function (reservation, idx) {
- slotHtml += '
';
- slotHtml += ' ';
- slotHtml += '
';
- slotHtml += '
';
- slotHtml += '
';
- slotHtml += '
';
- });
-
- slotHtml += '
';
- slotHtml += '
';
-
- reservationsBySlotContainer.append(slotHtml);
-
- // 渲染每个预约的参与者表格
- slotReservations.forEach(function (reservation, idx) {
- var participants = reservation.participants || [];
-
- table.render({
- elem: '#participantsTable_' + slotType + '_' + reservation.id,
- data: participants,
- page: false,
- cols: [[
- { field: 'id', title: 'ID', width: 60 },
- { field: 'user_id', title: '用户ID', width: 80 },
- { field: 'user_name', title: '用户昵称', width: 120 },
- {
- field: 'avatar_image',
- title: '用户头像',
- width: 80,
- templet: function (d) {
- if (d.avatar_image) {
- return '
';
- }
- return '无';
- }
- },
- { field: 'join_time', title: '参与时间', width: 150 },
- {
- field: 'role',
- title: '角色',
- width: 80,
- templet: function (d) {
- return d.role === 1 ? '发起者' : '参与者';
- }
- },
- { field: 'quit_time', title: '退出时间', width: 150 },
- {
- field: 'is_refund',
- title: '鸽子费状态',
- width: 100,
- templet: function (d) {
- var refundText = '';
- var refundColor = '';
- switch (d.is_refund) {
- case 0:
- refundText = '无需退款';
- refundColor = '#999';
- break;
- case 1:
- refundText = '未付鸽子费';
- refundColor = '#1E9FFF';
- break;
- case 2:
- refundText = '已付鸽子费';
- refundColor = '#FFB800';
- break;
- case 3:
- refundText = '退款中';
- refundColor = '#5FB878';
- break;
- case 4:
- refundText = '退款成功';
- refundColor = '#5FB878';
- break;
- case 9:
- refundText = '退款失败';
- refundColor = '#FF5722';
- break;
- default:
- refundText = '未知状态';
- refundColor = '#999';
- }
- return '' + refundText + '';
- }
- },
- { field: 'remarks', title: '备注', minWidth: 150 }
- ]]
- });
- });
- }
- }
- }
+ // 使用模板弹窗
+ admin.popup({
+ title: roomName + ' - ' + dateStr + ' 详情',
+ area: ['1200px', '90%'],
+ id: 'LAY-popup-sqroompricing-datedetails',
+ success: function (layero, index) {
+ view(this.id).render('sq/sqroompricing/date-details', {
+ data: {
+ dateStr: dateStr,
+ roomId: selectedRoomId,
+ roomName: roomName
}
+ }).done(function () {
+ // 模板加载完成后的回调
});
- } else {
- layer.msg(e.msg || '获取数据失败');
}
});
}