bill.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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">+{{merchantType==10?info.paymentAmount||0:info.orderAmount||0}}</text>
  17. <text>{{merchantType==10?info.paymentCount:info.orders||0}}笔</text>
  18. </view>
  19. <view>
  20. <text>退款金额</text>
  21. <text>{{merchantType==10?info.refundAmount:info.refundOrderAmount||0}}</text>
  22. <text>{{merchantType==10?info.refundCount:info.refundOrders||0}}笔</text>
  23. </view>
  24. </view>
  25. <template v-if="merchantType==10">
  26. <view class="li" v-for="(item,index) in info.pageData.list" :key="index" @click="detail(item)">
  27. <view class="left">
  28. <text>{{item.playDate}}
  29. {{item.playTime}}出发/{{item.orderType==2?'包船':'拼船'}}/{{item.boatNo}}</text>
  30. <text>{{item.payTime}}</text>
  31. </view>
  32. <view class="right">{{item.realPrice}}</text>
  33. </view>
  34. </view>
  35. </template>
  36. <template v-if="merchantType==4">
  37. <view class="li" v-for="(item,index) in info.merchantOrderDTOS" :key="index" @click="detail(item)">
  38. <view class="left">
  39. <text>{{item.productName}}</text>
  40. <text>{{item.orderTime}}</text>
  41. </view>
  42. <view class="right">{{item.realityPay}}</text>
  43. </view>
  44. </view>
  45. </template>
  46. </view>
  47. <u-datetime-picker @confirm="confirmDate" @cancel="show=false" :show="show" v-model="value1"
  48. mode="date"></u-datetime-picker>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. data() {
  54. return {
  55. cdate: new Date().Format('yyyy-MM-dd'),
  56. date: new Date().Format('yyyy-MM-dd'),
  57. show: false,
  58. value1: Number(new Date()),
  59. mt: uni.getSystemInfoSync().statusBarHeight + 44,
  60. info: {
  61. orderAmount: 0,
  62. orders: 0,
  63. refundOrderAmount: 0,
  64. fishermanOrderDTOS: [],
  65. refundOrders: 0,
  66. },
  67. merchantId: uni.getStorageSync('merchantId'),
  68. merchantType: uni.getStorageSync('merchantType'),
  69. }
  70. },
  71. onLoad() {
  72. if (this.merchantType == 10) {
  73. this.getList()
  74. } else {
  75. this.getList2()
  76. }
  77. },
  78. methods: {
  79. confirmDate(e) {
  80. // 创建一个Date对象并传入时间戳
  81. const date = new Date(e.value);
  82. // 使用Date对象的方法获取年、月、日、小时、分钟和秒
  83. const year = date.getFullYear();
  84. const month = ('0' + (date.getMonth() + 1)).slice(-2);
  85. const day = ('0' + date.getDate()).slice(-2);
  86. // 格式化时间
  87. const formattedTime = `${year}-${month}-${day}`;
  88. this.date = formattedTime;
  89. if (this.merchantType == 10) {
  90. this.getList()
  91. } else {
  92. this.getList2()
  93. }
  94. this.show = false;
  95. },
  96. //渔家乐
  97. getList() {
  98. this.$api.get('/scenic/order/tradeBills', {
  99. startDate: this.date,
  100. endDate: '',
  101. dateType: '1',
  102. merchantId: uni.getStorageSync('merchantId')
  103. }).then(res => {
  104. console.log(res.data)
  105. if (res.data.code === 0) {
  106. this.info = res.data.data;
  107. } else {
  108. this.info = {
  109. pageData: {
  110. list: []
  111. },
  112. paymentAmount: 0,
  113. paymentCount: 0,
  114. refundAmount: 0,
  115. refundCount: 0,
  116. }
  117. }
  118. })
  119. },
  120. //餐饮
  121. getList2() {
  122. this.$api.post('/api/merchant/food/getMerchantFoodDeal', {
  123. dateTime: this.date,
  124. dateType: '1',
  125. merchantId: uni.getStorageSync('merchantId')
  126. }).then(res => {
  127. console.log(res.data)
  128. if (res.data.code === 0) {
  129. this.info = res.data.data;
  130. } else {
  131. this.info = {
  132. orderAmount: 0,
  133. orders: 0,
  134. refundOrderAmount: 0,
  135. fishermanOrderDTOS: [],
  136. refundOrders: 0,
  137. }
  138. }
  139. })
  140. },
  141. detail(item) {
  142. let info = encodeURIComponent(JSON.stringify(item));
  143. uni.navigateTo({
  144. url: "/pagesHouse/home/orderBillDetail?info=" + info
  145. })
  146. }
  147. },
  148. }
  149. </script>
  150. <style lang="less" scoped>
  151. .page {
  152. background: #F3F4F4;
  153. padding-bottom: 40rpx;
  154. box-sizing: border-box;
  155. .query {
  156. height: 100rpx;
  157. display: flex;
  158. align-items: center;
  159. padding-left: 30rpx;
  160. background-color: #fff;
  161. }
  162. .list {
  163. width: calc(100% - 36rpx);
  164. margin: 20rpx auto;
  165. padding: 36rpx 24rpx;
  166. background-color: #fff;
  167. border-radius: 24rpx;
  168. .time {
  169. text {
  170. &:first-child {
  171. font-size: 40rpx;
  172. font-weight: bold;
  173. color: #666;
  174. margin-right: 10rpx;
  175. }
  176. }
  177. margin-bottom: 30rpx;
  178. }
  179. .money {
  180. display: flex;
  181. align-items: center;
  182. &>view {
  183. width: 50%;
  184. text {
  185. display: block;
  186. font-weight: bold;
  187. &:first-child {
  188. color: #111;
  189. font-size: 28rpx;
  190. }
  191. &:nth-child(2) {
  192. font-size: 40rpx;
  193. margin: 14rpx 0 16rpx;
  194. }
  195. &:last-child {
  196. color: #999;
  197. font-size: 26rpx;
  198. font-weight: inherit;
  199. }
  200. }
  201. .in {
  202. color: #FEA400;
  203. }
  204. }
  205. }
  206. .li {
  207. display: flex;
  208. justify-content: space-between;
  209. padding: 30rpx 0;
  210. border-bottom: 1rpx solid #EFEFEF;
  211. .left {
  212. text {
  213. &:first-child {
  214. font-size: 28rpx;
  215. color: #111;
  216. margin-bottom: 15rpx;
  217. }
  218. display: block;
  219. color: #999;
  220. font-size: 26rpx;
  221. }
  222. }
  223. .right {
  224. color: #FEA400;
  225. font-size: 36rpx;
  226. font-weight: bold;
  227. }
  228. }
  229. }
  230. }
  231. </style>