2024-06-05 19:00:42 +08:00
|
|
|
|
<template>
|
|
|
|
|
<view>
|
2024-12-19 15:36:44 +08:00
|
|
|
|
<!-- topbar -->
|
|
|
|
|
<u-navbar title="确认订单" bgColor="#d43030" :titleStyle="{ color: '#FFF'}" :autoBack="true" placeholder>
|
|
|
|
|
<view class="u-nav-slot" slot="left">
|
|
|
|
|
<u-icon name="arrow-left" color="#fff" size="19"></u-icon>
|
|
|
|
|
</view>
|
|
|
|
|
</u-navbar>
|
|
|
|
|
<!-- tab -->
|
2024-12-20 17:06:09 +08:00
|
|
|
|
<view class="tabListBox m-l-24 m-r-24 m-t-24 flex msb pr">
|
2024-12-19 15:36:44 +08:00
|
|
|
|
<view class="tabBox flex mac mc fz32" v-for="(tab,index) in tabList" :key="index" @click="handlerTab(index)"
|
|
|
|
|
:class="current===index?'fb':''">
|
2024-12-20 17:06:09 +08:00
|
|
|
|
<view class="pr">
|
|
|
|
|
<badge :cou="orderCouArr[index]"></badge>
|
|
|
|
|
{{tab}}
|
|
|
|
|
</view>
|
2024-12-19 15:36:44 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- tabLine -->
|
2024-12-19 19:32:10 +08:00
|
|
|
|
<view class="tabLineBox flex mac mc z-top" :style="{ left: tabLineLeft + 'rpx' }">
|
2024-12-19 15:36:44 +08:00
|
|
|
|
<view class="tabLine rad8 bg-m"></view>
|
|
|
|
|
</view>
|
2024-12-19 19:32:10 +08:00
|
|
|
|
<!-- 订单页 swiper -->
|
|
|
|
|
<swiper class="swiperClass m-t-12" :current="current" @animationfinish="animationfinish">
|
|
|
|
|
<swiper-item class="swiperClass">
|
|
|
|
|
<scroll-view scroll-y class="swiperClass">
|
|
|
|
|
<view v-if="orderList_unpaid.length>0">
|
|
|
|
|
<orderItem v-for="order in orderList_unpaid" :order=order :key="order.id"></orderItem>
|
|
|
|
|
<u-divider class="m-r-24 m-l-24" text="没有更多了" :hairline="true"></u-divider>
|
|
|
|
|
<view class="extra-space2"></view>
|
|
|
|
|
</view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
</swiper-item>
|
|
|
|
|
<swiper-item>
|
|
|
|
|
<view v-if="orderList_paid.length>0">
|
|
|
|
|
<orderItem v-for="order in orderList_paid" :order=order :key="order.id"></orderItem>
|
|
|
|
|
<u-divider class="m-r-24 m-l-24" text="没有更多了" :hairline="true"></u-divider>
|
|
|
|
|
<view class="extra-space2"></view>
|
|
|
|
|
</view>
|
|
|
|
|
</swiper-item>
|
|
|
|
|
<swiper-item>
|
|
|
|
|
<view v-if="orderList_refund.length>0">
|
|
|
|
|
<orderItem v-for="order in orderList_refund" :order=order :key="order.id"></orderItem>
|
|
|
|
|
<u-divider class="m-r-24 m-l-24" text="没有更多了" :hairline="true"></u-divider>
|
|
|
|
|
<view class="extra-space2"></view>
|
|
|
|
|
</view>
|
|
|
|
|
</swiper-item>
|
|
|
|
|
</swiper>
|
|
|
|
|
<!-- tabbar -->
|
|
|
|
|
<view>
|
|
|
|
|
<tabbar></tabbar>
|
|
|
|
|
</view>
|
2024-06-05 19:00:42 +08:00
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2024-12-19 15:36:44 +08:00
|
|
|
|
tabList: ['待支付', '已付款', '退款售后'], // tab标签
|
2024-12-19 19:50:45 +08:00
|
|
|
|
current: 1, //当前激活标签
|
2024-12-19 15:36:44 +08:00
|
|
|
|
tabLineLeft: 24 //tabLine 样式表的left值
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-12-20 17:06:09 +08:00
|
|
|
|
onLoad() {
|
2024-12-19 19:50:45 +08:00
|
|
|
|
//初始化 tapline的位置
|
2024-12-20 17:06:09 +08:00
|
|
|
|
this.lineOffset(this.current)
|
2024-12-19 19:50:45 +08:00
|
|
|
|
},
|
2024-12-19 19:32:10 +08:00
|
|
|
|
computed: {
|
|
|
|
|
//未付款订单
|
|
|
|
|
orderList_unpaid() {
|
|
|
|
|
return this.$store.state.orderList.filter(item => item.main_status === '未付款')
|
|
|
|
|
},
|
2024-12-23 18:03:00 +08:00
|
|
|
|
//已付款 已完成 并且没有申请退款的订单
|
2024-12-20 17:06:09 +08:00
|
|
|
|
orderList_paid() {
|
2024-12-23 18:03:00 +08:00
|
|
|
|
return this.$store.state.orderList.filter(item => {
|
|
|
|
|
(item.main_status === '已付款' || item.main_status === '已完成') && item.refund_status === '未申请'
|
|
|
|
|
})
|
2024-12-19 19:32:10 +08:00
|
|
|
|
},
|
2024-12-23 18:03:00 +08:00
|
|
|
|
//申请中 已同意 主动退 拒绝退 等退款相关的订单
|
2024-12-20 17:06:09 +08:00
|
|
|
|
orderList_refund() {
|
2024-12-19 19:32:10 +08:00
|
|
|
|
return this.$store.state.orderList.filter(item => item.refund_status !== '未申请')
|
2024-12-20 17:06:09 +08:00
|
|
|
|
},
|
|
|
|
|
//订单数量 数组[未付款订单数量,已付款没有产生退款相关业务的订单数量,申请中 已同意 主动退 等退款的订单数量]
|
|
|
|
|
orderCouArr() {
|
|
|
|
|
return [this.orderList_unpaid.length, this.orderList_paid.length, this.orderList_refund.length]
|
2024-12-19 19:32:10 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2024-12-19 15:36:44 +08:00
|
|
|
|
methods: {
|
2024-12-19 19:32:10 +08:00
|
|
|
|
//点击tab标签时 设置current
|
2024-12-19 15:36:44 +08:00
|
|
|
|
handlerTab(index) {
|
|
|
|
|
this.current = index
|
2024-12-19 19:32:10 +08:00
|
|
|
|
},
|
|
|
|
|
// swiper滑动结束,设置current
|
|
|
|
|
animationfinish(e) {
|
|
|
|
|
this.current = e.detail.current
|
2024-12-19 19:50:45 +08:00
|
|
|
|
},
|
|
|
|
|
//计算每个 tabLine 的left值
|
2024-12-20 17:06:09 +08:00
|
|
|
|
lineOffset(val) {
|
2024-12-19 19:50:45 +08:00
|
|
|
|
// 计算每个 tabLine 的left值
|
|
|
|
|
const tabWidth = 200
|
|
|
|
|
const spacing = (750 - tabWidth * this.tabList.length - 48) / (this.tabList.length -
|
|
|
|
|
1) // 750是屏幕宽度,48是左右边距
|
|
|
|
|
this.tabLineLeft = 24 + val * (tabWidth + spacing) // 计算新的 left 值
|
2024-12-19 19:32:10 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
current: {
|
|
|
|
|
handler(val) {
|
2024-12-19 19:50:45 +08:00
|
|
|
|
//更新tapline 的位置
|
|
|
|
|
this.lineOffset(val)
|
2024-12-19 19:32:10 +08:00
|
|
|
|
}
|
2024-06-06 01:44:07 +08:00
|
|
|
|
}
|
2024-06-05 19:00:42 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-19 15:36:44 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.tabListBox {
|
|
|
|
|
height: 77rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tabBox {
|
|
|
|
|
width: 200rpx;
|
|
|
|
|
height: 77rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tabLineBox {
|
|
|
|
|
width: 200rpx;
|
|
|
|
|
height: 8rpx;
|
|
|
|
|
position: absolute;
|
2024-12-19 19:32:10 +08:00
|
|
|
|
transition: all .2s ease;
|
2024-12-19 15:36:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tabLine {
|
|
|
|
|
width: 70rpx;
|
|
|
|
|
height: 8rpx;
|
|
|
|
|
}
|
2024-12-19 19:32:10 +08:00
|
|
|
|
|
|
|
|
|
.swiperClass {
|
|
|
|
|
height: calc(100vh - 297rpx);
|
|
|
|
|
}
|
2024-12-19 15:36:44 +08:00
|
|
|
|
</style>
|