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.

select-car.vue 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="selectCar-box">
  3. <view v-if="state.list.length > 0" @click="choose(i, item)" class="item" v-for="(item, i) in state.list"
  4. :key="i">
  5. <view class="iten-left">
  6. <image :src="`${$imgUrl}che.png`" mode="aspectFill"></image>
  7. <text>{{ item.vehiclePlate }}</text>
  8. </view>
  9. <view class="choose-item">
  10. <view class="active" v-if="flag == i"> </view>
  11. </view>
  12. </view>
  13. <view v-else class="flex"> 暂无车辆订单信息 </view>
  14. </view>
  15. </template>
  16. <script lang="ts" setup>
  17. import { reactive, ref } from "vue";
  18. import { navTo } from "@/utils/utils";
  19. import { onLoad, onShow } from "@dcloudio/uni-app";
  20. import { orderList } from "@/utils/network/api.js";
  21. import { request } from "@/utils/network/request.js";
  22. import { msg } from "@/utils/utils";
  23. import { getItem, StorageKeys, setItem } from "@/utils/storage";
  24. import { stringToJson } from "@/utils/network/encryption";
  25. import { jump } from "@/datas/9901Jump.js";
  26. const state = reactive({
  27. list: [],
  28. type:"",//1 OBU重新激活 2 卡签注销 3 更换设备(正常走,现在不需要跳转)
  29. });
  30. onLoad((options) => {
  31. console.log("options",options)
  32. state.type=options.type
  33. if(options.type=="2"){
  34. uni.setNavigationBarTitle({
  35. title: 'ETC注销-选择车辆'
  36. });
  37. }else if(options.type=="3"){
  38. uni.setNavigationBarTitle({
  39. title: '更换ETC设备-选择车辆'
  40. });
  41. }
  42. quanCheckActionTrue().then((item : any) => {
  43. state.list = item.data;
  44. console.log(item);
  45. });
  46. });
  47. const quanCheckActionTrue = () => {
  48. let source = ""
  49. // #ifdef MP-ALIPAY
  50. source = "ALI"
  51. // #endif
  52. // #ifdef MP-WEIXIN
  53. source = "WECHAT"
  54. // #endif
  55. var data = {
  56. opId: getItem(StorageKeys.OpenId),
  57. source: source,
  58. tabIndex: "0",
  59. orderStep: "11",
  60. isValueCard: "",
  61. orderStatus: "1",
  62. isAfter: true,
  63. };
  64. const options = {
  65. type: 2,
  66. data: data,
  67. method: "POST",
  68. showLoading: true,
  69. };
  70. return new Promise(async (resolve, reject) => {
  71. const res = await request(orderList, options);
  72. const data = stringToJson(res.bizContent);
  73. resolve(data);
  74. }).catch((error) => {
  75. reject(error);
  76. });
  77. };
  78. const flag = ref("0");
  79. const choose = (i, item) => {
  80. console.log(item.cardId);
  81. // 判断9901
  82. // if(item.aa && state.type!=3){
  83. // // OBU重新激活跳转
  84. // const params = encodeURIComponent(JSON.stringify(item))
  85. // jump(state.type,params)
  86. // }else{
  87. if(state.type=="1"){
  88. // #ifdef MP-WEIXIN
  89. navTo(
  90. `/subpackage/after-sale/activation-once-again/activation-once-again?id=${item.id}`
  91. );
  92. // #endif
  93. // #ifdef MP-ALIPAY
  94. navTo(
  95. `/subpackage/after-sale/activation-once-again/activation-once-again-ali?id=${item.id}`
  96. );
  97. // #endif
  98. }else if(state.type=="2"){
  99. navTo(`/subpackage/after-sale/ETC-log-off/log-off-confirm?id=${item.id}`)
  100. }else if(state.type=="3"){
  101. navTo(`/subpackage/after-sale/replace-equipment/replace-equipment-confirm?id=${item.id}`)
  102. }
  103. // }
  104. }
  105. </script>
  106. <style>
  107. page {
  108. width: 100%;
  109. height: 100%;
  110. background-color: #eef7f7;
  111. }
  112. </style>
  113. <style lang="scss" scoped>
  114. .flex {
  115. display: flex;
  116. justify-content: center;
  117. }
  118. .selectCar-box {
  119. // width: 100%;
  120. height: 100%;
  121. padding: 30rpx;
  122. .item {
  123. padding: 20rpx;
  124. display: flex;
  125. justify-content: space-between;
  126. align-items: center;
  127. height: 130rpx;
  128. background: #ffffff;
  129. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  130. border-radius: 20rpx;
  131. margin-bottom: 30rpx;
  132. .iten-left {
  133. display: flex;
  134. align-items: center;
  135. image {
  136. width: 150rpx;
  137. height: 90rpx;
  138. }
  139. text {
  140. margin-left: 20rpx;
  141. font-size: 32rpx;
  142. font-family: Noto Sans S Chinese;
  143. font-weight: 400;
  144. color: #333333;
  145. }
  146. }
  147. .choose-item {
  148. width: 44rpx;
  149. height: 44rpx;
  150. background: #ffffff;
  151. border: 2rpx solid #00b38b;
  152. border-radius: 50%;
  153. margin-right: 20rpx;
  154. display: flex;
  155. justify-content: center;
  156. align-items: center;
  157. box-sizing: content-box;
  158. }
  159. .active {
  160. width: 34rpx;
  161. height: 34rpx;
  162. background: #00b38b;
  163. border-radius: 50%;
  164. }
  165. }
  166. }
  167. </style>