You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

flowingWater-selectCar.vue 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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
  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. flag.value = i
  107. if (state.type == "1") {
  108. navTo(`/subpackage/orders/flowingWater?vehicleId=${item.vehicleId}`)
  109. }else if (state.type == "2") {
  110. navTo(`/subpackage/orders/refund-deposit-card?cardId=${item.cardId}`)
  111. }
  112. }
  113. </script>
  114. <style>
  115. page {
  116. width: 100%;
  117. height: 100%;
  118. background-color: #EEF7F7;
  119. }
  120. </style>
  121. <style lang="scss" scoped>
  122. .flex {
  123. display: flex;
  124. justify-content: center;
  125. }
  126. .selectCar-box {
  127. height: 100%;
  128. padding: 30rpx;
  129. .item {
  130. padding: 20rpx;
  131. display: flex;
  132. justify-content: space-between;
  133. align-items: center;
  134. background: #FFFFFF;
  135. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  136. border-radius: 20rpx;
  137. margin-bottom: 30rpx;
  138. .iten-left {
  139. display: flex;
  140. align-items: center;
  141. image {
  142. width: 150rpx;
  143. height: 90rpx;
  144. }
  145. text {
  146. margin-left: 20rpx;
  147. font-size: 32rpx;
  148. font-family: Noto Sans S Chinese;
  149. font-weight: 400;
  150. color: #333333;
  151. }
  152. }
  153. .choose-item {
  154. width: 44rpx;
  155. height: 44rpx;
  156. background: #FFFFFF;
  157. border: 2rpx solid #00B38B;
  158. border-radius: 50%;
  159. margin-right: 20rpx;
  160. display: flex;
  161. justify-content: center;
  162. align-items: center;
  163. box-sizing: content-box;
  164. }
  165. .active {
  166. width: 34rpx;
  167. height: 34rpx;
  168. background: #00B38B;
  169. border-radius: 50%;
  170. }
  171. }
  172. }
  173. .message{
  174. font-size: 26rpx;
  175. margin-left: 6rpx;
  176. }
  177. </style>