bill.vue 5.5 KB

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