conversion.uvue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <script setup lang='ts'>
  2. import { fetchSubjectFeeRecord } from '@/services/subject/record'
  3. import { onMounted, ref } from 'vue'
  4. import { user } from '@/.cool'
  5. const recordList = ref<any[]>([])
  6. onMounted(() => {
  7. fetchSubjectFeeRecord({
  8. createdUserId: user.info.value?.userInfo.userId
  9. }).then(res => {
  10. recordList.value = res
  11. })
  12. })
  13. </script>
  14. <template>
  15. <view class=" bg-[#fff] shadow rounded-xl mt-[20px] text-[#00A9FF] ">
  16. <scroll-view direction="vertical" :show-scrollbar="false" class="sidebar">
  17. <view class="w-full grid grid-cols-2 gap-4 py-2" v-if="recordList.length > 0">
  18. <view v-for="item in recordList" :key="item" class="box flex flex-row items-center gap-2">
  19. <view class="h-full">
  20. <image src="https://oss.xiaoxiongcode.com/static/个人中心/图层 13.png" mode="heightFix" class=" h-full" />
  21. </view>
  22. <view class="flex flex-col justify-around h-full">
  23. <view class="text-[3vh] font-bold text-[#FC500F]">
  24. {{ item.mainTitle }}
  25. </view>
  26. <view class="text-[2vh] text-[#999]">
  27. 兑换时间:{{ item.createTime }}
  28. </view>
  29. <view class="text-[2vh] text-[#999]">
  30. 到期时间:{{ item.updateTime }}
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <view v-else class="w-full h-full flex flex-col justify-center items-center">
  36. <view class="text-center text-[#999] text-[14px]">
  37. 暂无兑换记录
  38. </view>
  39. </view>
  40. </scroll-view>
  41. </view>
  42. </template>
  43. <style lang="scss" scoped>
  44. .sidebar {
  45. height: calc(80vh - 90px);
  46. max-height: calc(620px - 90px);
  47. padding: 20px;
  48. }
  49. .box {
  50. width: 98%;
  51. // 宽高比3/1
  52. aspect-ratio: 4 / 1;
  53. padding: 5px;
  54. border-radius: 10px;
  55. background: linear-gradient(0deg, #FFFBF7 0%, #FFE0CC 100%);
  56. box-shadow: 3px 6px 4px 0px rgba(239, 103, 36, 0.48);
  57. }
  58. </style>