settlementDetail.vue 6.6 KB

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