my-bills.vue 5.9 KB

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