<template>
|
<view class="order-vip">
|
<view class="order-tabs">
|
<view class="tab-item" :class="{ active: currentTab === -1 }" @click="switchTab(-1)">
|
全部
|
</view>
|
<view class="tab-item" :class="{ active: currentTab === 0 }" @click="switchTab(0)">
|
未结算
|
</view>
|
<view class="tab-item" :class="{ active: currentTab === 1 }" @click="switchTab(1)">
|
已结算
|
</view>
|
</view>
|
|
<view class="order-list">
|
<view class="order-item" v-for="item in orderList" :key="item.id">
|
<view class="order-header">
|
<view class="order-no">订单号:{{ item.orderMaster.order_no }}</view>
|
<view class="order-status" :class="{ 'settled': item.is_settled }">
|
{{ item.is_settled ? '已结算' : '未结算' }}
|
</view>
|
</view>
|
|
<view class="order-content">
|
<view class="goods-info">
|
<view class="goods-img">
|
<image :src="item.orderMaster.product[0].image.file_path" mode="aspectFill"></image>
|
</view>
|
<view class="goods-desc">
|
<view class="goods-name">{{ item.orderMaster.product[0].product_name }}</view>
|
<view class="goods-spec">{{ item.orderMaster.product[0].spec_sku.spec_attr }}</view>
|
</view>
|
</view>
|
|
<view class="order-price">
|
<view class="price">¥{{ item.order_price }}</view>
|
<view class="commission">佣金:¥{{ item.vip_area_money }}</view>
|
<!-- <view class="commission" v-if="item.vip_area_type==30">下级收益:¥{{ item.subordinate_money }}</view> -->
|
</view>
|
</view>
|
|
<view class="order-footer">
|
<view class="order-time">{{ item.create_time }}</view>
|
<view class="order-type">{{ item.vip_area_type_text }}</view>
|
</view>
|
</view>
|
|
<view class="no-data" v-if="orderList.length === 0">
|
暂无订单记录
|
</view>
|
</view>
|
|
<!-- 加载更多 -->
|
<view class="load-more" v-if="orderList.length > 0 && hasMore">
|
<view @click="loadMore">点击加载更多</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
titel: 'VIP订单',
|
currentTab: -1, // -1: 全部, 0: 未结算, 1: 已结算
|
page: 1,
|
hasMore: true,
|
orderList: []
|
};
|
},
|
onLoad() {
|
this.loadData();
|
},
|
methods: {
|
// 加载数据
|
loadData() {
|
let self = this;
|
uni.showLoading({ title: '加载中' });
|
|
let params = {
|
page: self.page
|
};
|
|
if (self.currentTab !== -1) {
|
params.is_settled = self.currentTab;
|
}
|
|
self._get('plus.vip.order/lists', params, function(res) {
|
uni.hideLoading();
|
|
if (self.page === 1) {
|
self.orderList = res.data.list.data;
|
} else {
|
self.orderList = [...self.orderList, ...res.data.list.data];
|
}
|
|
// 判断是否还有更多数据
|
self.hasMore = res.data.list.last_page > res.data.list.current_page;
|
});
|
},
|
|
// 切换标签页
|
switchTab(tab) {
|
if (this.currentTab !== tab) {
|
this.currentTab = tab;
|
this.page = 1;
|
this.hasMore = true;
|
this.loadData();
|
}
|
},
|
|
// 加载更多
|
loadMore() {
|
if (this.hasMore) {
|
this.page++;
|
this.loadData();
|
}
|
},
|
|
goback() {
|
uni.navigateBack();
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
.order-vip {
|
min-height: 100vh;
|
background: #f5f5f5;
|
}
|
|
.head_top {
|
position: absolute;
|
width: 100%;
|
padding-top: var(--status-bar-height);
|
height: 30px;
|
line-height: 30px;
|
color: #FFFFFF;
|
font-size: 32rpx;
|
z-index: 2;
|
}
|
|
.reg180 {
|
padding-right: 20rpx;
|
text-align: right;
|
transform: rotateY(180deg);
|
position: absolute;
|
bottom: 0;
|
}
|
|
.icon-jiantou {
|
color: #FFFFFF;
|
font-size: 30rpx;
|
}
|
|
.order-tabs {
|
display: flex;
|
background: #fff;
|
margin-bottom: 20rpx;
|
|
.tab-item {
|
flex: 1;
|
text-align: center;
|
padding: 30rpx 0;
|
font-size: 30rpx;
|
color: #666;
|
position: relative;
|
|
&.active {
|
color: #FF5649;
|
font-weight: bold;
|
|
&::after {
|
content: '';
|
position: absolute;
|
bottom: 0;
|
left: 50%;
|
transform: translateX(-50%);
|
width: 60rpx;
|
height: 6rpx;
|
background: #FF5649;
|
border-radius: 3rpx;
|
}
|
}
|
}
|
}
|
|
.order-list {
|
.order-item {
|
background: #fff;
|
margin-bottom: 20rpx;
|
|
.order-header {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
padding: 20rpx 30rpx;
|
border-bottom: 1rpx solid #f5f5f5;
|
|
.order-no {
|
font-size: 26rpx;
|
color: #999;
|
}
|
|
.order-status {
|
font-size: 26rpx;
|
color: #FF9900;
|
|
&.settled {
|
color: #07c160;
|
}
|
}
|
}
|
|
.order-content {
|
display: flex;
|
padding: 30rpx;
|
border-bottom: 1rpx solid #f5f5f5;
|
|
.goods-info {
|
display: flex;
|
flex: 1;
|
|
.goods-img {
|
width: 120rpx;
|
height: 120rpx;
|
border-radius: 10rpx;
|
overflow: hidden;
|
margin-right: 20rpx;
|
|
image {
|
width: 100%;
|
height: 100%;
|
}
|
}
|
|
.goods-desc {
|
flex: 1;
|
|
.goods-name {
|
font-size: 28rpx;
|
color: #333;
|
margin-bottom: 10rpx;
|
display: -webkit-box;
|
-webkit-box-orient: vertical;
|
-webkit-line-clamp: 2;
|
overflow: hidden;
|
}
|
|
.goods-spec {
|
font-size: 24rpx;
|
color: #999;
|
}
|
}
|
}
|
|
.order-price {
|
text-align: right;
|
|
.price {
|
font-size: 30rpx;
|
color: #333;
|
font-weight: bold;
|
margin-bottom: 10rpx;
|
}
|
|
.commission {
|
font-size: 24rpx;
|
color: #FF5649;
|
}
|
}
|
}
|
|
.order-footer {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
padding: 20rpx 30rpx;
|
|
.order-time {
|
font-size: 24rpx;
|
color: #999;
|
}
|
|
.order-type {
|
font-size: 24rpx;
|
color: #666;
|
}
|
}
|
}
|
|
.no-data {
|
text-align: center;
|
padding: 100rpx 0;
|
color: #999;
|
font-size: 28rpx;
|
}
|
}
|
|
.load-more {
|
text-align: center;
|
padding: 30rpx;
|
|
view {
|
display: inline-block;
|
padding: 15rpx 30rpx;
|
background: #f5f5f5;
|
border-radius: 30rpx;
|
font-size: 28rpx;
|
color: #666;
|
}
|
}
|
</style>
|