wangfukang 3 weeks ago
parent
commit
c0a0b31042
  1. 568
      pages/index/index.vue

568
pages/index/index.vue

@ -49,7 +49,7 @@
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/553230c20dea4e5c85f1e396058a7493.png" alt="" />
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/1a02b40d853a4cfdb062fff44ec49e6a.png" alt=""
style="position: absolute;top: -16rpx;right: 0;width: 88rpx;height: 36rpx;">
<view class="menu-name"></view>
<view class="menu-name"></view>
</view>
<view class="menu-list" @tap="goDetail('3')">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/a2f41e2d45cb4d418d273f6e9ceafff0.png" alt="" />
@ -161,22 +161,40 @@
</view>
<view class="daimai-box" style="padding-bottom:180rpx;">
<view class="daimai-tab" id="menuList" :style="{'top': navBarHeight + 'px','background':lastScrollTop>583?'#fff':''}">
<view @tap="checkTab('daimaifan')">
<view class="like-title" style="position: relative;width: 240rpx;" v-if="checked == 'daimaifan'">
<view @tap="checkTab('waimai')">
<view class="like-title" style="position: relative;width: 240rpx;" v-if="checked == 'waimai'">
<img src="/static/images/img/daimaifantitle.png" alt="" style="width: 220rpx;" />
<text style="position: absolute;top: 0;right: 0;font-size: 36rpx;font-weight: 700;">31</text>
<text style="position: absolute;top: 0;right: 0;font-size: 36rpx;font-weight: 700;">{{waimaiCount}}</text>
</view>
<view style="font-size: 30rpx;font-weight: 700;margin-left: 20rpx;color: #777;" v-else>
代买饭 (9)
外卖{{waimaiCount}}
</view>
</view>
<view @tap="checkTab('kuaidi')" style="margin-left: 15px;">
<view class="like-title" style="position: relative;width:320rpx;" v-if="checked == 'kuaidi'">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/99162216d23a44a8ba81c7cb5249f3b8.png" alt="" style="width: 270rpx;">
<text style="position: absolute;top: 0;right: 0;font-size: 36rpx;font-weight: 700;">{{kuaidiCount}}</text>
</view>
<view style="font-size: 30rpx;font-weight: 700;margin-left: 20rpx;color: #777;" v-else>
快递{{kuaidiCount}}
</view>
</view>
<view @tap="checkTab('paotui')" style="margin-left: 15px;">
<view class="like-title" style="position: relative;width:320rpx;" v-if="checked == 'paotui'">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/99162216d23a44a8ba81c7cb5249f3b8.png" alt="" style="width: 270rpx;">
<text style="position: absolute;top: 0;right: 0;font-size: 36rpx;font-weight: 700;">9</text>
<text style="position: absolute;top: 0;right: 0;font-size: 36rpx;font-weight: 700;">{{paotuiCount}}</text>
</view>
<view style="font-size: 30rpx;font-weight: 700;margin-left: 20rpx;color: #777;" v-else>
跑腿{{paotuiCount}}
</view>
</view>
<view @tap="checkTab('zhipai')" style="margin-left: 15px;" v-if="worker != null">
<view class="like-title" style="position: relative;width:320rpx;" v-if="checked == 'zhipai'">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/99162216d23a44a8ba81c7cb5249f3b8.png" alt="" style="width: 270rpx;">
<text style="position: absolute;top: 0;right: 0;font-size: 36rpx;font-weight: 700;">{{zhipaiCount}}</text>
</view>
<view style="font-size: 30rpx;font-weight: 700;margin-left: 20rpx;color: #777;" v-else>
代取快递/跑腿 (9)
指派单{{zhipaiCount}}
</view>
</view>
</view>
@ -224,19 +242,19 @@
</view>
</view>
<view class="daimai-list">
<view class="list-1">
<view class="list-1" v-for="(item,index) in deliveryItem" :key="index" @tap="goDetail('search',item)">
<view class="daoda-time">
送达时间02-02 18:02
送达时间{{item.mustFinishTime != null ? item.mustFinishTime : '' | formatHourMinute }}
</view>
<view class="order-page">
<view class="maotou">
#<text>021</text>
#<text>{{item.numberCode != null ? item.numberCode : ''}}</text>
</view>
<view class="shangjia">
<text style="font-weight: 700;">王继酸辣粉</text>
<text style="font-weight: 700;">{{item.shopName != null ? item.shopName : ''}}</text>
<view
style="width: 32rpx;height: 30rpx;font-weight: 700;font-size: 20rpx;color: #fff;text-align: center;background: #00BFFF;border-radius: 10rpx;margin: 20rpx 0 0 10rpx;line-height: 30rpx;">
</view>
</view>
<view class="shangpin">
@ -247,23 +265,27 @@
</view>
<view class="qu-text">
<view class="qu-left">
第三师堂A02窗口
{{item.shopAddress != null ? item.shopAddress : ''}}
</view>
<view class="qu-right">
1000m
<img @tap="makeCall(item.contactPhone)"
src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/869a7af6a1c24bf3a0d523c4a18b55c6.png"
alt="" style="width: 20px;height: 20px;" />
</view>
</view>
</view>
<view class="qu-box" style="margin-top:10rpx;">
<view class="qu-box" style="margin-top:15rpx;">
<view class='qu-tu'>
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/d0764fb4138747769538cf1cafa3b017.png" alt="" />
</view>
<view class="qu-text">
<view class="qu-left">
11号楼310
{{item.receiverAddress != null ? item.receiverAddress : ''}}
</view>
<view class="qu-right">
2.1km
<img @tap="makeCall(item.receiverPhone)"
src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/869a7af6a1c24bf3a0d523c4a18b55c6.png"
alt="" style="width: 20px;height: 20px;" />
</view>
</view>
</view>
@ -278,374 +300,14 @@
</view>
</view>
<view style="font-weight: 700;width: 50%;text-align: right;">
5.00
<text style="color: #777;font-size: 22rpx;">包含2平台佣金</text>
</view>
</view>
<view class="beizhu">
备注一共有3个快递哦普通快递没有超重和超大的辛苦了
</view>
<view class="qiangdan-btn">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/1b8b815302a34902ac79a76a469e4ee6.png" alt="">
</view>
</view>
<view class="list-1">
<view style="display:flex;">
<view class="daoda-time">
送达时间02-02 18:02
</view>
<view class="paotui-title">
<view class="paotui-text">
取件码:1-2-9830
</view>
<view class="paotui-num">
3
</view>
<view>
<uni-icons type="right" size="12"></uni-icons>
</view>
</view>
</view>
<view class="order-page">
<view class="shangjia">
<text style="font-weight: 700;">王继酸辣粉</text>
<view
style="width: 32rpx;height: 30rpx;font-weight: 700;font-size: 20rpx;color: #fff;text-align: center;background: #00BFFF;border-radius: 10rpx;margin: 20rpx 0 0 10rpx;line-height: 30rpx;">
</view>
</view>
<view class="shangpin">
<view class="qu-song">
<view class="qu-box">
<view class='qu-tu'>
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/1f77398a73454a6595c12a3c18731599.png" alt="" />
</view>
<view class="qu-text">
<view class="qu-left">
第三师堂A02窗口
</view>
<view class="qu-right">
1000m
{{(item.deliveryFee + item.deliveryFeeMarketplace).toFixed(2)}}
<text style="color: #777;font-size: 22rpx;" v-if="item.deliveryFeeMarketplace > 0">包含{{item.deliveryFeeMarketplace}}平台佣金</text>
</view>
</view>
<view class="beizhu" v-if="item.remark != null">
备注{{item.remark}}
</view>
<view class="qu-box" style="margin-top:10rpx;">
<view class='qu-tu'>
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/d0764fb4138747769538cf1cafa3b017.png" alt="" />
</view>
<view class="qu-text">
<view class="qu-left">
11号楼310
</view>
<view class="qu-right">
2.1km
</view>
</view>
</view>
</view>
</view>
</view>
<view class="yongjin">
<view style="width: 50%;color: #777;padding-left: 4%;display: flex;">
配送佣金
<view class="chaoda">
超大/超重
</view>
</view>
<view style="font-weight: 700;width: 50%;text-align: right;">
5.00
<text style="color: #777;font-size: 22rpx;">包含2平台佣金</text>
</view>
</view>
<view class="qiangdan-btn">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/1b8b815302a34902ac79a76a469e4ee6.png" alt="">
</view>
</view>
<view class="list-1">
<view style="display:flex;">
<view class="daoda-time">
送达时间02-02 18:02
</view>
<view class="paotui-title">
<view class="paotui-text">
取件码:1-2-9830
</view>
<view class="paotui-num">
3
</view>
<view>
<uni-icons type="right" size="12"></uni-icons>
</view>
</view>
</view>
<view class="order-page">
<view class="shangjia">
<text style="font-weight: 700;">王继酸辣粉</text>
<view
style="width: 32rpx;height: 30rpx;font-weight: 700;font-size: 20rpx;color: #fff;text-align: center;background: #00BFFF;border-radius: 10rpx;margin: 20rpx 0 0 10rpx;line-height: 30rpx;">
</view>
</view>
<view class="shangpin">
<view class="qu-song">
<view class="qu-box">
<view class='qu-tu'>
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/1f77398a73454a6595c12a3c18731599.png" alt="" />
</view>
<view class="qu-text">
<view class="qu-left">
第三师堂A02窗口
</view>
<view class="qu-right">
1000m
</view>
</view>
</view>
<view class="qu-box" style="margin-top:10rpx;">
<view class='qu-tu'>
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/d0764fb4138747769538cf1cafa3b017.png" alt="" />
</view>
<view class="qu-text">
<view class="qu-left">
11号楼310
</view>
<view class="qu-right">
2.1km
</view>
</view>
</view>
</view>
</view>
</view>
<view class="yongjin">
<view style="width: 50%;color: #777;padding-left: 4%;display: flex;">
配送佣金
<view class="chaoda">
超大/超重
</view>
</view>
<view style="font-weight: 700;width: 50%;text-align: right;">
5.00
<text style="color: #777;font-size: 22rpx;">包含2平台佣金</text>
</view>
</view>
<view class="qiangdan-btn">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/1b8b815302a34902ac79a76a469e4ee6.png" alt="">
</view>
</view>
<view class="list-1">
<view style="display:flex;">
<view class="daoda-time">
送达时间02-02 18:02
</view>
<view class="paotui-title">
<view class="paotui-text">
取件码:1-2-9830
</view>
<view class="paotui-num">
3
</view>
<view>
<uni-icons type="right" size="12"></uni-icons>
</view>
</view>
</view>
<view class="order-page">
<view class="shangjia">
<text style="font-weight: 700;">王继酸辣粉</text>
<view
style="width: 32rpx;height: 30rpx;font-weight: 700;font-size: 20rpx;color: #fff;text-align: center;background: #00BFFF;border-radius: 10rpx;margin: 20rpx 0 0 10rpx;line-height: 30rpx;">
</view>
</view>
<view class="shangpin">
<view class="qu-song">
<view class="qu-box">
<view class='qu-tu'>
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/1f77398a73454a6595c12a3c18731599.png" alt="" />
</view>
<view class="qu-text">
<view class="qu-left">
第三师堂A02窗口
</view>
<view class="qu-right">
1000m
</view>
</view>
</view>
<view class="qu-box" style="margin-top:10rpx;">
<view class='qu-tu'>
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/d0764fb4138747769538cf1cafa3b017.png" alt="" />
</view>
<view class="qu-text">
<view class="qu-left">
11号楼310
</view>
<view class="qu-right">
2.1km
</view>
</view>
</view>
</view>
</view>
</view>
<view class="yongjin">
<view style="width: 50%;color: #777;padding-left: 4%;display: flex;">
配送佣金
<view class="chaoda">
超大/超重
</view>
</view>
<view style="font-weight: 700;width: 50%;text-align: right;">
5.00
<text style="color: #777;font-size: 22rpx;">包含2平台佣金</text>
</view>
</view>
<view class="qiangdan-btn">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/1b8b815302a34902ac79a76a469e4ee6.png" alt="">
</view>
</view>
<view class="list-1">
<view style="display:flex;">
<view class="daoda-time">
送达时间02-02 18:02
</view>
<view class="paotui-title">
<view class="paotui-text">
取件码:1-2-9830
</view>
<view class="paotui-num">
3
</view>
<view>
<uni-icons type="right" size="12"></uni-icons>
</view>
</view>
</view>
<view class="order-page">
<view class="shangjia">
<text style="font-weight: 700;">王继酸辣粉</text>
<view
style="width: 32rpx;height: 30rpx;font-weight: 700;font-size: 20rpx;color: #fff;text-align: center;background: #00BFFF;border-radius: 10rpx;margin: 20rpx 0 0 10rpx;line-height: 30rpx;">
</view>
</view>
<view class="shangpin">
<view class="qu-song">
<view class="qu-box">
<view class='qu-tu'>
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/1f77398a73454a6595c12a3c18731599.png" alt="" />
</view>
<view class="qu-text">
<view class="qu-left">
第三师堂A02窗口
</view>
<view class="qu-right">
1000m
</view>
</view>
</view>
<view class="qu-box" style="margin-top:10rpx;">
<view class='qu-tu'>
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/d0764fb4138747769538cf1cafa3b017.png" alt="" />
</view>
<view class="qu-text">
<view class="qu-left">
11号楼310
</view>
<view class="qu-right">
2.1km
</view>
</view>
</view>
</view>
</view>
</view>
<view class="yongjin">
<view style="width: 50%;color: #777;padding-left: 4%;display: flex;">
配送佣金
<view class="chaoda">
超大/超重
</view>
</view>
<view style="font-weight: 700;width: 50%;text-align: right;">
5.00
<text style="color: #777;font-size: 22rpx;">包含2平台佣金</text>
</view>
</view>
<view class="qiangdan-btn">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/1b8b815302a34902ac79a76a469e4ee6.png" alt="">
</view>
</view>
<view class="list-1">
<view style="display:flex;">
<view class="daoda-time">
送达时间02-02 18:02
</view>
<view class="paotui-title">
<view class="paotui-text">
取件码:1-2-9830
</view>
<view class="paotui-num">
3
</view>
<view>
<uni-icons type="right" size="12"></uni-icons>
</view>
</view>
</view>
<view class="order-page">
<view class="shangjia">
<text style="font-weight: 700;">王继酸辣粉</text>
<view
style="width: 32rpx;height: 30rpx;font-weight: 700;font-size: 20rpx;color: #fff;text-align: center;background: #00BFFF;border-radius: 10rpx;margin: 20rpx 0 0 10rpx;line-height: 30rpx;">
</view>
</view>
<view class="shangpin">
<view class="qu-song">
<view class="qu-box">
<view class='qu-tu'>
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/1f77398a73454a6595c12a3c18731599.png" alt="" />
</view>
<view class="qu-text">
<view class="qu-left">
第三师堂A02窗口
</view>
<view class="qu-right">
1000m
</view>
</view>
</view>
<view class="qu-box" style="margin-top:10rpx;">
<view class='qu-tu'>
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/d0764fb4138747769538cf1cafa3b017.png" alt="" />
</view>
<view class="qu-text">
<view class="qu-left">
11号楼310
</view>
<view class="qu-right">
2.1km
</view>
</view>
</view>
</view>
</view>
</view>
<view class="yongjin">
<view style="width: 50%;color: #777;padding-left: 4%;display: flex;">
配送佣金
<view class="chaoda">
超大/超重
</view>
</view>
<view style="font-weight: 700;width: 50%;text-align: right;">
5.00
<text style="color: #777;font-size: 22rpx;">包含2平台佣金</text>
</view>
</view>
<view class="qiangdan-btn">
<view class="qiangdan-btn" @tap="getOrder(item,index)">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/1b8b815302a34902ac79a76a469e4ee6.png" alt="">
</view>
</view>
@ -791,7 +453,8 @@
areaName:'',
indicatorDots: false,
autoplay: true,
interval: 4000,
deliveryItem:[]
, interval: 4000,
duration: 1000,
latitude: 39.909, //
longitude: 116.39742, //
@ -811,10 +474,25 @@
}],
dataList: [],
areaList:[],
waimaiCount:0,
kuaidiCount:0,
paotuiCount:0,
zhipaiCount:0,
searchForm:{
hallOnly: true,
status: 0,
pageNum:1,
regionId:JSON.parse(uni.getStorageSync('area')).id,
deliveryType: 1,
waimaiData: [],
workerId: uni.getStorageSync('worker') ? uni.getStorageSync('worker').workerId : '',
kuaidiData: []
},
checked:'daimaifan',
navBarHeight: 0,
menuListOffsetTop: 0,
lastScrollTop: 0,
worker:null,
isSwitching: true,
yongjin:false,
isArea: false,
@ -836,6 +514,17 @@
postList,
myCenter
},
filters: {
formatHourMinute(value) {
if (!value) return '';
// 使 Date
return new Date(value).toLocaleTimeString('zh-CN', {
hour: '2-digit',
minute: '2-digit',
hour12: false
});
}
},
onPageScroll(e) {
const scrollTop = e.scrollTop;
const isScrollingUp = scrollTop < this.lastScrollTop;
@ -857,8 +546,36 @@
}
},
onLoad() {
let worker = uni.getStorageSync('worker')
if(worker != '' && worker != undefined && worker != null){
this.worker = worker
}
//
this.getUserLocation();
if(uni.getStorageSync('waimaiData')){
let waimailist = uni.getStorageSync('waimaiData')
if(waimailist.length > 0){
for(let a = 0;a<waimailist.length;a++){
let waimai = {
getAreaId:waimailist[a].getAreaId,
putAreaId:waimailist[a].putAreaId
}
this.searchForm.waimaiData.push(waimai)
}
}
}
if(uni.getStorageSync('kuaidiData')){
let waimailist = uni.getStorageSync('kuaidiData')
if(waimailist.length > 0){
for(let a = 0;a<waimailist.length;a++){
let waimai = {
getAreaId:waimailist[a].getAreaId,
putAreaId:waimailist[a].putAreaId
}
this.searchForm.kuaidiData.push(waimai)
}
}
}
// WebSocket
this.getDeliveryLocation();
this.getDelivery();
@ -898,8 +615,65 @@
// 400ms200ms200ms
setTimeout(() => { this.isSwitching = false; }, 400);
},
getOrder(item,index){
let data = {
groupId:item.groupId ? item.groupId : '',
deliveryId:item.id,
workerId:uni.getStorageSync('worker') ? uni.getStorageSync('worker').workerId : '',
regionId:JSON.parse(uni.getStorageSync('area')).id
}
let that = this
this.tui.request("/mall/delivery/accept", "POST",data, false, true).then((res) => {
that.loadStatus = 'nomore';
if (res.code == 200) {
that.deliveryItem.splice(index,1)
that.tui.toast(res.message);
if(item.deliveryType == 1){
that.waimaiCount -= 1
}else if(item.deliveryType == 2){
that.kuaidiCount -= 1
}else if(item.deliveryType == 3){
that.paotuiCount -= 1
}
if(item.workerId != null && item.workerId != undefined && item.workerId != ''){
that.zhipaiCount -= 1
}
that.$forceUpdate();
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res) => {});
},
getDelivery(){
let that = this
this.tui.request("/mall/delivery/page", "POST", this.searchForm, false, false).then((res) => {
that.loadStatus = 'nomore';
if (res.code == 200) {
that.deliveryItem = res.result.records;
if(res.result.orderCount != null){
for(let i =0;i<res.result.orderCount.length;i++){
console.log(res.result.orderCount[i])
if(res.result.orderCount[i].deliveryType == 1){
that.waimaiCount = res.result.orderCount[i].orderCount
}else if(res.result.orderCount[i].deliveryType == 2){
that.kuaidiCount = res.result.orderCount[i].orderCount
}else if(res.result.orderCount[i].deliveryType == 3){
that.paotuiCount = res.result.orderCount[i].orderCount
}
if(res.result.zhipaiCount != undefined && res.result.zhipaiCount != null){
that.zhipaiCount = res.result.zhipaiCount
}
}
}
that.$forceUpdate();
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res) => {});
},
checkTab(index) {
for (let i = 0; i < this.menuList.length; i++) {
@ -1004,8 +778,23 @@
},
checkTab(type){
this.checked = type
if(type == 'waimai'){
this.searchForm.deliveryType = 1
}else if(type == 'kuaidi'){
this.searchForm.deliveryType = 2
}else if(type == 'paotui'){
this.searchForm.deliveryType = 3
}else if(type == 'zhipai'){
this.searchForm.deliveryType = 4
}
this.getDelivery()
this.$forceUpdate()
},
makeCall(phone){
uni.makePhoneCall({
phoneNumber: phone
});
},
// 使WebSocket
getDeliveryLocation() {
// WebSocket
@ -1420,13 +1209,14 @@
}
.daoda-time {
width: 284rpx;
width: 200rpx;
height: 48rpx;
font-size: 24rpx;
padding-left: 10rpx;
font-weight: 700;
border-radius: 10rpx;
line-height: 48rpx;
text-align: center;
text-align: left;
background: rgba(166, 255, 234, 0.3);
margin: 20rpx 0 20rpx 20rpx;
}
@ -1447,7 +1237,7 @@
background-size: 100%;
position: absolute;
top: -60rpx;
right: 40rpx;
right: 10rpx;
text-align: center;
line-height: 90rpx;
font-weight: 900;
@ -1545,12 +1335,12 @@
}
.qu-left {
width: 50%;
width: 80%;
padding-left: 10rpx;
}
.qu-right {
width: 50%;
width: 20%;
text-align: right;
padding-right: 10rpx;
font-weight: 700;

Loading…
Cancel
Save