integralShow.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <!-- -->
  2. <template>
  3. <div class="statisticsBox d-flex">
  4. <div class="d-flex mt-2" style="flex: 1;">
  5. <div v-for="(val, i) in list" :key="i" :style="{'margin-left': val.showRules ? '0' : '200px'}">
  6. <div>
  7. <span class="ml-10 item-title">{{ val.title }}</span>
  8. <span v-if="val.showRules" class="ml-5 rules cursor-pointer" @click="integralRulesClick">
  9. {{ $t('points.integralRules') }}
  10. <v-icon style="font-size: 16px; color: var(--color-666); line-height: 16px; margin-left: 1px;">mdi-help-circle-outline</v-icon>
  11. </span>
  12. </div>
  13. <div>
  14. <span v-if="val.value === 'balance'" class="ml-10 item-value">{{ accountData[val.value] && accountData[val.value] > 0 ? (accountData[val.value]) : 0 }}</span>
  15. <span v-else class="ml-10 item-value">{{ accountData[val.value] || 0 }}</span>
  16. </div>
  17. </div>
  18. </div>
  19. <div class="d-flex align-end">
  20. <span style="font-size: 16px; color: #787d82; line-height: 24px;" class="mr-8">
  21. <template v-if="props.showMall">
  22. <span class="mall-text" @click="handleClickMall">{{ $t('points.handpickMall') }}</span>
  23. </template>
  24. <template v-if="props.taskCenter">
  25. <span class="septal-line"></span>
  26. <span class="mall-text" @click="router.push({ path: '/recruit/personal/personalCenter/memberBenefits/taskCenter' })">赚取积分</span>
  27. </template>
  28. </span>
  29. </div>
  30. </div>
  31. </template>
  32. <script setup>
  33. defineOptions({name: 'myRegistration-integralShow'})
  34. import { ref } from 'vue'
  35. import { useUserStore } from '@/store/user'
  36. import { useRouter } from 'vue-router'; const router = useRouter()
  37. const props = defineProps({
  38. showMall: {
  39. type: Boolean,
  40. default: true
  41. },
  42. taskCenter: {
  43. type: Boolean,
  44. default: false
  45. },
  46. // 招聘端
  47. isEnterprise: {
  48. type: Boolean,
  49. default: false
  50. }
  51. })
  52. const list = ref([
  53. { title: '您当前剩余积分', value: 'point', showRules: true },
  54. // { title: '您当前余额', value: 'balance', showRules: false },
  55. ])
  56. const userStore = useUserStore()
  57. let accountData = ref(JSON.parse(localStorage.getItem('userAccount')) || {})
  58. userStore.$subscribe((mutation, state) => {
  59. if (Object.keys(state.userAccount).length) accountData.value = state.userAccount
  60. })
  61. // 积分规则
  62. const integralRulesClick = () => {
  63. window.open('/integral/personalIntegralRules')
  64. }
  65. // 跳转门墩儿商城
  66. const handleClickMall = () => {
  67. window.open('/pointsExchange')
  68. }
  69. </script>
  70. <style lang="scss" scoped>
  71. .statisticsBox {
  72. padding: 10px 0;
  73. border-radius: 10px;
  74. background-color: var(--default-bgc);
  75. // background-color: var(--color-f3);
  76. // font-family: 宋体, SimSun;
  77. }
  78. .mall-text {
  79. color: var(--color-666);
  80. cursor: pointer;
  81. &:hover {
  82. color: var(--v-primary-base);
  83. }
  84. }
  85. .item-title {
  86. font-size: 20px;
  87. color: var(--color-333);
  88. line-height: 28px;
  89. font-weight: bold;
  90. }
  91. .item-value {
  92. font-size: 42px;
  93. color: #00B760;
  94. line-height: 50px;
  95. }
  96. .rules {
  97. font-size: 14px;
  98. color: var(--color-666);
  99. line-height: 24px;
  100. }
  101. </style>