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

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