bill.vue 5.9 KB

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