wangfukang 22 hours ago
parent
commit
2ffc8f3f89
  1. 53
      pages/index/index.vue

53
pages/index/index.vue

@ -26,19 +26,39 @@
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/eaae29a344a241b3b46e7b91882ca197.png" alt="" />
</swiper-item>
</swiper>
<swiper class="swiper" vertical circular :autoplay="orderLists.length > 0"
:interval="onlineWorkerInterval" :duration="onlineWorkerDuration">
<swiper-item v-if="orderLists.length > 0" v-for="(item,index) in orderLists" :key="index" @tap="goOrderDetail(item)">
<view class="order-msg-box">
<view class="order-msg-left">
<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%;">配送员正在赶往商家
</view>
<view style="font-size: 24rpx;">预计<text style="color: red;">12:03-12:30</text>送达</view>
</view>
<view class="order-msg-right" @tap="$refs.pagesPopup.open()">
<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>
</swiper-item>
</swiper>
<view class="menu-box">
<view class="menu-list" @tap="goDetail('1')">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/7690c4f897604fca804ea932bc3c1239.png" alt="" />
@ -473,7 +493,9 @@
autoplay: true,
deliveryItem:[],
interval: 4000,
onlineWorkerInterval:4000,
duration: 1000,
onlineWorkerDuration:1000,
latitude: 39.909, //
longitude: 116.39742, //
markers: [], //
@ -492,6 +514,7 @@
}],
dataList: [],
areaList:[],
orderLists:[],
waimaiCount:0,
kuaidiCount:0,
paotuiCount:0,
@ -600,6 +623,7 @@
}
//
this.getUserLocation();
this.getUserOrders();
// WebSocket
this.getDeliveryLocation();
if(!uni.getStorageSync('area')){
@ -785,6 +809,11 @@
url: url
})
},
goOrderDetail(item){
uni.redirectTo({
url: '/package1/order/orderDetail?id=' + item.id
});
},
onClickArea(item){
uni.setStorageSync('area',JSON.stringify(item))
this.searchForm.regionId = item.id
@ -828,6 +857,20 @@
}
}).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) {
if (type == 'getarea') {
if(this.searchForm.getAreaId == value.id){

Loading…
Cancel
Save