index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <script setup lang="ts">
  2. // import { navTabTypeList } from '@/subPack-smqjh/order/order-data'
  3. definePage({
  4. name: 'common-integral',
  5. islogin: true,
  6. style: {
  7. navigationBarTitleText: '积分',
  8. disableScroll: true,
  9. },
  10. })
  11. const navTabTypeList = ref<Api.sysDict[]>([])
  12. const showPointsPopup = ref(false)
  13. const { data: info } = useRequest(() =>
  14. Apis.xsb.findUserPoints({}),
  15. )
  16. const { data: pointList, isLastPage, page } = usePagination((pageNum, pageSize) => Apis.xsb.findUserPointsPage({ data: { pageNum, pageSize } }), { data: resp => resp.data?.list, initialPage: 1, initialPageSize: 10, immediate: true, append: true })
  17. function handleScrollBottom() {
  18. console.log(isLastPage.value, '=====')
  19. if (!isLastPage.value) {
  20. page.value++
  21. }
  22. }
  23. async function getNavList() {
  24. const res = await Apis.sys.dictPage({ data: { typeCode: 'sys_business_type' } })
  25. navTabTypeList.value = res.data?.list || []
  26. }
  27. getNavList()
  28. </script>
  29. <template>
  30. <view class="pages pty24rpx">
  31. <view class="grid grid-cols-4 w-full bg-white py-24rpx">
  32. <view class="flex flex-col items-center justify-center">
  33. <view class="text-28rpx text-[#AAAAAA]">
  34. 总充值积分
  35. </view>
  36. <view class="text-36rpx text-[#222] font-semibold">
  37. {{ info?.data?.pointsTotal || 0 }}
  38. </view>
  39. </view>
  40. <view class="flex flex-col items-center justify-center" @click="showPointsPopup = true">
  41. <view class="text-28rpx text-[#AAAAAA]">
  42. 当前可用积分
  43. </view>
  44. <view class="text-36rpx text-[#222] font-semibold">
  45. {{ info?.data?.availablePointsTotal || 0 }} >
  46. </view>
  47. </view>
  48. <view class="flex flex-col items-center justify-center">
  49. <view class="text-28rpx text-[#AAAAAA]">
  50. 已过期积分
  51. </view>
  52. <view class="text-36rpx text-[#222] font-semibold">
  53. {{ info?.data?.expiryPointsTotal || 0 }}
  54. </view>
  55. </view>
  56. <view class="flex flex-col items-center justify-center">
  57. <view class="text-28rpx text-[#AAAAAA]">
  58. 已消耗积分
  59. </view>
  60. <view class="text-36rpx text-[#222] font-semibold">
  61. {{ info?.data?.consumePointsTotal || 0 }}
  62. </view>
  63. </view>
  64. </view>
  65. <view class="px-24rpx py-20rpx">
  66. 可用积分记录
  67. </view>
  68. <scroll-view scroll-y class="view" @scrolltolower="handleScrollBottom">
  69. <view v-for="(item, index) in pointList" :key="item.pointsId" class="bg-white p-24rpx">
  70. <view class="flex items-center justify-between text-32rpx font-semibold">
  71. <view class="text-[#222]">
  72. {{ item.businessTypeName || '未知状态' }}
  73. </view>
  74. <view class="text-[#FF4A39]">
  75. {{ item?.pointsTypeName }}{{ item?.variablePoints || 0 }}
  76. </view>
  77. </view>
  78. <view class="mt-20rpx flex items-center justify-between text-28rpx text-[#AAAAAA]">
  79. <view>{{ item?.creationDate }}</view>
  80. <view>当前可用积分 {{ item?.currentlyAvailablePoints || 0 }}</view>
  81. </view>
  82. <view v-if="index < pointList.length - 1" class="mt-24rpx h-2rpx w-full bg-[#F0F0F0]" />
  83. </view>
  84. <StatusTip v-if="!pointList.length" tip="暂无内容" />
  85. </scroll-view>
  86. <!-- <Zpopup v-model="showPointsPopup" :showfooter="false" bg="#fff">
  87. <view class="px-32rpx pb-40rpx pt-40rpx">
  88. <view class="mb-32rpx text-center text-32rpx font-bold">
  89. 积分有限期
  90. </view>
  91. <view class="mb-24rpx flex items-center justify-between">
  92. <view class="text-28rpx text-[#222] font-bold">
  93. 当前可用积分
  94. </view>
  95. <view class="text-36rpx text-[#222] font-bold">
  96. {{ info?.data?.availablePointsTotal || 0 }}
  97. </view>
  98. </view>
  99. <view class="mb-16rpx flex items-center justify-between">
  100. <view class="text-24rpx text-[#999]">
  101. 有效期至:2026-07-06 23:59:59
  102. </view>
  103. <view class="text-24rpx text-[#222]">
  104. 2000
  105. </view>
  106. </view>
  107. <view class="mb-32rpx flex items-center justify-between">
  108. <view class="text-24rpx text-[#999]">
  109. 有效期至:2026-07-06 23:59:59
  110. </view>
  111. <view class="text-24rpx text-[#222]">
  112. 700
  113. </view>
  114. </view>
  115. <view class="mb-32rpx h-2rpx w-full bg-[#F0F0F0]" />
  116. <view class="mb-16rpx text-28rpx text-[#222] font-bold">
  117. 说明:
  118. </view>
  119. <view class="text-24rpx text-[#999] leading-40rpx">
  120. <view>1.请在积分有效期内使用,逾期自动作废;</view>
  121. <view>2.使用时,系统会优先使用快过期的积分;</view>
  122. <view>3.如若交易在使用的积分有效期之外发生退款,该部分积分也为过期。</view>
  123. </view>
  124. </view>
  125. </Zpopup> -->
  126. </view>
  127. </template>
  128. <style scoped>
  129. .view {
  130. height: calc(100vh - var(--window-top) - 250rpx);
  131. }
  132. </style>