完善订单页面

This commit is contained in:
wangxiaowei
2025-12-08 01:37:33 +08:00
parent becadb1d0c
commit 4a0d0c1114
6 changed files with 348 additions and 141 deletions

View File

@ -5,7 +5,7 @@
<view class="search-wrap2 d-b-c" style="margin-left: 30rpx;">
<view class="index-search t-c flex-1" style="border: none;background-color: #fff;border-radius: 36rpx;">
<span class="icon iconfont icon-sousuo"></span>
<input type="text" v-model="form.keyWord" class="flex-1 ml10 f30 gray3" value="" placeholder-class="f32 gray7"
<input type="text" v-model="keyWord" class="flex-1 ml10 f30 gray3" value="" placeholder-class="f32 gray7"
placeholder="搜索场馆订单" confirm-type="search" @confirm="search()"/>
</view>
<!--<button class="btn ml10" @click="search()" type="default">搜索</button>-->
@ -14,12 +14,17 @@
</navbar>
<view class="top-tabbar">
<view :class="state_active == 0 ? 'tab-item active' : 'tab-item'" @click="stateFunc(0)">全部订单</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>
<view class="d-f a-i-c ball-type-box">
<view class="ball" :class="ballType == 1 ? 'active' : ''" @click="changeBallType(1)">网球</view>
<view class="ball" :class="ballType == 2 ? 'active' : ''" @click="changeBallType(2)">篮球</view>
</view>
<!--列表-->
<scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" lower-threshold="50"
@scrolltolower="scrolltolowerFunc">
@ -31,19 +36,19 @@
<view class="order-head d-b-c">
<view class="d-f a-i-c">
<!-- <text class="state-text">{{ item.order_source_text }}</text> -->
<text class="cg-name flex-1 fb">场馆名称</text>
<text class="cg-name flex-1 fb" @click="toGround(item.ground_id)">{{ item.ground_name }}</text>
<image style="width: 48rpx;height: 48rpx;" src="@/static/icon/right.png" mode=""></image>
</view>
<view class="state cg-state">
<text class="red">{{ item.state_text }}</text>
<!-- <text style="color: #365A9A;">已预约</text>
<text style="color: #606266;">已完成</text>
<text style="color: #C9C9C9;">订单取消</text>
<text style="color: #606266;">退款成功</text> -->
<text class="red" v-if="item.order_status == 0">待付款</text>
<text style="color: #365A9A;" v-if="item.order_status == 1">已预约</text>
<text style="color: #606266;" v-if="item.order_status == 2">已完成</text>
<text style="color: #C9C9C9;" v-if="item.order_status == 3">订单取消</text>
<text style="color: #606266;" v-if="item.order_status == 4">退款成功</text>
</view>
</view>
<!--多个商品显示-->
<view class="product-list pr" v-if="item.product.length > 1" @click="gotoOrder(item.order_id)">
<!-- <view class="product-list pr" v-if="item.product.length > 1" @click="gotoOrder(item.order_id)">
<scroll-view scroll-x="true">
<view class="list d-s-c pr100">
<view class="cover mr10" v-for="(img, num) in item.product" :key="num" style="width: 200rpx; height: 200rxpx;">
@ -59,16 +64,13 @@
</view>
<view class="count">共{{ item.product.length }}件</view>
</view>
</view>
</view> -->
<!--一个商品显示-->
<view class="one-product d-s-c" v-else @click="gotoOrder(item.order_id)">
<view class="cover" v-for="(img, num) in item.product" :key="num" style="width: 200rpx; height: 200rxpx;">
<image :src="img.image.file_path" mode="aspectFill" style="width: 200rpx; height: 200rxpx;"></image>
</view>
<view class="one-product d-s-c" @click="gotoOrder(item.order_id)">
<image :src="item.image" mode="aspectFill" style="width: 200rpx; height: 200rpx; border-radius: 10rpx;"></image>
<view class="flex-1">
<view class="pro-info cg-info1">这个是场馆的分场名称</view>
<view class="pro-info cg-info2">预约时间03/18 08:00-12:00</view>
<view class="pro-info cg-info3">预约时长2小时</view>
<view class="pro-info cg-info2">订单号:{{ item.order_sn }}</view>
<view class="pro-info cg-info3">活动日期:{{ item.trade[0].day_title }}</view>
</view>
<!-- <view class="total-count">
@ -163,34 +165,17 @@
<view v-else class="count d-e-c ww100 redF11">取消申请中</view>
</view>
<view class="order-bts" v-else>
<block v-if="item.order_status.value ==10">
<block>
<!-- 未支付取消订单 -->
<button @click="showCancleOrderPopup(item.order_id)" class="theme-borderbtn cancel-btn"
v-if="item.pay_status.value == 10">取消订单</button>
<!-- 已支付取消订单 -->
<block v-if="item.pay_status.value == 20 && item.delivery_status.value == 10">
<button @click="cancelOrder(item.order_id)" class="theme-borderbtn pay-btn">申请取消</button>
</block>
<!-- 订单核销码 -->
<template
v-if="item.pay_status.value == 20 && item.delivery_type.value == 20 && item.delivery_status.value == 10">
<button v-if="item.order_source == 30 && item.assemble_status==20"
@click="onQRCode(item.order_id)" class="theme-borderbtn">核销码</button>
<button v-if="item.order_source != 30" @click="onQRCode(item.order_id)"
class="theme-borderbtn">核销码</button>
</template>
v-if="item.order_status == 0">取消订单</button>
<!-- 订单付款 -->
<block v-if="item.pay_status.value == 10"><button class="theme-btn pay-btn"
@click="onPayOrder(item.order_id)">去支付</button></block>
<block v-if="item.order_status == 0">
<button class="theme-btn pay-btn" @click="onPayOrder(item.order_id)">去支付</button>
</block>
<!-- todo 缺了一个删除订单的功能,需要跟后端确认 -->
<!-- <block v-if="item.pay_status.value == 10"><button class="theme-btn del-btn"
@click="onDelOrder(item.order_id)">删除订单</button></block> -->
<!-- 确认收货 -->
<block v-if="item.delivery_status.value == 20 && item.receipt_status.value == 10">
<button class="theme-btn" @click="orderReceipt(item.order_id)">确认收货</button>
<block v-if="item.order_status >= 2">
<button class="theme-btn del-btn" @click="onDelOrder(item.order_id)">删除订单</button>
</block>
</block>
<text v-if="item.order_status.value == 21" class="count">取消申请中</text>
@ -297,6 +282,9 @@
codeImg: '',
cancelOrderPopup: false,
delOrderPopup: false,
orderStatus: '',
keyWord: '',
ballType: 1, // 1网球 2篮球
};
},
computed: {
@ -317,15 +305,20 @@
if (typeof e.dataType != 'undefined') {
this.dataType = e.dataType;
}
if (this.dataType == 'payment') {
if (this.dataType == 'all') {
this.state_active = 0;
} else if (this.dataType == 0) {
this.state_active = 1;
} else if (this.dataType == 'received') {
this.state_active = 3;
} else if (this.dataType == 'comment') {
this.state_active = 4;
} else if (this.dataType == 'delivery') {
} else if (this.dataType == 1) {
this.state_active = 2;
} else if (this.dataType == 2) {
this.state_active = 3;
} else if (this.dataType == 4) {
this.state_active = 4;
}
console.log("🚀 ~ this.dataType:", this.dataType)
console.log("🚀 ~ this.dataType:", this.state_active)
},
mounted() {
this.init();
@ -353,33 +346,45 @@
});
},
// 切换球类
changeBallType(type) {
let self = this;
self.ballType = type;
self.listData = [];
self.getData();
},
/*状态切换*/
stateFunc(e) {
console.log("🚀 ~ e:", e)
let self = this;
console.log("🚀 ~ state_active:", self.state_active)
if (self.state_active != e) {
self.page = 1;
self.loading = true;
self.state_active = e;
switch (e) {
case 0:
case 'all':
self.listData = [];
self.dataType = 'all';
break;
case 1:
self.listData = [];
self.dataType = 'payment';
self.dataType = 0;
break;
case 2:
self.listData = [];
self.dataType = 'reserve';
self.dataType = 1;
break;
case 3:
self.listData = [];
self.dataType = 'completed';
self.dataType = 2;
break;
case 4:
self.listData = [];
self.dataType = 'comment';
self.dataType = 4;
break;
}
self.getData();
@ -402,20 +407,47 @@
/*获取数据*/
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;
self._get(
'user.order/lists', {
dataType: dataType,
if (dataType == 'all') {
dataType = '';
}
self._post(
'order.groundOrder/orderGroundList', {
order_status: dataType,
search: self.keyWord,
page: self.page,
list_rows: self.list_rows
size: self.list_rows,
app_id: self.getAppId(),
type: self.ballType
},
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.listData = self.listData.concat(res.data.lists.data);
console.log("🚀 ~ self.listData:", self.listData)
self.last_page = res.data.lists.last_page;
if (res.data.lists.last_page <= 1) {
self.no_more = true;
} else {
self.no_more = false;
@ -627,6 +659,13 @@
duration: 2000,
icon: 'none'
});
},
// 跳转场馆
toGround(ground_id) {
uni.navigateTo({
url: `/bundle/reserve/details?id=${id}&typeId=${this.ballType}`
});
}
}
};
@ -692,4 +731,27 @@
}
}
.ball-type-box {
margin-left: 40rpx;
margin-bottom: 24rpx;
.ball {
width: 108rpx;
height: 52rpx;
text-align: center;
line-height: 52rpx;
background: #FFFFFF;
border-radius: 8rpx;
font-size: 26rpx;
color: #606266;
margin-right: 10rpx;
}
.ball.active {
background: #365A9A;
color: #FFFFFF;
}
}
</style>

View File

@ -139,7 +139,7 @@ page {
height: 60rpx;
line-height: 60rpx;
margin-left: 20rpx;
font-size: 32rpx;
font-size: 28rpx;
border: 1px solid #F6220C;
border-radius: 8px;
background: #ffffff;
@ -238,7 +238,7 @@ page {
}
.cg-info2 {
margin-top: 34rpx;
white-space: nowrap;
font-weight: 400;
font-size: 26rpx;
color: #606266;

View File

@ -58,7 +58,7 @@
class="icon iconfont icon-jiantou"></text></view>
</view>
<view class="d-b-c w100">
<view class="item" @click="jumpPage('/pages/order/cg-my-order?dataType=payment')">
<view class="item" @click="jumpPage('/pages/order/cg-my-order?dataType=0')">
<view class="icon-box pr">
<image src="/static/icon/dfk.png" mode=""></image>
<text class="dot d-c-c"
@ -66,7 +66,7 @@
</view>
<text>待付款</text>
</view>
<view class="item" @click="jumpPage('/pages/order/cg-my-order?dataType=reserve')">
<view class="item" @click="jumpPage('/pages/order/cg-my-order?dataType=1')">
<view class="icon-box pr">
<image src="/static/icon/yyy.png" mode=""></image>
<text class="dot d-c-c"
@ -74,7 +74,7 @@
</view>
<text class="">已预约</text>
</view>
<view class="item" @click="jumpPage('/pages/order/cg-my-order?dataType=completed')">
<view class="item" @click="jumpPage('/pages/order/cg-my-order?dataType=2')">
<view class="icon-box pr">
<image src="/static/icon/ywc.png" mode=""></image>
<text class="dot d-c-c"
@ -82,7 +82,7 @@
</view>
<text>已完成</text>
</view>
<view class="item" @click="jumpPage('/pages/order/refund/index/index')">
<view class="item" @click="jumpPage('/pages/order/cg-my-order?dataType=4')">
<view class="icon-box pr">
<image src="/static/icon/tk.png" mode=""></image>
<text class="dot d-c-c"