员工端h5版本代码提交
This commit is contained in:
99
src/views/verify/VerifyView.vue
Normal file
99
src/views/verify/VerifyView.vue
Normal file
@@ -0,0 +1,99 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { showToast } from 'vant'
|
||||
import { Keyboard, QrCode, ScanLine } from 'lucide-vue-next'
|
||||
import { fetchOrderDetail } from '@/api/orders'
|
||||
|
||||
const router = useRouter()
|
||||
const orderId = ref('')
|
||||
const loading = ref(false)
|
||||
|
||||
const queryOrder = async () => {
|
||||
if (!orderId.value.trim()) {
|
||||
showToast('请输入订单号')
|
||||
return
|
||||
}
|
||||
loading.value = true
|
||||
try {
|
||||
const detail = await fetchOrderDetail(orderId.value.trim())
|
||||
router.push({
|
||||
path: '/verify/confirm',
|
||||
query: {
|
||||
orderId: detail.orderId,
|
||||
packageName: detail.commodityName
|
||||
}
|
||||
})
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const scanPlaceholder = () => {
|
||||
showToast('当前先按订单号核销,扫码入口已预留')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="page">
|
||||
<header class="page-header">
|
||||
<p class="page-kicker">商品核销</p>
|
||||
<h1 class="page-title">核销订单</h1>
|
||||
<p class="page-subtitle">输入订单号后核对商品与联系人信息,再确认核销。</p>
|
||||
</header>
|
||||
|
||||
<section class="scan-panel panel">
|
||||
<button class="scan-button" type="button" @click="scanPlaceholder">
|
||||
<QrCode :size="54" />
|
||||
<span>扫码核销</span>
|
||||
</button>
|
||||
</section>
|
||||
|
||||
<section class="panel form-panel">
|
||||
<h2 class="section-title">手动核销</h2>
|
||||
<van-field v-model="orderId" label="订单号" placeholder="请输入订单号" clearable>
|
||||
<template #left-icon><Keyboard :size="17" /></template>
|
||||
</van-field>
|
||||
<van-button block type="primary" :loading="loading" @click="queryOrder">
|
||||
<template #icon><ScanLine :size="18" /></template>
|
||||
查询订单
|
||||
</van-button>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.scan-panel {
|
||||
padding: 18px;
|
||||
background:
|
||||
linear-gradient(135deg, rgba(15, 139, 114, 0.12), rgba(243, 165, 29, 0.12)),
|
||||
var(--surface);
|
||||
}
|
||||
|
||||
.scan-button {
|
||||
display: grid;
|
||||
width: 100%;
|
||||
min-height: 156px;
|
||||
border: 1px dashed rgba(15, 139, 114, 0.45);
|
||||
border-radius: var(--radius);
|
||||
background: rgba(255, 255, 255, 0.78);
|
||||
color: var(--primary-deep);
|
||||
font-weight: 750;
|
||||
place-items: center;
|
||||
}
|
||||
|
||||
.scan-button span {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.form-panel {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.form-panel :deep(.van-cell) {
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user