myPoint.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <view class="content">
  3. <view class="portrait-box">
  4. <image src="/static/pointTrade/point_bg_1.png" mode=""></image>
  5. <image class="point-img" src="/static/pointTrade/tradehall.png" />
  6. <view class="position-point">
  7. <view class="apply-point" @click="goIntro"><text>积分介绍</text></view>
  8. </view>
  9. </view>
  10. <u-row class="portrait-box2">
  11. <u-col span="6" class="portrait-box2-col" :gutter="16">
  12. <text>累计获得:</text>
  13. <text class="pcolor">{{ pointData.point || 0 }}</text>
  14. </u-col>
  15. <u-col span="6" class="portrait-box2-col">
  16. <text>未使用:</text>
  17. <text class="pcolor">{{ pointData.variablePoint || 0 }}</text>
  18. </u-col>
  19. </u-row>
  20. <div class="point-list">
  21. <view class="point-item" v-for="(item, index) in pointList" :key="index">
  22. <view>
  23. <view>{{ item.content }}</view>
  24. <view>{{ item.createTime}}</view>
  25. </view>
  26. <view><span>{{item.pointType == "1" ? '+' : '-'}}</span>{{ item.variablePoint }}</view>
  27. </view>
  28. <uni-load-more :status="count.loadStatus"></uni-load-more>
  29. </div>
  30. </view>
  31. </template>
  32. <script>
  33. import { getPointsData } from "@/api/members.js";
  34. import { getMemberPointSum } from "@/api/members.js";
  35. export default {
  36. data() {
  37. return {
  38. count: {
  39. loadStatus: "more",
  40. },
  41. pointList: [], //积分数据集合
  42. params: {
  43. pageNumber: 1,
  44. pageSize: 10,
  45. },
  46. pointData: {}, //累计获取 未输入 集合
  47. };
  48. },
  49. onLoad() {
  50. this.initPointData();
  51. this.getList();
  52. },
  53. /**
  54. * 触底加载
  55. */
  56. onReachBottom() {
  57. this.params.pageNumber++;
  58. this.getList();
  59. },
  60. methods: {
  61. /**
  62. * 获取积分数据
  63. */
  64. getList() {
  65. let params = this.params;
  66. uni.showLoading({
  67. title: "加载中",
  68. });
  69. getPointsData(params).then((res) => {
  70. uni.hideLoading();
  71. if (res.data.success) {
  72. let data = res.data.result.records;
  73. if (data.length < 10) {
  74. this.$set(this.count, "loadStatus", "noMore");
  75. this.pointList.push(...data);
  76. } else {
  77. this.pointList.push(...data);
  78. if (data.length < 10) this.$set(this.count, "loadStatus", "noMore");
  79. }
  80. }
  81. });
  82. },
  83. /**
  84. * 获得累计积分使用
  85. */
  86. initPointData() {
  87. getMemberPointSum().then((res) => {
  88. this.pointData = res.data.result;
  89. });
  90. },
  91. },
  92. };
  93. </script>
  94. <style lang="scss" scoped>
  95. .point-list{
  96. margin-top: 50rpx;
  97. }
  98. .title {
  99. height: 80rpx;
  100. text-align: center;
  101. line-height: 80rpx;
  102. font-size: 32rpx;
  103. font-weight: bold;
  104. }
  105. .point-item {
  106. width: 100%;
  107. height: 130rpx;
  108. padding: 0 20rpx;
  109. background: #ffffff;
  110. font-size: $font-sm;
  111. border-bottom: 1px solid $border-color-light;
  112. display: flex;
  113. justify-content: end;
  114. align-items: center;
  115. > view:nth-child(1) {
  116. flex: 1;
  117. line-height: 40rpx;
  118. view {
  119. color: #666666;
  120. }
  121. :last-child {
  122. color: #999;
  123. }
  124. }
  125. > view:nth-child(2) {
  126. width: 100rpx;
  127. text-align: center;
  128. }
  129. }
  130. .portrait-box2 {
  131. height: 100rpx;
  132. background: #ffffff;
  133. border-radius: 0 0 20rpx 20rpx;
  134. margin: 0 20rpx;
  135. font-size: 26rpx;
  136. /deep/ .u-col {
  137. text-align: center !important;
  138. }
  139. /deep/ .u-col:first-child {
  140. border-right: 1px solid $border-color-light;
  141. }
  142. .pcolor {
  143. color: #4ebb9d;
  144. }
  145. }
  146. .content {
  147. background: #f9f9f9;
  148. }
  149. .more {
  150. text-align: right;
  151. color: $u-tips-color;
  152. font-size: 24rpx;
  153. padding-right: 40rpx !important;
  154. }
  155. .portrait-box {
  156. background-color: $main-color;
  157. height: 250rpx;
  158. background: linear-gradient(134deg, #28d094 2%, #1abc9c 98%);
  159. border-radius: 20rpx 20rpx 0 0;
  160. margin: 20rpx 20rpx 0;
  161. position: relative;
  162. display: flex;
  163. flex-direction: column;
  164. justify-content: center;
  165. align-items: center;
  166. color: #ffffff;
  167. > image:first-child {
  168. width: 263rpx;
  169. height: 250rpx;
  170. position: absolute;
  171. left: 0;
  172. bottom: 0;
  173. transform: rotateY(180deg);
  174. }
  175. .position-point {
  176. position: absolute;
  177. right: -2rpx;
  178. top: 0;
  179. .apply-point {
  180. margin-top: 30rpx;
  181. text-align: center;
  182. line-height: 40rpx;
  183. font-size: $font-sm;
  184. color: #ffffff;
  185. width: 142rpx;
  186. height: 40rpx;
  187. background: rgba(#ffffff, 0.2);
  188. border-radius: 20rpx 0px 0px 20rpx;
  189. }
  190. }
  191. .point-img {
  192. height: 108rpx;
  193. width: 108rpx;
  194. margin-bottom: 30rpx;
  195. }
  196. .point {
  197. font-size: 56rpx;
  198. }
  199. }
  200. </style>