index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view>
  3. <view class="header-box"></view>
  4. <view class="header-title">
  5. <text style="margin-top: 4%;">累计积分</text>
  6. <text style="margin-top: 2%;font-size: 36rpx;">{{totalNums || '-'}}</text>
  7. </view>
  8. <view class="count-deatil-box">
  9. <view class="count-detail-title">
  10. 积分明细
  11. </view>
  12. <view class="leader-info" v-for="item in teamList" :key='item.id'>
  13. <image :src="item.headimg"></image>
  14. <view class="leader-column">
  15. <view>
  16. <text>{{item.name || '-'}}</text>
  17. <text style="visibility: hidden;">A</text>
  18. <text v-show=" item.name!=='分享奖励' ">购买了产品</text>
  19. </view>
  20. <view>
  21. <text style="color:#ccc;font-size: 28rpx;">{{item.time || '-'}}</text>
  22. </view>
  23. </view>
  24. <view class="count-sum">
  25. {{item.score || '-'}}
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. var md5 = require('../../../common/md5.js')
  33. export default {
  34. data() {
  35. return {
  36. title: 'selfCenter',
  37. totalNums:'',
  38. teamList: [
  39. // {
  40. // name: '晚霞',
  41. // count: '+12999',
  42. // time: '2019-02-14 00:00',
  43. // id: 1
  44. // },
  45. // {
  46. // name: '午霞',
  47. // count: '+5112',
  48. // time: '2019-02-15 00:00',
  49. // id: 2
  50. // },
  51. // {
  52. // name: '午霞A',
  53. // count: '+8999',
  54. // time: '2019-02-15 01:00',
  55. // id:3
  56. // },
  57. // {
  58. // name: '午霞2',
  59. // count: '+13999',
  60. // time: '2019-02-16 00:00',
  61. // id: 4
  62. // }
  63. ]
  64. };
  65. },
  66. onLoad() {
  67. this.getScoreList();
  68. },
  69. methods: {
  70. getScoreList(){
  71. uni.showLoading({
  72. title: '加载中',
  73. });
  74. let that = this;
  75. uni.request({
  76. url: getApp().globalData.shareUrl, //需要设置为全局
  77. method: 'POST',
  78. header: {
  79. 'content-type': 'application/x-www-form-urlencoded'
  80. },
  81. data: {
  82. method: 'getScoreList',
  83. timestamp: getApp().globalData.globalTimestamp, //Date.now()
  84. page: '',
  85. pageSize:'',
  86. uid:getApp().globalData.user_id,
  87. //uid:'14',
  88. sign: md5('getScoreList' + getApp().globalData.globalTimestamp)
  89. },
  90. success: res => {
  91. if (res.data.code === 200) {
  92. uni.hideLoading();
  93. that.totalNums = res.data.msg.totality;
  94. that.teamList = res.data.msg.list || [];
  95. }
  96. }
  97. });
  98. }
  99. }
  100. };
  101. </script>
  102. <style>
  103. .header-box {
  104. width: 100%;
  105. height: 180rpx;
  106. background: #1a9ed3;
  107. }
  108. .header-title {
  109. width: 93%;
  110. height: 150rpx;
  111. display: flex;
  112. flex-direction: column;
  113. align-items: center;
  114. background: #fff;
  115. z-index: 99;
  116. border-radius: 10rpx;
  117. font-size: 30rpx;
  118. margin: -13% auto;
  119. margin-bottom: 3%;
  120. }
  121. .count-sum {
  122. color: red;
  123. font-size: 32rpx;
  124. text-align: right;
  125. width: 20%;
  126. }
  127. .count-deatil-box {
  128. width: 93%;
  129. border-radius: 10rpx;
  130. display: flex;
  131. flex-direction: column;
  132. align-items: center;
  133. background: #fff;
  134. margin: 0 auto;
  135. }
  136. .count-detail-title {
  137. width: 89%;
  138. border-bottom: 1px solid #dbdbdb;
  139. padding: 10px;
  140. font-size: 32rpx;
  141. }
  142. .leader-info {
  143. width: 90%;
  144. display: flex;
  145. align-items: center;
  146. background: #fff;
  147. padding: 20rpx;
  148. border-bottom: 1px solid #ccc;
  149. }
  150. .leader-column {
  151. display: flex;
  152. flex-direction: column;
  153. justify-content: space-between;
  154. height: 90rpx;
  155. font-size: 28rpx;
  156. margin-right: 2%;
  157. width: 400rpx;
  158. }
  159. .leader-info image {
  160. height: 75rpx;
  161. width: 75rpx;
  162. border-radius: 50%;
  163. border: 1px solid #eee;
  164. margin-right: 3%;
  165. }
  166. </style>