您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

equity-list.vue 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <view class="selectCar-box">
  3. <view v-if="state.list" class="item" v-for="(item,i) in state.list" :key="i">
  4. <view class="iten-left">
  5. <view>权益名称:{{item.name}}</view>
  6. <view>权益金额:¥{{item.fee * 0.01}}元</view>
  7. </view>
  8. <view class="btn btn-primary" v-if="item.evaluate==1">已评价</view>
  9. <view class="btn btn-primary" v-else @click="goQuanyi(item)">去评价</view>
  10. </view>
  11. <view v-else>
  12. <empty title='暂无权益记录' />
  13. </view>
  14. <view style="text-align: center;margin: 20rpx;font-size: 30rpx;" v-if="state.flags">我是有底线的~</view>
  15. </view>
  16. </template>
  17. <script lang="ts" setup>
  18. import empty from "@/components/empty/empty.vue";
  19. import {
  20. reactive,
  21. ref
  22. } from "vue"
  23. import {
  24. msg,
  25. navTo
  26. } from "@/utils/utils"
  27. import {
  28. onLoad, onReachBottom, onShow
  29. } from "@dcloudio/uni-app";
  30. import {
  31. showEquityListApi
  32. } from "@/utils/network/api.js";
  33. import {
  34. request
  35. } from "@/utils/network/request.js";
  36. import {
  37. getItem,
  38. StorageKeys,
  39. } from "@/utils/storage";
  40. import {
  41. stringToJson
  42. } from "@/utils/network/encryption";
  43. const state = reactive({
  44. list: [],//车辆list,
  45. equtyId: "",//权益id
  46. flags: false,
  47. pageSize: 10,
  48. pageNo: 1
  49. });
  50. const flag = ref('0') //默认选择0
  51. onLoad((option) => {
  52. // showEquityListRequest()
  53. });
  54. onShow(() => {
  55. state.list = []
  56. showEquityListRequest()
  57. })
  58. const showEquityListRequest = () => {
  59. const options = {
  60. type: 2,
  61. data: {
  62. "openId": getItem(StorageKeys.OpenId),
  63. "pageNo": state.pageNo,
  64. "pageSize": state.pageSize,
  65. },
  66. method: 'POST',
  67. showLoading: true,
  68. }
  69. request(showEquityListApi, options).then((res) => {
  70. const data = stringToJson(res.bizContent);
  71. state.list = [...state.list, ...stringToJson(res.bizContent).data]
  72. console.log("购买2", data.data, state.list.length > 0)
  73. })
  74. }
  75. onReachBottom(() => {
  76. if (state.list.length < state.pageNo * 10) return state.flags = true
  77. console.log("触底了")
  78. state.pageNo++
  79. showEquityListRequest()
  80. })
  81. const goQuanyi = (item) => {
  82. navTo(`/subpackage/after-sale/add-equity/equity-product-evaluation?equityId=${item.equityId}&id=${item.id}&orderId=${item.orderId}`)
  83. }
  84. </script>
  85. <style>
  86. page {
  87. width: 100%;
  88. height: 100%;
  89. background-color: #EEF7F7;
  90. }
  91. </style>
  92. <style lang="scss" scoped>
  93. .selectCar-box {
  94. padding: 30rpx;
  95. .item {
  96. padding: 0 20rpx;
  97. display: flex;
  98. justify-content: space-between;
  99. align-items: center;
  100. height: 130rpx;
  101. background: #FFFFFF;
  102. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  103. border-radius: 20rpx;
  104. margin-bottom: 30rpx;
  105. .iten-left {
  106. align-items: center;
  107. font-size: 30rpx;
  108. text {
  109. margin-left: 20rpx;
  110. font-size: 32rpx;
  111. font-family: Noto Sans S Chinese;
  112. font-weight: 400;
  113. color: #333333;
  114. }
  115. }
  116. .choose-item {
  117. width: 44rpx;
  118. height: 44rpx;
  119. background: #FFFFFF;
  120. border: 2rpx solid #00B38B;
  121. border-radius: 50%;
  122. margin-right: 20rpx;
  123. display: flex;
  124. justify-content: center;
  125. align-items: center;
  126. box-sizing: content-box;
  127. }
  128. .active {
  129. width: 34rpx;
  130. height: 34rpx;
  131. background: #00B38B;
  132. border-radius: 50%;
  133. }
  134. }
  135. }
  136. .btn-primary {
  137. border: 1px solid #00b38b;
  138. color: #00b38b;
  139. }
  140. .btn {
  141. height: 60rpx;
  142. line-height: 58rpx;
  143. border-radius: 30rpx;
  144. padding: 0 24rpx;
  145. font-size: 23rpx;
  146. box-sizing: border-box;
  147. margin-right: 12rpx;
  148. }
  149. </style>