my-points.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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. let m = new Date().getMonth() + 1
  92. let y = new Date().getFullYear()
  93. let m1 = m<10? ("0" + m) : m
  94. this.defaultTime = y + '-' + m1
  95. },
  96. onLoad(options) {
  97. if(options.point){
  98. this.point = options.point
  99. }
  100. },
  101. methods: {
  102. confirmTime(e){
  103. this.defaultTime = e.year + '-' +e.month
  104. this.downCallback()
  105. },
  106. upCallback(mescroll) {
  107. let params = {
  108. current:mescroll.num,
  109. size:mescroll.size,
  110. userId:this.vuex_userId,
  111. monthTime:this.defaultTime
  112. }
  113. try {
  114. this.$api.account.pointList(params).then(res => {
  115. let data = res.data.records
  116. let total = res.data.total
  117. mescroll.endBySize(data.length, total);
  118. if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
  119. this.list = this.list.concat(data); //追加新数据
  120. })
  121. } catch (e) {
  122. this.mescroll.endErr()
  123. }
  124. },
  125. downCallback() {
  126. setTimeout(() => {
  127. this.mescroll.resetUpScroll();
  128. }, 10)
  129. },
  130. }
  131. }
  132. </script>
  133. <style lang="scss" scoped>
  134. .btn {
  135. background-color: #FC8D38;
  136. color: #FFFFFF;
  137. border-radius: 50rpx;
  138. border: 1rpx solid #FFFFFF;
  139. }
  140. .hoverClass1{
  141. box-shadow: 0rpx 0rpx 10rpx #DDDDDD;
  142. }
  143. .top {
  144. padding: 50rpx;
  145. background-color: #FC8D38;
  146. display: flex;
  147. justify-content: space-between;
  148. .value {
  149. display: flex;
  150. flex-direction: column;
  151. text-align: center;
  152. text:first-child {
  153. color: #FCE7D6;
  154. font-size: 32rpx;
  155. }
  156. text:last-child {
  157. padding-top: 10rpx;
  158. font-size: 70rpx;
  159. color: #FFFFFF;
  160. }
  161. }
  162. }
  163. .data {
  164. padding: 50rpx 0 25rpx 40rpx;
  165. display: flex;
  166. justify-content: space-between;
  167. .left {
  168. display: flex;
  169. flex-direction: column;
  170. view:first-child {
  171. font-size: 34rpx;
  172. color: #000;
  173. padding-bottom: 10rpx;
  174. }
  175. view:last-child {
  176. font-size: 26rpx;
  177. color: #666666;
  178. }
  179. }
  180. .right {
  181. padding-right: 20rpx;
  182. color: #666666;
  183. display: flex;
  184. justify-content: center;
  185. align-items: center;
  186. text-align: center;
  187. }
  188. }
  189. .card {
  190. background-color: #FFFFFF;
  191. .area-padding {
  192. padding: 40rpx 0 20rpx;
  193. }
  194. .text-area{
  195. display: flex;
  196. justify-content: flex-start;
  197. align-items: center;
  198. }
  199. .area1 {
  200. padding-left: 30rpx;
  201. width: 55%;
  202. view:first-child {
  203. display: flex;
  204. image {
  205. width: 80rpx;
  206. height: 80rpx
  207. }
  208. view {
  209. padding-left: 15rpx;
  210. padding-bottom: 5rpx;
  211. display: flex;
  212. flex-direction: column;
  213. text:first-child {
  214. font-size: 32rpx;
  215. padding-bottom: 10rpx;
  216. color: #000;
  217. }
  218. text:last-child {
  219. font-size: 22rpx;
  220. color: #888888;
  221. }
  222. }
  223. }
  224. }
  225. .area2 {
  226. width: 25%;
  227. }
  228. .area3 {
  229. width: 20%;
  230. }
  231. .item-padding {
  232. padding: 20rpx 0;
  233. }
  234. .item {
  235. padding: 5rpx;
  236. display: flex;
  237. border-bottom: 1rpx solid #DDDDDD;
  238. }
  239. .item:last-child{
  240. border: none;
  241. }
  242. }
  243. </style>