pointsDetails.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <view class="app-container">
  3. <uv-navbar title="我的积分" placeholder autoBack></uv-navbar>
  4. <view class="top u-flex-center-sb">
  5. <view class="top-item">
  6. <view class="num">{{ info.todayInnerIntegral || 0 }}</view>
  7. <view class="text">今日积分</view>
  8. </view>
  9. <view class="line"></view>
  10. <view class="top-item">
  11. <view class="num">{{ info.integralAble || 0 }}</view>
  12. <view class="text">积分剩余</view>
  13. </view>
  14. </view>
  15. <view class="middle-list">
  16. <view class="list-title u-flex-center">
  17. <image class="icon" :src="$handleImageUrl('/personalCenter/icon_points.png')" alt="" />
  18. <text class="text">积分明细</text>
  19. </view>
  20. <view
  21. class="list-item u-flex-center-sb"
  22. v-for="(item, index) in pointsList"
  23. :key="index"
  24. >
  25. <view class="info">
  26. <view class="remark">{{ item.remark }}</view>
  27. <view class="time">{{ item.createTime }}</view>
  28. </view>
  29. <view
  30. class="num"
  31. :style="{ color: item.billType == 1 ? '#ff0000' : '#1a1a1a' }"
  32. >
  33. <text v-if="item.billType == 1">+</text>
  34. <text v-else>-</text>
  35. <text>{{ item.value }}</text>
  36. </view>
  37. </view>
  38. <loadMore v-if="pointsList.length > 0" :status="status"></loadMore>
  39. <noData v-else :config="{ top: 1, content: '暂无数据~' }"></noData>
  40. </view>
  41. </view>
  42. </template>
  43. <script setup>
  44. import { ref } from "vue";
  45. import { onLoad, onReachBottom, onPullDownRefresh } from "@dcloudio/uni-app";
  46. import { userBusinessIntegralRecordPage_Api } from "@/api/index.js";
  47. import { userBusinessRoleInfo_Api } from "@/api/userInfo.js";
  48. const info = ref({});
  49. const pointsList = ref([]);
  50. const params = ref({
  51. pageNum: 1,
  52. pageSize: 10,
  53. });
  54. const status = ref("more");
  55. const getMydetailed = () => {
  56. userBusinessIntegralRecordPage_Api(params.value).then((res) => {
  57. if (res && res.code == 200) {
  58. uni.stopPullDownRefresh();
  59. pointsList.value = pointsList.value.concat(res.rows);
  60. if (res.total <= pointsList.value.length) {
  61. status.value = "noMore";
  62. } else {
  63. status.value = "more";
  64. }
  65. }
  66. });
  67. };
  68. const getShopInfo = () => {
  69. userBusinessRoleInfo_Api(params.value.businessRoleId).then((res) => {
  70. if (res && res.code == 200) {
  71. info.value = res.data;
  72. }
  73. });
  74. };
  75. onLoad((options) => {
  76. if (!options.id) {
  77. uni.$uv.toast("未获取到店铺信息");
  78. uni.navigateBack();
  79. return;
  80. }
  81. params.value.businessRoleId = options.id;
  82. pointsList.value = [];
  83. getShopInfo();
  84. getMydetailed();
  85. });
  86. onReachBottom(() => {
  87. if (status.value != "noMore") {
  88. params.value.pageNum++;
  89. getMydetailed();
  90. }
  91. });
  92. onPullDownRefresh(() => {
  93. getShopInfo();
  94. params.value.pageNum = 1;
  95. pointsList.value = [];
  96. getMydetailed();
  97. });
  98. </script>
  99. <style lang="scss" scoped>
  100. .app-container {
  101. min-height: 100vh;
  102. box-sizing: border-box;
  103. .top {
  104. width: 690rpx;
  105. min-height: 213rpx;
  106. background: #f7f6f6;
  107. border-radius: 20rpx;
  108. margin: 30rpx auto;
  109. box-sizing: border-box;
  110. .line {
  111. width: 1rpx;
  112. height: 126rpx;
  113. background: #e6e5e5;
  114. flex-shrink: 0;
  115. }
  116. .top-item {
  117. flex: 1;
  118. .num {
  119. font-size: 60rpx;
  120. font-weight: normal;
  121. text-align: center;
  122. color: #eb5153;
  123. }
  124. .text {
  125. font-size: 28rpx;
  126. font-weight: 400;
  127. text-align: left;
  128. color: #1a1a1a;
  129. text-align: center;
  130. }
  131. }
  132. }
  133. .middle-list {
  134. min-height: 30vh;
  135. background: linear-gradient(180deg, #fbe6e9, #ffffff 130rpx);
  136. border-radius: 40rpx 40rpx 0px 0px;
  137. padding: 30rpx 54rpx;
  138. .list-title {
  139. .icon {
  140. width: 44rpx;
  141. height: 44rpx;
  142. margin-right: 10rpx;
  143. }
  144. .text {
  145. font-size: 34rpx;
  146. font-weight: 700;
  147. color: #1a1a1a;
  148. }
  149. }
  150. .list-item {
  151. padding: 30rpx 0;
  152. border-bottom: 1rpx solid #f0f0f0;
  153. .info {
  154. flex: 1;
  155. .remark {
  156. font-size: 28rpx;
  157. color: #1a1a1a;
  158. }
  159. .time {
  160. font-size: 24rpx;
  161. color: #999999;
  162. margin-top: 5rpx;
  163. }
  164. }
  165. .num {
  166. flex-shrink: 0;
  167. margin-left: 20rpx;
  168. font-size: 30rpx;
  169. font-weight: 700;
  170. }
  171. }
  172. }
  173. }
  174. </style>