655 lines
13 KiB
Plaintext
655 lines
13 KiB
Plaintext
<template>
|
|
|
|
<!-- 骨架屏状态 -->
|
|
<view v-if="loading" class="skeleton-loading">
|
|
<!-- 收入概览骨架屏 -->
|
|
<view class="skeleton-card income-overview">
|
|
<view class="skeleton-income-title"></view>
|
|
<view class="skeleton-income-amount"></view>
|
|
<view class="skeleton-time-tabs">
|
|
<view class="skeleton-tab-item"></view>
|
|
<view class="skeleton-tab-item"></view>
|
|
<view class="skeleton-tab-item"></view>
|
|
</view>
|
|
<view class="skeleton-month-total"></view>
|
|
</view>
|
|
|
|
<!-- 收入构成骨架屏 -->
|
|
<view class="skeleton-card income-composition">
|
|
<view class="skeleton-pie-container">
|
|
<view class="skeleton-pie-chart"></view>
|
|
<view class="skeleton-legend-list">
|
|
<view class="skeleton-legend-item" v-for="item in 3">
|
|
<view class="skeleton-legend-dot"></view>
|
|
<view class="skeleton-legend-text"></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 钱包区域骨架屏 -->
|
|
<view class="skeleton-card wallet-section">
|
|
<view class="skeleton-wallet-header">
|
|
<view class="skeleton-wallet-title"></view>
|
|
<view class="skeleton-wallet-amount"></view>
|
|
</view>
|
|
<view class="skeleton-withdraw-button"></view>
|
|
<view class="skeleton-withdraw-tip"></view>
|
|
</view>
|
|
|
|
<!-- 收入明细骨架屏 -->
|
|
<view class="skeleton-card">
|
|
<view class="skeleton-detail-title"></view>
|
|
</view>
|
|
|
|
<!-- 明细项骨架屏 -->
|
|
<view v-for="index in 3" :key="index" class="skeleton-card detail-list">
|
|
<view class="skeleton-detail-content">
|
|
<view class="skeleton-icon-placeholder"></view>
|
|
<view class="skeleton-detail-info">
|
|
<view class="skeleton-order-id"></view>
|
|
<view class="skeleton-order-time"></view>
|
|
</view>
|
|
<view class="skeleton-order-amount"></view>
|
|
</view>
|
|
</view>
|
|
<!-- 加载更多 -->
|
|
<view class="skeleton-card" style="display: flex; justify-content: center; ">
|
|
<view class="skeleton-detail-title"></view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 收入概览区域 -->
|
|
<view v-else class="income-container">
|
|
<view class="income-overview">
|
|
<view class="income-header">
|
|
<text class="income-title">今日已赚</text>
|
|
<text class="income-amount">¥86.50</text>
|
|
</view>
|
|
|
|
<!-- 时间选择标签 -->
|
|
<view class="time-tabs">
|
|
<text v-for="(item ,index) in timeList" :key="index" @click="changeTab(index)"
|
|
:class="{ 'active':currentTime==index }" class="tab-item">{{item}}</text>
|
|
</view>
|
|
<text class="month-total">本月累计¥1,240.00</text>
|
|
</view>
|
|
|
|
<!-- 收入构成区域 -->
|
|
<view class="income-composition">
|
|
<!-- 饼图占位区域 -->
|
|
<view class="pie-chart-placeholder">
|
|
<view id="cahrt" class="pie-chart">
|
|
<!-- 黑边白底的饼图占位 -->
|
|
</view>
|
|
<view class="chart-legend">
|
|
<view class="legend-item">
|
|
<view class="legend-dot blue"></view>
|
|
<text class="legend-text">配送费¥60.50</text>
|
|
</view>
|
|
<view class="legend-item">
|
|
<view class="legend-dot orange"></view>
|
|
<text class="legend-text">冲单奖¥20.00</text>
|
|
</view>
|
|
<view class="legend-item">
|
|
<view class="legend-dot green"></view>
|
|
<text class="legend-text">恶劣天气补贴¥6.00</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 钱包区域 -->
|
|
<view class="wallet-section">
|
|
<view class="wallet-header">
|
|
<text class="wallet-title">钱包余额</text>
|
|
<text class="wallet-amount">¥86.50</text>
|
|
</view>
|
|
<u-button class="withdraw-button" @click="Service.GoPage('/pages/order/withdraw')" type="primary">立即提现</u-button>
|
|
<text class="withdraw-tip">提现到账时间: T+1工作日</text>
|
|
</view>
|
|
|
|
<!-- 收入明细区域 -->
|
|
<view class="detail-header">
|
|
<text class="detail-title">收入明细</text>
|
|
</view>
|
|
<view class="detail-list" @click="Service.GoPage('/pages/order/incomeDetail')" v-for="(item, index) in 3"
|
|
:key="index">
|
|
<view class="detail-content">
|
|
<view class="icon-placeholder">
|
|
<image :src="Service.GetIconImg('/static/index/income/order.png')"
|
|
style="width: 55rpx; height: 55rpx;" mode=""></image>
|
|
</view>
|
|
<view class="detail-info">
|
|
<text class="order-id">订单 MT20251020123456</text>
|
|
<text class="order-time">10-20 18:35</text>
|
|
</view>
|
|
<text class="order-amount">+¥5.50</text>
|
|
</view>
|
|
</view>
|
|
<up-loadmore :status="status" />
|
|
<view class="" style="width: 100vw; height: 100rpx; ">
|
|
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { onLoad } from '@dcloudio/uni-app';
|
|
import { ref, onMounted } from 'vue';
|
|
import * as echarts from 'echarts';
|
|
import { Service } from '@/Service/Service';
|
|
|
|
let loading = ref(true)
|
|
|
|
let timeList = ref([
|
|
'今日',
|
|
'本周',
|
|
'本月'
|
|
])
|
|
|
|
let currentTime = ref(0)
|
|
|
|
let status = ref('nomore')
|
|
|
|
let test = ref(10)
|
|
|
|
let option = ref({
|
|
tooltip: {
|
|
'show': false
|
|
},
|
|
legend: {
|
|
'show': false
|
|
},
|
|
series: [
|
|
{
|
|
name: 'Access From',
|
|
type: 'pie',
|
|
radius: ['40%', '70%'],
|
|
avoidLabelOverlap: true,
|
|
label: {
|
|
show: false,
|
|
position: 'center'
|
|
},
|
|
emphasis: {
|
|
label: {
|
|
show: false,
|
|
fontSize: 40,
|
|
fontWeight: 'bold'
|
|
}
|
|
},
|
|
labelLine: {
|
|
show: false
|
|
},
|
|
data: [
|
|
{ value: test.value, name: "配送奖", itemStyle: { color: '#1890FF' } },
|
|
{ value: 735, name: "冲单奖", itemStyle: { color: '#52C41A' } },
|
|
{ value: 580, name: "恶劣天气奖", itemStyle: { color: '#FF4D4F' } }
|
|
]
|
|
}
|
|
]
|
|
})
|
|
|
|
onLoad(() => {
|
|
setTimeout(() => {
|
|
loading.value = false
|
|
setTimeout(() => {
|
|
draw()
|
|
}, 1000)
|
|
}, 1000)
|
|
})
|
|
onMounted(() => {
|
|
})
|
|
|
|
const draw = () => {
|
|
let chartDom = ref(document.getElementById('cahrt'))
|
|
let myChart = ref(echarts.init(chartDom.value))
|
|
myChart.value.setOption(option.value)
|
|
}
|
|
|
|
const changeTab = (index : number) => {
|
|
currentTime.value = index
|
|
}
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
.income-container {
|
|
padding: 20rpx;
|
|
background-color: #f5f5f5;
|
|
}
|
|
|
|
/* 收入概览区域 */
|
|
.income-overview {
|
|
background-color: #fff;
|
|
border-radius: 20rpx;
|
|
padding: 30rpx;
|
|
margin-bottom: 20rpx;
|
|
}
|
|
|
|
.income-header {
|
|
margin-bottom: 20rpx;
|
|
}
|
|
|
|
.income-title {
|
|
font-size: 28rpx;
|
|
color: #666;
|
|
display: block;
|
|
margin-bottom: 10rpx;
|
|
}
|
|
|
|
.income-amount {
|
|
font-size: 48rpx;
|
|
font-weight: bold;
|
|
color: #ff4d4f;
|
|
}
|
|
|
|
/* 时间标签 */
|
|
.time-tabs {
|
|
display: flex;
|
|
margin-bottom: 20rpx;
|
|
}
|
|
|
|
.tab-item {
|
|
font-size: 28rpx;
|
|
color: #666;
|
|
margin-right: 40rpx;
|
|
padding-bottom: 10rpx;
|
|
}
|
|
|
|
.tab-item.active {
|
|
color: #1890ff;
|
|
border-bottom: 3rpx solid #1890ff;
|
|
}
|
|
|
|
.month-total {
|
|
font-size: 26rpx;
|
|
color: #666;
|
|
}
|
|
|
|
/* 收入构成区域 */
|
|
.income-composition {
|
|
background-color: #fff;
|
|
border-radius: 20rpx;
|
|
padding: 30rpx;
|
|
margin-bottom: 20rpx;
|
|
}
|
|
|
|
/* 饼图占位 */
|
|
.pie-chart-placeholder {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.pie-chart {
|
|
width: 200rpx;
|
|
height: 200rpx;
|
|
margin-right: 30rpx;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
|
|
.chart-legend {
|
|
flex: 1;
|
|
}
|
|
|
|
.legend-item {
|
|
display: flex;
|
|
align-items: center;
|
|
margin-bottom: 15rpx;
|
|
}
|
|
|
|
.legend-dot {
|
|
width: 16rpx;
|
|
height: 16rpx;
|
|
border-radius: 50%;
|
|
margin-right: 10rpx;
|
|
}
|
|
|
|
.legend-dot.blue {
|
|
background-color: var(--nav-mian);
|
|
}
|
|
|
|
.legend-dot.orange {
|
|
background-color: var(--nav-vice);
|
|
}
|
|
|
|
.legend-dot.green {
|
|
background-color: var(--nav-diluted);
|
|
}
|
|
|
|
.legend-text {
|
|
font-size: 26rpx;
|
|
color: #666;
|
|
}
|
|
|
|
/* 钱包区域 */
|
|
.wallet-section {
|
|
background-color: #fff;
|
|
border-radius: 20rpx;
|
|
padding: 30rpx;
|
|
margin-bottom: 20rpx;
|
|
}
|
|
|
|
.wallet-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 20rpx;
|
|
}
|
|
|
|
.wallet-title {
|
|
font-size: 28rpx;
|
|
color: #333;
|
|
}
|
|
|
|
.wallet-amount {
|
|
font-size: 36rpx;
|
|
font-weight: bold;
|
|
color: #ff4d4f;
|
|
}
|
|
|
|
.withdraw-button {
|
|
width: 100%;
|
|
height: 80rpx;
|
|
line-height: 80rpx;
|
|
font-size: 32rpx;
|
|
border-radius: 40rpx;
|
|
background-color: #1890ff;
|
|
color: #fff;
|
|
margin-bottom: 10rpx;
|
|
}
|
|
|
|
.withdraw-tip {
|
|
display: block;
|
|
font-size: 22rpx;
|
|
color: #999;
|
|
text-align: center;
|
|
}
|
|
|
|
/* 收入明细区域 */
|
|
.income-detail {
|
|
background-color: #fff;
|
|
border-radius: 20rpx;
|
|
padding: 30rpx;
|
|
}
|
|
|
|
.detail-header {
|
|
margin-bottom: 20rpx;
|
|
}
|
|
|
|
.detail-title {
|
|
font-size: 28rpx;
|
|
font-weight: bold;
|
|
color: #333;
|
|
}
|
|
|
|
|
|
.detail-content {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.detail-list {
|
|
margin: 15rpx 0 0;
|
|
background-color: #fff;
|
|
padding: 20rpx 30rpx;
|
|
border-radius: 20rpx;
|
|
}
|
|
|
|
/* 图标占位符 - 黑边白底 */
|
|
.icon-placeholder {
|
|
width: 70rpx;
|
|
height: 70rpx;
|
|
background-color: #E6F7FF;
|
|
border-radius: 8rpx;
|
|
margin-right: 20rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.detail-info {
|
|
flex: 1;
|
|
}
|
|
|
|
.order-id {
|
|
display: block;
|
|
font-size: 26rpx;
|
|
color: #333;
|
|
margin-bottom: 5rpx;
|
|
}
|
|
|
|
.order-time {
|
|
font-size: 24rpx;
|
|
color: #999;
|
|
}
|
|
|
|
.order-amount {
|
|
font-size: 32rpx;
|
|
font-weight: bold;
|
|
color: #ff4d4f;
|
|
}
|
|
|
|
/* 没有更多记录 */
|
|
.no-more {
|
|
text-align: center;
|
|
padding: 40rpx 0;
|
|
}
|
|
|
|
.no-more-text {
|
|
font-size: 24rpx;
|
|
color: #999;
|
|
}
|
|
|
|
/* 骨架屏样式 */
|
|
.skeleton-loading .skeleton-card {
|
|
background-color: #fff;
|
|
border-radius: 20rpx;
|
|
padding: 30rpx;
|
|
margin-bottom: 20rpx;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* 收入概览骨架屏 */
|
|
.skeleton-income-title {
|
|
width: 100rpx;
|
|
height: 30rpx;
|
|
background-color: #f0f0f0;
|
|
border-radius: 4rpx;
|
|
margin-bottom: 15rpx;
|
|
}
|
|
|
|
.skeleton-income-amount {
|
|
width: 200rpx;
|
|
height: 50rpx;
|
|
background-color: #f0f0f0;
|
|
border-radius: 4rpx;
|
|
margin-bottom: 20rpx;
|
|
}
|
|
|
|
.skeleton-time-tabs {
|
|
display: flex;
|
|
margin-bottom: 20rpx;
|
|
}
|
|
|
|
.skeleton-tab-item {
|
|
width: 80rpx;
|
|
height: 30rpx;
|
|
background-color: #f0f0f0;
|
|
border-radius: 4rpx;
|
|
margin-right: 40rpx;
|
|
}
|
|
|
|
.skeleton-month-total {
|
|
width: 200rpx;
|
|
height: 30rpx;
|
|
background-color: #f0f0f0;
|
|
border-radius: 4rpx;
|
|
}
|
|
|
|
/* 收入构成骨架屏 */
|
|
.skeleton-pie-container {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.skeleton-pie-chart {
|
|
width: 200rpx;
|
|
height: 200rpx;
|
|
background-color: #f0f0f0;
|
|
border-radius: 50%;
|
|
margin-right: 30rpx;
|
|
}
|
|
|
|
.skeleton-legend-list {
|
|
flex: 1;
|
|
}
|
|
|
|
.skeleton-legend-item {
|
|
display: flex;
|
|
align-items: center;
|
|
margin-bottom: 15rpx;
|
|
}
|
|
|
|
.skeleton-legend-dot {
|
|
width: 16rpx;
|
|
height: 16rpx;
|
|
background-color: #f0f0f0;
|
|
border-radius: 50%;
|
|
margin-right: 10rpx;
|
|
}
|
|
|
|
.skeleton-legend-text {
|
|
width: 200rpx;
|
|
height: 30rpx;
|
|
background-color: #f0f0f0;
|
|
border-radius: 4rpx;
|
|
}
|
|
|
|
/* 钱包区域骨架屏 */
|
|
.skeleton-wallet-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 20rpx;
|
|
}
|
|
|
|
.skeleton-wallet-title {
|
|
width: 120rpx;
|
|
height: 30rpx;
|
|
background-color: #f0f0f0;
|
|
border-radius: 4rpx;
|
|
}
|
|
|
|
.skeleton-wallet-amount {
|
|
width: 150rpx;
|
|
height: 40rpx;
|
|
background-color: #f0f0f0;
|
|
border-radius: 4rpx;
|
|
}
|
|
|
|
.skeleton-withdraw-button {
|
|
width: 100%;
|
|
height: 80rpx;
|
|
background-color: #f0f0f0;
|
|
border-radius: 40rpx;
|
|
margin-bottom: 10rpx;
|
|
}
|
|
|
|
.skeleton-withdraw-tip {
|
|
width: 300rpx;
|
|
height: 24rpx;
|
|
background-color: #f0f0f0;
|
|
border-radius: 4rpx;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
/* 收入明细骨架屏 */
|
|
.skeleton-detail-title {
|
|
width: 150rpx;
|
|
height: 30rpx;
|
|
background-color: #f0f0f0;
|
|
border-radius: 4rpx;
|
|
}
|
|
|
|
.skeleton-detail-content {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.skeleton-icon-placeholder {
|
|
width: 70rpx;
|
|
height: 70rpx;
|
|
background-color: #f0f0f0;
|
|
border-radius: 8rpx;
|
|
margin-right: 20rpx;
|
|
}
|
|
|
|
.skeleton-detail-info {
|
|
flex: 1;
|
|
}
|
|
|
|
.skeleton-order-id {
|
|
width: 300rpx;
|
|
height: 30rpx;
|
|
background-color: #f0f0f0;
|
|
border-radius: 4rpx;
|
|
margin-bottom: 10rpx;
|
|
}
|
|
|
|
.skeleton-order-time {
|
|
width: 200rpx;
|
|
height: 26rpx;
|
|
background-color: #f0f0f0;
|
|
border-radius: 4rpx;
|
|
}
|
|
|
|
.skeleton-order-amount {
|
|
width: 100rpx;
|
|
height: 36rpx;
|
|
background-color: #f0f0f0;
|
|
border-radius: 4rpx;
|
|
}
|
|
|
|
/* 骨架屏动画 */
|
|
.skeleton-loading .skeleton-income-title::after,
|
|
.skeleton-loading .skeleton-income-amount::after,
|
|
.skeleton-loading .skeleton-tab-item::after,
|
|
.skeleton-loading .skeleton-month-total::after,
|
|
.skeleton-loading .skeleton-pie-chart::after,
|
|
.skeleton-loading .skeleton-legend-dot::after,
|
|
.skeleton-loading .skeleton-legend-text::after,
|
|
.skeleton-loading .skeleton-wallet-title::after,
|
|
.skeleton-loading .skeleton-wallet-amount::after,
|
|
.skeleton-loading .skeleton-withdraw-button::after,
|
|
.skeleton-loading .skeleton-withdraw-tip::after,
|
|
.skeleton-loading .skeleton-detail-title::after,
|
|
.skeleton-loading .skeleton-icon-placeholder::after,
|
|
.skeleton-loading .skeleton-order-id::after,
|
|
.skeleton-loading .skeleton-order-time::after,
|
|
.skeleton-loading .skeleton-order-amount::after {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
|
|
animation: shimmer 1.5s infinite;
|
|
}
|
|
|
|
@keyframes shimmer {
|
|
0% {
|
|
transform: translateX(-100%);
|
|
}
|
|
|
|
100% {
|
|
transform: translateX(100%);
|
|
}
|
|
}
|
|
</style> |