|
|
@ -54,24 +54,24 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="bottom"> |
|
|
|
<view @click.stop="toPayOrder(item)" class="b1" v-if="item.state == 0"> |
|
|
|
立即付款 |
|
|
|
</view> |
|
|
|
<view @click.stop="calcelOrder(item.id)" class="b1" v-if="item.state == 1"> |
|
|
|
<view @click.stop="calcelOrder(item.id,cancelSuccess)" class="b1" v-if="item.state == 0"> |
|
|
|
取消订单 |
|
|
|
</view> |
|
|
|
<view class="b2" @click.stop="toEvaluate()" v-if="item.state == 0 && item.type == 0"> |
|
|
|
微信支付 |
|
|
|
</view> |
|
|
|
<view class="b2" @click.stop="toEvaluate()" v-if="item.state == 0 && item.type == 1"> |
|
|
|
余额支付 |
|
|
|
<view @click.stop="toPayOrder(item)" class="b2" v-if="item.state == 0"> |
|
|
|
立即付款 |
|
|
|
</view> |
|
|
|
<view class="b1" @click.stop="moreOrder(item)" v-if="item.state == 3"> |
|
|
|
<!-- <view @click.stop="toPayOrder(item)" class="b2" v-if="item.state == 2"> |
|
|
|
立即确认 |
|
|
|
</view> --> |
|
|
|
<view class="b1" @click.stop="moreOrder(item.projectId,toPlaceorder)" v-if="item.state == 3"> |
|
|
|
再来一单 |
|
|
|
</view> |
|
|
|
<view class="b2" @click.stop="toEvaluate(item)" v-if="item.state == 3 && item.jsEvaluated == 0"> |
|
|
|
<view class="b2" @click.stop="toEvaluate(item.id,item.projectId)" v-if="item.state == 3"> |
|
|
|
立即评价 |
|
|
|
</view> |
|
|
|
<view class="b2" @click.stop="moreOrder(item.projectId,toPlaceorder)" v-if="item.state == 4"> |
|
|
|
再来一单 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
@ -88,11 +88,13 @@ |
|
|
|
showConfirmDialog |
|
|
|
} from 'vant'; |
|
|
|
import Position from '@/utils/position.js' |
|
|
|
import order from '@/mixins/order.js' |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
mNavbar, |
|
|
|
}, |
|
|
|
mixins: [order], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
tabs: [{ |
|
|
@ -114,7 +116,7 @@ |
|
|
|
name: '已取消' |
|
|
|
} |
|
|
|
], |
|
|
|
active: this.$route.query.active || 0, |
|
|
|
active: this.$route.query.active ? parseInt(this.$route.query.active) : 0, |
|
|
|
queryParams: { |
|
|
|
state: -1, |
|
|
|
pageNo: 1, |
|
|
@ -126,22 +128,21 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.getOrderList(-1) |
|
|
|
this.getOrderList() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//获取订单列表 |
|
|
|
getOrderList() { |
|
|
|
this.queryParams.state = this.active - 1 > -2 ? this.active - 1 : -1 |
|
|
|
this.$api('getOrderList', this.queryParams, res => { |
|
|
|
if (res.code == 200) { |
|
|
|
if (res.code == 200) { |
|
|
|
this.orderList = res.result.records; |
|
|
|
} else { |
|
|
|
this.finished = true |
|
|
|
} |
|
|
|
this.orderList = res.result.records; |
|
|
|
if (this.queryParams.pageSize > res.result.total) { |
|
|
|
this.finished = true |
|
|
|
} |
|
|
|
this.loading = false |
|
|
|
}else{ |
|
|
|
this.finished = true |
|
|
|
} |
|
|
|
|
|
|
|
//用户不存在,删除token和用户信息并且需要用户重新登录 |
|
|
@ -165,13 +166,6 @@ |
|
|
|
this.getOrderList() |
|
|
|
}, |
|
|
|
|
|
|
|
//跳转评论页面 |
|
|
|
toEvaluate(item) { |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/order/evaluate?id=' + item.id + '&projectId=' + item.projectId |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//跳转订单详情页面 |
|
|
|
toOrderDetail(id) { |
|
|
|
uni.navigateTo({ |
|
|
@ -179,54 +173,21 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//再来一单 |
|
|
|
moreOrder(item) { |
|
|
|
this.$api('getProjectDetail', { |
|
|
|
id: item.projectId |
|
|
|
}, res => { |
|
|
|
if (res.code == 200) { |
|
|
|
uni.navigateTo({ |
|
|
|
url: `/pages/technician/selectTechnician?serviceId=${item.projectId}` |
|
|
|
}) |
|
|
|
sessionStorage.setItem('technicianList', JSON.stringify(res.result.tenPageList)) |
|
|
|
} |
|
|
|
//跳转再来一单 |
|
|
|
toPlaceorder(res, projectId) { |
|
|
|
uni.navigateTo({ |
|
|
|
url: `/pages/technician/selectTechnician?serviceId=${projectId}¤t=order&active=${this.active}` |
|
|
|
}) |
|
|
|
sessionStorage.setItem('technicianList', JSON.stringify(res.result.tenPageList)) |
|
|
|
}, |
|
|
|
|
|
|
|
//取消订单 |
|
|
|
calcelOrder(orderId) { |
|
|
|
showConfirmDialog({ |
|
|
|
title: '取消订单', |
|
|
|
message: '确认取消订单?取消后,请留意退款或后续通知。', |
|
|
|
}).then(() => { |
|
|
|
this.$api('cancelVipOrder', { |
|
|
|
orderId |
|
|
|
}, res => { |
|
|
|
if (res.code == 200) { |
|
|
|
uni.showToast({ |
|
|
|
title: '取消成功', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
this.getOrderList() |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => {}); |
|
|
|
}, |
|
|
|
|
|
|
|
//立即支付 |
|
|
|
toPayOrder(item) { |
|
|
|
this.$api('immediatelyPay', { |
|
|
|
addressId: item.addressId, |
|
|
|
couponId: item.couponId, |
|
|
|
orderId: item.id, |
|
|
|
payType: item.payType, |
|
|
|
remark: item.remark, |
|
|
|
serviceTime: item.serviceTime |
|
|
|
}, res => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.$wxPay(res,this.getOrderList,this.getOrderList) |
|
|
|
} |
|
|
|
|
|
|
|
//取消成功 |
|
|
|
cancelSuccess() { |
|
|
|
uni.showToast({ |
|
|
|
title: '取消成功', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
this.getOrderList() |
|
|
|
}, |
|
|
|
|
|
|
|
//list列表滑动到底部自动新增数据列表 |
|
|
@ -275,12 +236,12 @@ |
|
|
|
.left { |
|
|
|
width: 150rpx; |
|
|
|
height: 150rpx; |
|
|
|
overflow: hidden; |
|
|
|
border-radius: 10rpx; |
|
|
|
|
|
|
|
image { |
|
|
|
width: 150rpx; |
|
|
|
height: 150rpx; |
|
|
|
border-radius: 10rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.tag { |
|
|
|