my-points.vue 5.4 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('/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="area3 area-padding">
  36. <text>积分价值</text>
  37. </view>
  38. </view>
  39. <mescroll-body :height="height" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption"
  40. :up="upOption">
  41. <view @click="jump(item)" class="item" hover-class="hoverClass"
  42. v-for="(item,index) in list" :key="index">
  43. <view class="area1">
  44. <view class="item-padding">
  45. <image :src="item.channelLogo" mode="aspectFit"></image>
  46. <view class="">
  47. <text>{{item.channelName}}</text>
  48. <text>{{item.createTime}}</text>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="area3 text-area ">
  53. <view v-if="item.type=='PAY_CONSUMER'" class="item-padding" style="font-size: 34rpx;color: #000;">-¥{{item.totalPrice}}</view>
  54. <view v-else class="item-padding" style="font-size: 34rpx;color: #000;">+¥{{item.totalPrice}}</view>
  55. </view>
  56. </view>
  57. </mescroll-body>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
  63. export default {
  64. mixins: [MescrollMixin],
  65. data() {
  66. return {
  67. list:[],
  68. downOption:{
  69. auto:false
  70. },
  71. showTime:false,
  72. params: {
  73. year: true,
  74. month: true,
  75. },
  76. defaultTime:'',
  77. point:'',
  78. height:''
  79. }
  80. },
  81. onReady(){
  82. this.defaultTime=this.$dateTime.format(new Date(),'YYYY-mm')
  83. this.getElInfo()
  84. },
  85. onLoad(options) {
  86. if(options.point){
  87. this.point = options.point
  88. }
  89. },
  90. methods: {
  91. async getElInfo() {
  92. let rectInfo = await this.$u.getRect('.cardTitle');
  93. this.height = this.$u.sys().windowHeight - rectInfo.top + 'px'
  94. },
  95. jump(item){
  96. console.log(item);
  97. uni.navigateTo({
  98. url:'/pagesA/pages/bill/bill-detail?billDetail='+JSON.stringify(item)+'&type=point'
  99. })
  100. },
  101. confirmTime(e){
  102. this.defaultTime = e.year + '-' +e.month
  103. this.downCallback()
  104. },
  105. upCallback(mescroll) {
  106. let params = {
  107. current:mescroll.num,
  108. size:mescroll.size,
  109. payId:this.vuex_userId,
  110. }
  111. try {
  112. this.$api.pointbills.list(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: 80%;
  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>