统一排行榜对齐星雀UI,页面资源后台配置实时刷新
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
149
miniprogram/pages/kaohe_jilu/kaohe_jilu.js
Normal file
149
miniprogram/pages/kaohe_jilu/kaohe_jilu.js
Normal file
@@ -0,0 +1,149 @@
|
||||
// pages/kaohe_jilu/kaohe_jilu.js
|
||||
const app = getApp();
|
||||
import request from '../../utils/request.js';
|
||||
|
||||
Page({
|
||||
data: {
|
||||
// 板块筛选
|
||||
moduleList: [],
|
||||
xuanzhongBankuaiId: 0, // 0代表全部
|
||||
// 状态筛选:0-全部 1-审核中 2-已通过 3-未通过
|
||||
statusFilter: 0,
|
||||
// 记录列表
|
||||
recordList: [],
|
||||
page: 1,
|
||||
pageSize: 5,
|
||||
hasMore: true,
|
||||
isLoading: false,
|
||||
isLoadingMore: false,
|
||||
// 展开的记录ID集合(字符串数组)
|
||||
expandedIds: [],
|
||||
// OSS地址
|
||||
ossImageUrl: app.globalData.ossImageUrl || '',
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.loadModules();
|
||||
},
|
||||
|
||||
// 加载板块(复用审核大厅接口)
|
||||
async loadModules() {
|
||||
try {
|
||||
const res = await request({ url: '/dengji/shdthqmk', method: 'POST' });
|
||||
if (res && res.data.code === 0) {
|
||||
const modules = res.data.data.modules || [];
|
||||
this.setData({ moduleList: modules, xuanzhongBankuaiId: 0 });
|
||||
this.loadRecords(true);
|
||||
} else {
|
||||
wx.showToast({ title: '加载模块失败', icon: 'none' });
|
||||
}
|
||||
} catch (e) {
|
||||
wx.showToast({ title: '网络错误', icon: 'none' });
|
||||
}
|
||||
},
|
||||
|
||||
// 选择板块
|
||||
selectModule(e) {
|
||||
const bankuaiId = e.currentTarget.dataset.id;
|
||||
if (bankuaiId === this.data.xuanzhongBankuaiId) return;
|
||||
this.setData({
|
||||
xuanzhongBankuaiId: bankuaiId,
|
||||
recordList: [],
|
||||
page: 1,
|
||||
hasMore: true,
|
||||
expandedIds: []
|
||||
});
|
||||
this.loadRecords(true);
|
||||
},
|
||||
|
||||
// 选择状态
|
||||
selectStatus(e) {
|
||||
const status = e.currentTarget.dataset.status;
|
||||
if (status === this.data.statusFilter) return;
|
||||
this.setData({
|
||||
statusFilter: status,
|
||||
recordList: [],
|
||||
page: 1,
|
||||
hasMore: true,
|
||||
expandedIds: []
|
||||
});
|
||||
this.loadRecords(true);
|
||||
},
|
||||
|
||||
// 加载历史记录
|
||||
async loadRecords(isRefresh = false) {
|
||||
if (this.data.isLoading) return;
|
||||
const page = isRefresh ? 1 : this.data.page;
|
||||
if (!isRefresh && !this.data.hasMore) return;
|
||||
|
||||
this.setData({ isLoading: true, isLoadingMore: !isRefresh });
|
||||
|
||||
try {
|
||||
const res = await request({
|
||||
url: '/dengji/khghqkhjl',
|
||||
method: 'POST',
|
||||
data: {
|
||||
bankuai_id: this.data.xuanzhongBankuaiId || undefined,
|
||||
status: this.data.statusFilter || undefined,
|
||||
page: page,
|
||||
page_size: this.data.pageSize
|
||||
}
|
||||
});
|
||||
|
||||
this.setData({ isLoading: false, isLoadingMore: false });
|
||||
|
||||
if (res && res.data.code === 0) {
|
||||
const list = res.data.data.list || [];
|
||||
const hasMore = res.data.data.has_more;
|
||||
// 拼接头像
|
||||
const oss = this.data.ossImageUrl;
|
||||
const processedList = list.map(item => {
|
||||
let avatar = item.shenqingren_avatar || '';
|
||||
if (avatar && !avatar.startsWith('http')) {
|
||||
avatar = oss + avatar;
|
||||
}
|
||||
return { ...item, shenqingren_avatar: avatar };
|
||||
});
|
||||
const newList = isRefresh ? processedList : [...this.data.recordList, ...processedList];
|
||||
this.setData({ recordList: newList, page: page + 1, hasMore: hasMore });
|
||||
} else {
|
||||
wx.showToast({ title: '加载记录失败', icon: 'none' });
|
||||
}
|
||||
} catch (e) {
|
||||
this.setData({ isLoading: false, isLoadingMore: false });
|
||||
wx.showToast({ title: '网络错误', icon: 'none' });
|
||||
}
|
||||
},
|
||||
|
||||
// 上拉加载更多
|
||||
onReachBottom() {
|
||||
if (this.data.hasMore && !this.data.isLoading && !this.data.isLoadingMore) {
|
||||
this.loadRecords(false);
|
||||
}
|
||||
},
|
||||
|
||||
// 展开/收起详情
|
||||
toggleExpand(e) {
|
||||
const jiluId = e.currentTarget.dataset.id;
|
||||
// 确保 jiluId 是字符串
|
||||
const id = String(jiluId);
|
||||
const expandedIds = this.data.expandedIds.slice(); // 拷贝
|
||||
const index = expandedIds.indexOf(id);
|
||||
if (index > -1) {
|
||||
expandedIds.splice(index, 1);
|
||||
} else {
|
||||
expandedIds.push(id);
|
||||
}
|
||||
this.setData({ expandedIds });
|
||||
},
|
||||
|
||||
// 去评判(跳转考核打分页)
|
||||
goJudge(e) {
|
||||
const item = e.currentTarget.dataset.item;
|
||||
if (!item) return;
|
||||
wx.navigateTo({ url: '/pages/kaohe_dafen/kaohe_dafen?jilu_id=' + item.jilu_id });
|
||||
},
|
||||
|
||||
// 阻止冒泡
|
||||
noop() {}
|
||||
});
|
||||
9
miniprogram/pages/kaohe_jilu/kaohe_jilu.json
Normal file
9
miniprogram/pages/kaohe_jilu/kaohe_jilu.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"chenghao-tag": "/components/chenghao-tag/chenghao-tag",
|
||||
"global-notification": "/components/global-notification/global-notification"
|
||||
},
|
||||
"navigationBarTitleText": "考核记录",
|
||||
"navigationBarBackgroundColor": "#FDFBF7",
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
130
miniprogram/pages/kaohe_jilu/kaohe_jilu.wxml
Normal file
130
miniprogram/pages/kaohe_jilu/kaohe_jilu.wxml
Normal file
@@ -0,0 +1,130 @@
|
||||
<!-- pages/kaohe_jilu/kaohe_jilu.wxml -->
|
||||
<view class="page-root">
|
||||
<!-- 顶部筛选区 -->
|
||||
<view class="filter-bar">
|
||||
<!-- 板块筛选 -->
|
||||
<scroll-view class="module-scroll" scroll-x enhanced show-scrollbar="{{false}}">
|
||||
<view class="module-container">
|
||||
<view class="filter-item {{xuanzhongBankuaiId === 0 ? 'active' : ''}}"
|
||||
data-id="{{0}}" bindtap="selectModule">
|
||||
<text>全部板块</text>
|
||||
</view>
|
||||
<block wx:for="{{moduleList}}" wx:key="bankuai_id">
|
||||
<view class="filter-item {{xuanzhongBankuaiId === item.bankuai_id ? 'active' : ''}}"
|
||||
data-id="{{item.bankuai_id}}" bindtap="selectModule">
|
||||
<text>{{item.mingcheng}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 状态筛选 -->
|
||||
<view class="status-row">
|
||||
<view class="status-item {{statusFilter === 0 ? 'active' : ''}}" data-status="{{0}}" bindtap="selectStatus">全部</view>
|
||||
<view class="status-item {{statusFilter === 1 ? 'active' : ''}}" data-status="{{1}}" bindtap="selectStatus">审核中</view>
|
||||
<view class="status-item {{statusFilter === 2 ? 'active' : ''}}" data-status="{{2}}" bindtap="selectStatus">已通过</view>
|
||||
<view class="status-item {{statusFilter === 3 ? 'active' : ''}}" data-status="{{3}}" bindtap="selectStatus">未通过</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 列表区域 -->
|
||||
<view class="list-container">
|
||||
<scroll-view class="list-scroll" scroll-y enhanced show-scrollbar="{{false}}"
|
||||
bindscrolltolower="onReachBottom">
|
||||
<view class="record-list">
|
||||
<view wx:if="{{!isLoading && recordList.length === 0}}" class="empty-tip">暂无考核记录</view>
|
||||
|
||||
<block wx:for="{{recordList}}" wx:key="jilu_id">
|
||||
<view class="card">
|
||||
<!-- 头部信息 -->
|
||||
<view class="card-header">
|
||||
<image class="avatar" src="{{item.shenqingren_avatar}}" mode="aspectFill" />
|
||||
<view class="user-info">
|
||||
<text class="nickname">{{item.shenqingren_nicheng || '用户'}}</text>
|
||||
<text class="uid">UID {{item.shenqingren_id}}</text>
|
||||
</view>
|
||||
<view class="status-tag status-{{item.zhuangtai}}">
|
||||
{{item.zhuangtai == 0 ? '审核中' : (item.zhuangtai == 1 ? '已通过' : (item.zhuangtai == 2 ? '未通过' : '待审核'))}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 摘要信息 -->
|
||||
<view class="card-summary">
|
||||
<view class="summary-item">
|
||||
<text class="label">板块</text>
|
||||
<text class="value">{{item.bankuai_mingcheng}}</text>
|
||||
</view>
|
||||
<view class="summary-item">
|
||||
<text class="label">标签</text>
|
||||
<chenghao-tag mingcheng="{{item.chenghao_mingcheng}}" texiaoJson="{{item.chenghao_texiao_json}}" />
|
||||
</view>
|
||||
<view class="summary-item">
|
||||
<text class="label">次数</text>
|
||||
<text class="value">{{item.cishu}}次</text>
|
||||
</view>
|
||||
<view class="summary-item">
|
||||
<text class="label">总费用</text>
|
||||
<text class="value">¥{{item.total_fee}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 操作行 -->
|
||||
<view class="card-actions">
|
||||
<view class="expand-btn" data-id="{{item.jilu_id}}" bindtap="toggleExpand">
|
||||
{{expandedIds.indexOf(item.jilu_id) > -1 ? '收起详情' : '展开详情'}}
|
||||
</view>
|
||||
<view wx:if="{{item.zhuangtai == 0}}" class="judge-btn" data-item="{{item}}" bindtap="goJudge">
|
||||
去评判
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 展开的详细内容 -->
|
||||
<view class="card-detail" wx:if="{{expandedIds.indexOf(item.jilu_id) > -1}}">
|
||||
<view class="detail-section" wx:if="{{item.guize_neirong}}">
|
||||
<text class="detail-title">考核规则</text>
|
||||
<text class="detail-text">{{item.guize_neirong}}</text>
|
||||
</view>
|
||||
<view class="detail-section">
|
||||
<text class="detail-title">缴纳记录</text>
|
||||
<view wx:for="{{item.fee_list}}" wx:key="cishu" class="fee-row">
|
||||
<text>第{{item.cishu}}次:¥{{item.jine}}</text>
|
||||
</view>
|
||||
<text wx:if="{{!item.fee_list || item.fee_list.length === 0}}" class="detail-empty">暂无缴纳记录</text>
|
||||
</view>
|
||||
<view class="detail-section">
|
||||
<text class="detail-title">拒绝记录</text>
|
||||
<view wx:for="{{item.reject_list}}" wx:key="cishu" class="reject-row">
|
||||
<view class="reject-item">
|
||||
<text class="reject-time">{{item.create_time}}</text>
|
||||
<text class="reject-reason">第{{item.cishu}}次拒绝:{{item.yuanyin}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<text wx:if="{{!item.reject_list || item.reject_list.length === 0}}" class="detail-empty">暂无拒绝记录</text>
|
||||
</view>
|
||||
<view class="detail-section">
|
||||
<text class="detail-title">其他信息</text>
|
||||
<view class="info-grid">
|
||||
<text>打手游戏ID:{{item.dashou_youxi_id || '无'}}</text>
|
||||
<text>打手备注:{{item.dashou_beizhu || '无'}}</text>
|
||||
<text>审核官游戏ID:{{item.shenheguan_youxi_id || '无'}}</text>
|
||||
<text>创建时间:{{item.create_time}}</text>
|
||||
<text>更新时间:{{item.update_time}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<view wx:if="{{isLoadingMore}}" class="loading-more">加载更多...</view>
|
||||
<view wx:if="{{!hasMore && recordList.length > 0}}" class="no-more">—— 没有更多了 ——</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 加载遮罩 -->
|
||||
<view wx:if="{{isLoading && recordList.length === 0}}" class="loading-mask">
|
||||
<view class="loading-spinner"></view>
|
||||
<text>加载中...</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<global-notification id="global-notification" />
|
||||
263
miniprogram/pages/kaohe_jilu/kaohe_jilu.wxss
Normal file
263
miniprogram/pages/kaohe_jilu/kaohe_jilu.wxss
Normal file
@@ -0,0 +1,263 @@
|
||||
/* pages/kaohe_jilu/kaohe_jilu.wxss - 晨露微光风格(左右均等边距) */
|
||||
page {
|
||||
background: linear-gradient(135deg, #FDFBF7 0%, #F2EFE9 100%);
|
||||
color: #4A4A4A;
|
||||
font-family: 'SF Pro Display', 'PingFang SC', system-ui;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.page-root {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 筛选栏 */
|
||||
.filter-bar {
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
backdrop-filter: blur(20px);
|
||||
border-bottom: 1rpx solid rgba(0,0,0,0.04);
|
||||
flex-shrink: 0;
|
||||
padding: 20rpx 0 0;
|
||||
}
|
||||
|
||||
.module-scroll {
|
||||
white-space: nowrap;
|
||||
height: 70rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.module-container {
|
||||
display: inline-flex;
|
||||
gap: 20rpx;
|
||||
align-items: center;
|
||||
height: 70rpx;
|
||||
}
|
||||
|
||||
.filter-item {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 30rpx;
|
||||
height: 56rpx;
|
||||
border-radius: 28rpx;
|
||||
background: #F0EFEC;
|
||||
font-size: 26rpx;
|
||||
color: #6B6B6B;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.filter-item.active {
|
||||
background: #C8A27A;
|
||||
color: #FFFFFF;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 4rpx 12rpx rgba(200, 162, 122, 0.3);
|
||||
}
|
||||
|
||||
.status-row {
|
||||
display: flex;
|
||||
padding: 15rpx 30rpx 20rpx;
|
||||
gap: 30rpx;
|
||||
}
|
||||
.status-item {
|
||||
font-size: 26rpx;
|
||||
color: #8B8B8B;
|
||||
padding-bottom: 8rpx;
|
||||
border-bottom: 4rpx solid transparent;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.status-item.active {
|
||||
color: #C8A27A;
|
||||
border-bottom-color: #C8A27A;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* 列表容器 */
|
||||
.list-container {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
.list-scroll {
|
||||
height: 100%;
|
||||
padding: 20rpx 0; /* 上下内边距 */
|
||||
}
|
||||
|
||||
.empty-tip {
|
||||
text-align: center;
|
||||
color: #A0A0A0;
|
||||
font-size: 28rpx;
|
||||
padding-top: 200rpx;
|
||||
}
|
||||
|
||||
/* 卡片:统一左右边距 30rpx */
|
||||
.card {
|
||||
background: #FFFFFF;
|
||||
border-radius: 28rpx;
|
||||
padding: 30rpx;
|
||||
margin: 0 30rpx 24rpx 30rpx; /* 左右严格相等 */
|
||||
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.04);
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.avatar {
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 18rpx;
|
||||
border: 2rpx solid #F0EDE8;
|
||||
background: #F7F5F2;
|
||||
}
|
||||
.user-info {
|
||||
flex: 1;
|
||||
}
|
||||
.nickname {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #3A3A3A;
|
||||
display: block;
|
||||
}
|
||||
.uid {
|
||||
font-size: 24rpx;
|
||||
color: #9A9A9A;
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
.status-tag {
|
||||
font-size: 24rpx;
|
||||
padding: 6rpx 18rpx;
|
||||
border-radius: 20rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
.status-0 { background: #FFF3E0; color: #EF6C00; }
|
||||
.status-1 { background: #E8F5E9; color: #2E7D32; }
|
||||
.status-2 { background: #FFEBEE; color: #C62828; }
|
||||
.status-3 { background: #E3F2FD; color: #1565C0; }
|
||||
|
||||
.card-summary {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 16rpx 24rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.summary-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.summary-item .label {
|
||||
color: #8B8B8B;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.summary-item .value {
|
||||
color: #3A3A3A;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.card-actions {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-top: 20rpx;
|
||||
border-top: 1rpx solid #F5F2ED;
|
||||
}
|
||||
.expand-btn {
|
||||
font-size: 26rpx;
|
||||
color: #C8A27A;
|
||||
font-weight: 500;
|
||||
}
|
||||
.judge-btn {
|
||||
font-size: 26rpx;
|
||||
background: #C8A27A;
|
||||
color: #FFFFFF;
|
||||
padding: 8rpx 24rpx;
|
||||
border-radius: 24rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 展开详情(左右边距继承卡片,无需额外设置) */
|
||||
.card-detail {
|
||||
margin-top: 20rpx;
|
||||
padding-top: 20rpx;
|
||||
border-top: 1rpx solid #F5F2ED;
|
||||
}
|
||||
.detail-section {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.detail-title {
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
color: #5A5A5A;
|
||||
margin-bottom: 10rpx;
|
||||
display: block;
|
||||
}
|
||||
.detail-text {
|
||||
font-size: 24rpx;
|
||||
color: #6B6B6B;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.fee-row, .reject-row {
|
||||
font-size: 24rpx;
|
||||
color: #6B6B6B;
|
||||
padding: 6rpx 0;
|
||||
}
|
||||
.reject-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #FFF9F5;
|
||||
padding: 12rpx 16rpx;
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.reject-time {
|
||||
font-size: 22rpx;
|
||||
color: #B0A090;
|
||||
margin-bottom: 4rpx;
|
||||
}
|
||||
.reject-reason {
|
||||
font-size: 24rpx;
|
||||
color: #7A5A4A;
|
||||
}
|
||||
.detail-empty {
|
||||
font-size: 24rpx;
|
||||
color: #A0A0A0;
|
||||
padding: 8rpx 0;
|
||||
}
|
||||
.info-grid {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #6B6B6B;
|
||||
}
|
||||
|
||||
/* 加载 */
|
||||
.loading-more, .no-more {
|
||||
text-align: center;
|
||||
padding: 30rpx;
|
||||
font-size: 24rpx;
|
||||
color: #A0A0A0;
|
||||
}
|
||||
.loading-mask {
|
||||
position: fixed;
|
||||
top: 0; left: 0; right: 0; bottom: 0;
|
||||
background: rgba(253, 251, 247, 0.8);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 999;
|
||||
}
|
||||
.loading-spinner {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border: 4rpx solid #E0DDD5;
|
||||
border-top-color: #C8A27A;
|
||||
border-radius: 50%;
|
||||
animation: spin 0.8s linear infinite;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
Reference in New Issue
Block a user