Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

log-off-confirm.vue 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <vehicleDetail ref="vehicleDetailRef" :vehicleId="state.vehicleId" @getVehicleDetail="getVehicleDetail"></vehicleDetail>
  3. <div class="card-block project-detail">
  4. <div class="title">您当前的产品</div>
  5. <div class="detail project-name">{{ state.deviceLogOutState.productName }}</div>
  6. <template v-if="state.deviceLogOutState.isCancel">
  7. <div class="detail">当前办理时间未满{{ state.deviceLogOutState.cancelAgeLimit }}年</div>
  8. <div class="detail">需要支付违约金 {{ (state.deviceLogOutState.cancelAmount / 100).toFixed(2) }}元</div>
  9. </template>
  10. <template v-if="state.deviceLogOutState.isBlack">
  11. <div class="title">您当前的设备存在黑名单</div>
  12. <div class="detail">请<text class="light-tip">处理黑名单</text>后,在申请注销</div>
  13. <div class="search-black">
  14. <button type="default" class="ui-btn black-search-btn">黑名单查询</button>
  15. </div>
  16. </template>
  17. </div>
  18. <FixedFooter >
  19. <button type="default" class="ui-btn" :style="{opacity: state.deviceLogOutState.isBlack ? '0.75' : 1}" :disabled="state.deviceLogOutState.isBlack" @click="nextACtion">下一步</button>
  20. </FixedFooter>
  21. </template>
  22. <script lang="ts" setup>
  23. import { getCodeName } from "@/datas/queryKey.js";
  24. import { reactive, ref } from "vue"
  25. import { navTo,desensitization, objectToQueryString } from "@/utils/utils"
  26. import { onLoad, onUnload } from "@dcloudio/uni-app";
  27. import {requestNew} from "@/utils/network/request.js";
  28. import { commGetDetail, cancelValid, deviceLogOutStateQuery } from "@/utils/network/api.js";
  29. import vehicleDetail from '@/components/vehicle-detail/vehicle-detail.vue'
  30. import FixedFooter from "@/components/common/FixedFooter.vue";
  31. import { deviceStore } from '@/stores/device.js'
  32. const { setDeviceInfoStore, setLogOffStore } = deviceStore()
  33. const state = reactive({
  34. vehicleId: '',
  35. data: {
  36. cardStatus: undefined,
  37. obuStatus: undefined,
  38. },
  39. type: undefined,
  40. cardType:"",
  41. vehicleInfo: {
  42. cardId: '',
  43. obuId: '',
  44. cardTypeNew: ''
  45. },
  46. deviceLogOutState: {
  47. cancelAgeLimit: 0, // 注销年限
  48. cancelAmount: 0, // 注销违约金 单位:分
  49. isBlack: false, // 是否存在黑名单
  50. isCancel: false, // 是否需要支付违约金
  51. productName: "" // 产品名称
  52. }
  53. });
  54. /*视图进入后操作*/
  55. onLoad((option) => {
  56. if (option.vehicleId) {
  57. state.vehicleId = decodeURIComponent(option.vehicleId)
  58. }
  59. });
  60. onUnload(() => {
  61. });
  62. // 是
  63. const getDeviceLogOutStateQuery = () => {
  64. let option = {
  65. data: {
  66. vehicleId: state.vehicleId,
  67. cardId: state.vehicleInfo.cardId,
  68. obuId: state.vehicleInfo.obuId
  69. },
  70. method: "POST",
  71. showLoading: true,
  72. }
  73. requestNew(deviceLogOutStateQuery, option).then(res => {
  74. state.deviceLogOutState = res
  75. setLogOffStore(res)
  76. })
  77. }
  78. // 获取车辆详情
  79. const getVehicleDetail = (res) => {
  80. state.vehicleInfo = res
  81. setDeviceInfoStore(res) // 缓存车辆详情
  82. if (state.vehicleInfo.cardId && state.vehicleInfo.obuId) {
  83. getDeviceLogOutStateQuery()
  84. } else {
  85. uni.showModal({
  86. title: '提示',
  87. content: '改车辆暂无ETC卡签信息,无法注销',
  88. showCancel: false,
  89. success: () => {
  90. uni.navigateBack()
  91. }
  92. })
  93. }
  94. }
  95. /*下一步*/
  96. const nextACtion = () => {
  97. if (state.deviceLogOutState.isBlack) {
  98. uni.showModal({
  99. title: '提示',
  100. content: `您当前的设备存在黑名单,请处理黑名单后,在申请注销`
  101. })
  102. return false
  103. }
  104. navTo(`/subpackage/after-sale/ETC-log-off/etc-log-off?vehicleId=${state.vehicleId}`)
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. .search-black{
  109. }
  110. .black-search-btn{
  111. height: 70rpx;
  112. line-height: 70rpx;
  113. width: 220rpx;
  114. font-size: 24rpx;
  115. }
  116. .project-detail{
  117. .title{
  118. color: #004576;
  119. font-size: 28rpx;
  120. display: flex;
  121. align-items: center;
  122. }
  123. .title::before{
  124. content: "";
  125. display: block;
  126. width: 2px;
  127. height: 30rpx;
  128. background-color: #004576;
  129. margin-right: 12rpx;
  130. }
  131. .detail{
  132. color: #01243A;
  133. font-size: 30rpx;
  134. margin-bottom: 24rpx;
  135. color: #01243A;
  136. }
  137. .light-tip{
  138. color: #D6AD47;
  139. }
  140. .project-name{
  141. color: #D6AD47;
  142. }
  143. }
  144. </style>