bill.vue 6.1 KB

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