quanwei
2026-01-17 e1e2fe5710a5b5cd9c19bd3aa99c998a1a613ca8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<template>
    <view>
        <view class="cu-list grid col-3 no-border">
            <view class="cu-item">
                <view class="text-price text-xl">
                    99.00
                </view>
                <text>昨日分红</text>
            </view>
            <view class="cu-item">
                <view class="text-price text-xl">
                    99.00
                </view>
                <text>7日分红总计</text>
            </view>
            <view class="cu-item">
                <view class="text-price text-xl">
                    99.00
                </view>
                <text>月分红总计</text>
            </view>
        </view>
        <view class="bg-white margin-sm padding">
            <view class="flex flex-wrap align-center text-center" style="width: 500rpx;margin: auto;">
                <view class="flex-sub" @click="tabSelect(0)">
                    <view class="btn1" :class="TabCur==0?'active':''">昨日分红</view>
                </view>
                <view class="flex-sub" @click="tabSelect(1)">
                    <view class="btn2" :class="TabCur==1?'active':''">7日分红</view>
                </view>
                <view class="flex-sub" @click="tabSelect(2)">
                    <view class="btn3" :class="TabCur==2?'active':''">月分红</view>
                </view>
            </view>
             
            <view class="margin-top">
                 <canvas @tap="tapLine($event,'canvasLineA')" canvas-id="canvasLineA" id="canvasLineA" class="charts"></canvas>
            </view>
        </view>
    </view>
</template>
 
<script>
    import uCharts from '@/pages2/u-charts/u-charts.min.js';
    var _self;
    var canvaLineA=null;
    var mycanvas=[];
    export default {
        data() {
            return {
                pixelRatio: 1,
                cWidth:'',
                cHeight:'',
                TabCur:1
            };
        },
        components: {
            
        },
        onLoad() {
            _self = this;
            this.cWidth=uni.upx2px(650);
            this.cHeight=uni.upx2px(500);
            this.zhexiantu("canvasLineA",[]);
        },
        methods: {
            /***** 基本柱形图start ******/
            zhexiantu(id,data){
                let LineA={
                    categories: ['10-1','10-2','10-3','10-4','10-5','10-6','10-7'],
                    series: [{
                        name: "分红金额",
                        color:'#e2231a',
                        data: [54.77,62,56,78,35,68,85]
                    }],
                };
                 
                this.showLineA(id,LineA);
            },
            tapLine(e,id){
                canvaLineA.showToolTip(e)
            },
            showLineA(canvasId,chartData){
                canvaLineA=new uCharts({
                    $this:_self,
                    canvasId: canvasId,
                    type:'column',
                    legend:true,
                    fontSize:12,
                    background:'#FFFFFF',
                    pixelRatio:_self.pixelRatio,
                    animation:true,
                    categories: chartData.categories,
                    series: chartData.series,
                    xAxis:{
                        disableGrid:true,
                    },
                    yAxis:{
                        disabled:true
                    },
                    dataLabel:true,
                    width: _self.cWidth*_self.pixelRatio,
                    height: _self.cHeight*_self.pixelRatio,
                    legend:{show: false},
                    padding:[15,15,0,15],
                    extra:{
                        column:{
                            type:'group',
                            width: _self.cWidth*_self.pixelRatio*0.45/chartData.categories.length,
                        }
                    }
                });
                return;
            },
            /***** 基本柱形图end ******/
            tabSelect(e) {
                this.TabCur = e;
            } 
        }
    }
    
</script>
 
<style>
    @import '/pages2/common/main.css';
    @import '/pages2/common/icon.css';
    .btn1,.btn2,.btn3{
        border:1rpx solid #e2231a;
        padding:10rpx 0;
        color:#666;
    }
    .btn1{
        border-radius: 100rpx 0 0 100rpx;
    }
    .btn3{
        border-radius: 0 100rpx 100rpx 0;
    }
    .btn1.active,.btn2.active,.btn3.active{
        background: #e2231a;
        color: #fff;
    }
    .charts{width:100%; height:500upx;background-color:#FFFFFF;} 
</style>