record.vue 3.6 KB

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