wangfukang 2 weeks ago
parent
commit
7f9f037e7e
  1. 232
      components/tab-bar/delivery.vue

232
components/tab-bar/delivery.vue

@ -27,12 +27,26 @@
</view>
</view>
<view style="height: 50rpx;width: 95%;margin: -200rpx auto 0;display: flex;line-height: 50rpx;">
<view class="guize-box1" :style="{'background':tab1Checked1 == 'fantuan'?'rgba(130, 255, 130, 1)':'#F5F5F5'}" @tap="chooseType('fantuan')">
<uni-icons type="info" size="10"></uni-icons>
饭团
</view>
<view class="guize-box1" :style="{'background':tab1Checked1 == 'kuaidi'?'rgba(130, 255, 130, 1)':'#F5F5F5'}" @tap="chooseType('kuaidi')">
<uni-icons type="info" size="10"></uni-icons>
快递
</view>
<view class="guize-box1" :style="{'background':tab1Checked1 == 'paotui'?'rgba(130, 255, 130, 1)':'#F5F5F5'}" @tap="chooseType('paotui')">
<uni-icons type="info" size="10"></uni-icons>
跑腿
</view>
<view style="padding-right: 12rpx;">|</view>
<view class="guize-box" @tap="openPopup()">
<uni-icons type="info" size="10"></uni-icons>
设置规则
接单规则
</view>
<view class="">
<view @tap="changeOnline(0)" class="shangxia-btn shangxian-btn" v-if="isOnLine==1">
<view @tap="changeOnline(0)" class="shangxia-btn shangxian-btn" v-if="isOnLine==0">
<text>已上线</text>
</view>
<view @tap="changeOnline(1)" class="shangxia-btn lixian-btn" v-else>
@ -41,44 +55,41 @@
</view>
</view>
<view class="content">
<view class="box1">
<view class="box1" v-for="(item,index) in deliveryItem" :key="index">
<view class="maotou">
#<text>021</text>
#样式要改<text>{{item.numberCode}}</text>
</view>
<view style="width: 100%;line-height: 70rpx;font-size: 28rpx;font-weight: 700;display: flex;">
<view
<view v-if="item.deliveryType == 1"
style="height: 40rpx;line-height: 40rpx;background: rgba(255, 233, 89, 1);padding: 0 16rpx;border-radius: 40rpx;margin: 14rpx 20rpx 0 0;">
代买饭
外卖
</view>
<!-- <view style="height: 40rpx;line-height: 40rpx;background: rgba(166, 255, 234, 1);padding: 0 16rpx;border-radius: 40rpx;margin: 14rpx 20rpx 0 0;">
指派单-代买饭
</view>
<view style="height: 40rpx;line-height: 40rpx;background: rgba(255, 220, 199, 1);padding: 0 16rpx;border-radius: 40rpx;margin: 14rpx 20rpx 0 0;">
<view v-if="item.deliveryType == 2" style="height: 40rpx;line-height: 40rpx;background: rgba(255, 220, 199, 1);padding: 0 16rpx;border-radius: 40rpx;margin: 14rpx 20rpx 0 0;">
代取快递
</view>
<view style="height: 40rpx;line-height: 40rpx;background: rgba(130, 255, 130, 1);padding: 0 16rpx;border-radius: 40rpx;margin: 14rpx 20rpx 0 0;">
<view v-if="item.deliveryType == 3" style="height: 40rpx;line-height: 40rpx;background: rgba(130, 255, 130, 1);padding: 0 16rpx;border-radius: 40rpx;margin: 14rpx 20rpx 0 0;">
代跑腿
</view> -->
立即送达1030
</view>
<view class=""
{{item.mustFinishTime != null ? item.mustFinishTime : '' | formatHourMinute }}前送达
</view>
<view class="" v-if="item.remark != '' && item.remark != null"
style="background: #f5f5f5;height: 80rpx;line-height: 80rpx;font-weight: 500;padding: 0 20rpx;border-radius: 20rpx;">
备注不要葱不要香菜
备注{{item.remark}}
</view>
<view class=""
<view class="" v-if="item.deliveryType == 3 || item.deliveryType == 2"
style="background: #f5f5f5;line-height: 80rpx;font-weight: 700;padding: 0 20rpx;border-radius: 20rpx;margin-top: 20rpx;color: #777;">
<view style="display: flex;">
<view style="flex:1">
取件方式3
取件方式{{item.allCount != null ? item.allCount : 0}}
</view>
<!-- <view class="">
取件码截图
<view class="" v-if="item.getPictures != null">
取件码截图(分割一下) {{item.getPictures}}
</view>
<view class="" v-if="item.getCodes != null">
取件码取件{{item.getCodes}}
</view>
<view class="">
取件码取件
</view> -->
<view style="flex:1;text-align: right;">
手机尾号
手机尾号{{item.phoneNumber}}
</view>
</view>
@ -103,14 +114,14 @@
alt="" style="width: 50rpx;height: 50rpx;" />
<view style="flex: 1;">
<view class="">
沁园春第三食堂A20窗口
{{item.shopName}}
</view>
<view style="color: #777;">
18829382718
{{item.shopAddress}}
</view>
</view>
<view class="right">
<img @tap="makeCall(shopItem.contactPhone)"
<img @tap="makeCall(item.shopPhone)"
src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/869a7af6a1c24bf3a0d523c4a18b55c6.png"
alt="" style="width: 60rpx;height: 60rpx;" />
</view>
@ -121,14 +132,14 @@
alt="" style="width: 50rpx;height: 50rpx;" />
<view style="flex: 1;">
<view class="">
11号宿舍楼610
{{item.receiverName}}
</view>
<view style="color: #777;">
18829382718
{{item.receiverAddress}}
</view>
</view>
<view class="right">
<img @tap="makeCall(shopItem.contactPhone)"
<img @tap="makeCall(item.receiverPhone)"
src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/869a7af6a1c24bf3a0d523c4a18b55c6.png"
alt="" style="width: 60rpx;height: 60rpx;" />
</view>
@ -142,20 +153,25 @@
<view style="flex: 1;display: flex;">
<view style="color: #777;display: flex;">
配送佣金
<view class="chaoda">
<view class="chaoda" v-if="item.isBig != null && item.isBig == 1">
超大/超重
</view>
</view>
<view style="flex: 1;text-align: right;">
5.00 <text style="color: #777;font-size: 20rpx;">包含2平台佣金</text>
{{item.deliveryFee}} <text style="color: #777;font-size: 20rpx;"v-if="item.deliveryFeeMarketplace != null">包含{{item.deliveryFeeMarketplace}}平台佣金</text>
</view>
</view>
</view>
</view>
</view>
<view v-if="item.isReturn != null && item.isReturn == 1" style="width: 100%;height: 100rpx;margin-top: 32rpx;">
用户申请退款中
</view>
<view style="width: 100%;height: 100rpx;margin-top: 32rpx;">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c318cf292a4f40b296995c30e5e539ea.png"
alt="" style="width: 100%;height: 100rpx;background-size: 100%;" />
<view v-else style="width: 100%;height: 100rpx;margin-top: 32rpx;">
<img v-if="item.status == 1" src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c318cf292a4f40b296995c30e5e539ea.png"
alt="" style="width: 100%;height: 100rpx;background-size: 100%;" @tap="changeStatus(item,2)"/>
<img v-if="item.status == 2" src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/869a7af6a1c24bf3a0d523c4a18b55c6.png"
alt="" style="width: 100%;height: 100rpx;background-size: 100%;" @tap="changeStatus(item,3)" />
</view>
</view>
@ -253,8 +269,20 @@
<img :src="bigImg" alt="" style="width: 100%;height: 100%;">
</view>
</uni-popup>
<uni-popup ref="productPopup" background-color="#fff">
<view class="popup-area-content" style="height: 1200rpx;overflow: scroll;">
<view class="popup-area-title">
<text>订单详情 商家退款中 不能操作</text>
</view>
<view class="popup-area-container" v-for="(item,index) in productData" :key="index">
<text style="display: inline-block">{{item.productName}} {{item.specs}} * {{item.quantity}}</text>
</view>
</view>
</uni-popup>
<view style="width: 100%;height: 160rpx;"></view>
<uni-load-more :status="loadStatus" />
<uni-load-more :status="loadStatus" @change="onChange" />
</view>
</view>
</template>
@ -269,8 +297,20 @@
tab1Checked: 'daiqu',
menuButtonInfo: {},
isArea: false,
searchForm:{
status: 1,
pageNum:1,
pageSize: 10,
order:'',
regionId:'',
deliveryType: null,
workerId: uni.getStorageSync('worker') ? uni.getStorageSync('worker').workerId : ''
},
waimaRuleList: [],
tab1Checked1:'',
deliveryItem:[],
selectRuleList: [],
totalPages:1,
paotuiRuleList: [],
lineStatus: [{
title: '上线',
@ -290,19 +330,79 @@
},
onReachBottom() {
if (this.searchForm.pageNumber >= this.totalPages) return;
if (this.searchForm.pageNum >= this.totalPages) return;
// this.status = 'loading';
this.searchForm.pageNumber++;
this.getShopList();
this.searchForm.pageNum++;
this.getDelivery();
},
filters: {
formatHourMinute(value) {
if (!value) return '';
const date = new Date(value);
// (getDate)0
const day = String(date.getDate()).padStart(2, '0');
// (getHours)0
const hour = String(date.getHours()).padStart(2, '0');
// (getMinutes)0
const minute = String(date.getMinutes()).padStart(2, '0');
// --:
return `${day}-${hour}:${minute}`;
}
},
methods: {
init() {
console.log("配送初始化")
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
this.isOnLine = uni.getStorageSync('worker').isOnLine
if(uni.getStorageSync('area')){
this.searchForm.regionId = JSON.parse(uni.getStorageSync('area')).id;
}
this.getDelivery()
this.$forceUpdate()
},
chooseType(type){
if(this.tab1Checked1 == type){
this.tab1Checked1 = ''
this.searchForm.deliveryType = null
}else{
this.tab1Checked1 = type;
if(type == 'fantuan'){
this.searchForm.deliveryType = 1
}else if(type == 'kuaidi'){
this.searchForm.deliveryType = 2
}else if(type == 'paotui'){
this.searchForm.deliveryType = 3
}
}
this.searchForm.pageNum = 1
this.getDelivery()
this.$forceUpdate();
},
getDelivery(){
let that = this
this.tui.request("/mall/delivery/pagebyworker", "POST", this.searchForm, false, false).then((res) => {
that.loadStatus = 'nomore';
if (res.code == 200) {
that.deliveryItem = res.result.records;
if (that.searchForm.pageNum == 1) {
that.deliveryItem = res.result.records;
} else {
that.deliveryItem = [...that.deliveryItem, ...res.result.records]
}
that.totalPages = res.result.pages; // pages =
that.$forceUpdate();
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res) => {});
},
//
largeImg(img) {
this.bigImg = 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/00b1f011787c4549bbea650d95a4eb39.png'
@ -443,16 +543,60 @@
checkArea() {
this.isArea = !this.isArea
},
changeStatus(item,status){
let url = ''
if(status == 2){
url = "/mall/delivery/pickup"
}else{
url = "/mall/delivery/complete"
}
let that = this
that.tui.request(url, "POST", {deliveryId:item.id,workerId:item.workerId}, false, true).then((res) => {
if (res.code == 200) {
that.tui.toast(res.message);
that.searchForm.pageNum = 1
that.getDelivery()
that.$forceUpdate();
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res) => {});
},
checkTab1(type) {
this.tab1Checked = type
if(type == 'daiqu'){
this.searchForm.status = 1
}else{
this.searchForm.status = 2
}
this.searchForm.pageNum = 1
this.getDelivery()
},
makeCall(phone){
uni.makePhoneCall({
phoneNumber: phone
});
},
changeOnline(value) {
let url = ''
if(this.isOnLine == value){
if (value == 0) {
url = '/worker/offLine'
value = 1
} else {
url = '/worker/onLine'
value = 0
}
}else{
if (value == 0) {
url = '/worker/onLine'
} else {
url = '/worker/offLine'
}
}
this.tui.request(url, "POST", {
id: uni.getStorageSync('worker').workerId
}, false, true).then((res) => {
@ -727,7 +871,17 @@
width: 140rpx;
height: 50rpx;
border-radius: 50rpx;
margin-right: 20rpx;
margin-right: 15rpx;
padding-left: 10rpx;
}
.guize-box1{
font-size: 20rpx;
font-weight: 700;
text-align: center;
width: 140rpx;
height: 50rpx;
border-radius: 50rpx;
margin-right: 15rpx;
padding-left: 10rpx;
}
</style>
Loading…
Cancel
Save