feat: 核销api
This commit is contained in:
+227
-74
@@ -38,32 +38,34 @@
|
|||||||
<view class="list">
|
<view class="list">
|
||||||
<view v-for="item in displayList" :key="item.id" class="card bg24">
|
<view v-for="item in displayList" :key="item.id" class="card bg24">
|
||||||
<view class="card-hd flex-center ju-between">
|
<view class="card-hd flex-center ju-between">
|
||||||
|
<view class="status-wrap">
|
||||||
<view class="status" :class="{ statusWait: Number(item.status) === 1 }">
|
<view class="status" :class="{ statusWait: Number(item.status) === 1 }">
|
||||||
{{ item.statusName }}
|
{{ item.statusName }}
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="getOrderItems(item).length > 1" class="goods-total">
|
||||||
|
共{{ getOrderItems(item).length }}件
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="time c_999 size24">
|
<view class="time c_999 size24">
|
||||||
下单时间:{{ sheep.$helper.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM') }}
|
下单时间:{{ sheep.$helper.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM') }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="card-bd flex-center al-flex-start">
|
<view class="card-bd flex-center al-flex-start">
|
||||||
<view class="thumb-stack">
|
<view class="goods-thumb">
|
||||||
<view
|
<image
|
||||||
v-for="(pic, picIndex) in getStackPics(item)"
|
v-if="getItemPic(getMainItem(item))"
|
||||||
:key="`${item.orderId || item.id}-${picIndex}`"
|
class="goods-thumb__img"
|
||||||
class="thumb-card"
|
:src="getItemPic(getMainItem(item))"
|
||||||
:style="{ left: `${picIndex * 22}rpx`, zIndex: getStackPics(item).length - picIndex }"
|
mode="aspectFill"
|
||||||
>
|
/>
|
||||||
<image class="thumb-img" :src="resolvePicUrl(pic)" mode="aspectFill" />
|
<view v-else class="goods-thumb__empty">暂无图片</view>
|
||||||
</view>
|
|
||||||
<view v-if="!getStackPics(item).length" class="thumb-empty">
|
|
||||||
暂无图片
|
|
||||||
</view>
|
|
||||||
<view v-if="getPicCount(item) > 1" class="thumb-count">
|
|
||||||
{{ getPicCount(item) }}
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="flex1">
|
<view class="flex1">
|
||||||
<view class="name lineTwo">{{ getOrderTitle(item) }}</view>
|
<view class="name lineTwo">{{ getMainItem(item)?.spuName || '商品信息暂无' }}</view>
|
||||||
|
<view v-if="getItemSpec(getMainItem(item))" class="meta c_999 size24 m-t-8">
|
||||||
|
规格:{{ getItemSpec(getMainItem(item)) }}
|
||||||
|
</view>
|
||||||
|
<view class="meta c_999 size24 m-t-8">数量:x{{ getMainItem(item)?.count || 0 }}</view>
|
||||||
<view class="meta c_999 size24 m-t-10">订单号:{{ item.orderNo }}</view>
|
<view class="meta c_999 size24 m-t-10">订单号:{{ item.orderNo }}</view>
|
||||||
<view class="meta c_999 size24 m-t-6">取货码:{{ getPickUpCode(item) || '--' }}</view>
|
<view class="meta c_999 size24 m-t-6">取货码:{{ getPickUpCode(item) || '--' }}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -76,6 +78,49 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view
|
||||||
|
v-if="getExtraItems(item).length"
|
||||||
|
class="fold-box"
|
||||||
|
:class="{ 'fold-box--active': isExpanded(item) }"
|
||||||
|
>
|
||||||
|
<view class="fold-trigger" @tap="toggleExpand(item)">
|
||||||
|
<view class="fold-trigger__left">
|
||||||
|
<view class="fold-trigger__badge">{{ getExtraItems(item).length }}</view>
|
||||||
|
<view class="fold-trigger__text">
|
||||||
|
{{ isExpanded(item) ? '收起其他商品' : `展开其他${getExtraItems(item).length}件商品` }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="fold-trigger__icon" :class="{ 'fold-trigger__icon--active': isExpanded(item) }">
|
||||||
|
<uni-icons
|
||||||
|
:type="isExpanded(item) ? 'top' : 'bottom'"
|
||||||
|
size="14"
|
||||||
|
color="#7b8494"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="isExpanded(item)" class="fold-panel">
|
||||||
|
<view
|
||||||
|
v-for="(goods, goodsIndex) in getExtraItems(item)"
|
||||||
|
:key="goods.orderItemId || goodsIndex"
|
||||||
|
class="fold-item"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
v-if="getItemPic(goods)"
|
||||||
|
class="fold-item__img"
|
||||||
|
:src="getItemPic(goods)"
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
<view v-else class="fold-item__empty">暂无图片</view>
|
||||||
|
<view class="fold-item__info">
|
||||||
|
<view class="fold-item__name lineTwo">{{ goods.spuName || '商品信息暂无' }}</view>
|
||||||
|
<view v-if="getItemSpec(goods)" class="meta c_999 size24 m-t-8">
|
||||||
|
规格:{{ getItemSpec(goods) }}
|
||||||
|
</view>
|
||||||
|
<view class="meta c_999 size24 m-t-8">数量:x{{ goods.count || 0 }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="displayList.length === 0" class="empty c_999">暂无数据</view>
|
<view v-if="displayList.length === 0" class="empty c_999">暂无数据</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -101,6 +146,7 @@
|
|||||||
|
|
||||||
const list = ref([]);
|
const list = ref([]);
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
const expandedMap = ref({});
|
||||||
const userStore = sheep.$store('user');
|
const userStore = sheep.$store('user');
|
||||||
|
|
||||||
const displayList = computed(() => list.value);
|
const displayList = computed(() => list.value);
|
||||||
@@ -166,34 +212,40 @@
|
|||||||
return Array.isArray(item?.items) ? item.items.filter(Boolean) : [];
|
return Array.isArray(item?.items) ? item.items.filter(Boolean) : [];
|
||||||
};
|
};
|
||||||
|
|
||||||
const getPicList = (item) => {
|
const getMainItem = (item) => {
|
||||||
const pics = getOrderItems(item)
|
return getOrderItems(item)[0] || null;
|
||||||
.map((it) => sanitizeText(it?.picUrl))
|
|
||||||
.filter(Boolean);
|
|
||||||
const fallback = sanitizeText(item?.picUrl);
|
|
||||||
return pics.length ? pics : [fallback].filter(Boolean);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getStackPics = (item) => {
|
const getExtraItems = (item) => {
|
||||||
return getPicList(item).slice(0, 3);
|
return getOrderItems(item).slice(1);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getPicCount = (item) => {
|
const getItemPic = (goods) => {
|
||||||
return getPicList(item).length;
|
const text = sanitizeText(goods?.picUrl);
|
||||||
};
|
|
||||||
|
|
||||||
const resolvePicUrl = (url) => {
|
|
||||||
const text = sanitizeText(url);
|
|
||||||
if (!text) return '';
|
if (!text) return '';
|
||||||
if (/^https?:\/\//i.test(text)) return text;
|
if (/^https?:\/\//i.test(text)) return text;
|
||||||
return sheep.$url.cdn(text);
|
return sheep.$url.cdn(text);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getOrderTitle = (item) => {
|
const getItemSpec = (goods) => {
|
||||||
const firstName = getOrderItems(item)[0]?.spuName || item?.spuName || '';
|
return goods?.spec || '';
|
||||||
const totalCount = Number(item?.totalCount || getOrderItems(item).length || 0);
|
};
|
||||||
if (!firstName) return '商品信息暂无';
|
|
||||||
return totalCount > 1 ? `${firstName} 等${totalCount}件商品` : firstName;
|
const getExpandKey = (item) => {
|
||||||
|
return String(item?.orderId || item?.id || '');
|
||||||
|
};
|
||||||
|
|
||||||
|
const isExpanded = (item) => {
|
||||||
|
return Boolean(expandedMap.value[getExpandKey(item)]);
|
||||||
|
};
|
||||||
|
|
||||||
|
const toggleExpand = (item) => {
|
||||||
|
const key = getExpandKey(item);
|
||||||
|
if (!key) return;
|
||||||
|
expandedMap.value = {
|
||||||
|
...expandedMap.value,
|
||||||
|
[key]: !expandedMap.value[key],
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const getPickUpCode = (item) => {
|
const getPickUpCode = (item) => {
|
||||||
@@ -288,6 +340,13 @@
|
|||||||
margin-bottom: 14rpx;
|
margin-bottom: 14rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.status-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10rpx;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.status {
|
.status {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #2556ec;
|
color: #2556ec;
|
||||||
@@ -301,37 +360,32 @@
|
|||||||
background: rgba(107, 78, 255, 0.12);
|
background: rgba(107, 78, 255, 0.12);
|
||||||
}
|
}
|
||||||
|
|
||||||
.thumb-stack {
|
.goods-total {
|
||||||
width: 184rpx;
|
font-size: 22rpx;
|
||||||
|
color: #8a8a8a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-thumb {
|
||||||
|
width: 140rpx;
|
||||||
height: 140rpx;
|
height: 140rpx;
|
||||||
margin-right: 16rpx;
|
margin-right: 16rpx;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.thumb-card {
|
.goods-thumb__img,
|
||||||
position: absolute;
|
.goods-thumb__empty {
|
||||||
top: 0;
|
|
||||||
width: 140rpx;
|
|
||||||
height: 140rpx;
|
|
||||||
border-radius: 18rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
background: #f2f4f7;
|
|
||||||
box-shadow: 0 6rpx 18rpx rgba(0, 0, 0, 0.08);
|
|
||||||
border: 2rpx solid rgba(255, 255, 255, 0.9);
|
|
||||||
}
|
|
||||||
|
|
||||||
.thumb-img {
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
border-radius: 18rpx;
|
||||||
|
background: #f2f4f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-thumb__img {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.thumb-empty {
|
.goods-thumb__empty {
|
||||||
width: 140rpx;
|
|
||||||
height: 140rpx;
|
|
||||||
border-radius: 18rpx;
|
|
||||||
background: #f2f4f7;
|
|
||||||
color: #bbb;
|
color: #bbb;
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -341,25 +395,6 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.thumb-count {
|
|
||||||
position: absolute;
|
|
||||||
right: 45rpx;
|
|
||||||
bottom: 0;
|
|
||||||
min-width: 36rpx;
|
|
||||||
height: 36rpx;
|
|
||||||
padding: 0 10rpx;
|
|
||||||
font-size: 22rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border-radius: 18rpx;
|
|
||||||
color: rgba(0, 0, 0, 0.75);
|
|
||||||
background: rgba(255, 255, 255, 0.7);
|
|
||||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
||||||
z-index: 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #222;
|
color: #222;
|
||||||
@@ -392,6 +427,124 @@
|
|||||||
color: #2556ec;
|
color: #2556ec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fold-box {
|
||||||
|
margin-top: 16rpx;
|
||||||
|
border-radius: 18rpx;
|
||||||
|
background: #f7f8fc;
|
||||||
|
border: 2rpx solid #eef1f6;
|
||||||
|
overflow: hidden;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-box--active {
|
||||||
|
background: #f5f7ff;
|
||||||
|
border-color: rgba(37, 86, 236, 0.18);
|
||||||
|
box-shadow: 0 8rpx 24rpx rgba(37, 86, 236, 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-trigger {
|
||||||
|
padding: 18rpx 20rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-trigger__left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
min-width: 0;
|
||||||
|
gap: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-trigger__badge {
|
||||||
|
min-width: 36rpx;
|
||||||
|
height: 36rpx;
|
||||||
|
padding: 0 10rpx;
|
||||||
|
border-radius: 999rpx;
|
||||||
|
background: rgba(37, 86, 236, 0.12);
|
||||||
|
color: #2556ec;
|
||||||
|
font-size: 22rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-trigger__text {
|
||||||
|
font-size: 25rpx;
|
||||||
|
color: #4d5562;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-trigger__icon {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
background: #fff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-shrink: 0;
|
||||||
|
border: 2rpx solid #eceff5;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-trigger__icon--active {
|
||||||
|
background: rgba(37, 86, 236, 0.1);
|
||||||
|
border-color: rgba(37, 86, 236, 0.14);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-panel {
|
||||||
|
padding: 0 20rpx 18rpx;
|
||||||
|
border-top: 2rpx dashed #e6ebf4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
padding-top: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-item + .fold-item {
|
||||||
|
margin-top: 16rpx;
|
||||||
|
padding-top: 16rpx;
|
||||||
|
border-top: 2rpx solid #eceff5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-item__img,
|
||||||
|
.fold-item__empty {
|
||||||
|
width: 104rpx;
|
||||||
|
height: 104rpx;
|
||||||
|
border-radius: 14rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
background: #f2f4f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-item__img {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-item__empty {
|
||||||
|
color: #bbb;
|
||||||
|
font-size: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border: 2rpx dashed #e3e6ee;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-item__info {
|
||||||
|
margin-left: 16rpx;
|
||||||
|
min-width: 0;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-item__name {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #222;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
.empty {
|
.empty {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 80rpx 0;
|
padding: 80rpx 0;
|
||||||
|
|||||||
@@ -26,7 +26,9 @@
|
|||||||
<view class="scan-tip c_999 size24">或点击下方按钮开始扫码</view>
|
<view class="scan-tip c_999 size24">或点击下方按钮开始扫码</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btnScan" @tap="startScan">开始扫码</view>
|
<view class="btnScan" :class="{ btnScanDisabled: verifying }" @tap="startScan">
|
||||||
|
{{ verifying ? '核销中...' : '开始扫码' }}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="panel bg24" v-else>
|
<view class="panel bg24" v-else>
|
||||||
@@ -39,7 +41,9 @@
|
|||||||
:styles="{ fontSize: '34rpx' }"
|
:styles="{ fontSize: '34rpx' }"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="btnScan" @tap="confirmManual">确认核销</view>
|
<view class="btnScan" :class="{ btnScanDisabled: verifying }" @tap="confirmManual">
|
||||||
|
{{ verifying ? '核销中...' : '确认核销' }}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="records bg24">
|
<view class="records bg24">
|
||||||
@@ -63,9 +67,13 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import modeSwitch from '@/components/mode_switch/mode_switch.vue';
|
import modeSwitch from '@/components/mode_switch/mode_switch.vue';
|
||||||
|
import sheep from '@/sheep';
|
||||||
|
import OrderStoreApi from '@/sheep/api/trade/orderStore';
|
||||||
|
|
||||||
const tab = ref('scan');
|
const tab = ref('scan');
|
||||||
const manualCode = ref('');
|
const manualCode = ref('');
|
||||||
|
const verifying = ref(false);
|
||||||
|
const userStore = sheep.$store('user');
|
||||||
|
|
||||||
const STORAGE_KEY = 'merchant.verify.records';
|
const STORAGE_KEY = 'merchant.verify.records';
|
||||||
const records = ref(uni.getStorageSync(STORAGE_KEY) || []);
|
const records = ref(uni.getStorageSync(STORAGE_KEY) || []);
|
||||||
@@ -84,17 +92,50 @@
|
|||||||
uni.setStorageSync(STORAGE_KEY, next);
|
uni.setStorageSync(STORAGE_KEY, next);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getVerifyIds = async () => {
|
||||||
|
const localIds = Array.isArray(userStore?.userInfo?.ids) ? userStore.userInfo.ids : [];
|
||||||
|
if (localIds.length) return localIds;
|
||||||
|
const userInfo = await userStore.getInfo();
|
||||||
|
return Array.isArray(userInfo?.ids) ? userInfo.ids : [];
|
||||||
|
};
|
||||||
|
|
||||||
|
const verifyCode = async (code) => {
|
||||||
|
const pickUpVerifyCode = String(code || '').trim();
|
||||||
|
if (!pickUpVerifyCode) {
|
||||||
|
uni.showToast({ title: '核销码不能为空', icon: 'none' });
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (verifying.value) return false;
|
||||||
|
const ids = await getVerifyIds();
|
||||||
|
if (!ids.length) {
|
||||||
|
uni.showToast({ title: '缺少核销ids', icon: 'none' });
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
verifying.value = true;
|
||||||
|
try {
|
||||||
|
const { code: resCode } = await OrderStoreApi.verify(ids, pickUpVerifyCode);
|
||||||
|
if (resCode !== 0) return false;
|
||||||
|
pushRecord(pickUpVerifyCode);
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
uni.showToast({ title: '核销失败,请稍后重试', icon: 'none' });
|
||||||
|
return false;
|
||||||
|
} finally {
|
||||||
|
verifying.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const startScan = () => {
|
const startScan = () => {
|
||||||
|
if (verifying.value) return;
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
scanType: ['qrCode', 'barCode'],
|
scanType: ['qrCode', 'barCode'],
|
||||||
success: (res) => {
|
success: async (res) => {
|
||||||
const code = String(res.result || '').trim();
|
const code = String(res.result || '').trim();
|
||||||
if (!code) {
|
if (!code) {
|
||||||
uni.showToast({ title: '未识别到内容', icon: 'none' });
|
uni.showToast({ title: '未识别到内容', icon: 'none' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pushRecord(code);
|
await verifyCode(code);
|
||||||
uni.showToast({ title: '核销成功', icon: 'success' });
|
|
||||||
},
|
},
|
||||||
fail: () => {
|
fail: () => {
|
||||||
uni.showToast({ title: '扫码失败', icon: 'none' });
|
uni.showToast({ title: '扫码失败', icon: 'none' });
|
||||||
@@ -102,15 +143,16 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const confirmManual = () => {
|
const confirmManual = async () => {
|
||||||
const code = String(manualCode.value || '').trim();
|
const code = String(manualCode.value || '').trim();
|
||||||
if (!code) {
|
if (!code) {
|
||||||
uni.showToast({ title: '请输入取货码', icon: 'none' });
|
uni.showToast({ title: '请输入取货码', icon: 'none' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pushRecord(code);
|
const success = await verifyCode(code);
|
||||||
|
if (success) {
|
||||||
manualCode.value = '';
|
manualCode.value = '';
|
||||||
uni.showToast({ title: '核销成功', icon: 'success' });
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const clear = () => {
|
const clear = () => {
|
||||||
@@ -198,6 +240,10 @@
|
|||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btnScanDisabled {
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
.input-row {
|
.input-row {
|
||||||
border-radius: 24rpx;
|
border-radius: 24rpx;
|
||||||
background: #f6f7fb;
|
background: #f6f7fb;
|
||||||
|
|||||||
@@ -35,6 +35,21 @@ const OrderStoreApi = {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
verify: (ids, pickUpVerifyCode) => {
|
||||||
|
const idText = Array.isArray(ids) ? ids.filter(Boolean).join(',') : String(ids || '');
|
||||||
|
return request({
|
||||||
|
url: '/trade/order-store/staff/verify',
|
||||||
|
method: 'PUT',
|
||||||
|
params: {
|
||||||
|
ids: idText,
|
||||||
|
pickUpVerifyCode: String(pickUpVerifyCode || '').trim(),
|
||||||
|
},
|
||||||
|
custom: {
|
||||||
|
showSuccess: true,
|
||||||
|
successMsg: '核销成功',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default OrderStoreApi;
|
export default OrderStoreApi;
|
||||||
|
|||||||
Reference in New Issue
Block a user