my-points.vue 5.8 KB

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