新增复核列表页面

This commit is contained in:
zm2000 2026-07-17 16:05:58 +08:00
parent 4002c9feeb
commit 788ee2e1e4
2 changed files with 597 additions and 0 deletions

View File

@ -216,6 +216,13 @@
"titleNView": false
}
},
{
"path" : "pages/work/order/orderReviewList",
"style" :
{
"titleNView": false
}
},
{
"path" : "pages/work/order/weighing",
"style" :

View File

@ -0,0 +1,590 @@
<template>
<view class="review-list-page">
<!-- 顶部栏 -->
<view class="top-bar">
<view class="status-bar"></view>
<view class="header">
<view class="header-left">
<view class="header-left__back" @click="handleBack">
<u-icon name="arrow-left" size="36rpx" color="#303133"></u-icon>
</view>
<view class="header-left__divider"></view>
<view class="scan-toggle-btn" @click="toggleScanInput">
<text class="scan-toggle-btn__text">{{ scanInputOpen ? '关闭扫码' : '扫码' }}</text>
</view>
</view>
<text class="header-title">复核列表</text>
<view class="header-right"></view>
</view>
</view>
<!-- 扫码输入区 -->
<view v-if="scanInputOpen" class="scan-section">
<view class="scan-row">
<input
class="scan-input"
v-model="scanKeyword"
:focus="inputFocus"
placeholder="扫描/输入快递单号"
placeholder-style="color:#c0c4cc;font-size:32rpx"
@confirm="handleScanConfirm"
/>
<view class="scan-camera-btn" @click="handleCameraScan">
<u-icon name="scan" size="34rpx" color="#2979ff"></u-icon>
</view>
</view>
</view>
<!-- 模式切换条 -->
<view class="content-box">
<view class="mode-switch-bar">
<view
class="mode-switch-item"
:class="{ 'mode-switch-item--active': currentMode === 'scatter' }"
@click="handleModeChange('scatter')"
>
<text class="mode-switch-item__text">散单模式</text>
</view>
<view
class="mode-switch-item"
:class="{ 'mode-switch-item--active': currentMode === 'group' }"
@click="handleModeChange('group')"
>
<text class="mode-switch-item__text">团购模式</text>
</view>
</view>
</view>
<!-- 待复核 / 已复核 子标签 -->
<view class="sub-tabs">
<view class="sub-switch-bar">
<view
class="sub-switch-item"
:class="{ 'sub-switch-item--active': currentSubTab === 0 }"
@click="handleSubTabChange(0)"
>
<text class="sub-switch-item__text">待复核列表</text>
</view>
<view
class="sub-switch-item"
:class="{ 'sub-switch-item--active': currentSubTab === 1 }"
@click="handleSubTabChange(1)"
>
<text class="sub-switch-item__text">已复核列表</text>
</view>
</view>
</view>
<!-- 列表内容 -->
<scroll-view class="detail-scroll" scroll-y>
<view v-if="listData.length === 0" class="empty-state">
<u-icon name="list" size="86" color="#c0c4cc"></u-icon>
<text class="empty-text">{{ currentSubTab === 0 ? '暂无待复核订单' : '暂无已复核订单' }}</text>
</view>
<view v-else class="record-list">
<view
v-for="item in listData"
:key="item.id"
class="record-item"
:class="{ 'record-item--reviewed': currentSubTab === 1 }"
>
<view class="record-main">
<view class="record-left">
<view class="record-line">
<text class="record-label">订单号:</text>
<text class="record-value">{{ item.orderNo || '--' }}</text>
</view>
<view class="record-line">
<text class="record-label">快递单号:</text>
<text class="record-value">{{ item.waybillNo || '--' }}</text>
</view>
<view class="record-line record-line--split">
<view class="record-half">
<text class="record-half-label">商品数:</text>
<text class="record-half-value">{{ item.goodsCount || 0 }}</text>
</view>
<view class="record-half">
<text class="record-half-label">数量:</text>
<text class="record-half-value">{{ item.totalQty || 0 }}</text>
</view>
</view>
</view>
<view class="record-right">
<text
class="record-status"
:class="currentSubTab === 0 ? 'record-status--pending' : 'record-status--done'"
>{{ currentSubTab === 0 ? '待复核' : '已复核' }}</text>
</view>
</view>
<view class="record-footer">
<text class="record-time">{{ item.reviewTime || item.createTime || '--' }}</text>
<view v-if="currentSubTab === 0" class="record-actions">
<u-button
type="primary"
size="mini"
:customStyle="{ backgroundColor: '#e74c3c', borderColor: '#e74c3c', fontSize: '26rpx', height: '60rpx', lineHeight: '60rpx', padding: '0 20rpx' }"
@click="handleStartReview(item)"
>
开始复核
</u-button>
</view>
</view>
</view>
</view>
<view class="safe-area-bottom"></view>
</scroll-view>
<!-- 分页 -->
<view class="pagination-wrap">
<pagination
:pageNum.sync="currentPage"
:pageSize="pageSize"
:total="paginationTotal"
:showTotal="true"
:prevText="'上一页'"
:nextText="'下一页'"
:showFirstLast="true"
:firstText="'首页'"
:lastText="'末页'"
@change="handlePageChange"
/>
</view>
</view>
</template>
<script>
export default {
data() {
return {
scanInputOpen: false,
inputFocus: false,
scanKeyword: '',
currentMode: 'scatter',
currentSubTab: 0,
keyword: '',
listData: [],
currentPage: 1,
pageSize: 20,
paginationTotal: 0
};
},
created() {
this.fetchList();
},
methods: {
handleBack() {
uni.navigateBack({ delta: 1 });
},
toggleScanInput() {
this.scanInputOpen = !this.scanInputOpen;
if (this.scanInputOpen) {
this.$nextTick(() => { this.inputFocus = true; });
}
},
handleCameraScan() {
uni.scanCode({
onlyFromCamera: true,
scanType: ['barCode', 'qrCode', 'datamatrix', 'pdf417'],
success: (res) => {
const code = String(res?.result || '').trim();
if (!code) return;
this.doSearch(code);
},
fail: () => {}
});
},
handleScanConfirm() {
const keyword = String(this.scanKeyword || '').trim();
if (!keyword) return;
this.scanKeyword = '';
this.doSearch(keyword);
},
doSearch(keyword) {
this.keyword = keyword;
this.currentPage = 1;
this.fetchList();
},
handleModeChange(mode) {
if (this.currentMode === mode) return;
this.currentMode = mode;
this.currentPage = 1;
this.fetchList();
},
handleSubTabChange(index) {
this.currentSubTab = index;
this.currentPage = 1;
this.fetchList();
},
clearSearch() {
this.keyword = '';
this.currentPage = 1;
this.fetchList();
},
fetchList() {
const params = {
mode: this.currentMode,
status: this.currentSubTab === 0 ? 'pending' : 'reviewed',
keyword: this.keyword,
page: this.currentPage,
pageSize: this.pageSize
};
console.log('[orderReviewList] fetchList params:', params);
// TODO: 对接实际API接口,更新 listData 和 paginationTotal
},
handlePageChange(page) {
this.currentPage = page;
this.fetchList();
},
handleStartReview(item) {
uni.navigateTo({
url: `/pages/work/order/order-review?orderId=${item.id}&mode=${this.currentMode}`
});
}
}
};
</script>
<style lang="scss" scoped>
.review-list-page {
height: 100vh;
background: #f8f9fa;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* ===== 顶部栏 ===== */
.top-bar {
background: #ffffff;
flex-shrink: 0;
}
.status-bar {
height: var(--status-bar-height, 44rpx);
}
.header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 24rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.header-left {
display: flex;
align-items: center;
gap: 12rpx;
min-width: 100rpx;
}
.header-left__back {
display: flex;
align-items: center;
justify-content: center;
width: 56rpx;
height: 56rpx;
}
.header-left__divider {
width: 1rpx;
height: 32rpx;
background: #dcdfe6;
}
.header-title {
flex: 1;
padding: 0 16rpx;
font-size: 32rpx;
font-weight: bold;
color: #333;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.header-right {
min-width: 100rpx;
display: flex;
justify-content: flex-end;
}
/* 扫码开关按钮(头部) */
.scan-toggle-btn {
display: flex;
align-items: center;
justify-content: center;
width: 120rpx;
height: 52rpx;
background: #2979ff;
border-radius: 8rpx;
}
.scan-toggle-btn__text {
font-size: 28rpx;
color: #ffffff;
white-space: nowrap;
}
/* ===== 扫码输入区 ===== */
.scan-section {
padding: 20rpx 24rpx;
background: #ffffff;
border-bottom: 1rpx solid #f0f0f0;
flex-shrink: 0;
}
.scan-row {
display: flex;
align-items: center;
gap: 12rpx;
}
.scan-input {
flex: 1;
height: 80rpx;
background: #f5f5f5;
border: 2rpx solid #dcdfe6;
border-radius: 12rpx;
padding: 0 20rpx;
font-size: 32rpx;
color: #303133;
}
.scan-camera-btn {
flex-shrink: 0;
width: 72rpx;
height: 72rpx;
display: flex;
align-items: center;
justify-content: center;
background: #f0f7ff;
border: 2rpx solid #2979ff;
border-radius: 12rpx;
}
.scan-camera-btn:active {
opacity: 0.7;
}
/* ===== 模式切换条 ===== */
.content-box {
padding: 20rpx 24rpx 0;
flex-shrink: 0;
}
.mode-switch-bar {
display: flex;
gap: 0;
border-radius: 12rpx;
overflow: hidden;
border: 2rpx solid #e74c3c;
}
.mode-switch-item {
flex: 1;
text-align: center;
padding: 20rpx 0;
background: #ffffff;
transition: all 0.2s;
}
.mode-switch-item--active {
background: #e74c3c;
}
.mode-switch-item__text {
font-size: 32rpx;
color: #303133;
font-weight: 500;
}
.mode-switch-item--active .mode-switch-item__text {
color: #ffffff;
}
/* ===== 子标签切换条 ===== */
.sub-tabs {
padding: 16rpx 24rpx 0;
flex-shrink: 0;
}
.sub-switch-bar {
display: flex;
gap: 0;
border-radius: 12rpx;
overflow: hidden;
border: 2rpx solid #2979ff;
}
.sub-switch-item {
flex: 1;
text-align: center;
padding: 16rpx 0;
background: #ffffff;
transition: all 0.2s;
}
.sub-switch-item--active {
background: #2979ff;
}
.sub-switch-item__text {
font-size: 32rpx;
color: #303133;
font-weight: 500;
}
.sub-switch-item--active .sub-switch-item__text {
color: #ffffff;
}
/* ===== 列表 ===== */
.detail-scroll {
flex: 1;
min-height: 0;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
padding: 16rpx 24rpx;
box-sizing: border-box;
}
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: 200rpx;
}
.empty-text {
font-size: 28rpx;
color: #909399;
margin-top: 20rpx;
}
.record-list {
display: flex;
flex-direction: column;
gap: 16rpx;
}
.record-item {
background: #ffffff;
border-radius: 12rpx;
padding: 24rpx;
border: 1rpx solid #ebeef5;
}
.record-item--reviewed {
background: #f9f9f9;
border-color: #e0e0e0;
}
.record-main {
display: flex;
justify-content: space-between;
}
.record-left {
flex: 1;
min-width: 0;
}
.record-line {
margin-bottom: 12rpx;
display: flex;
align-items: center;
}
.record-line--split {
display: flex;
gap: 24rpx;
}
.record-half {
display: flex;
align-items: center;
}
.record-half-label {
font-size: 26rpx;
color: #909399;
}
.record-half-value {
font-size: 26rpx;
color: #303133;
font-weight: 500;
}
.record-label {
font-size: 26rpx;
color: #909399;
flex-shrink: 0;
}
.record-value {
font-size: 28rpx;
color: #303133;
font-weight: 500;
}
.record-right {
flex-shrink: 0;
margin-left: 20rpx;
display: flex;
flex-direction: column;
align-items: flex-end;
justify-content: center;
}
.record-status {
font-size: 28rpx;
font-weight: 600;
padding: 6rpx 16rpx;
border-radius: 8rpx;
}
.record-status--pending {
color: #e6a23c;
background: #fdf6ec;
}
.record-status--done {
color: #67c23a;
background: #f0f9eb;
}
.record-footer {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 16rpx;
padding-top: 16rpx;
border-top: 1rpx solid #f0f0f0;
}
.record-time {
font-size: 24rpx;
color: #c0c4cc;
}
.record-actions {
display: flex;
gap: 16rpx;
}
/* ===== 分页 ===== */
.pagination-wrap {
background: #ffffff;
padding: 16rpx 24rpx;
border-top: 1rpx solid #ebeef5;
flex-shrink: 0;
}
.safe-area-bottom {
height: 20rpx;
}
</style>