You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

844 lines
19 KiB

2 weeks ago
<template>
1 week ago
<!-- 配送员已完成订单列表 -->
2 weeks ago
<view class="page1">
<view class="title">
<view class="title-sreach">
<view class="back-btn" @tap="back" :style="{'top': menuButtonInfo.top +'px'}">
<uni-icons type="left" size="28"></uni-icons>
</view>
<view class="title-name" :style="{'padding-top': menuButtonInfo.top +'px'}">
1 week ago
已完成订单
2 weeks ago
</view>
</view>
</view>
1 week ago
<view class="summary-card">
<view class="summary-label">共计送达</view>
<view class="summary-count">{{totalCount}}<text></text></view>
</view>
<view class="search-card">
<view class="date-picker-wrap">
<uni-datetime-picker :clear-icon="false" v-model="range" type="daterange" @change="searchList" />
</view>
<view class="reset-btn" @tap="resetDateRange">重置</view>
</view>
<view class="list-wrap">
2 weeks ago
<view class="box1" @tap="goDetail(item)" v-for="(item,index) in orderList" :key="index">
1 week ago
<view class="order-head">
<view class="type-tag" :class="'type-' + item.deliveryType">
{{deliveryTypeText(item.deliveryType)}}
2 weeks ago
</view>
1 week ago
<view class="order-code" v-if="item.numberCode">
#{{orderCodeText(item.numberCode)}}
2 weeks ago
</view>
1 week ago
<view class="done-tag">已送达</view>
2 weeks ago
</view>
1 week ago
<view class="time-row">
<text v-if="item.mustFinishTime">{{item.mustFinishTime | formatHourMinute}}前送达</text>
<text v-else>{{item.createTime | formatISOTime}}</text>
</view>
<view class="time-detail">
<view class="time-item" v-if="item.acceptTime">
<text>接单</text>{{item.acceptTime | formatISOTime}}
2 weeks ago
</view>
1 week ago
<view class="time-item" v-if="item.arriveTime">
<text>到店</text>{{item.arriveTime | formatISOTime}}
</view>
<view class="time-item" v-if="item.getTime">
<text>取货</text>{{item.getTime | formatISOTime}}
</view>
<view class="time-item" v-if="item.finishTime">
<text>送达</text>{{item.finishTime | formatISOTime}}
</view>
</view>
<view class="remark" v-if="item.remark != '' && item.remark != null">
备注{{item.remark}}
</view>
<view class="extra-info" v-if="item.deliveryType == 2 || item.deliveryType == 3">
<text>{{item.allCount != null ? item.allCount : 0}}</text>
<text v-if="item.getCodes != null">取件码{{item.getCodes}}</text>
<text v-if="item.phoneNumber != null">尾号{{item.phoneNumber}}</text>
</view>
<view class="route-box">
<view class="route-line">
<view class="route-dot get"></view>
<view class="route-main">
<view class="route-name">{{item.shopName || '取货点'}}</view>
<view class="route-address">{{item.shopAddress || '暂无取货地址'}}</view>
2 weeks ago
</view>
1 week ago
</view>
<view class="route-line">
<view class="route-dot send"></view>
<view class="route-main">
<view class="route-name">{{item.receiverName || '收货人'}}</view>
<view class="route-address">{{item.receiverAddress || '暂无收货地址'}}</view>
2 weeks ago
</view>
</view>
</view>
1 week ago
<view class="goods-row" v-if="item.goodsList && item.goodsList.length > 0" @tap.stop="productDetail(item)">
<view class="goods-title">
商品详情
</view>
<view class="goods-desc">
{{item.goodsNum}}点击查看规格和数量
2 weeks ago
</view>
1 week ago
<uni-icons type="right" size="14" color="#7a8582"></uni-icons>
</view>
<view class="fee-row">
<view class="big-tag" v-if="item.isBig != null && item.isBig == 1">超大/超重</view>
<view class="fee-text">
配送佣金 <text>{{item.deliveryFee || 0}}</text>
2 weeks ago
</view>
1 week ago
<view class="market-fee" v-if="item.deliveryFeeMarketplace != null">
含平台{{item.deliveryFeeMarketplace}}
2 weeks ago
</view>
</view>
</view>
1 week ago
<view class="empty-box" v-if="orderList.length == 0 && loadStatus == 'nomore'">
暂无已完成订单
</view>
2 weeks ago
</view>
1 week ago
<uni-popup ref="productPopup" background-color="transparent">
<view class="product-popup-content">
<view class="product-popup-header">
<view class="product-popup-title">商品详情</view>
<view class="product-popup-subtitle">请核对商品规格和数量</view>
</view>
<view class="product-popup-list" v-if="productData != null && productData.length > 0">
<view class="product-popup-card" v-for="(item1,index1) in productData" :key="index1">
<view class="product-popup-img">
<img :src="item1.productPicture" alt="">
2 weeks ago
</view>
1 week ago
<view class="product-popup-info">
<view class="product-popup-name">
{{item1.productName}}
2 weeks ago
</view>
1 week ago
<view class="product-popup-spec">
<text class="product-popup-label">规格</text>
<text class="product-popup-spec-text">{{item1.specs | delNode}}</text>
2 weeks ago
</view>
</view>
1 week ago
<view class="product-popup-quantity">
<view class="product-popup-quantity-num">x{{item1.quantity}}</view>
<view class="product-popup-quantity-label">数量</view>
2 weeks ago
</view>
</view>
</view>
1 week ago
<view class="product-popup-empty" v-else>
暂无商品详情
</view>
2 weeks ago
</view>
</uni-popup>
1 week ago
<view class="bottom-space"></view>
2 weeks ago
</view>
</template>
<script>
export default {
data() {
return {
loadStatus: 'more',
searchForm: {
status: 3,
pageNum: 1,
pageSize: 10,
order: '',
regionId: JSON.parse(uni.getStorageSync('area')).id,
deliveryType: null,
1 week ago
workerId: uni.getStorageSync('worker').workerId,
startDate: '',
endDate: ''
2 weeks ago
},
1 week ago
range: [],
productData: [],
2 weeks ago
totalPages: 1,
1 week ago
totalCount: 0,
2 weeks ago
tuanzhangOrder:[],
orderList: [],
currentIndex: 10,
menuButtonInfo: {}
}
},
onReachBottom() {
if (this.searchForm.pageNum >= this.totalPages) return;
this.searchForm.pageNum++;
this.getList();
},
filters: {
1 week ago
formatHourMinute(value) {
if (!value) return '';
const date = new Date(value);
const day = String(date.getDate()).padStart(2, '0');
const hour = String(date.getHours()).padStart(2, '0');
const minute = String(date.getMinutes()).padStart(2, '0');
return `${day}${hour}:${minute}`;
},
2 weeks ago
formatISOTime(isoString) {
const date = new Date(isoString);
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
const hours = date.getHours().toString().padStart(2, '0');
const minutes = date.getMinutes().toString().padStart(2, '0');
const seconds = date.getSeconds().toString().padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
delPlus(data){
if (data.endsWith("+")) {
2 weeks ago
data = data.slice(0, -1);
2 weeks ago
}
return data;
1 week ago
},
delNode(data) {
let str;
if (typeof data === 'object' && data !== null) {
str = JSON.stringify(data);
} else if (typeof data === 'string') {
str = data;
} else {
str = String(data);
}
return str.replace(/[{}"]/g, '');
2 weeks ago
}
},
onShow() {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
this.searchForm.shopId = uni.getStorageSync('shopId')
this.regionId = JSON.parse(uni.getStorageSync('area')).id
},
onLoad(option) {
if (option.index) {
this.searchForm.searchStatus = option.index
this.currentIndex = option.index
}
this.getList()
},
methods: {
getList() {
this.loadStatus = 'loading'
let that = this
1 week ago
that.tui.request("/mall/delivery/pagebyworkerHistory", "POST", this.searchForm, false, false).then((
2 weeks ago
res) => {
that.loadStatus = 'nomore';
if (res.code == 200) {
if (that.searchForm.pageNum == 1) {
that.orderList = res.result.records;
} else {
that.orderList = [...that.orderList, ...res.result.records]
}
for(let i=0;i<that.orderList.length;i++){
that.orderList[i].goodsNum = 0
1 week ago
if (that.orderList[i].goodsList && that.orderList[i].goodsList.length) {
for(let m=0;m<that.orderList[i].goodsList.length;m++){
that.orderList[i].goodsNum += that.orderList[i].goodsList[m].quantity
}
2 weeks ago
}
}
that.totalPages = res.result.pages;
1 week ago
that.totalCount = res.result.total || that.orderList.length;
2 weeks ago
that.$forceUpdate();
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res) => {});
},
1 week ago
deliveryTypeText(type) {
if (type == 1) return '外卖';
if (type == 2) return '代取快递';
if (type == 3) return '代跑腿';
return '配送';
},
orderCodeText(numberCode) {
if (!numberCode) return '';
if (numberCode.length > 14) return '多订单';
return numberCode.endsWith("+") ? numberCode.slice(0, -1) : numberCode;
},
productDetail(item) {
this.productData = item.goodsList || [];
this.$refs.productPopup.open()
},
searchList(range) {
const dateRange = range || this.range || [];
this.searchForm.startDate = dateRange[0] || '';
this.searchForm.endDate = dateRange[1] || '';
this.searchForm.pageNum = 1;
this.getList();
},
resetDateRange() {
this.range = [];
this.searchForm.startDate = '';
this.searchForm.endDate = '';
this.searchForm.pageNum = 1;
this.getList();
},
2 weeks ago
tanchuang(v){
this.tui.toast('该订单为'+(v==1?'配送':'自取')+'单')
},
getGroupOrders(id){
this.tui.request("/mall/order/selectAllOrderByOrderId/"+id, "GET", {}, false, true).then((res) => {
if (res.code == 200) {
this.tuanzhangOrder = res.result;
this.$refs.pintuanPopup.open('bottom')
} else {
that.tui.toast(res.message)
return
}
uni.hideLoading()
}).catch((res) => {})
},
openPopup(){
this.$refs.groupPopup.open()
},
mealServing(item){
let that = this
uni.showModal({
title: '提示',
content: '确定要出餐吗?',
success: function (res) {
if (res.confirm) {
let data = {}
let url = ''
if(item.deliveryType == 2){ //自取单
url = '/mall/order/complete'
}else if(item.deliveryType == 1){ //外卖单
url = '/mall/order/shopMakeTime'
}
that.tui.request(url, "post", {
orderId:item.id
}, false, true).then((res) => {
if (res.code == 200) {
that.getList()
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res) => {});
}
}
});
},
goDetail(item) {
uni.navigateTo({
url: '/package2/shop/orderDetail?id=' + item.orderId
})
},
handleStatusClick(index) {
this.searchForm.pageNum = 1
if (this.currentIndex === index) return;
this.currentIndex = index;
this.searchForm.searchStatus = index
this.getList()
},
back() {
uni.navigateBack()
},
}
}
</script>
<style>
page {
width: 100%;
height: 100%;
font-size: 24rpx;
background: #F5F8F5;
color: #00231C;
}
.page1 {
width: 100%;
height: 100%;
font-size: 24rpx;
position: relative;
1 week ago
padding-bottom: 40rpx;
2 weeks ago
}
.title {
background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/8bc15960c2dc40268e295d6dd23aecce.png') no-repeat;
width: 100%;
1 week ago
height: 360rpx;
background-size: 100% 100%;
2 weeks ago
}
.title-sreach {
width: 100%;
display: flex;
height: 200rpx;
position: relative;
}
.back-btn {
position: absolute;
bottom: 0;
left: 0;
}
.title-name {
padding-top: 110rpx;
font-size: 36rpx;
font-weight: 700;
flex: 1;
text-align: center;
}
1 week ago
.summary-card {
width: 92%;
height: 128rpx;
margin: -156rpx auto 24rpx;
padding: 24rpx 28rpx;
box-sizing: border-box;
2 weeks ago
display: flex;
1 week ago
align-items: center;
border-radius: 28rpx;
background:
radial-gradient(circle at 92% 0, rgba(166, 255, 234, 0.78) 0, rgba(166, 255, 234, 0) 170rpx),
#fff;
box-shadow: 0 14rpx 34rpx rgba(0, 35, 28, 0.08);
2 weeks ago
}
1 week ago
.summary-label {
flex: 1;
color: #61716d;
font-size: 26rpx;
font-weight: 700;
2 weeks ago
}
1 week ago
.summary-count {
color: #00231C;
font-size: 52rpx;
font-weight: 900;
line-height: 64rpx;
}
.summary-count text {
margin-left: 6rpx;
color: #61716d;
font-size: 24rpx;
font-weight: 700;
}
.list-wrap {
width: 92%;
margin: 0 auto;
}
.search-card {
width: 92%;
margin: 0 auto 8rpx;
padding: 16rpx 18rpx;
box-sizing: border-box;
2 weeks ago
display: flex;
align-items: center;
1 week ago
border-radius: 22rpx;
background: #fff;
box-shadow: 0 10rpx 24rpx rgba(0, 35, 28, 0.05);
2 weeks ago
}
1 week ago
.date-picker-wrap {
flex: 1;
min-width: 0;
}
.reset-btn {
width: 88rpx;
height: 56rpx;
margin-left: 14rpx;
border-radius: 56rpx;
background: rgba(166, 255, 234, 0.48);
color: #126255;
font-size: 24rpx;
font-weight: 800;
line-height: 56rpx;
2 weeks ago
text-align: center;
1 week ago
}
.box1 {
width: 100%;
margin: 18rpx auto;
background: #fff;
border-radius: 24rpx;
padding: 22rpx;
2 weeks ago
box-sizing: border-box;
1 week ago
box-shadow: 0 10rpx 28rpx rgba(0, 35, 28, 0.05);
2 weeks ago
}
1 week ago
.order-head {
display: flex;
align-items: center;
min-height: 44rpx;
}
.type-tag {
height: 40rpx;
line-height: 40rpx;
padding: 0 16rpx;
border-radius: 40rpx;
font-size: 22rpx;
font-weight: 700;
}
.type-1 {
background: rgba(255, 233, 89, 1);
}
.type-2 {
background: rgba(255, 220, 199, 1);
}
.type-3 {
background: rgba(130, 255, 130, 1);
}
.order-code {
flex: 1;
min-width: 0;
margin-left: 14rpx;
color: #60716c;
font-size: 22rpx;
height: 40rpx;
line-height: 40rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.done-tag {
height: 38rpx;
line-height: 38rpx;
padding: 0 14rpx;
border-radius: 12rpx;
background: rgba(166, 255, 234, 0.5);
color: #0b665a;
font-size: 22rpx;
font-weight: 700;
}
.time-row {
margin-top: 12rpx;
color: #223b36;
2 weeks ago
font-size: 28rpx;
1 week ago
font-weight: 800;
line-height: 38rpx;
2 weeks ago
}
1 week ago
.time-detail {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8rpx 14rpx;
margin-top: 12rpx;
padding: 12rpx 14rpx;
border-radius: 16rpx;
background: rgba(247, 248, 248, 0.58);
2 weeks ago
}
1 week ago
.time-item {
min-width: 0;
color: #6f7c78;
font-size: 20rpx;
line-height: 30rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
2 weeks ago
}
1 week ago
.time-item text {
margin-right: 8rpx;
color: #243d38;
font-weight: 800;
}
.remark,
.extra-info {
margin-top: 14rpx;
padding: 12rpx 16rpx;
border-radius: 16rpx;
background: rgba(247, 248, 248, 0.72);
color: #5f6c69;
font-size: 22rpx;
line-height: 34rpx;
}
.extra-info {
display: flex;
flex-wrap: wrap;
gap: 12rpx 24rpx;
}
.route-box {
margin-top: 16rpx;
padding: 14rpx 16rpx;
border: 1px solid rgba(166, 255, 234, 0.78);
2 weeks ago
border-radius: 20rpx;
1 week ago
}
.route-line {
display: flex;
padding: 8rpx 0;
}
.route-dot {
width: 38rpx;
height: 38rpx;
line-height: 38rpx;
flex-shrink: 0;
margin: 3rpx 14rpx 0 0;
2 weeks ago
text-align: center;
1 week ago
border-radius: 38rpx;
background: #00231C;
color: #fff;
font-size: 20rpx;
2 weeks ago
font-weight: 700;
}
1 week ago
.route-dot.send {
background: #8adfca;
color: #00231C;
}
.route-main {
flex: 1;
min-width: 0;
}
.route-name {
color: #152d28;
font-size: 25rpx;
font-weight: 800;
line-height: 34rpx;
}
.route-address {
margin-top: 4rpx;
color: #7a8582;
font-size: 22rpx;
line-height: 32rpx;
word-break: break-all;
}
.goods-row {
display: flex;
align-items: center;
margin-top: 16rpx;
padding: 14rpx 16rpx;
border-radius: 18rpx;
background: rgba(247, 248, 248, 0.72);
}
.goods-title {
color: #172f2a;
font-size: 24rpx;
font-weight: 900;
}
.goods-desc {
flex: 1;
min-width: 0;
margin-left: 16rpx;
color: #7a8582;
font-size: 22rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.fee-row {
display: flex;
align-items: center;
margin-top: 16rpx;
color: #64726f;
font-size: 24rpx;
2 weeks ago
line-height: 40rpx;
1 week ago
}
.big-tag {
margin-right: 12rpx;
padding: 0 10rpx;
height: 32rpx;
line-height: 32rpx;
2 weeks ago
border-radius: 10rpx;
1 week ago
background: rgba(255, 117, 88, 1);
2 weeks ago
color: #fff;
1 week ago
font-size: 20rpx;
font-weight: 700;
2 weeks ago
}
1 week ago
.fee-text {
flex: 1;
2 weeks ago
}
1 week ago
.fee-text text {
color: #00231C;
font-size: 30rpx;
font-weight: 900;
}
.market-fee {
color: #9aa4a1;
font-size: 20rpx;
}
.empty-box {
padding: 120rpx 0;
color: #8b9894;
2 weeks ago
font-size: 28rpx;
1 week ago
text-align: center;
}
.product-popup-content {
width: 680rpx;
max-height: 880rpx;
padding: 34rpx 28rpx 30rpx;
box-sizing: border-box;
overflow: scroll;
border-radius: 36rpx;
background:
radial-gradient(circle at 92% 4%, rgba(166, 255, 234, 0.38) 0, rgba(166, 255, 234, 0) 180rpx),
linear-gradient(180deg, #ffffff 0%, #f8fffc 100%);
box-shadow: 0 24rpx 56rpx rgba(0, 35, 28, 0.18);
}
.product-popup-header {
margin-bottom: 26rpx;
text-align: center;
}
.product-popup-title {
color: #143d35;
font-size: 36rpx;
font-weight: 900;
line-height: 48rpx;
2 weeks ago
}
1 week ago
.product-popup-subtitle {
margin-top: 8rpx;
color: #7b8a85;
font-size: 24rpx;
line-height: 34rpx;
}
.product-popup-list {
display: flex;
flex-direction: column;
gap: 20rpx;
2 weeks ago
}
1 week ago
.product-popup-card {
display: flex;
align-items: center;
padding: 22rpx;
border: 1px solid rgba(166, 255, 234, 0.58);
border-radius: 28rpx;
background: rgba(255, 255, 255, 0.88);
box-shadow: 0 12rpx 28rpx rgba(0, 35, 28, 0.06);
}
.product-popup-img {
width: 128rpx;
height: 128rpx;
flex-shrink: 0;
overflow: hidden;
border-radius: 22rpx;
background: #f0f5f3;
}
.product-popup-img img {
width: 100%;
height: 100%;
background-size: 100%;
}
.product-popup-info {
flex: 1;
min-width: 0;
padding: 0 22rpx;
2 weeks ago
}
1 week ago
.product-popup-name {
color: #172f2a;
font-size: 30rpx;
font-weight: 900;
line-height: 42rpx;
}
.product-popup-spec {
display: flex;
align-items: flex-start;
margin-top: 16rpx;
}
.product-popup-label {
flex-shrink: 0;
height: 34rpx;
padding: 0 14rpx;
border-radius: 999rpx;
background: rgba(166, 255, 234, 0.72);
color: #126255;
font-size: 20rpx;
font-weight: 800;
line-height: 34rpx;
}
.product-popup-spec-text {
flex: 1;
margin-left: 12rpx;
color: #65736f;
font-size: 24rpx;
line-height: 34rpx;
word-break: break-all;
}
.product-popup-quantity {
width: 92rpx;
height: 92rpx;
flex-shrink: 0;
border-radius: 28rpx;
background: linear-gradient(135deg, #fff4ce 0%, #a6ffea 100%);
color: #103f36;
text-align: center;
box-shadow: 0 10rpx 20rpx rgba(0, 35, 28, 0.08);
}
.product-popup-quantity-num {
padding-top: 16rpx;
font-size: 30rpx;
font-weight: 900;
line-height: 34rpx;
}
.product-popup-quantity-label {
margin-top: 2rpx;
color: #52736b;
font-size: 20rpx;
line-height: 28rpx;
}
.product-popup-empty {
padding: 80rpx 20rpx;
border-radius: 28rpx;
background: rgba(247, 255, 251, 0.9);
color: #7b8a85;
font-size: 28rpx;
2 weeks ago
font-weight: 700;
1 week ago
text-align: center;
}
.bottom-space {
width: 100%;
height: 60rpx;
2 weeks ago
}
</style>