settlementSxDetail.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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 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" :custom-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,findStoreShelfSettleRule } 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. console.log(decodeURIComponent(option.data.replace(/%/g, '%25')))
  83. // this.info = JSON.parse(decodeURIComponent(option.data.replace(/%/g, '%25')))
  84. this.getDetail()
  85. this.getwaitSettleForSx()
  86. },
  87. methods: {
  88. // 查询详情
  89. getDetail(){
  90. findStoreShelfSettleRule().then(res => {
  91. console.log(res)
  92. if(res.status == 200){
  93. this.info = res.data
  94. }
  95. })
  96. },
  97. // 去支付
  98. toPay(){
  99. this.info.shelfOrderSnList = this.shelfOrderSnList
  100. uni.navigateTo({
  101. url:'/pages/pay/settlementPay/settlementPay?data='+encodeURIComponent(JSON.stringify(this.info))
  102. })
  103. },
  104. waitSettleAmount() {
  105. let ret = 0
  106. this.allData.map(item => {
  107. ret = ret + item.settleAmount
  108. })
  109. this.info.waitSettleAmount = ret.toFixed(2)
  110. },
  111. // 获取详细列表
  112. getwaitSettleForSx(){
  113. const state = ["WAIT","FREEZE","FINISH"]
  114. waitSettleForSx({shelfOrderState: state[this.tabIndex]}).then(res => {
  115. this.allData = res.data || []
  116. console.log(this.allData)
  117. // 默认显示第一页
  118. const allTotal = this.allData.length
  119. this.list = this.allData.slice(0,allTotal<=this.pageSize?allTotal:this.pageSize)
  120. this.status = allTotal>=this.list.length ? "nomore" : 'loadmore'
  121. if(this.tabIndex==0){
  122. // 获取所有sn
  123. this.allData.map(item => {
  124. this.shelfOrderSnList.push(item.shelfOrderSn)
  125. })
  126. this.waitSettleAmount()
  127. }
  128. })
  129. },
  130. tabChange(i){
  131. this.tabIndex = i
  132. this.pageNo = 1
  133. this.status = "loading"
  134. this.allData = []
  135. this.list = []
  136. this.shelfOrderSnList = []
  137. this.getwaitSettleForSx()
  138. },
  139. loadMore(event){
  140. console.log(event,'滚动到底部')
  141. const curCount = this.list.length
  142. const total = this.allData.length
  143. if(curCount<total){
  144. // 下页
  145. this.pageNo = this.pageNo + 1
  146. this.status = "loading"
  147. setTimeout(()=>{
  148. const end = this.pageNo * this.pageSize
  149. this.list = this.allData.slice(0,end)
  150. this.status = total>=this.list.length ? "nomore" : 'loadmore'
  151. },500)
  152. }else{
  153. this.status = "nomore"
  154. }
  155. }
  156. }
  157. }
  158. </script>
  159. <style lang="less">
  160. .settlement-pages{
  161. width: 100%;
  162. height: 100vh;
  163. display: flex;
  164. flex-direction: column;
  165. > view{
  166. padding: 30rpx 50rpx;
  167. }
  168. .sxjs-box{
  169. > view{
  170. background-color: #fff;
  171. border-radius: 25rpx;
  172. min-height: 100rpx;
  173. padding: 30rpx;
  174. color: #666;
  175. }
  176. .sxjs-head{
  177. width: 100%;
  178. text-align: center;
  179. font-size: 30rpx;
  180. margin-bottom: 0;
  181. > .edu{
  182. color: #FA3534;
  183. padding: 10rpx 0;
  184. font-size: 36rpx;
  185. text{
  186. font-size: 46rpx;
  187. font-style: italic;
  188. font-weight: 900;
  189. }
  190. }
  191. }
  192. .sxjs-head-grid{
  193. margin-top: -40rpx;
  194. padding-bottom: 20rpx;
  195. > view{
  196. width: 50%;
  197. border-right: 2rpx solid #eee;
  198. text-align: center;
  199. color: #999;
  200. position: relative;
  201. .edu{
  202. text{
  203. font-size: 40rpx;
  204. }
  205. }
  206. &:last-child{
  207. border: 0;
  208. }
  209. .line{
  210. width: 60%;
  211. position: absolute;
  212. left: 20%;
  213. bottom: -20rpx;
  214. }
  215. }
  216. .active{
  217. color: #666;
  218. .edu{
  219. text{
  220. color: #222;
  221. }
  222. }
  223. .line{
  224. border-bottom: 6rpx solid #0485F6;
  225. }
  226. }
  227. }
  228. }
  229. .ds-box{
  230. flex-grow: 1;
  231. padding: 0 50rpx;
  232. overflow: auto;
  233. .notes-msg{
  234. background-color: #F8ECD9;
  235. border-radius: 25rpx;
  236. margin-bottom: 20rpx;
  237. min-height: 100rpx;
  238. padding: 30rpx;
  239. color: #666E75;
  240. font-size: 28rpx;
  241. }
  242. .ds-list{
  243. background-color: #fff;
  244. border-radius: 25rpx;
  245. margin-bottom: 20rpx;
  246. min-height: 100rpx;
  247. padding: 10rpx;
  248. color: #666;
  249. > view{
  250. padding: 10rpx;
  251. font-size: 28rpx;
  252. &:first-child{
  253. justify-content: space-between;
  254. }
  255. .time{
  256. color: #666E75;
  257. font-size: 24rpx;
  258. }
  259. .price{
  260. color: #FA3534;
  261. font-size: 32rpx;
  262. padding-left: 20rpx;
  263. }
  264. .carImage{
  265. padding-right: 20rpx;
  266. }
  267. .carModel{
  268. color: #222;
  269. font-size: 28rpx;
  270. flex-grow: 1;
  271. }
  272. .orderNo{
  273. font-size: 28rpx;
  274. }
  275. }
  276. }
  277. }
  278. }
  279. </style>