my-points.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <view>
  3. <u-picker v-model="showTime" mode="time" :params="params" :default-time="defaultTime" @confirm="confirmTime"></u-picker>
  4. <view class="top">
  5. <view class="value">
  6. <text>积分价值</text>
  7. <text>{{point}}</text>
  8. </view>
  9. <view class="flex justify-center align-center">
  10. <view class="cu-btn btn" hover-class="hoverClass1" @click="$jump('/pages/mine/my-points/accredit')">
  11. 积分授权
  12. </view>
  13. </view>
  14. </view>
  15. <view class="data">
  16. <view class="left">
  17. <view @click.stop="showTime = true">
  18. <text>{{defaultTime}}</text>
  19. <text class="cuIcon-unfold padding-left-10"></text>
  20. </view>
  21. <!-- <view>
  22. <text>支出 ¥ 165.00 收入 ¥ 463.00</text>
  23. </view> -->
  24. </view>
  25. <view class="right">
  26. <text>统计</text>
  27. <text class="cuIcon-right"></text>
  28. </view>
  29. </view>
  30. <view class="card">
  31. <view style="display: flex;">
  32. <view class="area1 area-padding " style="padding-left: 40rpx;">
  33. <text>积分来源</text>
  34. </view>
  35. <view class="area2 area-padding">
  36. <text>积分数量</text>
  37. </view>
  38. <view class="area3 area-padding">
  39. <text>价值</text>
  40. </view>
  41. </view>
  42. <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption"
  43. :up="upOption">
  44. <view @click="$jump('/pages/bill/bill-detail?bill-detail='+JSON.stringify(item))+'&type==point'" class="item" hover-class="hoverClass"
  45. v-for="(item,index) in list" :key="index">
  46. <view class="area1">
  47. <view class="item-padding">
  48. <image :src="item.logo" mode="aspectFit"></image>
  49. <view class="">
  50. <text>{{item.name}}</text>
  51. <text>{{item.updateTime}}</text>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="area2 text-area ">
  56. <view class="item-padding">
  57. <image style="width: 35rpx;height: 35rpx;margin-bottom: -5rpx;"
  58. src="@/static/icon/points-value.png"></image>
  59. <text v-if="item.type==1||item.type==2" style="font-size: 32rpx;margin-left: 10rpx;color: #F39248;">+{{item.point}}</text>
  60. <text v-if="item.type==3" style="font-size: 32rpx;margin-left: 10rpx;color: #000000;">-{{item.point}}</text>
  61. </view>
  62. </view>
  63. <view class="area3 text-area ">
  64. <view class="item-padding" style="font-size: 34rpx;color: #000;">¥{{item.pointValue}}</view>
  65. </view>
  66. </view>
  67. </mescroll-body>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
  73. export default {
  74. mixins: [MescrollMixin],
  75. data() {
  76. return {
  77. list:[],
  78. downOption:{
  79. auto:false
  80. },
  81. showTime:false,
  82. params: {
  83. year: true,
  84. month: true,
  85. },
  86. defaultTime:'',
  87. point:''
  88. }
  89. },
  90. onReady(){
  91. this.defaultTime=this.$dateTime.format(new Date(),'YYYY-mm')
  92. },
  93. onLoad(options) {
  94. this.defaultTime=this.$dateTime.format(new Date(),'YYYY-mm')
  95. if(options.point){
  96. this.point = options.point
  97. }
  98. },
  99. methods: {
  100. confirmTime(e){
  101. this.defaultTime = e.year + '-' +e.month
  102. this.downCallback()
  103. },
  104. upCallback(mescroll) {
  105. let params = {
  106. current:mescroll.num,
  107. size:mescroll.size,
  108. userId:this.vuex_userId,
  109. monthTime:this.defaultTime
  110. }
  111. try {
  112. this.$api.account.pointList(params).then(res => {
  113. let data = res.data.records
  114. let total = res.data.total
  115. mescroll.endBySize(data.length, total);
  116. if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
  117. this.list = this.list.concat(data); //追加新数据
  118. })
  119. } catch (e) {
  120. this.mescroll.endErr()
  121. }
  122. },
  123. downCallback() {
  124. setTimeout(() => {
  125. this.mescroll.resetUpScroll();
  126. }, 10)
  127. },
  128. }
  129. }
  130. </script>
  131. <style lang="scss" scoped>
  132. .btn {
  133. background-color: #FC8D38;
  134. color: #FFFFFF;
  135. border-radius: 50rpx;
  136. border: 1rpx solid #FFFFFF;
  137. }
  138. .hoverClass1{
  139. box-shadow: 0rpx 0rpx 10rpx #DDDDDD;
  140. }
  141. .top {
  142. padding: 50rpx;
  143. background-color: #FC8D38;
  144. display: flex;
  145. justify-content: space-between;
  146. .value {
  147. display: flex;
  148. flex-direction: column;
  149. text-align: center;
  150. text:first-child {
  151. color: #FCE7D6;
  152. font-size: 32rpx;
  153. }
  154. text:last-child {
  155. padding-top: 10rpx;
  156. font-size: 70rpx;
  157. color: #FFFFFF;
  158. }
  159. }
  160. }
  161. .data {
  162. padding: 50rpx 0 25rpx 40rpx;
  163. display: flex;
  164. justify-content: space-between;
  165. .left {
  166. display: flex;
  167. flex-direction: column;
  168. view:first-child {
  169. font-size: 34rpx;
  170. color: #000;
  171. padding-bottom: 10rpx;
  172. }
  173. view:last-child {
  174. font-size: 26rpx;
  175. color: #666666;
  176. }
  177. }
  178. .right {
  179. padding-right: 20rpx;
  180. color: #666666;
  181. display: flex;
  182. justify-content: center;
  183. align-items: center;
  184. text-align: center;
  185. }
  186. }
  187. .card {
  188. background-color: #FFFFFF;
  189. .area-padding {
  190. padding: 40rpx 0 20rpx;
  191. }
  192. .text-area{
  193. display: flex;
  194. justify-content: flex-start;
  195. align-items: center;
  196. }
  197. .area1 {
  198. padding-left: 30rpx;
  199. width: 55%;
  200. view:first-child {
  201. display: flex;
  202. image {
  203. width: 80rpx;
  204. height: 80rpx
  205. }
  206. view {
  207. padding-left: 15rpx;
  208. padding-bottom: 5rpx;
  209. display: flex;
  210. flex-direction: column;
  211. text:first-child {
  212. font-size: 32rpx;
  213. padding-bottom: 10rpx;
  214. color: #000;
  215. }
  216. text:last-child {
  217. font-size: 22rpx;
  218. color: #888888;
  219. }
  220. }
  221. }
  222. }
  223. .area2 {
  224. width: 25%;
  225. }
  226. .area3 {
  227. width: 20%;
  228. }
  229. .item-padding {
  230. padding: 20rpx 0;
  231. }
  232. .item {
  233. padding: 5rpx;
  234. display: flex;
  235. border-bottom: 1rpx solid #DDDDDD;
  236. }
  237. .item:last-child{
  238. border: none;
  239. }
  240. }
  241. </style>