goose.vue 792 B

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