record.vue 3.7 KB

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