statistics_title.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <view class="m-b20 statistics_title">
  3. <view class="row-justify-sb center">
  4. <view class="row-c left">
  5. <view class="circle column-c justify-center">
  6. <view class="outer" :style="{background:bgColor[genre]}"></view>
  7. <view class="inside" :style="{background:bgColor[genre]}"></view>
  8. </view>
  9. <text class="size-28 text-color-12 sys-weight-600 m-l16">{{leftText}}</text>
  10. </view>
  11. <view class="row-c line-40" v-if="is_right && !is_age" @click="onHandle">
  12. <text class="size-24 text-color-8F9 m-r6">{{rightText}}</text>
  13. <uni-icons type="forward" size="16" color="#8F99B1"></uni-icons>
  14. </view>
  15. <view v-else></view>
  16. <view class="row-c" v-if="is_age">
  17. <view class="row-c m-l20" v-for="(item,index) in list" :key="index">
  18. <view class="wh-14 m-r10" :style="{background:item.color}"></view>
  19. <text class="size-24 text-color-576">{{item.name}}</text>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. name: 'statistics_title',
  28. props: {
  29. genre: {
  30. type: Number,
  31. default: 0
  32. },
  33. leftText: {
  34. type: String,
  35. default: ''
  36. },
  37. rightText: {
  38. type: String,
  39. default: ''
  40. },
  41. is_right: {
  42. type: Boolean,
  43. default: true
  44. },
  45. is_age: {
  46. type: Boolean,
  47. default: false
  48. },
  49. },
  50. data() {
  51. return {
  52. bgColor: ['#0FB160', '#FE7F37', '#10A2B0', '#DE2519'],
  53. list: [{
  54. color: '#2B7DFA'
  55. },{
  56. name: '数量',
  57. color: '#2B7DFA'
  58. }, {
  59. name: '金额',
  60. color: '#00BF8A'
  61. }, {
  62. name: '金额',
  63. color: '#ED9A2C'
  64. }, ]
  65. };
  66. },
  67. methods: {
  68. onHandle() {
  69. this.$emit('onHandle')
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. .statistics_title {
  76. .left {
  77. line-height: 40rpx;
  78. .circle {
  79. position: relative;
  80. .outer {
  81. width: 35rpx;
  82. height: 35rpx;
  83. opacity: 0.2;
  84. border-radius: 50%;
  85. }
  86. .inside {
  87. width: 12rpx;
  88. height: 12rpx;
  89. border-radius: 50%;
  90. position: absolute;
  91. top: calc(50% - 6rpx);
  92. }
  93. }
  94. }
  95. .right {
  96. line-height: 35rpx;
  97. }
  98. }
  99. </style>