index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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 || '0'}}</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>购买了产品</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. let that = this;
  72. uni.request({
  73. url: getApp().globalData.shareUrl, //需要设置为全局
  74. method: 'POST',
  75. header: {
  76. 'content-type': 'application/x-www-form-urlencoded'
  77. },
  78. data: {
  79. method: 'getScoreList',
  80. timestamp: getApp().globalData.globalTimestamp, //Date.now()
  81. page: '',
  82. pageSize:'',
  83. uid:getApp().globalData.user_id,
  84. //uid:'14',
  85. sign: md5('getScoreList' + getApp().globalData.globalTimestamp)
  86. },
  87. success: res => {
  88. if (res.data.code === 200) {
  89. console.log(res.data.msg)
  90. that.totalNums = res.data.msg.totality;
  91. that.teamList = res.data.msg.list || [];
  92. }
  93. }
  94. });
  95. }
  96. }
  97. };
  98. </script>
  99. <style>
  100. .header-box {
  101. width: 100%;
  102. height: 180rpx;
  103. background: #1a9ed3;
  104. }
  105. .header-title {
  106. width: 93%;
  107. height: 150rpx;
  108. display: flex;
  109. flex-direction: column;
  110. align-items: center;
  111. background: #fff;
  112. z-index: 99;
  113. border-radius: 10rpx;
  114. font-size: 30rpx;
  115. margin: -13% auto;
  116. margin-bottom: 3%;
  117. }
  118. .count-sum {
  119. color: red;
  120. font-size: 32rpx;
  121. margin-left: 5%;
  122. }
  123. .count-deatil-box {
  124. width: 93%;
  125. border-radius: 10rpx;
  126. display: flex;
  127. flex-direction: column;
  128. align-items: center;
  129. background: #fff;
  130. margin: 0 auto;
  131. }
  132. .count-detail-title {
  133. width: 89%;
  134. border-bottom: 1px solid #dbdbdb;
  135. padding: 10px;
  136. font-size: 32rpx;
  137. }
  138. .leader-info {
  139. width: 90%;
  140. display: flex;
  141. align-items: center;
  142. background: #fff;
  143. padding: 20rpx;
  144. border-bottom: 1px solid #ccc;
  145. }
  146. .leader-column {
  147. display: flex;
  148. flex-direction: column;
  149. justify-content: space-between;
  150. height: 90rpx;
  151. font-size: 28rpx;
  152. margin-right: 2%;
  153. width: 400rpx;
  154. }
  155. .leader-info image {
  156. height: 75rpx;
  157. width: 75rpx;
  158. border-radius: 50%;
  159. border: 1px solid #eee;
  160. margin-right: 3%;
  161. }
  162. </style>