record.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. res.data.data.list.forEach((item, index) => {
  62. this.totalAmount += item.orderAmount
  63. });
  64. this.totalNum = res.data.data.total;
  65. this.data = res.data.data.list;
  66. }
  67. console.log(res)
  68. })
  69. },
  70. confirmDate(e) {
  71. // 创建一个Date对象并传入时间戳
  72. const date = new Date(e.value);
  73. // 使用Date对象的方法获取年、月、日、小时、分钟和秒
  74. const year = date.getFullYear();
  75. const month = ('0' + (date.getMonth() + 1)).slice(-2);
  76. const day = ('0' + date.getDate()).slice(-2);
  77. // 格式化时间
  78. let formattedTime = "";
  79. formattedTime = `${year}-${month}`;
  80. this.dateStr = `${year}年-${month}月`
  81. this.date = formattedTime;
  82. this.show = false;
  83. this.getdata()
  84. },
  85. }
  86. }
  87. </script>
  88. <style lang="less" scoped>
  89. .page {
  90. box-sizing: border-box;
  91. }
  92. .top {
  93. padding: 24rpx 30rpx;
  94. display: flex;
  95. justify-content: space-between;
  96. align-items: center;
  97. .time {
  98. display: flex;
  99. align-items: center;
  100. gap: 0 10rpx;
  101. }
  102. .right {
  103. color: #999;
  104. font-size: 24rpx;
  105. }
  106. }
  107. .list {
  108. padding: 0 30rpx;
  109. .item {
  110. padding: 30rpx 0;
  111. border-bottom: 1rpx solid #EFEFEF;
  112. display: flex;
  113. justify-content: space-between;
  114. image {
  115. border-radius: 16rpx;
  116. width: 136rpx;
  117. min-width: 136rpx;
  118. height: 136rpx;
  119. }
  120. .mid {
  121. margin: 0 30rpx 0 20rpx;
  122. text {
  123. display: inline-block;
  124. font-size: 28rpx;
  125. color: #777;
  126. &:first-child {
  127. font-size: 30rpx;
  128. color: #111;
  129. font-weight: bold;
  130. }
  131. &:nth-child(2) {
  132. margin: 18rpx 0;
  133. }
  134. }
  135. }
  136. .price {
  137. line-height: 80rpx;
  138. font-size: 32rpx;
  139. color: #111111;
  140. font-weight: bold;
  141. }
  142. }
  143. }
  144. </style>