record.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view class="page" :style="{'min-height':(h)+'px','padding-top':mt+'px'}">
  3. <c-nav-bar title="核销记录"></c-nav-bar>
  4. <view class="top">
  5. <view class="time" @click="show=true">
  6. <u-icon name="calendar" :label="dateStr" labelPos="right" labelColor="#666" color="#666" space="7px"
  7. size="25px"></u-icon>
  8. <u-icon name="arrow-down" color="#999" size="20px" style="margin-left: 20rpx;"></u-icon>
  9. </view>
  10. <view class="right">共{{totalNum}}单 收入¥{{totalAmount}}</view>
  11. </view>
  12. <view class="list">
  13. <view class="item" v-for="(item,index) in data" :key="index">
  14. <image :src="item.goodsType==2?'../../static/bao.png':'../../static/pin.png'"></image>
  15. <view class="mid">
  16. <text>{{item.playDate}}{{item.playTime}}出发/{{i.goodsType==2?'包船':'拼船'}}/{{item.boatNo}}</text>
  17. <text>{{item.num}}人 · 出游{{item.playLength}}小时</text>
  18. <text>核销时间:{{item.updateDate}}</text>
  19. </view>
  20. <view class="price">¥1500</view>
  21. </view>
  22. </view>
  23. <u-datetime-picker @confirm="confirmDate" @cancel="show=false" :show="show" v-model="value1"
  24. visibleItemCount="6" mode="year-month"></u-datetime-picker>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. dateStr: new Date().Format('yyyy年-MM月'),
  32. date: new Date().Format('yyyy-MM'),
  33. show: false,
  34. k: '',
  35. data: [],
  36. value1: Number(new Date()),
  37. merchantId: uni.getStorageSync('merchantId'),
  38. totalAmount: 0,
  39. totalNum: 0
  40. }
  41. },
  42. onLoad() {
  43. this.getdata();
  44. },
  45. methods: {
  46. getdata() {
  47. this.$api.get('/scenic/order/writeOffRecordPage', {
  48. limit:50,
  49. page:1,
  50. merchantId: this.merchantId,
  51. queryDate: this.date
  52. }).then(res => {
  53. if (res.data.code == 0) {
  54. this.totalAmount = res.data.data.totalAmount;
  55. this.totalNum = res.data.data.totalNum;
  56. this.data=res.data.data.pageData.list;
  57. }
  58. console.log(res)
  59. })
  60. },
  61. confirmDate(e) {
  62. // 创建一个Date对象并传入时间戳
  63. const date = new Date(e.value);
  64. // 使用Date对象的方法获取年、月、日、小时、分钟和秒
  65. const year = date.getFullYear();
  66. const month = ('0' + (date.getMonth() + 1)).slice(-2);
  67. const day = ('0' + date.getDate()).slice(-2);
  68. // 格式化时间
  69. let formattedTime = "";
  70. formattedTime = `${year}-${month}`;
  71. this.dateStr = `${year}年-${month}月`
  72. this.date = formattedTime;
  73. this.show = false;
  74. this.getdata()
  75. },
  76. }
  77. }
  78. </script>
  79. <style lang="less" scoped>
  80. .page{
  81. box-sizing: border-box;
  82. }
  83. .top {
  84. padding: 24rpx 30rpx;
  85. display: flex;
  86. justify-content: space-between;
  87. align-items: center;
  88. .time {
  89. display: flex;
  90. align-items: center;
  91. gap: 0 10rpx;
  92. }
  93. .right {
  94. color: #999;
  95. font-size: 24rpx;
  96. }
  97. }
  98. .list {
  99. padding: 0 30rpx;
  100. .item {
  101. padding: 30rpx 0;
  102. border-bottom: 1rpx solid #EFEFEF;
  103. display: flex;
  104. justify-content: space-between;
  105. image {
  106. width: 80rpx;
  107. height: 80rpx;
  108. }
  109. .mid {
  110. margin: 0 30rpx 0 20rpx;
  111. text {
  112. display: inline-block;
  113. font-size: 28rpx;
  114. color: #777;
  115. &:first-child {
  116. font-size: 30rpx;
  117. color: #111;
  118. font-weight: bold;
  119. }
  120. &:nth-child(2) {
  121. margin: 18rpx 0;
  122. }
  123. }
  124. }
  125. .price {
  126. font-size: 32rpx;
  127. }
  128. }
  129. }
  130. </style>