goose.vue 936 B

1234567891011121314151617181920212223242526272829303132333435
  1. <template>
  2. <view>
  3. <up-line-progress v-if="growthType!==3" :percentage="progress" :showText="false" activeColor="#54e1fe" class="game-progress-box"></up-line-progress>
  4. <text v-if="growthType!==3" class="game-progress-text">成长值:{{progress}}%</text>
  5. <image :src="imgUrl" class="goose-img-box" @click="handleTouch"></image>
  6. </view>
  7. </template>
  8. <script setup>
  9. import {gooseGrowthTypeList} from "./constantConfig.js"
  10. import { ref,computed } from "vue";
  11. import upLineProgress from "uview-plus/components/u-line-progress/u-line-progress.vue";
  12. const props = defineProps({
  13. growthType: {
  14. type: [String,Number]
  15. },
  16. progress: {
  17. type: [String,Number],
  18. default: 0
  19. }
  20. })
  21. const imgUrl = computed(() => {
  22. const active = gooseGrowthTypeList.find(item => item.id == props.growthType)
  23. return active ? active.imgUrl: ''
  24. })
  25. function handleTouch() {
  26. console.log('333')
  27. }
  28. </script>
  29. <style>
  30. </style>