settlementSxDetail.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <view class="settlement-pages">
  3. <!-- 授信结算 -->
  4. <view class="sxjs-box" v-if="info">
  5. <view class="sxjs-head flex flex_column align-center justify_center">
  6. <view>已用额度</view>
  7. <view class="edu">
  8. <text>{{info.usedAmount}}</text>
  9. </view>
  10. </view>
  11. <view class="sxjs-head-grid flex align-center justify_between">
  12. <view :class="tabIndex==0?'active':''" @click="tabChange(0)">
  13. <view>待结算</view>
  14. <view class="edu"><text>{{info.waitSettleAmount}}</text></view>
  15. <view class="line"></view>
  16. </view>
  17. <view :class="tabIndex==1?'active':''" @click="tabChange(1)">
  18. <view>已冻结</view>
  19. <view class="edu"><text>{{info.freezeAmount}}</text></view>
  20. <view class="line"></view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="ds-box">
  25. <scroll-view style="height: calc(100vh - 370upx);position: relative;" scroll-y @scrolltolower="loadMore">
  26. <view class="notes-msg" v-if="tabIndex==1">
  27. 已冻结金额是指状态为“待取货”的取货单结算金额合计暂时无需支付,但是会占用授信额度,请尽快处理
  28. </view>
  29. <!-- 列表 -->
  30. <view class="ds-list" v-for="item in list" :key="item.id">
  31. <view class="flex align_center">
  32. <view class="orderNo">{{item.shelfOrderNo}}</view>
  33. <view class="time">{{item.createDate}}</view>
  34. </view>
  35. <view class="flex align_center">
  36. <view class="carImage flex flex_column justify_center">
  37. <u-image :src="item.vehicleLogo" border-radius="30" width="100" height="100" bg-color="#EBEBEB" ></u-image>
  38. </view>
  39. <view class="carModel">
  40. {{item.vehicleModel}}
  41. </view>
  42. <view class="price">{{item.settleAmount}}</view>
  43. </view>
  44. </view>
  45. <view style="padding-top: 10%;border:0" v-if="list.length==0 && status!='loading'">
  46. <u-empty :src="`/static/nodata.png`" icon-size="180" text="暂无记录" img-width="180" mode="list"></u-empty>
  47. </view>
  48. <view style="padding: 20upx;">
  49. <u-loadmore load-text="正在加载..." v-if="(allData.length>=list.length&&list.length)||status=='loading'" :status="status" />
  50. </view>
  51. </scroll-view>
  52. </view>
  53. <view class="footer" v-if="tabIndex==0&&info.waitSettleAmount>0">
  54. <u-button @click="toPay" :throttle-time="100" :style="{background:'#1283d4',color:'#fff'}" shape="circle" type="success">
  55. 立即支付(¥{{info.waitSettleAmount}})
  56. </u-button>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. import uniIcons from '@/components/uni-icons/uni-icons.vue';
  62. import { waitSettleForSx,shelfSettleBillToPay } from '@/api/shelf.js'
  63. export default {
  64. components: {
  65. uniIcons
  66. },
  67. data() {
  68. return {
  69. tabIndex: 0,
  70. pageNo: 1,
  71. pageSize:10,
  72. list: [],
  73. allData: [],
  74. info:null,
  75. status: 'loading',
  76. shelfOrderSnList:[]
  77. }
  78. },
  79. onReady() {
  80. },
  81. onLoad(option) {
  82. this.info = JSON.parse(decodeURIComponent(option.data.replace(/%/g, '%25')))
  83. this.getwaitSettleForSx()
  84. },
  85. methods: {
  86. // 去支付
  87. toPay(){
  88. this.info.shelfOrderSnList = this.shelfOrderSnList
  89. uni.navigateTo({
  90. url:'/pages/pay/settlementPay/settlementPay?data='+encodeURIComponent(JSON.stringify(this.info))
  91. })
  92. },
  93. waitSettleAmount() {
  94. let ret = 0
  95. this.allData.map(item => {
  96. ret = ret + item.settleAmount
  97. })
  98. this.info.waitSettleAmount = ret.toFixed(2)
  99. },
  100. // 获取详细列表
  101. getwaitSettleForSx(){
  102. const state = ["WAIT","FREEZE","FINISH"]
  103. waitSettleForSx({shelfOrderState: state[this.tabIndex]}).then(res => {
  104. this.allData = res.data || []
  105. console.log(this.allData)
  106. // 默认显示第一页
  107. const allTotal = this.allData.length
  108. this.list = this.allData.slice(0,allTotal<=this.pageSize?allTotal:this.pageSize)
  109. this.status = allTotal>=this.list.length ? "nomore" : 'loadmore'
  110. if(this.tabIndex==0){
  111. // 获取所有sn
  112. this.allData.map(item => {
  113. this.shelfOrderSnList.push(item.shelfOrderSn)
  114. })
  115. this.waitSettleAmount()
  116. }
  117. })
  118. },
  119. tabChange(i){
  120. this.tabIndex = i
  121. this.pageNo = 1
  122. this.status = "loading"
  123. this.allData = []
  124. this.list = []
  125. this.shelfOrderSnList = []
  126. this.getwaitSettleForSx()
  127. },
  128. loadMore(event){
  129. console.log(event,'滚动到底部')
  130. const curCount = this.list.length
  131. const total = this.allData.length
  132. if(curCount<total){
  133. // 下页
  134. this.pageNo = this.pageNo + 1
  135. this.status = "loading"
  136. setTimeout(()=>{
  137. const end = this.pageNo * this.pageSize
  138. this.list = this.allData.slice(0,end)
  139. this.status = total>=this.list.length ? "nomore" : 'loadmore'
  140. },500)
  141. }else{
  142. this.status = "nomore"
  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. > .edu{
  170. color: #FA3534;
  171. padding: 10rpx 0;
  172. font-size: 36rpx;
  173. text{
  174. font-size: 46rpx;
  175. font-style: italic;
  176. font-weight: 900;
  177. }
  178. }
  179. }
  180. .sxjs-head-grid{
  181. margin-top: -40rpx;
  182. padding-bottom: 20rpx;
  183. > view{
  184. width: 50%;
  185. border-right: 2rpx solid #eee;
  186. text-align: center;
  187. color: #999;
  188. position: relative;
  189. .edu{
  190. text{
  191. font-size: 40rpx;
  192. }
  193. }
  194. &:last-child{
  195. border: 0;
  196. }
  197. .line{
  198. width: 60%;
  199. position: absolute;
  200. left: 20%;
  201. bottom: -20rpx;
  202. }
  203. }
  204. .active{
  205. color: #666;
  206. .edu{
  207. text{
  208. color: #222;
  209. }
  210. }
  211. .line{
  212. border-bottom: 6rpx solid #0485F6;
  213. }
  214. }
  215. }
  216. }
  217. .ds-box{
  218. flex-grow: 1;
  219. padding: 0 50rpx;
  220. overflow: auto;
  221. .notes-msg{
  222. background-color: #F8ECD9;
  223. border-radius: 25rpx;
  224. margin-bottom: 20rpx;
  225. min-height: 100rpx;
  226. padding: 30rpx;
  227. color: #666E75;
  228. font-size: 28rpx;
  229. }
  230. .ds-list{
  231. background-color: #fff;
  232. border-radius: 25rpx;
  233. margin-bottom: 20rpx;
  234. min-height: 100rpx;
  235. padding: 10rpx;
  236. color: #666;
  237. > view{
  238. padding: 10rpx;
  239. font-size: 28rpx;
  240. &:first-child{
  241. justify-content: space-between;
  242. }
  243. .time{
  244. color: #666E75;
  245. font-size: 24rpx;
  246. }
  247. .price{
  248. color: #FA3534;
  249. font-size: 32rpx;
  250. padding-left: 20rpx;
  251. }
  252. .carImage{
  253. padding-right: 20rpx;
  254. }
  255. .carModel{
  256. color: #222;
  257. font-size: 28rpx;
  258. flex-grow: 1;
  259. }
  260. .orderNo{
  261. font-size: 28rpx;
  262. }
  263. }
  264. }
  265. }
  266. }
  267. </style>