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.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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 { getItem, StorageKeys, setItem } from "@/utils/storage";
  23. import { stringToJson } from "@/utils/network/encryption";
  24. import { jump } from "@/datas/9901Jump.js";
  25. import { deviceType } from "@/utils/network/difference";
  26. const state = reactive({
  27. list: [],
  28. type: "",//1 OBU重新激活 2 卡签注销 3 更换设备 4卡签续期 5挂失解挂 6增补设备
  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. } else if (options.type == "4") {
  42. uni.setNavigationBarTitle({
  43. title: '卡签续期-选择车辆'
  44. });
  45. }else if (options.type == "5") {
  46. uni.setNavigationBarTitle({
  47. title: '卡签挂失/解除挂失-选择车辆'
  48. });
  49. }else if (options.type == "6") {
  50. uni.setNavigationBarTitle({
  51. title: '增补设备-选择车辆'
  52. });
  53. }
  54. quanCheckActionTrue().then((item : any) => {
  55. state.list = item.data;
  56. console.log(item);
  57. });
  58. });
  59. const quanCheckActionTrue = () => {
  60. let source = ""
  61. // #ifdef MP-ALIPAY
  62. source = "ALI"
  63. // #endif
  64. // #ifdef MP-WEIXIN
  65. source = "WECHAT"
  66. // #endif
  67. var data = {
  68. opId: getItem(StorageKeys.OpenId),
  69. source: source,
  70. tabIndex: "0",
  71. orderStep: "11",
  72. isValueCard: "",
  73. orderStatus: "1",
  74. isAfter: true,
  75. };
  76. const options = {
  77. type: 2,
  78. data: data,
  79. method: "POST",
  80. showLoading: true,
  81. };
  82. return new Promise(async (resolve, reject) => {
  83. const res = await request(orderList, options);
  84. const data = stringToJson(res.bizContent);
  85. resolve(data);
  86. }).catch((error) => {
  87. reject(error);
  88. });
  89. };
  90. const flag = ref("0");
  91. const choose = (i, item) => {
  92. console.log(item.cardId);
  93. flag.value = i
  94. // 判断9901
  95. if (item.deviceType == deviceType) {
  96. // OBU重新激活跳转
  97. const params = encodeURIComponent(JSON.stringify(item))
  98. if(state.type=="5"){
  99. }
  100. jump(state.type, params)
  101. } else {
  102. if (state.type == "1") {
  103. // #ifdef MP-WEIXIN
  104. navTo(
  105. `/subpackage/after-sale/activation-once-again/activation-once-again?id=${item.id}`
  106. );
  107. // #endif
  108. // #ifdef MP-ALIPAY
  109. navTo(
  110. `/subpackage/after-sale/activation-once-again/activation-once-again-ali?id=${item.id}`
  111. );
  112. // #endif
  113. } else if (state.type == "2") {
  114. navTo(`/subpackage/after-sale/ETC-log-off/log-off-confirm?id=${item.id}`)
  115. } else if (state.type == "3") {
  116. navTo(`/subpackage/after-sale/replace-equipment/replace-equipment-confirm?id=${item.id}`)
  117. } else if (state.type == "4") {
  118. navTo(`/subpackage/after-sale/card-Renewal/renewal-confirm?id=${item.id}&orderId=${item.orderId}`)
  119. } else if (state.type == "5") {
  120. navTo(`/subpackage/after-sale/card-loss-reporting/cardloss-confirm?id=${item.id}`)
  121. }else if (state.type == "6") {
  122. navTo(`/subpackage/after-sale/additional-equipment/additional-equipment-confirm?id=${item.id}`)
  123. }
  124. }
  125. }
  126. </script>
  127. <style>
  128. page {
  129. width: 100%;
  130. height: 100%;
  131. background-color: #eef7f7;
  132. }
  133. </style>
  134. <style lang="scss" scoped>
  135. .flex {
  136. display: flex;
  137. justify-content: center;
  138. }
  139. .selectCar-box {
  140. height: 100%;
  141. padding: 30rpx;
  142. .item {
  143. padding: 20rpx;
  144. display: flex;
  145. justify-content: space-between;
  146. align-items: center;
  147. height: 130rpx;
  148. background: #ffffff;
  149. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  150. border-radius: 20rpx;
  151. margin-bottom: 30rpx;
  152. .iten-left {
  153. display: flex;
  154. align-items: center;
  155. image {
  156. width: 150rpx;
  157. height: 90rpx;
  158. }
  159. text {
  160. margin-left: 20rpx;
  161. font-size: 32rpx;
  162. font-family: Noto Sans S Chinese;
  163. font-weight: 400;
  164. color: #333333;
  165. }
  166. }
  167. .choose-item {
  168. width: 44rpx;
  169. height: 44rpx;
  170. background: #ffffff;
  171. border: 2rpx solid #00b38b;
  172. border-radius: 50%;
  173. margin-right: 20rpx;
  174. display: flex;
  175. justify-content: center;
  176. align-items: center;
  177. box-sizing: content-box;
  178. }
  179. .active {
  180. width: 34rpx;
  181. height: 34rpx;
  182. background: #00b38b;
  183. border-radius: 50%;
  184. }
  185. }
  186. }
  187. </style>