conversion.uvue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. userId: 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" 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. <cl-image src="https://oss.xiaoxiongcode.com/static/个人中心/图层 13.png" mode="heightFix" height="100%"
  21. width="auto"></cl-image>
  22. </view>
  23. <view class="flex flex-col justify-around h-full">
  24. <view class="text-[16px] font-bold text-[#FC500F]">
  25. {{ item.mainTitle }}
  26. </view>
  27. <view class="text-[14px] text-[#999]">
  28. 兑换时间:{{ item.createTime }}
  29. </view>
  30. <view class="text-[14px] text-[#999]">
  31. 到期时间:{{ item.updateTime }}
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <view v-else class="w-full h-full flex flex-col justify-center items-center">
  37. <view class="text-center text-[#999] text-[14px]">
  38. 暂无兑换记录
  39. </view>
  40. </view>
  41. </scroll-view>
  42. </view>
  43. </template>
  44. <style lang="scss" scoped>
  45. .sidebar {
  46. height: calc(80vh - 90px);
  47. max-height: calc(620px - 90px);
  48. padding: 20px;
  49. }
  50. .box {
  51. width: 98%;
  52. // 宽高比3/1
  53. aspect-ratio: 4 / 1;
  54. padding: 5px;
  55. border-radius: 10px;
  56. background: linear-gradient(0deg, #FFFBF7 0%, #FFE0CC 100%);
  57. box-shadow: 3px 6px 4px 0px rgba(239, 103, 36, 0.48);
  58. }
  59. </style>