bill.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  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 pageDataList" :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 merchantOrderDTOSList" :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. pageDataList:[],
  76. merchantOrderDTOSList:[],
  77. page:1,
  78. limit:10,
  79. isOver:false,
  80. }
  81. },
  82. onLoad() {
  83. if (this.merchantType == 10) {
  84. this.getList()
  85. } else {
  86. this.getList2()
  87. }
  88. },
  89. onReachBottom() {
  90. if (this.isOver) return;
  91. if (this.merchantType == 10) {
  92. this.getList()
  93. } else {
  94. this.getList2()
  95. }
  96. },
  97. methods: {
  98. confirmDate(e) {
  99. // 创建一个Date对象并传入时间戳
  100. const date = new Date(e.value);
  101. // 使用Date对象的方法获取年、月、日、小时、分钟和秒
  102. const year = date.getFullYear();
  103. const month = ('0' + (date.getMonth() + 1)).slice(-2);
  104. const day = ('0' + date.getDate()).slice(-2);
  105. // 格式化时间
  106. const formattedTime = `${year}-${month}-${day}`;
  107. this.date = formattedTime;
  108. if (this.merchantType == 10) {
  109. this.getList()
  110. } else {
  111. this.getList2()
  112. }
  113. this.show = false;
  114. },
  115. //渔家乐
  116. getList() {
  117. this.$api.get('/scenic/api/order/tradeBills', {
  118. startDate: this.date,
  119. endDate: '',
  120. dateType: '1',
  121. merchantId: uni.getStorageSync('merchantId'),
  122. page:this.page,
  123. limit:this.limit
  124. }).then(res => {
  125. if (res.data.code === 0) {
  126. this.info = res.data.data;
  127. this.page++;
  128. let { list, total } = res.data.data.pageData;
  129. if (this.pageDataList.length + list.length > total || list.length == 0) return this.isOver = true;
  130. this.pageDataList = [...this.pageDataList, ...list];
  131. this.merchantOrderDTOSList = this.info.merchantOrderDTOS;
  132. } else {
  133. this.info = {
  134. pageData: {
  135. list: []
  136. },
  137. paymentAmount: 0,
  138. paymentCount: 0,
  139. refundAmount: 0,
  140. refundCount: 0,
  141. };
  142. this.pageDataList = [];
  143. this.merchantOrderDTOSList = [];
  144. }
  145. })
  146. },
  147. //餐饮
  148. getList2() {
  149. this.$api.post('/api/merchant/food/getMerchantFoodDeal', {
  150. dateTime: this.date,
  151. dateType: '1',
  152. merchantId: uni.getStorageSync('merchantId')
  153. }).then(res => {
  154. console.log(res.data)
  155. if (res.data.code === 0) {
  156. this.info = res.data.data;
  157. } else {
  158. this.info = {
  159. orderAmount: 0,
  160. orders: 0,
  161. refundOrderAmount: 0,
  162. fishermanOrderDTOS: [],
  163. refundOrders: 0,
  164. }
  165. }
  166. })
  167. },
  168. detail(item) {
  169. item.real
  170. let info = encodeURIComponent(JSON.stringify(item));
  171. uni.navigateTo({
  172. url: "/pagesHouse/home/orderBillDetail?info=" + info
  173. })
  174. }
  175. },
  176. }
  177. </script>
  178. <style lang="less" scoped>
  179. .page {
  180. background: #F3F4F4;
  181. padding-bottom: 40rpx;
  182. box-sizing: border-box;
  183. .query {
  184. height: 100rpx;
  185. display: flex;
  186. align-items: center;
  187. padding-left: 30rpx;
  188. background-color: #fff;
  189. }
  190. .list {
  191. width: calc(100% - 36rpx);
  192. margin: 20rpx auto;
  193. padding: 36rpx 24rpx;
  194. background-color: #fff;
  195. border-radius: 24rpx;
  196. .time {
  197. text {
  198. &:first-child {
  199. font-size: 40rpx;
  200. font-weight: bold;
  201. color: #666;
  202. margin-right: 10rpx;
  203. }
  204. }
  205. margin-bottom: 30rpx;
  206. }
  207. .money {
  208. display: flex;
  209. align-items: center;
  210. &>view {
  211. width: 50%;
  212. text {
  213. display: block;
  214. font-weight: bold;
  215. &:first-child {
  216. color: #111;
  217. font-size: 28rpx;
  218. }
  219. &:nth-child(2) {
  220. font-size: 40rpx;
  221. margin: 14rpx 0 16rpx;
  222. }
  223. &:last-child {
  224. color: #999;
  225. font-size: 26rpx;
  226. font-weight: inherit;
  227. }
  228. }
  229. .in {
  230. color: #FEA400;
  231. }
  232. }
  233. }
  234. .li {
  235. display: flex;
  236. justify-content: space-between;
  237. padding: 30rpx 0;
  238. border-bottom: 1rpx solid #EFEFEF;
  239. .left {
  240. text {
  241. &:first-child {
  242. font-size: 28rpx;
  243. color: #111;
  244. margin-bottom: 15rpx;
  245. }
  246. display: block;
  247. color: #999;
  248. font-size: 26rpx;
  249. }
  250. }
  251. .right {
  252. color: #FEA400;
  253. font-size: 36rpx;
  254. font-weight: bold;
  255. }
  256. }
  257. }
  258. }
  259. </style>