369 lines
6.6 KiB
Plaintext
369 lines
6.6 KiB
Plaintext
<template>
|
|
<view 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" 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" v-for="(item, index) in 3" :key="index">
|
|
<view class="detail-content">
|
|
<view class="icon-placeholder">
|
|
<image src="/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>
|
|
</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 timeList = ref([
|
|
'今日',
|
|
'本周',
|
|
'本月'
|
|
])
|
|
|
|
let currentTime = ref(0)
|
|
|
|
let option = ref({
|
|
tooltip: {
|
|
trigger: 'item'
|
|
},
|
|
legend: {
|
|
top: '5%',
|
|
left: 'center'
|
|
},
|
|
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: 1048 },
|
|
{ value: 735 },
|
|
{ value: 580 },
|
|
{ value: 484},
|
|
{ value: 300 }
|
|
]
|
|
}
|
|
]
|
|
})
|
|
|
|
onLoad(() => {
|
|
|
|
})
|
|
onMounted(()=>{
|
|
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;
|
|
min-height: 100vh;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
/* 收入概览区域 */
|
|
.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: #1890ff;
|
|
}
|
|
|
|
.legend-dot.orange {
|
|
background-color: #fa8c16;
|
|
}
|
|
|
|
.legend-dot.green {
|
|
background-color: #52c41a;
|
|
}
|
|
|
|
.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;
|
|
}
|
|
</style> |