NumWidget.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <widget-card :bodyStyle="bodyStyle">
  3. <i class="fa-fw fas fa-user fa-3x" style="color: #40c9c6;"></i>
  4. <div class="info">
  5. <div class="text">官方购买人数/二手市场(人)</div>
  6. <div class="num">{{ info.officialNum }}/{{ info.transferNum }}</div>
  7. </div>
  8. </widget-card>
  9. </template>
  10. <script>
  11. import WidgetCard from './WidgetCard';
  12. import acc from '../mixins/acc';
  13. export default {
  14. props: {
  15. info: {
  16. type: Object,
  17. default: () => {
  18. return {};
  19. }
  20. }
  21. },
  22. mixins: [acc],
  23. computed: {
  24. total() {
  25. return this.accAdd(this.info.officialNum || 0, this.info.transferNum || 0);
  26. }
  27. },
  28. data() {
  29. return {
  30. bodyStyle: {
  31. display: 'flex',
  32. alignItems: 'center'
  33. }
  34. };
  35. },
  36. components: {
  37. WidgetCard
  38. }
  39. };
  40. </script>
  41. <style lang="less" scoped>
  42. .info {
  43. flex-grow: 1;
  44. text-align: right;
  45. .text {
  46. color: #999;
  47. font-size: 16px;
  48. margin-bottom: 12px;
  49. }
  50. .num {
  51. font-size: 20px;
  52. color: #333;
  53. }
  54. }
  55. </style>