feat: 核销码展示、备货进度静态

This commit is contained in:
2026-07-14 16:44:57 +08:00
parent 585fd6fb7e
commit 94f8297a01
6 changed files with 504 additions and 37 deletions
+37 -35
View File
@@ -38,23 +38,25 @@
<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 class="status" :class="{ statusWait: Number(item.status) === 1 }">
{{ item.statusName }}
</view>
<view class="time c_999 size24">
下单时间:{{ sheep.$helper.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM') }}
</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" />
<image class="thumb" :src="item.picUrl" mode="aspectFill" />
<view class="flex1">
<view class="name lineTwo">{{ item.name }}</view>
<view class="name lineTwo">{{ item.spuName }}</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 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 v-if="Number(item.status) === 0" class="btn btnPrimary" @tap="markPicked(item)">
标记已分拣
</view>
<view v-else-if="item.status === 'wait'" class="btn btnOutline" @tap="goScan">
<view v-else-if="Number(item.status) === 1" class="btn btnOutline" @tap="goScan">
去核销
</view>
</view>
@@ -68,7 +70,10 @@
<script setup>
import { computed, ref } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import modeSwitch from '@/components/mode_switch/mode_switch.vue';
import sheep from '@/sheep';
import OrderStoreApi from '@/sheep/api/trade/orderStore';
const tabs = [
{ label: '全部', value: 'all' },
@@ -79,50 +84,47 @@
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 list = ref([]);
const loading = ref(false);
const filteredList = computed(() => {
const k = String(keyword.value || '').trim();
return list.value.filter((item) => {
const hitTab = currentTab.value === 'all' || item.status === currentTab.value;
const s = Number(item.status);
const hitTab =
currentTab.value === 'all' ||
(currentTab.value === 'sorting' && s === 0) ||
(currentTab.value === 'wait' && s === 1);
if (!hitTab) return false;
if (!k) return true;
return (
String(item.orderNo).includes(k) ||
String(item.pickupCode).includes(k) ||
String(item.name).includes(k)
String(item.pickUpCode).includes(k) ||
String(item.spuName).includes(k)
);
});
});
const getList = async () => {
if (loading.value) return;
loading.value = true;
const { data, code } = await OrderStoreApi.getPendingList({});
loading.value = false;
if (code !== 0) return;
list.value = Array.isArray(data) ? data : [];
};
onShow(() => {
getList();
});
const goScan = () => {
uni.reLaunch({ url: '/pages/merchant/scanVerify' });
};
const markPicked = (item) => {
item.status = 'wait';
item.statusText = '待取货';
item.status = 1;
item.statusName = '待取货';
uni.showToast({ title: '已标记', icon: 'success' });
};
</script>