chore: prepare release build

This commit is contained in:
wushumin
2026-05-16 16:32:56 +08:00
parent dd56e0861b
commit deecb5d33e
28 changed files with 4396 additions and 361 deletions

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, ref } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { adminApi, type AdminOrderDetail } from "../../api/admin";
import { adminApi, type AdminFileAsset, type AdminOrderDetail } from "../../api/admin";
import { showErrorToast } from "../../utils/feedback";
const loading = ref(false);
@@ -9,10 +9,13 @@ const pageReady = ref(false);
const loadError = ref("");
const detail = ref<AdminOrderDetail | null>(null);
const orderId = ref(0);
const activeInboundVideo = ref<AdminFileAsset | null>(null);
const pageTitle = computed(() => detail.value?.order_info.order_no || "订单详情");
const timeline = computed(() => detail.value?.timeline || []);
const inboundAttachments = computed(() => detail.value?.inbound_attachments || []);
const internalTagNo = computed(() => detail.value?.transfer_flow?.internal_tag_no || detail.value?.order_info.internal_tag_no || "");
async function fetchDetail() {
if (!orderId.value) return;
@@ -47,6 +50,39 @@ function displayAddress(address?: { consignee?: string; mobile?: string; full_ad
return [address.consignee, address.mobile, address.full_address].filter(Boolean).join(" / ");
}
function isImageAsset(item: AdminFileAsset) {
return item.file_type === "image" || item.mime_type?.startsWith("image/");
}
function isVideoAsset(item: AdminFileAsset) {
return item.file_type === "video" || item.mime_type?.startsWith("video/");
}
function attachmentTypeLabel(item: AdminFileAsset) {
if (isImageAsset(item)) return "图片";
if (isVideoAsset(item)) return "视频";
return "附件";
}
function previewInboundAttachment(item: AdminFileAsset) {
if (isImageAsset(item)) {
const urls = inboundAttachments.value.filter(isImageAsset).map((asset) => asset.file_url);
uni.previewImage({ urls, current: item.file_url });
return;
}
if (isVideoAsset(item)) {
activeInboundVideo.value = item;
return;
}
uni.showToast({ title: "当前附件暂不支持预览", icon: "none" });
}
function closeInboundVideo() {
activeInboundVideo.value = null;
}
onLoad((options) => {
orderId.value = Number(options?.id || 0);
if (!orderId.value) {
@@ -98,6 +134,10 @@ onShow(() => {
<view class="meta-label">预计完成</view>
<view class="meta-value">{{ detail.order_info.estimated_finish_time || "-" }}</view>
</view>
<view v-if="internalTagNo" class="meta-item meta-item--wide">
<view class="meta-label">流转码编号</view>
<view class="meta-value transfer-code-value">{{ internalTagNo }}</view>
</view>
</view>
</view>
@@ -141,6 +181,39 @@ onShow(() => {
</view>
</view>
<view v-if="inboundAttachments.length" class="card">
<view class="row attachment-card-head">
<view class="attachment-card-copy">
<view class="card-title">入库附件</view>
<view class="card-desc">仓管入库时提交的拆包图片和视频可点击预览</view>
</view>
<text class="tag attachment-count">{{ inboundAttachments.length }}</text>
</view>
<view class="attachment-grid">
<view v-for="item in inboundAttachments" :key="item.file_url" class="attachment-tile">
<view class="attachment-preview" @click="previewInboundAttachment(item)">
<image v-if="isImageAsset(item)" class="attachment-thumb" :src="item.thumbnail_url || item.file_url" mode="aspectFill" />
<video
v-else-if="isVideoAsset(item)"
class="attachment-thumb attachment-video-thumb"
:src="item.file_url"
:controls="false"
:muted="true"
:show-center-play-btn="false"
:enable-progress-gesture="false"
object-fit="cover"
/>
<view v-else class="attachment-file-thumb">附件</view>
<view v-if="isVideoAsset(item)" class="attachment-play"></view>
</view>
<view class="attachment-meta">
<text class="attachment-name">{{ item.name || item.file_id }}</text>
<text class="attachment-type">{{ attachmentTypeLabel(item) }}</text>
</view>
</view>
</view>
</view>
<view v-if="detail.report_summary" class="card">
<view class="row">
<view>
@@ -177,6 +250,16 @@ onShow(() => {
</view>
</view>
</view>
<view v-if="activeInboundVideo" class="video-preview-mask" @click="closeInboundVideo">
<view class="video-preview-panel" @click.stop>
<view class="video-preview-head">
<text class="video-preview-title">{{ activeInboundVideo.name || "入库视频" }}</text>
<text class="video-preview-close" @click="closeInboundVideo">关闭</text>
</view>
<video class="video-preview-player" :src="activeInboundVideo.file_url" controls autoplay />
</view>
</view>
</template>
</view>
</template>
@@ -212,4 +295,166 @@ onShow(() => {
font-size: 24rpx;
line-height: 1.5;
}
.attachment-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 14rpx;
margin-top: 18rpx;
}
.meta-item--wide {
grid-column: 1 / -1;
}
.transfer-code-value {
color: var(--work-warning);
font-weight: 900;
word-break: break-all;
}
.attachment-card-head {
align-items: flex-start;
}
.attachment-card-copy {
flex: 1;
min-width: 0;
}
.attachment-count {
flex: 0 0 auto;
white-space: nowrap;
}
.attachment-tile {
min-width: 0;
}
.attachment-preview {
position: relative;
width: 100%;
aspect-ratio: 1;
overflow: hidden;
border: 1px solid var(--work-border);
border-radius: var(--work-radius-sm);
background: var(--work-card-muted);
}
.attachment-thumb {
display: block;
width: 100%;
height: 100%;
}
.attachment-video-thumb {
background: #202124;
}
.attachment-file-thumb {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
color: var(--work-text-soft);
font-size: 24rpx;
font-weight: 800;
}
.attachment-play {
position: absolute;
left: 50%;
top: 50%;
width: 54rpx;
height: 54rpx;
margin-left: -27rpx;
margin-top: -27rpx;
border-radius: 50%;
background: rgba(32, 33, 36, 0.72);
color: #ffffff;
font-size: 28rpx;
line-height: 54rpx;
text-align: center;
}
.attachment-meta {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
align-items: center;
gap: 8rpx;
margin-top: 8rpx;
}
.attachment-name {
min-width: 0;
overflow: hidden;
color: var(--work-text);
font-size: 22rpx;
font-weight: 700;
line-height: 1.35;
text-overflow: ellipsis;
white-space: nowrap;
}
.attachment-type {
min-height: 34rpx;
padding: 0 10rpx;
border-radius: var(--work-radius-pill);
background: var(--work-info-soft);
color: var(--work-info);
font-size: 20rpx;
font-weight: 700;
line-height: 34rpx;
}
.video-preview-mask {
position: fixed;
z-index: 20;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
padding: 32rpx;
background: rgba(0, 0, 0, 0.58);
}
.video-preview-panel {
width: 100%;
overflow: hidden;
border-radius: var(--work-radius);
background: #ffffff;
}
.video-preview-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 18rpx;
padding: 22rpx 24rpx;
}
.video-preview-title {
min-width: 0;
overflow: hidden;
color: var(--work-text);
font-size: 28rpx;
font-weight: 800;
text-overflow: ellipsis;
white-space: nowrap;
}
.video-preview-close {
flex: 0 0 auto;
color: var(--work-info);
font-size: 26rpx;
font-weight: 800;
}
.video-preview-player {
display: block;
width: 100%;
height: 58vh;
background: #000000;
}
</style>