feat: 新增订单api
This commit is contained in:
+153
-14
@@ -59,6 +59,14 @@
|
||||
下单时间:{{ sheep.$helper.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM') }}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="getReceiverName(item) || getMaskedReceiverMobile(item)" class="buyer-top">
|
||||
<view class="buyer-top__left">
|
||||
<text v-if="getReceiverName(item)" class="buyer-top__name">{{ getReceiverName(item) }}</text>
|
||||
<text v-if="getMaskedReceiverMobile(item)" class="buyer-top__mobile">
|
||||
{{ getMaskedReceiverMobile(item) }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-bd flex-center al-flex-start">
|
||||
<view class="goods-thumb">
|
||||
<image
|
||||
@@ -75,15 +83,27 @@
|
||||
规格:{{ 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="order-no-row c_999 size24 m-t-10">
|
||||
<text class="order-no-row__text">订单号:{{ item.orderNo || '--' }}</text>
|
||||
<view v-if="item.orderNo" class="order-no-row__copy" @tap.stop="copyOrderNo(item.orderNo)">
|
||||
<image class="order-no-row__copy-icon" :src="`${$url}goods/copy2.svg`" mode="scaleToFill" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="actions">
|
||||
<view v-if="Number(item.status) === 0" class="btn btnPrimary" @tap="markPicked(item)">
|
||||
标记已分拣
|
||||
</view>
|
||||
<view v-else-if="Number(item.status) === 1" class="btn btnOutline" @tap="goScan">
|
||||
去核销
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="getReceiverMobileDigits(item) || Number(item.status) === 0 || Number(item.status) === 1"
|
||||
class="actions"
|
||||
>
|
||||
<view v-if="getReceiverMobileDigits(item)" class="btn btnGhost" @tap.stop="callReceiver(item)">
|
||||
<uni-icons type="phone" size="16" color="#2556ec" />
|
||||
<text>拨打电话</text>
|
||||
</view>
|
||||
<view v-if="Number(item.status) === 0" class="btn btnPrimary" @tap="markPicked(item)">
|
||||
标记已分拣
|
||||
</view>
|
||||
<view v-else-if="Number(item.status) === 1" class="btn btnOutline" @tap="goScan">
|
||||
去核销
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
@@ -346,6 +366,49 @@
|
||||
return goods?.spec || '';
|
||||
};
|
||||
|
||||
const getReceiverName = (item) => {
|
||||
return String(item?.receiverName || item?.userName || item?.nickname || '').trim();
|
||||
};
|
||||
|
||||
const maskMobile = (mobile) => {
|
||||
const digits = String(mobile || '').replace(/\D/g, '');
|
||||
if (digits.length < 7) return String(mobile || '').trim();
|
||||
if (digits.length === 11) return `${digits.slice(0, 3)}****${digits.slice(7)}`;
|
||||
return `${digits.slice(0, 3)}**${digits.slice(-4)}`;
|
||||
};
|
||||
|
||||
const getMaskedReceiverMobile = (item) => {
|
||||
const mobile = String(item?.receiverMobile || item?.receiverPhone || item?.mobile || '').trim();
|
||||
return mobile ? maskMobile(mobile) : '';
|
||||
};
|
||||
|
||||
const getReceiverMobileDigits = (item) => {
|
||||
return String(item?.receiverMobile || item?.receiverPhone || item?.mobile || '').replace(/\D/g, '');
|
||||
};
|
||||
|
||||
const callReceiver = (item) => {
|
||||
const phoneNumber = getReceiverMobileDigits(item);
|
||||
if (!phoneNumber) {
|
||||
uni.showToast({ title: '暂无手机号', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
uni.makePhoneCall({
|
||||
phoneNumber,
|
||||
fail: () => {
|
||||
uni.showToast({ title: '拨打失败', icon: 'none' });
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const copyOrderNo = (orderNo) => {
|
||||
const text = String(orderNo || '').trim();
|
||||
if (!text) {
|
||||
uni.showToast({ title: '暂无订单号', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
sheep.$helper.copyText(text);
|
||||
};
|
||||
|
||||
const getExpandKey = (item) => {
|
||||
return String(item?.orderId || item?.id || '');
|
||||
};
|
||||
@@ -481,6 +544,38 @@
|
||||
margin-bottom: 14rpx;
|
||||
}
|
||||
|
||||
.buyer-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
padding: 10rpx 12rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #f7f8fc;
|
||||
margin-bottom: 14rpx;
|
||||
}
|
||||
|
||||
.buyer-top__left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 12rpx;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.buyer-top__name {
|
||||
font-size: 24rpx;
|
||||
line-height: 34rpx;
|
||||
color: #222;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.buyer-top__mobile {
|
||||
font-size: 24rpx;
|
||||
line-height: 34rpx;
|
||||
color: #7b8494;
|
||||
}
|
||||
|
||||
.status-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -542,20 +637,56 @@
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.order-no-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10rpx;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.order-no-row__text {
|
||||
min-width: 0;
|
||||
flex: 0 1 auto;
|
||||
}
|
||||
|
||||
.order-no-row__copy {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.order-no-row__copy-icon {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
gap: 12rpx;
|
||||
flex-shrink: 0;
|
||||
margin-left: 14rpx;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 16rpx;
|
||||
margin-top: 16rpx;
|
||||
padding-top: 16rpx;
|
||||
border-top: 2rpx solid #f1f3f7;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 14rpx 20rpx;
|
||||
min-width: 176rpx;
|
||||
height: 64rpx;
|
||||
padding: 0 26rpx;
|
||||
border-radius: 18rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 1;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
font-weight: 600;
|
||||
gap: 8rpx;
|
||||
}
|
||||
|
||||
.btnPrimary {
|
||||
@@ -568,6 +699,14 @@
|
||||
color: #2556ec;
|
||||
}
|
||||
|
||||
.btnGhost {
|
||||
min-width: 0;
|
||||
padding: 0 20rpx;
|
||||
border: 2rpx solid #dbe3f2;
|
||||
color: #2556ec;
|
||||
background: #f7faff;
|
||||
}
|
||||
|
||||
.fold-box {
|
||||
margin-top: 16rpx;
|
||||
border-radius: 18rpx;
|
||||
|
||||
Reference in New Issue
Block a user