index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view class="page">
  3. <u-sticky>
  4. <View class=" tabs">
  5. <u-tabs :list="tabList"
  6. lineColor="#FFE05C"
  7. :activeStyle="{
  8. color: '#333333',
  9. fontWeight: 'bold',
  10. transform: 'scale(1.05)'
  11. }"
  12. :current="tabIndex" @click="clickTab"></u-tabs>
  13. </View>
  14. <view class="statistics flex-row justify-between ">
  15. <picker class="picker" @change="sureChooseDate" mode='date' fields="month" range-key="label" >
  16. <view class="left flex-row" @click="showDate">
  17. <text>{{dataTime || '全部'}}</text>
  18. <image class="xialaImage" src="/static/transaction/u5.png"></image>
  19. </view>
  20. </picker>
  21. <view class="right flex-row justify-around">
  22. <text>新增{{tranFlowstatistic.rechargeAmount || 0}}</text>
  23. <text>消费-{{tranFlowstatistic.consumeAmount || 0 }}</text>
  24. <text>退款-{{tranFlowstatistic.refundAmount || 0 }}</text>
  25. </view>
  26. </view>
  27. </u-sticky>
  28. <!-- 订单列表 -->
  29. <view :style="{'height':windowHeight}" >
  30. <swiper :style="{'height':windowHeight}" :current="tabIndex" @change="swiperChange">
  31. <swiper-item class="swiperItem" v-for="(item,index) in tabList" :key="index" >
  32. <view>
  33. <mescroll-item ref="MescrollItem" :i="index" :index="tabIndex" :dataTime="dataTime" :tabs="tabList" :height="windowHeight">
  34. </mescroll-item>
  35. </view>
  36. </swiper-item>
  37. </swiper>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import MescrollItem from "./module/mescrollUni-item.vue";
  43. export default {
  44. components: {
  45. MescrollItem
  46. },
  47. data() {
  48. return {
  49. windowHeight:'',
  50. tabIndex:0,
  51. tabList: [{
  52. name: '全部',
  53. }, {
  54. name: '消费'
  55. }, {
  56. name: '新增',
  57. }, {
  58. name: '微信退款'
  59. }, {
  60. name: '余额退款'
  61. }],
  62. serviceTimeShow: false,
  63. show: false,
  64. searchTime: '2023-8-9',
  65. value1: '',
  66. dataTime:'',
  67. tranFlowstatistic: {}
  68. };
  69. },
  70. onLoad() {
  71. let sysInfo = uni.getSystemInfoSync()
  72. this.windowHeight =sysInfo.windowHeight-94+'px'//除标题栏栏外的屏幕可用高度
  73. this.value1 = Date.now();
  74. // 查询交流流水统计
  75. this.transactionFlowstatistic();
  76. },
  77. methods: {
  78. clickTab(e){
  79. this.tabIndex = e.index
  80. },
  81. swiperChange(e){
  82. this.tabIndex = e.detail.current
  83. // if (this.$refs.MescrollItem[e.detail.current].orderList.length>0){
  84. // this.$refs.MescrollItem[e.detail.current].downCallback()
  85. // }
  86. },
  87. // 确定选择的服务日期
  88. sureChooseDate(e){
  89. this.dataTime = e.detail.value
  90. setTimeout(f=>{
  91. this.$refs.MescrollItem[this.tabIndex].downCallback()
  92. },100)
  93. },
  94. // 交易列表
  95. // 查询交易流水统计
  96. transactionFlowstatistic(){
  97. let that = this;
  98. this.$api.transactionFlowstatistic({data:this.reqParm}).then((res)=>{
  99. that.tranFlowstatistic = res.data.data;
  100. }).catch(() =>{
  101. uni.showToast({
  102. title: "操作失败"
  103. })
  104. });
  105. },
  106. // 详情
  107. orderDetail(item){
  108. uni.$u.route({
  109. url: '/pages/transaction/transaction-detail',
  110. params: {
  111. data: JSON.stringify(item)
  112. }
  113. })
  114. },
  115. showDate(){
  116. this.serviceTimeShow = true;
  117. },
  118. maxDate(selectedMonth) {
  119. if (!this.$isDataEmpty(selectedMonth)) {
  120. // 将选定的月份转换为Date对象
  121. let selected = new Date(selectedMonth);
  122. // 获取下个月的第一天
  123. let nextMonth = new Date(selected.getFullYear(), selected.getMonth() + 1, 1);
  124. // 获取本月的最后一天
  125. let lastDay = new Date(nextMonth - 1);
  126. // 返回最大日期
  127. return lastDay.toISOString().slice(0, 10);
  128. } else {
  129. // 如果没有选定月份,则返回当前月份的最大日期
  130. let today = new Date();
  131. let nextMonth = new Date(today.getFullYear(), today.getMonth() + 1, 1);
  132. let lastDay = new Date(nextMonth - 1);
  133. return lastDay.toISOString().slice(0, 10);
  134. }
  135. }
  136. },
  137. };
  138. </script>
  139. <style lang="scss" scoped>
  140. @import '/common/css/common.css';
  141. @import './index.rpx.css';
  142. </style>