wangfukang 20 hours ago
parent
commit
2ffc8f3f89
  1. 67
      pages/index/index.vue

67
pages/index/index.vue

@ -26,19 +26,39 @@
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/eaae29a344a241b3b46e7b91882ca197.png" alt="" /> <img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/eaae29a344a241b3b46e7b91882ca197.png" alt="" />
</swiper-item> </swiper-item>
</swiper> </swiper>
<view class="order-msg-box"> <swiper class="swiper" vertical circular :autoplay="orderLists.length > 0"
<view class="order-msg-left"> :interval="onlineWorkerInterval" :duration="onlineWorkerDuration">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/bf2bb7f80e17428391c407aef769517a.png" alt="" /> <swiper-item v-if="orderLists.length > 0" v-for="(item,index) in orderLists" :key="index" @tap="goOrderDetail(item)">
</view> <view class="order-msg-box">
<view class="order-msg-center"> <view class="order-msg-left">
<view style="font-weight: 700;font-size: 30rpx;line-height: 60rpx;margin-top: 5%;">配送员正在赶往商家 <img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/bf2bb7f80e17428391c407aef769517a.png" alt="" />
</view>
<view class="order-msg-center">
<view style="font-weight: 700;font-size: 30rpx;line-height: 60rpx;margin-top: 5%;">
<text v-if="item.status == 0">待支付</text>
<text v-if="item.status == 2">等待配送员接单</text>
<text v-if="item.status == 10">待成团</text>
<text v-if="item.status == 3 && item.deliveryType == 1">配送员已接单</text>
<text v-if="item.status == 3 && item.deliveryType == 2">待消费</text>
<text v-if="item.status == 4 && item.deliveryType == 1">配送员已取货</text>
<text v-if="item.status == 5">订单已完成</text>
<text v-if="item.status == 7">等待同意退款</text>
<text v-if="item.status == 6">订单已取消</text>
<text v-if="item.status == 8">订单已退款</text>
<text v-if="item.status == 11">售后中</text>
<text v-if="item.status == 12">订单已售后</text>
</view>
<view style="font-size: 24rpx;" v-if="item.deliveryType == 1 && (item.status == 3 || item.status == 4) && item.deliveryInfo != null">
预计<text style="color: red;">{{item.deliveryInfo.mustFinishTime | formatHourMinute }}</text>送达
</view>
</view>
<view class="order-msg-right" @tap.stop="$refs.pagesPopup.open()">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/579569bfcc954f52baea06f6f11951be.png" alt="" />
</view>
</view> </view>
<view style="font-size: 24rpx;">预计<text style="color: red;">12:03-12:30</text>送达</view> </swiper-item>
</view> </swiper>
<view class="order-msg-right" @tap="$refs.pagesPopup.open()">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/579569bfcc954f52baea06f6f11951be.png" alt="" />
</view>
</view>
<view class="menu-box"> <view class="menu-box">
<view class="menu-list" @tap="goDetail('1')"> <view class="menu-list" @tap="goDetail('1')">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/7690c4f897604fca804ea932bc3c1239.png" alt="" /> <img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/7690c4f897604fca804ea932bc3c1239.png" alt="" />
@ -473,7 +493,9 @@
autoplay: true, autoplay: true,
deliveryItem:[], deliveryItem:[],
interval: 4000, interval: 4000,
onlineWorkerInterval:4000,
duration: 1000, duration: 1000,
onlineWorkerDuration:1000,
latitude: 39.909, // latitude: 39.909, //
longitude: 116.39742, // longitude: 116.39742, //
markers: [], // markers: [], //
@ -492,6 +514,7 @@
}], }],
dataList: [], dataList: [],
areaList:[], areaList:[],
orderLists:[],
waimaiCount:0, waimaiCount:0,
kuaidiCount:0, kuaidiCount:0,
paotuiCount:0, paotuiCount:0,
@ -600,6 +623,7 @@
} }
// //
this.getUserLocation(); this.getUserLocation();
this.getUserOrders();
// WebSocket // WebSocket
this.getDeliveryLocation(); this.getDeliveryLocation();
if(!uni.getStorageSync('area')){ if(!uni.getStorageSync('area')){
@ -785,6 +809,11 @@
url: url url: url
}) })
}, },
goOrderDetail(item){
uni.redirectTo({
url: '/package1/order/orderDetail?id=' + item.id
});
},
onClickArea(item){ onClickArea(item){
uni.setStorageSync('area',JSON.stringify(item)) uni.setStorageSync('area',JSON.stringify(item))
this.searchForm.regionId = item.id this.searchForm.regionId = item.id
@ -828,6 +857,20 @@
} }
}).catch((res) => {}) }).catch((res) => {})
}, },
getUserOrders(){
let that = this
that.tui.request("/mall/order/getOrdersByUserId/"+ uni.getStorageSync('id'), "GET", {}, false, true).then((res) => {
if (res.code == 200) {
if(res.result != null){
that.orderLists = res.result
that.$forceUpdate()
}
} else {
that.tui.toast(res.message)
return
}
}).catch((res) => {})
},
searchOrder(type, value) { searchOrder(type, value) {
if (type == 'getarea') { if (type == 'getarea') {
if(this.searchForm.getAreaId == value.id){ if(this.searchForm.getAreaId == value.id){

Loading…
Cancel
Save