bill.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <view class="page" :style="{'min-height':(h-th)+'px','padding-top':mt+'px'}">
  3. <c-nav-bar title="交易账单"></c-nav-bar>
  4. <view class="query">
  5. <u-icon @click="show=true" name="calendar" label="自定义查询" labelPos="right" labelColor="#666" color="#666"
  6. size="25px"></u-icon>
  7. </view>
  8. <view class="list">
  9. <view class="time">
  10. <text v-if="date==cdate">今日</text>
  11. <text>{{date}}</text>
  12. </view>
  13. <view class="money">
  14. <view>
  15. <text>收入金额</text>
  16. <text class="in">+{{info.orderAmount||0}}</text>
  17. <text>{{info.orders||0}}笔</text>
  18. </view>
  19. <view>
  20. <text>退款金额</text>
  21. <text>{{info.refundOrderAmount||0}}</text>
  22. <text>{{info.refundOrders||0}}笔</text>
  23. </view>
  24. </view>
  25. <view class="li" v-for="(item,index) in info.fishermanOrderDTOS" :key="index" @click="detail(item)">
  26. <view class="left">
  27. <text>{{item.thingName}}</text>
  28. <text>{{item.orderTime}}</text>
  29. </view>
  30. <view class="right">+{{item.price}}</text>
  31. </view>
  32. </view>
  33. </view>
  34. <u-datetime-picker @confirm="confirmDate" @cancel="show=false" :show="show" v-model="value1"
  35. mode="date"></u-datetime-picker>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. cdate: new Date().Format('yyyy-MM-dd'),
  43. date: new Date().Format('yyyy-MM-dd'),
  44. show: false,
  45. value1: Number(new Date()),
  46. mt: uni.getSystemInfoSync().statusBarHeight + 44,
  47. info: {
  48. orderAmount: 0,
  49. orders: 0,
  50. refundOrderAmount: 0,
  51. fishermanOrderDTOS: [],
  52. refundOrders: 0,
  53. },
  54. }
  55. },
  56. onLoad() {
  57. this.getList()
  58. },
  59. methods: {
  60. confirmDate(e) {
  61. // 创建一个Date对象并传入时间戳
  62. const date = new Date(e.value);
  63. // 使用Date对象的方法获取年、月、日、小时、分钟和秒
  64. const year = date.getFullYear();
  65. const month = ('0' + (date.getMonth() + 1)).slice(-2);
  66. const day = ('0' + date.getDate()).slice(-2);
  67. // 格式化时间
  68. const formattedTime = `${year}-${month}-${day}`;
  69. this.date = formattedTime;
  70. this.getList();
  71. this.show = false;
  72. },
  73. getList() {
  74. this.$api.post('/merchant/merchantFisherman/home/getMerchantFishermanDeal', {
  75. dateTime: this.date,
  76. dateType: '1',
  77. fishermanId: uni.getStorageSync('merchantId')
  78. }).then(res => {
  79. console.log(res.data)
  80. if (res.data.code === 0) {
  81. this.info = res.data.data;
  82. } else {
  83. this.info = {
  84. orderAmount: 0,
  85. orders: 0,
  86. refundOrderAmount: 0,
  87. fishermanOrderDTOS: [],
  88. refundOrders: 0,
  89. }
  90. }
  91. })
  92. },
  93. detail(item) {
  94. let info=encodeURIComponent(JSON.stringify(item));
  95. uni.navigateTo({
  96. url: "/pagesHouse/home/orderBillDetail?info="+info
  97. })
  98. }
  99. },
  100. }
  101. </script>
  102. <style lang="less" scoped>
  103. .page {
  104. background: #F3F4F4;
  105. padding-bottom: 40rpx;
  106. box-sizing: border-box;
  107. .query {
  108. height: 100rpx;
  109. display: flex;
  110. align-items: center;
  111. padding-left: 30rpx;
  112. background-color: #fff;
  113. }
  114. .list {
  115. width: calc(100% - 36rpx);
  116. margin: 20rpx auto;
  117. padding: 36rpx 24rpx;
  118. background-color: #fff;
  119. border-radius: 24rpx;
  120. .time {
  121. text {
  122. &:first-child {
  123. font-size: 40rpx;
  124. font-weight: bold;
  125. color: #666;
  126. margin-right: 10rpx;
  127. }
  128. }
  129. margin-bottom: 30rpx;
  130. }
  131. .money {
  132. display: flex;
  133. align-items: center;
  134. &>view {
  135. width: 50%;
  136. text {
  137. display: block;
  138. font-weight: bold;
  139. &:first-child {
  140. color: #111;
  141. font-size: 28rpx;
  142. }
  143. &:nth-child(2) {
  144. font-size: 40rpx;
  145. margin: 14rpx 0 16rpx;
  146. }
  147. &:last-child {
  148. color: #999;
  149. font-size: 26rpx;
  150. font-weight: inherit;
  151. }
  152. }
  153. .in {
  154. color: #FEA400;
  155. }
  156. }
  157. }
  158. .li {
  159. display: flex;
  160. justify-content: space-between;
  161. padding: 30rpx 0;
  162. .left {
  163. text {
  164. &:first-child {
  165. font-size: 28rpx;
  166. color: #111;
  167. margin-bottom: 15rpx;
  168. }
  169. display: block;
  170. color: #999;
  171. font-size: 26rpx;
  172. }
  173. }
  174. .right {
  175. color: #FEA400;
  176. font-size: 36rpx;
  177. font-weight: bold;
  178. }
  179. }
  180. }
  181. }
  182. </style>