send 7.28
This commit is contained in:
@@ -1,28 +1,43 @@
|
||||
<template>
|
||||
<view class="wash">
|
||||
<view class="title">
|
||||
<u-tabs-swiper ref="tabs" :list="list" :is-scroll="false" active-color="#FF780F" :current="current" font-size="32" :show-bar="false" @change="tabsChange" height="88" ></u-tabs-swiper>
|
||||
<u-tabs-swiper ref="tabs" :list="list" :is-scroll="false" active-color="#FF780F" :current="current" font-size="32" :show-bar="false" @change="tabsChange" height="88"></u-tabs-swiper>
|
||||
<u-icon name="arrow-down-fill" :color="current == 0 ? '#FF780F' : '#333333'" size="17" class="order-icon" :style="{ left: list[0].name == '平台历史订单' ? '236rpx' : '252rpx' }"></u-icon>
|
||||
</view>
|
||||
<swiper :current="swiperCurrent" @animationfinish="animationfinish">
|
||||
<swiper-item class="swiper-item">
|
||||
<scroll-view scroll-y class="order-list">
|
||||
<view v-for="(item, index) in 6" :key="index" class="order-item">
|
||||
<scroll-view scroll-y class="order-list" @scrolltolower="loadmore">
|
||||
<view v-for="(item, index) in orderList" :key="index" class="order-item">
|
||||
<view class="order-title">
|
||||
<view class="order-text">订单状态</view>
|
||||
<view class="order-status">已预约</view>
|
||||
<view class="order-status">{{ item.order_status | viewStatus }}</view>
|
||||
</view>
|
||||
<view class="order-info">
|
||||
<image src="../static/mine/23.png"></image>
|
||||
<view>
|
||||
<view>骑手名字:xxx</view>
|
||||
<view>联系方式:123456789</view>
|
||||
<view>所属公司:xx公司</view>
|
||||
<view v-if="item.deliver_goods_type == 2 && item.order_status == 20">
|
||||
<view>骑手名字:{{ item.takeawayer_name }}</view>
|
||||
<view>联系方式:{{ item.member_phone }}</view>
|
||||
</view>
|
||||
<view v-if="item.order_status == 0">
|
||||
<view>正在等待接单</view>
|
||||
</view>
|
||||
<view v-if="item.order_status == 40">
|
||||
<view>商家已拒绝</view>
|
||||
</view>
|
||||
<view v-if="item.order_status == 50">
|
||||
<view>交易已完成</view>
|
||||
</view>
|
||||
<view v-if="item.deliver_goods_type == 1 && item.order_status == 20">
|
||||
<view>商家在正路途中,请耐心等待</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="send-btn">
|
||||
<view class="btn" v-if="btn_show">
|
||||
<view class="send-btn" v-if="item.order_status == 20 || item.order_status == 50">
|
||||
<view class="btn" v-if="item.order_status == 20" @click="sendLaundryOrderConfirm(item.laundry_id)">
|
||||
确认完成
|
||||
</view>
|
||||
<view class="btn" v-if="item.order_status == 50">
|
||||
去评价
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@@ -40,7 +55,7 @@
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view class="popup" v-if="showPopup" @click="onTap">
|
||||
<view class="popup" v-if="showPopup" @click="onTap">
|
||||
<view class="popup_cont" @click="replaces(1)">
|
||||
实体店历史订单
|
||||
</view>
|
||||
@@ -51,7 +66,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import Comment from '@/components/mine/comment/index'
|
||||
import Comment from '@/components/mine/comment/index';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -65,18 +80,85 @@ export default {
|
||||
}],
|
||||
current: 0,
|
||||
swiperCurrent: 0,
|
||||
btn_show:true
|
||||
btn_show:true,
|
||||
page: 1,
|
||||
orderList: [],
|
||||
timer: true,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Comment
|
||||
},
|
||||
filters: {
|
||||
viewStatus(status) {
|
||||
let state;
|
||||
switch (status) {
|
||||
case 0:
|
||||
state = '等待接单';
|
||||
break;
|
||||
case 20:
|
||||
state = '已接单';
|
||||
break;
|
||||
case 40:
|
||||
state = '交易失败';
|
||||
break;
|
||||
case 50:
|
||||
state = '交易成功';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.current = 0;
|
||||
this.swiperCurrent = 0;
|
||||
this.showPopup= false
|
||||
this.showPopup = false;
|
||||
this.sendLaundryOrderList();
|
||||
},
|
||||
methods: {
|
||||
async sendLaundryOrderList({ load = 'reload' } = {}) {
|
||||
let type = this.list[0].name == '平台历史订单' ? 1 : 2;
|
||||
const res = await this.$u.api.sendLaundryOrderList({
|
||||
type: type,
|
||||
page: this.page,
|
||||
})
|
||||
this.timer = false;
|
||||
if(res.errCode == 0) {
|
||||
// this.orderList = res.data.list;
|
||||
// console.log(...res.data.list);
|
||||
if(load == 'loadmore') this.orderList = this.orderList.concat(res.data.list);
|
||||
else if(load == 'reload') this.orderList = res.data.list;
|
||||
} else {
|
||||
this.orderList = [];
|
||||
}
|
||||
return res.data.list.length;
|
||||
},
|
||||
sendLaundryOrderConfirm(id) {
|
||||
this.$u.api.sendLaundryOrderConfirm({ id: id }).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.sendLaundryOrderList();
|
||||
}
|
||||
this.$u.toast(res.message);
|
||||
})
|
||||
},
|
||||
loadmore() {
|
||||
if(!this.timer) return false;
|
||||
this.loadStatus = "loading";
|
||||
this.page++;
|
||||
this.sendLaundryOrderList({ load: 'loadmore' }).then(length => {
|
||||
if(length == 0) {
|
||||
this.page--;
|
||||
this.status = 'nomore';
|
||||
} else {
|
||||
this.status = 'loading';
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loadStatus = "nomore";
|
||||
this.page--;
|
||||
})
|
||||
},
|
||||
tabsChange(index) {
|
||||
this.swiperCurrent = index;
|
||||
this.toApplyPage(index);
|
||||
@@ -90,14 +172,14 @@ export default {
|
||||
toApplyPage(index) {
|
||||
var that = this;
|
||||
if(index == 1) {
|
||||
this.showPopup = false
|
||||
this.showPopup = false;
|
||||
uni.navigateTo({
|
||||
url: '/pageE/tool/WashOrder'
|
||||
});
|
||||
}else if(index ==0){
|
||||
} else if (index == 0){
|
||||
this.history();
|
||||
}else{
|
||||
this.showPopup = false
|
||||
} else {
|
||||
this.showPopup = false;
|
||||
}
|
||||
},
|
||||
history(){
|
||||
@@ -106,9 +188,10 @@ export default {
|
||||
replaces(e){
|
||||
if(e == 1){
|
||||
this.$set(this.list,0,{name: '实体店历史订单'} )
|
||||
}else{
|
||||
} else {
|
||||
this.$set(this.list,0,{name: '平台历史订单'} )
|
||||
}
|
||||
this.sendLaundryOrderList();
|
||||
},
|
||||
onTap(){
|
||||
this.showPopup = false
|
||||
@@ -124,10 +207,15 @@ export default {
|
||||
flex-direction: column;
|
||||
> uni-swiper {
|
||||
flex: 1;
|
||||
height: 85vh;
|
||||
}
|
||||
.title{
|
||||
|
||||
.title {
|
||||
position: relative;
|
||||
.order-icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
z-index: 9;
|
||||
}
|
||||
}
|
||||
.swiper-item {
|
||||
padding-top: 20rpx;
|
||||
@@ -138,8 +226,8 @@ export default {
|
||||
padding: 0 30rpx;
|
||||
.order-item {
|
||||
padding: 30rpx;
|
||||
width:690rpx;
|
||||
height: 362rpx;
|
||||
width: 690rpx;
|
||||
// height: 362rpx;
|
||||
background: rgba(255,255,255,1);
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
@@ -218,7 +306,6 @@ export default {
|
||||
justify-content: top;
|
||||
align-items: center;
|
||||
transition-duration: 0.3s;
|
||||
|
||||
.popup_cont{
|
||||
border-top: 1px solid RGBA(239, 236, 240, 1);
|
||||
background-color: #fff;
|
||||
@@ -230,6 +317,7 @@ export default {
|
||||
font-weight:400;
|
||||
color:rgba(102,102,102,1);
|
||||
padding-left: 41rpx;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user