index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <view>
  3. <power-change-header></power-change-header>
  4. <view class="changeCurrent">
  5. <view class="info">
  6. <view><image src="../../static/icon7.png"></image></view>
  7. <view>{{currentDescript || '-'}}</view>
  8. </view>
  9. <view class="times">
  10. {{currentTime || '-'}} | {{plate || '-'}}
  11. </view>
  12. </view>
  13. <view class="timeline">
  14. <view class="timeinfo">
  15. <view class="list" v-for="(item,index) in swapStepList" :key="index">
  16. <view>{{$moment(item.seqTime).format("YYYY-MM-DD")}}</view>
  17. <view>{{$moment(item.seqTime).format("HH:mm:ss")}}</view>
  18. </view>
  19. </view>
  20. <view class="line">
  21. <uni-steps :options="swapStepList" :active="step" direction="column"></uni-steps>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. data() {
  29. return {
  30. swapStepList:this.$scan.swapStepList,
  31. step:this.$scan.swapStepList.length-1,
  32. currentDescript:'',
  33. currentTime:'',
  34. plate:'',
  35. swapInfoDTO:null,
  36. }
  37. },
  38. mounted() {
  39. this.InitWs()
  40. },
  41. methods: {
  42. InitWs(){
  43. if (this.$storage.get("exchangeNo")) {
  44. let msg = {
  45. type: "subscribeExchange",
  46. payLoad: {
  47. exchangeNo: this.$storage.get("exchangeNo")
  48. }
  49. }
  50. if (this.$ws.socketTask == null) {
  51. this.$ws.connect()
  52. this.$ws.onSocketOpen = () => {
  53. this.getWsData()
  54. this.$ws.sendmessage(msg)
  55. }
  56. }else{
  57. this.getWsData()
  58. this.$ws.sendmessage(msg)
  59. }
  60. }else {
  61. this.$utils.msg('未获取到换电编号')
  62. }
  63. // console.log(this.$scan,8989)
  64. // this.$scan.InitWs()
  65. // setTimeout(()=>{
  66. // this.swapStepList=this.$scan.swapStepList
  67. // this.step=this.$scan.swapStepList.length-1
  68. // this.currentDescript=this.$scan.swapStepList.slice(-1)[0].description,
  69. // this.currentTime=this.$scan.swapStepList.slice(-1)[0].seqTime,
  70. // this.plate=this.$scan.swapConfirmDTO.plate
  71. // },1000)
  72. }
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .timeline{
  78. padding:0 58rpx;
  79. display: flex;
  80. margin-top: 60rpx;
  81. .timeinfo{
  82. display: flex;
  83. flex-direction: column;
  84. text-align: right;
  85. .list{
  86. display: flex;
  87. flex-direction: column;
  88. width: 100%;
  89. height: 102rpx;
  90. color: #c9cdd4;
  91. font-size: 28rpx;
  92. view:first-child{
  93. color:#86909c;
  94. }
  95. }
  96. }
  97. .line{
  98. flex: 1;
  99. }
  100. }
  101. .changeCurrent{
  102. width: 690rpx;
  103. margin: 30rpx auto;
  104. height: 180rpx;
  105. background-image: url('@/static/change-bg.png');
  106. background-size: 100% 100%;
  107. padding: 25rpx;
  108. box-sizing: border-box;
  109. display: flex;
  110. flex-direction:column;
  111. justify-content: space-around;
  112. .info{
  113. display: flex;
  114. color: #fff;
  115. font-size: 30rpx;
  116. font-weight: bold;
  117. line-height: 36rpx;
  118. image{
  119. width: 60rpx;
  120. height: 60rpx;
  121. padding-right: 25rpx;
  122. }
  123. view:last-child{
  124. padding-top: 12rpx;
  125. }
  126. }
  127. .times{
  128. color:#ededed;
  129. text-indent: 10rpx;
  130. }
  131. }
  132. </style>