Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

flowingWater-selectCar.vue 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <view class="selectCar-box">
  3. <view v-if="state.list&&state.list.length>0" @click="choose(i,item)" class="item" v-for="(item,i) in state.list" :key="i">
  4. <view class="iten-left">
  5. <image :src="`${$imgUrl}che.png`" mode="aspectFill"></image>
  6. <view class="message">
  7. <view>车牌号:{{ item.vehiclePlate }}</view>
  8. <view>车牌颜色:{{ getVehiclePlateColor(item.vehiclePlateColor) }}</view>
  9. <view v-if="item.cardId">卡号:{{ item.cardId }}</view>
  10. <view v-if="item.cardStatus">卡状态:{{getCodeName('CARD_STATE_TYPE',item.cardStatus)}}</view>
  11. <view v-if="item.obuId">签号:{{ item.obuId }}</view>
  12. <view v-if="item.obuStatus">签状态:{{ getCodeName('OBU_STATE_TYPE',item.obuStatus) }}</view>
  13. </view>
  14. </view>
  15. <view class="choose-item">
  16. <view class="active" v-if="flag==i">
  17. </view>
  18. </view>
  19. </view>
  20. <view v-else>
  21. <empty title='暂无找到相关车辆信息' />
  22. </view>
  23. </view>
  24. </template>
  25. <script lang="ts" setup>
  26. import empty from "@/components/empty/empty.vue";
  27. import {
  28. reactive,
  29. ref
  30. } from "vue"
  31. import {
  32. navTo,interceptND
  33. } from "@/utils/utils"
  34. import {
  35. onLoad,
  36. } from "@dcloudio/uni-app";
  37. import {
  38. orderList
  39. } from "@/utils/network/api.js";
  40. import {
  41. request
  42. } from "@/utils/network/request.js";
  43. import {
  44. getItem,
  45. StorageKeys,
  46. } from "@/utils/storage";
  47. import {
  48. stringToJson
  49. } from "@/utils/network/encryption";
  50. import {
  51. getCodeName
  52. } from "@/datas/queryKey.js";
  53. import {
  54. getVehiclePlateColor
  55. } from "@/datas/vehiclePlateColor";
  56. const state = reactive({
  57. list: [], //车辆list
  58. type: "", //1补卡额 2储值卡充值退费
  59. });
  60. const flag = ref('0') //默认选择0
  61. onLoad((options) => {
  62. state.type = options.type
  63. if (options.type == "1") {
  64. uni.setNavigationBarTitle({
  65. title: '补卡额圈存-选择车辆'
  66. });
  67. } else if (options.type == "2") {
  68. uni.setNavigationBarTitle({
  69. title: '储值卡充值退费-选择车辆'
  70. });
  71. }
  72. quanCheckActionTrue().then((item: any) => {
  73. state.list = item.data
  74. })
  75. });
  76. const quanCheckActionTrue = () => {
  77. let source = ""
  78. // #ifdef MP-ALIPAY
  79. source ="ALI"
  80. // #endif
  81. // #ifdef MP-WEIXIN
  82. source ="WECHAT"
  83. // #endif
  84. var data = {
  85. opId: getItem(StorageKeys.OpenId),
  86. source: source, //渠道为小程序
  87. tabIndex: '0', //0全部
  88. orderStep: '11', //11 为已完成”
  89. isAfter: true,
  90. };
  91. const options = {
  92. type: 2,
  93. data: data,
  94. method: "POST",
  95. showLoading: true,
  96. };
  97. return new Promise(async (resolve, reject) => {
  98. const res = await request(orderList, options);
  99. const data = stringToJson(res.bizContent);
  100. resolve(data);
  101. }).catch((error) => {
  102. reject(error);
  103. });
  104. }
  105. const choose = (i, item) => {
  106. interceptND(item.vehicleId).then(()=>{
  107. flag.value = i
  108. if (state.type == "1") {
  109. navTo(`/subpackage/orders/flowingWater?vehicleId=${item.vehicleId}`)
  110. }else if (state.type == "2") {
  111. navTo(`/subpackage/orders/refund-deposit-card?cardId=${item.cardId}`)
  112. }
  113. })
  114. }
  115. </script>
  116. <style>
  117. page {
  118. width: 100%;
  119. height: 100%;
  120. background-color: #EEF7F7;
  121. }
  122. </style>
  123. <style lang="scss" scoped>
  124. .flex {
  125. display: flex;
  126. justify-content: center;
  127. }
  128. .selectCar-box {
  129. height: 100%;
  130. padding: 30rpx;
  131. .item {
  132. padding: 20rpx;
  133. display: flex;
  134. justify-content: space-between;
  135. align-items: center;
  136. background: #FFFFFF;
  137. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  138. border-radius: 20rpx;
  139. margin-bottom: 30rpx;
  140. .iten-left {
  141. display: flex;
  142. align-items: center;
  143. image {
  144. width: 150rpx;
  145. height: 90rpx;
  146. }
  147. text {
  148. margin-left: 20rpx;
  149. font-size: 32rpx;
  150. font-family: Noto Sans S Chinese;
  151. font-weight: 400;
  152. color: #333333;
  153. }
  154. }
  155. .choose-item {
  156. width: 44rpx;
  157. height: 44rpx;
  158. background: #FFFFFF;
  159. border: 2rpx solid #00B38B;
  160. border-radius: 50%;
  161. margin-right: 20rpx;
  162. display: flex;
  163. justify-content: center;
  164. align-items: center;
  165. box-sizing: content-box;
  166. }
  167. .active {
  168. width: 34rpx;
  169. height: 34rpx;
  170. background: #00B38B;
  171. border-radius: 50%;
  172. }
  173. }
  174. }
  175. .message{
  176. font-size: 26rpx;
  177. margin-left: 6rpx;
  178. }
  179. </style>