settlementDetail.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <view class="settlement-pages">
  3. <!-- 授信结算 -->
  4. <view class="sxjs-box" v-if="info">
  5. <view class="sxjs-head flex justify_between">
  6. <view class="flex flex_column align_start justify_center">
  7. <view>已结算</view>
  8. <view class="edu">
  9. ¥<text>{{info.settleAmount}}</text>
  10. </view>
  11. </view>
  12. <view class="flex flex_column align_end justify_center">
  13. <view>支付方式</view>
  14. <view class="pay">
  15. {{info.payTypeVal}}
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="ds-box" v-if="info">
  21. <view>
  22. <view class="titls">使用记录</view>
  23. <scroll-view style="height: calc(100vh - 370upx);position: relative;" scroll-y @scrolltolower="onreachBottom">
  24. <!-- 列表 -->
  25. <view class="ds-list" v-for="item in list" :key="item.id" @click="viewDetail(item)">
  26. <view class="flex align-center">
  27. <view class="orderNo">
  28. {{item.shelfOrderNo}}
  29. </view>
  30. <view class="time">{{item.createDate}}</view>
  31. </view>
  32. <view class="flex align_center">
  33. <view class="carImage flex flex_column">
  34. <u-image :src="item.vehicleLogo" border-radius="30" width="100" height="100" bg-color="#EBEBEB" ></u-image>
  35. </view>
  36. <view style="flex-grow: 1;">
  37. <!-- <view class="flex" v-if="item.vehicleNumber">
  38. <carNo color="#0055ff" :val="item.vehicleNumber"></carNo>
  39. </view> -->
  40. <view class="carModel flex align_center">
  41. {{item.vehicleModel}}
  42. <view class="price">
  43. ¥{{item.settleAmount}}
  44. </view>
  45. </view>
  46. <view class="carVin flex">
  47. <view>VIN码:{{item.vin||'暂无'}}</view>
  48. <text v-if="item.vin" @click.stop="copyVin(item.vin)">复制</text>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <view style="padding: 20upx;">
  54. <u-empty :src="`/static/nodata.png`" icon-size="180" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
  55. <u-loadmore v-if="(total>=list.length&&list.length)||status=='loading'" :status="status" />
  56. </view>
  57. </scroll-view>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. import carNo from '@/components/carNo.vue'
  64. import uniIcons from '@/components/uni-icons/uni-icons.vue';
  65. import { getShelfOrderList } from "@/api/shelf.js"
  66. export default {
  67. components: {
  68. uniIcons,
  69. carNo
  70. },
  71. data() {
  72. return {
  73. info: null,
  74. allData: [],
  75. list: [],
  76. pageSize: 20,
  77. pageNo: 1,
  78. status: 'loading',
  79. total: 0,
  80. }
  81. },
  82. onReady() {
  83. },
  84. onLoad() {
  85. this.info = this.$store.state.vuex_settleRecordDetail
  86. // 获取使用记录
  87. this.getUseRecord()
  88. },
  89. methods: {
  90. // 复制
  91. copyVin(vin){
  92. uni.setClipboardData({
  93. data: vin||'',
  94. })
  95. },
  96. getUseRecord(pageNo){
  97. let _this = this
  98. if (pageNo) {
  99. this.pageNo = pageNo
  100. }
  101. let params = {
  102. pageNo: this.pageNo,
  103. pageSize: this.pageSize,
  104. settleBillSn: this.info.settleBillSn
  105. }
  106. console.log(params)
  107. this.status = "loading"
  108. getShelfOrderList(params).then(res => {
  109. console.log(res)
  110. if (res.code == 200 || res.status == 204 || res.status == 200) {
  111. if(_this.pageNo>1){
  112. _this.list = _this.list.concat(res.data.list || [])
  113. }else{
  114. _this.list = res.data.list || []
  115. }
  116. _this.total = res.data.count || 0
  117. } else {
  118. _this.list = []
  119. _this.total = 0
  120. _this.noDataText = res.message
  121. }
  122. if(this.swiperCurrent == 0){
  123. this.tabList[0].count = _this.total<=99?_this.total:'99+'
  124. }
  125. _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
  126. })
  127. },
  128. // scroll-view到底部加载更多
  129. onreachBottom() {
  130. console.log(this.list.length, this.total)
  131. if(this.list.length < this.total){
  132. this.pageNo += 1
  133. this.getUseRecord()
  134. }else{
  135. this.status = "nomore"
  136. }
  137. },
  138. viewDetail(item){
  139. item.payDate = this.info.payDate
  140. this.$u.vuex('vuex_settleOrderDetail', item)
  141. uni.navigateTo({
  142. url: "/pages/digitalShelf/settlementRecord/orderPartDetail"
  143. })
  144. }
  145. }
  146. }
  147. </script>
  148. <style lang="less">
  149. .settlement-pages{
  150. height: 100vh;
  151. display: flex;
  152. flex-direction: column;
  153. > view{
  154. padding: 30rpx 50rpx;
  155. }
  156. .sxjs-box{
  157. > view{
  158. background-color: #fff;
  159. border-radius: 25rpx;
  160. min-height: 100rpx;
  161. padding: 30rpx;
  162. color: #666;
  163. }
  164. .sxjs-head{
  165. width: 100%;
  166. text-align: center;
  167. font-size: 30rpx;
  168. margin-bottom: 0;
  169. > view{
  170. width: 50%;
  171. > .edu{
  172. color: #29AD46;
  173. padding: 10rpx 0;
  174. font-size: 36rpx;
  175. text{
  176. font-size: 46rpx;
  177. font-style: italic;
  178. font-weight: 900;
  179. }
  180. }
  181. .pay{
  182. padding: 10rpx 0;
  183. font-size: 36rpx;
  184. color: #222222;
  185. }
  186. }
  187. }
  188. }
  189. .ds-box{
  190. flex-grow: 1;
  191. padding: 0 50rpx;
  192. overflow: auto;
  193. > view{
  194. background-color: #fff;
  195. border-radius: 25rpx;
  196. padding: 30rpx;
  197. .titls{
  198. font-weight: bold;
  199. }
  200. }
  201. .ds-list{
  202. background-color: #fff;
  203. min-height: 100rpx;
  204. padding: 20rpx 0;
  205. color: #666;
  206. border-bottom: 2rpx solid #f5f5f5;
  207. > view{
  208. padding: 10rpx;
  209. font-size: 28rpx;
  210. &:first-child{
  211. justify-content: space-between;
  212. }
  213. .time{
  214. color: #666E75;
  215. font-size: 24rpx;
  216. }
  217. .price{
  218. color: #FB1E1E;
  219. font-size: 32rpx;
  220. padding-left: 20rpx;
  221. }
  222. .carImage{
  223. padding-right: 20rpx;
  224. }
  225. .carModel{
  226. color: #222;
  227. font-size: 28rpx;
  228. margin-bottom: 10rpx;
  229. }
  230. .orderNo{
  231. color: #666E75;
  232. font-size: 28rpx;
  233. }
  234. .carVin{
  235. color: #666E75;
  236. font-size: 24upx;
  237. > view{
  238. word-break:break-all;
  239. }
  240. text{
  241. background-color: #EBEBEB;
  242. border-radius: 100rpx;
  243. padding: 0 20rpx;
  244. color: #033692;
  245. font-size: 20rpx;
  246. display: flex;
  247. align-items: center;
  248. justify-content: center;
  249. margin-left: 10rpx;
  250. height: 40rpx;
  251. }
  252. }
  253. }
  254. }
  255. }
  256. }
  257. </style>