254 lines
5.9 KiB
Vue
254 lines
5.9 KiB
Vue
<template>
|
||
<s-layout
|
||
title="提货清单"
|
||
:showLeftButton="false"
|
||
tabbar="/pages/merchant/pickupList"
|
||
navPreset="light"
|
||
>
|
||
<template #navRight>
|
||
<modeSwitch />
|
||
</template>
|
||
<view class="page">
|
||
<view class="top-bar bg24">
|
||
<view class="tabs">
|
||
<view
|
||
v-for="item in tabs"
|
||
:key="item.value"
|
||
class="tab"
|
||
:class="{ tabActive: currentTab === item.value }"
|
||
@tap="currentTab = item.value"
|
||
>
|
||
{{ item.label }}
|
||
</view>
|
||
</view>
|
||
<view class="search-row">
|
||
<view class="search-box flex-center">
|
||
<uni-icons type="search" size="18" color="#8a8a8a" />
|
||
<uni-easyinput
|
||
class="search-input flex1"
|
||
v-model="keyword"
|
||
placeholder="搜索订单号/取货码/商品名称"
|
||
:inputBorder="false"
|
||
:styles="{ fontSize: '28rpx' }"
|
||
/>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="list">
|
||
<view v-for="item in filteredList" :key="item.id" class="card bg24">
|
||
<view class="card-hd flex-center ju-between">
|
||
<view class="status" :class="{ statusWait: item.status === 'wait' }">
|
||
{{ item.statusText }}
|
||
</view>
|
||
<view class="time c_999 size24">{{ item.time }}</view>
|
||
</view>
|
||
<view class="card-bd flex-center al-flex-start">
|
||
<image class="thumb" :src="item.pic" mode="aspectFill" />
|
||
<view class="flex1">
|
||
<view class="name lineTwo">{{ item.name }}</view>
|
||
<view class="meta c_999 size24 m-t-10">订单号:{{ item.orderNo }}</view>
|
||
<view class="meta c_999 size24 m-t-6">取货码:{{ item.pickupCode }}</view>
|
||
</view>
|
||
<view class="actions">
|
||
<view v-if="item.status === 'sorting'" class="btn btnPrimary" @tap="markPicked(item)">
|
||
标记已分拣
|
||
</view>
|
||
<view v-else-if="item.status === 'wait'" class="btn btnOutline" @tap="goScan">
|
||
去核销
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view v-if="filteredList.length === 0" class="empty c_999">暂无数据</view>
|
||
</view>
|
||
</view>
|
||
</s-layout>
|
||
</template>
|
||
|
||
<script setup>
|
||
import { computed, ref } from 'vue';
|
||
import modeSwitch from '@/components/mode_switch/mode_switch.vue';
|
||
|
||
const tabs = [
|
||
{ label: '全部', value: 'all' },
|
||
{ label: '待分拣', value: 'sorting' },
|
||
{ label: '待取货', value: 'wait' },
|
||
];
|
||
|
||
const currentTab = ref('all');
|
||
const keyword = ref('');
|
||
|
||
const list = ref([
|
||
{
|
||
id: 1,
|
||
status: 'sorting',
|
||
statusText: '待分拣',
|
||
time: '下单时间:2026-06-25 10:15',
|
||
name: 'Apple iPhone 15 Pro 256G 原色钛金属',
|
||
orderNo: 'ORD202406251022',
|
||
pickupCode: '882910',
|
||
pic: '/static/empty/goods-empty.png',
|
||
},
|
||
{
|
||
id: 2,
|
||
status: 'wait',
|
||
statusText: '待取货',
|
||
time: '下单时间:2026-06-25 09:10',
|
||
name: '索尼 WH-1000XM5 无线降噪耳机',
|
||
orderNo: 'ORD202406250915',
|
||
pickupCode: '127736',
|
||
pic: '/static/empty/goods-empty.png',
|
||
},
|
||
]);
|
||
|
||
const filteredList = computed(() => {
|
||
const k = String(keyword.value || '').trim();
|
||
return list.value.filter((item) => {
|
||
const hitTab = currentTab.value === 'all' || item.status === currentTab.value;
|
||
if (!hitTab) return false;
|
||
if (!k) return true;
|
||
return (
|
||
String(item.orderNo).includes(k) ||
|
||
String(item.pickupCode).includes(k) ||
|
||
String(item.name).includes(k)
|
||
);
|
||
});
|
||
});
|
||
|
||
const goScan = () => {
|
||
uni.reLaunch({ url: '/pages/merchant/scanVerify' });
|
||
};
|
||
|
||
const markPicked = (item) => {
|
||
item.status = 'wait';
|
||
item.statusText = '待取货';
|
||
uni.showToast({ title: '已标记', icon: 'success' });
|
||
};
|
||
</script>
|
||
|
||
<style scoped lang="scss">
|
||
.page {
|
||
padding: 24rpx 24rpx 170rpx;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.top-bar {
|
||
border-radius: 24rpx;
|
||
padding: 18rpx 20rpx 20rpx;
|
||
box-sizing: border-box;
|
||
margin-bottom: 18rpx;
|
||
}
|
||
|
||
.tabs {
|
||
display: flex;
|
||
gap: 12rpx;
|
||
margin-bottom: 16rpx;
|
||
}
|
||
|
||
.tab {
|
||
padding: 14rpx 22rpx;
|
||
border-radius: 16rpx;
|
||
background: #f2f4f7;
|
||
color: #333;
|
||
font-size: 26rpx;
|
||
}
|
||
|
||
.tabActive {
|
||
background: rgba(37, 86, 236, 0.12);
|
||
color: #2556ec;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.search-row {
|
||
width: 100%;
|
||
}
|
||
|
||
.search-box {
|
||
width: 100%;
|
||
border-radius: 18rpx;
|
||
background: #f6f7fb;
|
||
padding: 6rpx 16rpx;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
:deep(.search-input .uni-easyinput__content) {
|
||
background: transparent !important;
|
||
}
|
||
|
||
.list {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 18rpx;
|
||
}
|
||
|
||
.card {
|
||
border-radius: 24rpx;
|
||
padding: 18rpx 18rpx 20rpx;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.card-hd {
|
||
margin-bottom: 14rpx;
|
||
}
|
||
|
||
.status {
|
||
font-size: 24rpx;
|
||
color: #2556ec;
|
||
background: rgba(37, 86, 236, 0.12);
|
||
padding: 6rpx 14rpx;
|
||
border-radius: 14rpx;
|
||
}
|
||
|
||
.statusWait {
|
||
color: #6b4eff;
|
||
background: rgba(107, 78, 255, 0.12);
|
||
}
|
||
|
||
.thumb {
|
||
width: 140rpx;
|
||
height: 140rpx;
|
||
border-radius: 18rpx;
|
||
margin-right: 16rpx;
|
||
flex-shrink: 0;
|
||
background: #f2f4f7;
|
||
}
|
||
|
||
.name {
|
||
font-size: 28rpx;
|
||
color: #222;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.actions {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: flex-end;
|
||
gap: 12rpx;
|
||
flex-shrink: 0;
|
||
margin-left: 14rpx;
|
||
}
|
||
|
||
.btn {
|
||
padding: 14rpx 20rpx;
|
||
border-radius: 18rpx;
|
||
font-size: 24rpx;
|
||
line-height: 1;
|
||
}
|
||
|
||
.btnPrimary {
|
||
background: #2556ec;
|
||
color: #fff;
|
||
}
|
||
|
||
.btnOutline {
|
||
border: 2rpx solid rgba(37, 86, 236, 0.6);
|
||
color: #2556ec;
|
||
}
|
||
|
||
.empty {
|
||
text-align: center;
|
||
padding: 80rpx 0;
|
||
}
|
||
</style>
|