| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <template>
- <view class="m-b20 statistics_title">
- <view class="row-justify-sb center">
- <view class="row-c left">
- <view class="circle column-c justify-center">
- <view class="outer" :style="{background:bgColor[genre]}"></view>
- <view class="inside" :style="{background:bgColor[genre]}"></view>
- </view>
- <text class="size-28 text-color-12 sys-weight-600 m-l16">{{leftText}}</text>
- </view>
- <view class="row-c line-40" v-if="is_right && !is_age" @click="onHandle">
- <text class="size-24 text-color-8F9 m-r6">{{rightText}}</text>
- <uni-icons type="forward" size="16" color="#8F99B1"></uni-icons>
- </view>
- <view v-else></view>
- <view class="row-c" v-if="is_age">
- <view class="row-c m-l20" v-for="(item,index) in list" :key="index">
- <view class="wh-14 m-r10" :style="{background:item.color}"></view>
- <text class="size-24 text-color-576">{{item.name}}</text>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: 'statistics_title',
- props: {
- genre: {
- type: Number,
- default: 0
- },
- leftText: {
- type: String,
- default: ''
- },
- rightText: {
- type: String,
- default: ''
- },
- is_right: {
- type: Boolean,
- default: true
- },
- is_age: {
- type: Boolean,
- default: false
- },
- },
- data() {
- return {
- bgColor: ['#0FB160', '#FE7F37', '#10A2B0', '#DE2519'],
- list: [{
- name: '数量',
- color: '#2B7DFA'
- }, {
- name: '年龄',
- color: '#00BF8A'
- }, {
- name: '金额',
- color: '#ED9A2C'
- }, ]
- };
- },
- methods: {
- onHandle() {
- this.$emit('onHandle')
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .statistics_title {
- .left {
- line-height: 40rpx;
- .circle {
- position: relative;
- .outer {
- width: 35rpx;
- height: 35rpx;
- opacity: 0.2;
- border-radius: 50%;
- }
- .inside {
- width: 12rpx;
- height: 12rpx;
- border-radius: 50%;
- position: absolute;
- top: calc(50% - 6rpx);
- }
- }
- }
- .right {
- line-height: 35rpx;
- }
- }
- </style>
|