完善订单
This commit is contained in:
@ -14,11 +14,17 @@
|
||||
</navbar>
|
||||
|
||||
<view class="top-tabbar">
|
||||
<view :class="state_active == 0 ? 'tab-item active' : 'tab-item'" @click="stateFunc('all')">全部订单</view>
|
||||
<!-- <view :class="state_active == 0 ? 'tab-item active' : 'tab-item'" @click="stateFunc('all')">全部订单</view>
|
||||
<view :class="state_active == 1 ? 'tab-item active' : 'tab-item'" @click="stateFunc(1)">待付款</view>
|
||||
<view :class="state_active == 2 ? 'tab-item active' : 'tab-item'" @click="stateFunc(2)">已预约</view>
|
||||
<view :class="state_active == 3 ? 'tab-item active' : 'tab-item'" @click="stateFunc(3)">已完成</view>
|
||||
<view :class="state_active == 4 ? 'tab-item active' : 'tab-item'" @click="stateFunc(4)">退订/退款</view>
|
||||
<view :class="state_active == 4 ? 'tab-item active' : 'tab-item'" @click="stateFunc(4)">退订/退款</view> -->
|
||||
<view :class="state_active == 0 ? 'tab-item active' : 'tab-item'" @click="stateFunc(0)">全部订单</view>
|
||||
<view :class="state_active == 1 ? 'tab-item active' : 'tab-item'" @click="stateFunc(1)">待付款</view>
|
||||
<view :class="state_active == 2 ? 'tab-item active' : 'tab-item'" @click="stateFunc(2)">已预约</view>
|
||||
<view :class="state_active == 3 ? 'tab-item active' : 'tab-item'" @click="stateFunc(3)">进行中</view>
|
||||
<view :class="state_active == 4 ? 'tab-item active' : 'tab-item'" @click="stateFunc(4)">已完成</view>
|
||||
<view :class="state_active == 5 ? 'tab-item active' : 'tab-item'" @click="stateFunc(5)">退订/退款</view>
|
||||
</view>
|
||||
|
||||
<view class="d-f a-i-c ball-type-box">
|
||||
@ -247,20 +253,24 @@
|
||||
if (typeof e.dataType != 'undefined') {
|
||||
this.dataType = e.dataType;
|
||||
}
|
||||
|
||||
// state_active 是tab栏的下标,dataType是订单状态,两者不一致,需要转换
|
||||
if (this.dataType == 'all') {
|
||||
// 全部订单
|
||||
this.state_active = 0;
|
||||
} else if (this.dataType == 0) {
|
||||
// 待付款
|
||||
this.state_active = 1;
|
||||
} else if (this.dataType == 1) {
|
||||
// 已预约
|
||||
this.state_active = 2;
|
||||
} else if (this.dataType == 2) {
|
||||
this.state_active = 3;
|
||||
} else if (this.dataType == 4) {
|
||||
} else if (this.dataType == 3) {
|
||||
// 已完成
|
||||
this.state_active = 4;
|
||||
} else if (this.dataType == 5) {
|
||||
// 退订/退款
|
||||
this.state_active = 5;
|
||||
}
|
||||
console.log("🚀 ~ this.dataType:", this.dataType)
|
||||
console.log("🚀 ~ this.dataType:", this.state_active)
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
@ -307,28 +317,41 @@
|
||||
self.page = 1;
|
||||
self.loading = true;
|
||||
self.state_active = e;
|
||||
|
||||
switch (e) {
|
||||
case 'all':
|
||||
case 0:
|
||||
// 全部订单
|
||||
self.listData = [];
|
||||
self.dataType = 'all';
|
||||
break;
|
||||
case 1:
|
||||
// 待付款
|
||||
self.listData = [];
|
||||
self.dataType = 0;
|
||||
break;
|
||||
case 2:
|
||||
// 已预约
|
||||
self.listData = [];
|
||||
self.dataType = 1;
|
||||
break;
|
||||
case 3:
|
||||
// 进行中
|
||||
self.listData = [];
|
||||
self.dataType = 2;
|
||||
break;
|
||||
case 4:
|
||||
// 已完成
|
||||
self.listData = [];
|
||||
self.dataType = 4;
|
||||
self.dataType = 3;
|
||||
break;
|
||||
case 5:
|
||||
// 退订/退款
|
||||
self.listData = [];
|
||||
self.dataType = 5;
|
||||
break;
|
||||
}
|
||||
console.log("🚀 ~fff self.dataType:", self.dataType)
|
||||
|
||||
self.getData();
|
||||
}
|
||||
},
|
||||
@ -349,29 +372,10 @@
|
||||
|
||||
/*获取数据*/
|
||||
getData() {
|
||||
// let self = this;
|
||||
// self.loading = true;
|
||||
// let dataType = self.dataType;
|
||||
// self._get(
|
||||
// 'user.order/lists', {
|
||||
// dataType: dataType,
|
||||
// page: self.page,
|
||||
// list_rows: self.list_rows
|
||||
// },
|
||||
// function(res) {
|
||||
// self.loading = false;
|
||||
// self.listData = self.listData.concat(res.data.list.data);
|
||||
// self.last_page = res.data.list.last_page;
|
||||
// if (res.data.list.last_page <= 1) {
|
||||
// self.no_more = true;
|
||||
// } else {
|
||||
// self.no_more = false;
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
let self = this;
|
||||
self.loading = true;
|
||||
let dataType = self.dataType;
|
||||
console.log("🚀 ~ dataType:", dataType)
|
||||
if (dataType == 'all') {
|
||||
dataType = '';
|
||||
}
|
||||
@ -511,7 +515,7 @@
|
||||
order_id: self.order_id
|
||||
},
|
||||
function(res) {
|
||||
this.cancelOrderPopup = false;
|
||||
self.cancelOrderPopup = false;
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '操作成功',
|
||||
@ -654,5 +658,12 @@
|
||||
}
|
||||
|
||||
|
||||
.tab-item {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.tab-item.active {
|
||||
color: #365A9A;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -91,8 +91,8 @@
|
||||
<view class="cg-reserve">
|
||||
<view class="cg-title">预约信息</view>
|
||||
<!-- todo 这里的状态如果是交易完成、订单取消、退款成功则将下面的预约改为使用 -->
|
||||
<view class="cg-desc1">预约时间:2025-03-18 09:00-12:00</view>
|
||||
<view class="cg-desc2">预约时长:3小时</view>
|
||||
<view class="cg-desc1">预约时间:{{ detail.day_time }}</view>
|
||||
<view class="cg-desc2">预约时长:{{ detail.hours }}小时</view>
|
||||
<template v-if="ballType == 1">
|
||||
<view class="cg-desc2">场地信息:</view>
|
||||
<view class="desc" v-for="(item, index) in detail.trade" :key="index">
|
||||
|
||||
Reference in New Issue
Block a user