settlementDetail.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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. <u-empty :src="`/static/def_imgs.png`" icon-size="240" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
  54. <view style="padding: 20upx;">
  55. <u-loadmore load-text="正在加载..." 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 clipboard from "@/js_sdk/dc-clipboard/clipboard.js"
  66. import { getShelfOrderList } from "@/api/shelf.js"
  67. export default {
  68. components: {
  69. uniIcons,
  70. carNo
  71. },
  72. data() {
  73. return {
  74. info: null,
  75. allData: [],
  76. list: [],
  77. pageSize: 20,
  78. pageNo: 1,
  79. status: 'loading',
  80. total: 0,
  81. }
  82. },
  83. onReady() {
  84. },
  85. onLoad() {
  86. this.info = this.$store.state.vuex_settleRecordDetail
  87. // 获取使用记录
  88. this.getUseRecord()
  89. },
  90. methods: {
  91. // 复制
  92. copyVin(vin){
  93. clipboard.setText(vin);
  94. uni.showToast({
  95. icon: 'none',
  96. title: 'vin码已复制成功'
  97. })
  98. },
  99. getUseRecord(pageNo){
  100. let _this = this
  101. if (pageNo) {
  102. this.pageNo = pageNo
  103. }
  104. let params = {
  105. pageNo: this.pageNo,
  106. pageSize: this.pageSize,
  107. settleBillSn: this.info.settleBillSn
  108. }
  109. console.log(params)
  110. this.status = "loading"
  111. getShelfOrderList(params).then(res => {
  112. console.log(res)
  113. if (res.code == 200 || res.status == 204 || res.status == 200) {
  114. if(_this.pageNo>1){
  115. _this.list = _this.list.concat(res.data.list || [])
  116. }else{
  117. _this.list = res.data.list || []
  118. }
  119. _this.total = res.data.count || 0
  120. } else {
  121. _this.list = []
  122. _this.total = 0
  123. _this.noDataText = res.message
  124. }
  125. if(this.swiperCurrent == 0){
  126. this.tabList[0].count = _this.total<=99?_this.total:'99+'
  127. }
  128. _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
  129. })
  130. },
  131. // scroll-view到底部加载更多
  132. onreachBottom() {
  133. console.log(this.list.length, this.total)
  134. if(this.list.length < this.total){
  135. this.pageNo += 1
  136. this.getUseRecord()
  137. }else{
  138. this.status = "nomore"
  139. }
  140. },
  141. viewDetail(item){
  142. item.payDate = this.info.payDate
  143. this.$u.vuex('vuex_settleOrderDetail', item)
  144. uni.navigateTo({
  145. url: "/pages/digitalShelf/settlementRecord/orderPartDetail"
  146. })
  147. }
  148. }
  149. }
  150. </script>
  151. <style lang="less">
  152. .settlement-pages{
  153. height: 100vh;
  154. display: flex;
  155. flex-direction: column;
  156. > view{
  157. padding: 30rpx 50rpx;
  158. }
  159. .sxjs-box{
  160. > view{
  161. background-color: #fff;
  162. border-radius: 25rpx;
  163. min-height: 100rpx;
  164. padding: 30rpx;
  165. color: #666;
  166. }
  167. .sxjs-head{
  168. width: 100%;
  169. text-align: center;
  170. font-size: 30rpx;
  171. margin-bottom: 0;
  172. > view{
  173. width: 50%;
  174. > .edu{
  175. color: #29AD46;
  176. padding: 10rpx 0;
  177. font-size: 36rpx;
  178. text{
  179. font-size: 46rpx;
  180. font-style: italic;
  181. font-weight: 900;
  182. }
  183. }
  184. .pay{
  185. padding: 10rpx 0;
  186. font-size: 36rpx;
  187. color: #222222;
  188. }
  189. }
  190. }
  191. }
  192. .ds-box{
  193. flex-grow: 1;
  194. padding: 0 50rpx;
  195. overflow: auto;
  196. > view{
  197. background-color: #fff;
  198. border-radius: 25rpx;
  199. padding: 30rpx;
  200. .titls{
  201. font-weight: bold;
  202. }
  203. }
  204. .ds-list{
  205. background-color: #fff;
  206. min-height: 100rpx;
  207. padding: 20rpx 0;
  208. color: #666;
  209. border-bottom: 2rpx solid #f5f5f5;
  210. > view{
  211. padding: 10rpx;
  212. font-size: 28rpx;
  213. &:first-child{
  214. justify-content: space-between;
  215. }
  216. .time{
  217. color: #666E75;
  218. font-size: 24rpx;
  219. }
  220. .price{
  221. color: #FB1E1E;
  222. font-size: 32rpx;
  223. padding-left: 20rpx;
  224. }
  225. .carImage{
  226. padding-right: 20rpx;
  227. }
  228. .carModel{
  229. color: #222;
  230. font-size: 28rpx;
  231. margin-bottom: 10rpx;
  232. }
  233. .orderNo{
  234. color: #666E75;
  235. font-size: 28rpx;
  236. }
  237. .carVin{
  238. color: #666E75;
  239. font-size: 24upx;
  240. > view{
  241. word-break:break-all;
  242. }
  243. text{
  244. background-color: #EBEBEB;
  245. border-radius: 100rpx;
  246. padding: 0 20rpx;
  247. color: #033692;
  248. font-size: 20rpx;
  249. display: flex;
  250. align-items: center;
  251. justify-content: center;
  252. margin-left: 10rpx;
  253. height: 40rpx;
  254. }
  255. }
  256. }
  257. }
  258. }
  259. }
  260. </style>