DashboardPriceSuggest.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <div class="q-mx-md q-mb-md">
  3. <q-card
  4. class="price-suggest-card bg-surface shadow-card"
  5. :flat="false"
  6. >
  7. <q-card-section class="price-suggest-section">
  8. <div class="row items-center justify-between no-wrap q-mb-sm">
  9. <span class="text-suggest-label text-no-wrap">
  10. {{ $t('provider.dashboard.price_suggest.region_label_1') }}
  11. <span class="fontbold">
  12. {{ $t('provider.dashboard.price_suggest.region_label_2') }}
  13. </span>
  14. </span>
  15. <q-badge
  16. class="price-badge fontbold text-no-wrap gradient-diarista-bg"
  17. rounded
  18. >
  19. {{ formatCurrency(data?.average_price ?? 0) }}
  20. </q-badge>
  21. </div>
  22. <div class="row items-center justify-between no-wrap">
  23. <span class="text-suggest-label text-no-wrap">
  24. {{ $t('provider.dashboard.price_suggest.my_price_label_1') }}
  25. <span class="fontbold">
  26. {{ $t('provider.dashboard.price_suggest.my_price_label_2') }}
  27. </span>
  28. </span>
  29. <div class="my-price-chip row items-center no-wrap q-ml-xs">
  30. <span class="text-my-price fontmedium text-no-wrap">
  31. {{
  32. showMyPrice
  33. ? formatCurrency(data?.your_price ?? 0)
  34. : $t('common.price_masked')
  35. }}
  36. </span>
  37. <q-btn
  38. class="q-pa-none q-ml-xs"
  39. color="grey-6"
  40. dense
  41. flat
  42. :icon="showMyPrice ? 'mdi-eye-outline' : 'mdi-eye-off-outline'"
  43. size="xs"
  44. @click="showMyPrice = !showMyPrice"
  45. />
  46. </div>
  47. <q-btn
  48. class="q-ml-xs"
  49. color="primary"
  50. flat
  51. no-caps
  52. padding="0"
  53. size="xs"
  54. @click="openServiceDataDialog"
  55. >
  56. <div class="row items-center no-wrap alter-label">
  57. <span class="fontbold">
  58. {{ $t('common.alter') }}
  59. </span>
  60. <q-icon
  61. class="q-ml-xs"
  62. name="mdi-pencil-outline"
  63. size="14px"
  64. />
  65. </div>
  66. </q-btn>
  67. </div>
  68. </q-card-section>
  69. </q-card>
  70. </div>
  71. </template>
  72. <script setup>
  73. import { formatCurrency } from 'src/helpers/utils';
  74. import { ref } from 'vue';
  75. import { useQuasar } from 'quasar';
  76. import ServiceDataDialog from '../profile/ProfileServiceDataDialog.vue';
  77. defineProps({
  78. data: {
  79. type: Object,
  80. default: () => ({
  81. })
  82. }
  83. });
  84. const showMyPrice = ref(false);
  85. const $q = useQuasar()
  86. const openServiceDataDialog = () => {
  87. $q.dialog({
  88. component: ServiceDataDialog
  89. })
  90. }
  91. </script>
  92. <style scoped lang="scss">
  93. .price-suggest-card {
  94. border-radius: 20px;
  95. }
  96. .price-suggest-section {
  97. padding: 14px 16px;
  98. }
  99. .text-suggest-label {
  100. color: #3a3a4a;
  101. font-size: clamp(10px, 3.2vw, 13px);
  102. line-height: 1.2;
  103. }
  104. .price-badge {
  105. border-radius: 20px;
  106. font-size: clamp(10px, 3.2vw, 13px);
  107. padding: 4px 12px;
  108. }
  109. .my-price-chip {
  110. border: 1px solid #b9b9c3;
  111. border-radius: 20px;
  112. padding: 2px 8px 2px 10px;
  113. }
  114. .text-my-price {
  115. color: #3a3a4a;
  116. font-size: clamp(9px, 2.9vw, 12px);
  117. letter-spacing: 0.5px;
  118. }
  119. .alter-label {
  120. font-size: clamp(10px, 3.1vw, 13px);
  121. }
  122. </style>