my-bills.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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%;" ></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%;" ></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. <toast ref="toast" ></toast>
  61. </view>
  62. </template>
  63. <script>
  64. import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
  65. export default {
  66. mixins: [MescrollMixin],
  67. data() {
  68. return {
  69. payCount:0,
  70. list:[],
  71. downOption:{
  72. auto:false
  73. },
  74. showTime:false,
  75. params: {
  76. year: true,
  77. month: true,
  78. },
  79. defaultTime:'',
  80. height:''
  81. }
  82. },
  83. onLoad(options) {
  84. // this.defaultTime =this.$dateTime.format(new Date(),'YYYY-mm')
  85. },
  86. onReady() {
  87. this.getElInfo()
  88. },
  89. methods: {
  90. async getElInfo() {
  91. let rectInfo = await this.$u.getRect('.card');
  92. this.height = this.$u.sys().windowHeight - rectInfo.top + 'px'
  93. },
  94. confirmTime(e){
  95. this.defaultTime = e.year + '-' +e.month
  96. this.mescroll.resetUpScroll();
  97. },
  98. upCallback(mescroll) {
  99. let params = {
  100. current:mescroll.num,
  101. size:mescroll.size,
  102. payId:this.vuex_userId,
  103. payStatus:'付款成功'
  104. }
  105. if (this.defaultTime) {
  106. params.yearMoth = this.$dateTime.format(new Date(this.defaultTime))
  107. }
  108. try {
  109. this.$api.bills.list(params).then(res => {
  110. let data = res.data.records
  111. let total = res.data.total
  112. this.payCount=total
  113. mescroll.endBySize(data.length, total);
  114. if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
  115. this.list = this.list.concat(data); //追加新数据
  116. })
  117. } catch (e) {
  118. console.log(e);
  119. this.mescroll.endErr()
  120. }
  121. },
  122. downCallback() {
  123. let _this=this
  124. setTimeout(() => {
  125. _this.mescroll.resetUpScroll();
  126. setTimeout(()=>{
  127. _this.$refs.toast.info('刷新成功')
  128. },150)
  129. },500)
  130. },
  131. }
  132. }
  133. </script>
  134. <style lang="scss" scoped>
  135. .btn {
  136. background-color: #FC8D38;
  137. color: #FFFFFF;
  138. border-radius: 50rpx;
  139. border: 1rpx solid #FFFFFF;
  140. }
  141. .hoverClass1{
  142. box-shadow: 0rpx 0rpx 10rpx #DDDDDD;
  143. }
  144. .top {
  145. padding: 50rpx;
  146. background-color: #FC8D38;
  147. display: flex;
  148. justify-content: space-between;
  149. .value {
  150. display: flex;
  151. flex-direction: column;
  152. text-align: center;
  153. text:first-child {
  154. color: #FCE7D6;
  155. font-size: 32rpx;
  156. }
  157. text:last-child {
  158. padding-top: 10rpx;
  159. font-size: 70rpx;
  160. color: #FFFFFF;
  161. }
  162. }
  163. }
  164. .data {
  165. padding: 50rpx 0 25rpx 40rpx;
  166. display: flex;
  167. justify-content: space-between;
  168. .left {
  169. display: flex;
  170. flex-direction: column;
  171. view:first-child {
  172. font-size: 34rpx;
  173. color: #000;
  174. padding-bottom: 10rpx;
  175. }
  176. view:last-child {
  177. font-size: 26rpx;
  178. color: #666666;
  179. }
  180. }
  181. .right {
  182. padding-right: 20rpx;
  183. color: #666666;
  184. display: flex;
  185. justify-content: center;
  186. align-items: center;
  187. text-align: center;
  188. }
  189. }
  190. .card {
  191. background-color: #FFFFFF;
  192. .area-padding {
  193. padding: 40rpx 0 20rpx;
  194. }
  195. .text-area{
  196. display: flex;
  197. justify-content: flex-start;
  198. align-items: center;
  199. }
  200. .area1 {
  201. padding-left: 30rpx;
  202. width: 55%;
  203. view:first-child {
  204. display: flex;
  205. image {
  206. width: 80rpx;
  207. height: 80rpx
  208. }
  209. view {
  210. padding-left: 15rpx;
  211. padding-bottom: 5rpx;
  212. display: flex;
  213. flex-direction: column;
  214. text:first-child {
  215. font-size: 32rpx;
  216. padding-bottom: 10rpx;
  217. color: #000;
  218. }
  219. text:last-child {
  220. font-size: 22rpx;
  221. color: #888888;
  222. }
  223. }
  224. }
  225. }
  226. .area2 {
  227. width: 25%;
  228. }
  229. .area3 {
  230. width: 20%;
  231. }
  232. .item-padding {
  233. padding: 20rpx 0;
  234. }
  235. .item {
  236. padding: 5rpx;
  237. display: flex;
  238. border-bottom: 1rpx solid #DDDDDD;
  239. }
  240. .item:last-child{
  241. border: none;
  242. }
  243. }
  244. .count::after {
  245. content: '笔';
  246. margin-left: 6rpx;
  247. font-size: 0.5em;
  248. }
  249. .price::after {
  250. content: '元';
  251. margin-left: 6rpx;
  252. font-size: 0.5em;
  253. }
  254. .reduce::before {
  255. content: '-';
  256. margin-right: 10rpx;
  257. }
  258. .plus::before {
  259. content: '+';
  260. margin-right: 10rpx;
  261. }
  262. </style>