record.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. <!-- <view class="time"> -->
  7. <u-icon name="calendar" :label="dateStr" labelPos="right" labelColor="#666" color="#666" space="7px"
  8. size="25px"></u-icon>
  9. <!-- <u-icon name="arrow-down" color="#999" size="20px" style="margin-left: 20rpx;"></u-icon> -->
  10. </view>
  11. <view class="right">共{{totalNum}}单 收入¥{{totalAmount}}</view>
  12. </view>
  13. <view class="list">
  14. <view class="item" v-for="(item,index) in data" :key="index">
  15. <image :src="item.cover"></image>
  16. <view class="" style="width: 100%; display: flex; justify-content: space-between;">
  17. <view class="mid">
  18. <view style="font-size: 30rpx; color: #111111; font-weight: bold; margin: 24rpx 0 30rpx;">
  19. {{item.comboName}}
  20. </view>
  21. <!-- <text>{{item.num}}人 · 出游{{item.playLength}}小时</text> -->
  22. <view>核销时间:{{item.checkinTime}}</view>
  23. </view>
  24. <view class="price">¥{{item.orderAmount}}</view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="nodata" v-if='data.length==0'>
  29. <NoData></NoData>
  30. </view>
  31. <u-datetime-picker @confirm="confirmDate" @cancel="show=false" :show="show" v-model="value1"
  32. visibleItemCount="6" mode="year-month"></u-datetime-picker>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. dateStr: new Date().Format('yyyy年-MM月'),
  40. date: new Date().Format('yyyy-MM'),
  41. show: false,
  42. k: '',
  43. data: [],
  44. value1: Number(new Date()),
  45. merchantId: uni.getStorageSync('merchantId'),
  46. totalAmount: 0,
  47. totalNum: 0,
  48. repastMonth: ''
  49. }
  50. },
  51. onLoad() {
  52. this.getdata();
  53. },
  54. methods: {
  55. getdata() {
  56. this.$api.get('/merchant/hotel/order/getMerchantOrderPageList', {
  57. limit: 50,
  58. page: 1,
  59. homestayId: uni.getStorageSync('homestayId'),
  60. orderStatus: 2,
  61. orderType: 201,
  62. repastMonth: this.date
  63. }).then(res => {
  64. if (res.data.code == 0) {
  65. var arr = []
  66. var number = 0
  67. res.data.data.list.forEach((item, index) => {
  68. number += item.orderAmount
  69. });
  70. this.totalAmount = parseFloat(number).toFixed(2)
  71. this.totalNum = res.data.data.total;
  72. this.data = res.data.data.list;
  73. }
  74. })
  75. },
  76. confirmDate(e) {
  77. // 创建一个Date对象并传入时间戳
  78. const date = new Date(e.value);
  79. // 使用Date对象的方法获取年、月、日、小时、分钟和秒
  80. const year = date.getFullYear();
  81. const month = ('0' + (date.getMonth() + 1)).slice(-2);
  82. const day = ('0' + date.getDate()).slice(-2);
  83. // 格式化时间
  84. let formattedTime = "";
  85. formattedTime = `${year}-${month}`;
  86. this.dateStr = `${year}年-${month}月`
  87. this.date = formattedTime;
  88. console.log(this.date);
  89. this.show = false;
  90. this.getdata()
  91. },
  92. }
  93. }
  94. </script>
  95. <style lang="less" scoped>
  96. .page {
  97. box-sizing: border-box;
  98. }
  99. .top {
  100. padding: 24rpx 30rpx;
  101. display: flex;
  102. justify-content: space-between;
  103. align-items: center;
  104. .time {
  105. display: flex;
  106. align-items: center;
  107. gap: 0 10rpx;
  108. }
  109. .right {
  110. color: #999;
  111. font-size: 24rpx;
  112. }
  113. }
  114. .list {
  115. padding: 0 30rpx;
  116. .item {
  117. padding: 30rpx 0;
  118. border-bottom: 1rpx solid #EFEFEF;
  119. display: flex;
  120. justify-content: space-between;
  121. image {
  122. border-radius: 16rpx;
  123. width: 136rpx;
  124. min-width: 136rpx;
  125. height: 136rpx;
  126. }
  127. .mid {
  128. margin: 0 30rpx 0 20rpx;
  129. text {
  130. display: inline-block;
  131. font-size: 28rpx;
  132. color: #777;
  133. &:first-child {
  134. font-size: 30rpx;
  135. color: #111;
  136. font-weight: bold;
  137. }
  138. &:nth-child(2) {
  139. margin: 18rpx 0;
  140. }
  141. }
  142. }
  143. .price {
  144. line-height: 80rpx;
  145. font-size: 32rpx;
  146. color: #111111;
  147. font-weight: bold;
  148. }
  149. }
  150. }
  151. </style>