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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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 更换设备(正常走,现在不需要跳转,因为要根据其他判断) 4卡签续期(正常走,现在不需要跳转,因为要根据其他判断)
  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. }
  46. quanCheckActionTrue().then((item : any) => {
  47. state.list = item.data;
  48. console.log(item);
  49. });
  50. });
  51. const quanCheckActionTrue = () => {
  52. let source = ""
  53. // #ifdef MP-ALIPAY
  54. source = "ALI"
  55. // #endif
  56. // #ifdef MP-WEIXIN
  57. source = "WECHAT"
  58. // #endif
  59. var data = {
  60. opId: getItem(StorageKeys.OpenId),
  61. source: source,
  62. tabIndex: "0",
  63. orderStep: "11",
  64. isValueCard: "",
  65. orderStatus: "1",
  66. isAfter: true,
  67. };
  68. const options = {
  69. type: 2,
  70. data: data,
  71. method: "POST",
  72. showLoading: true,
  73. };
  74. return new Promise(async (resolve, reject) => {
  75. const res = await request(orderList, options);
  76. const data = stringToJson(res.bizContent);
  77. resolve(data);
  78. }).catch((error) => {
  79. reject(error);
  80. });
  81. };
  82. const flag = ref("0");
  83. const choose = (i, item) => {
  84. console.log(item.cardId);
  85. // 判断9901
  86. console.log("state.type!=3 || state.type!=4",(state.type!="3" || state.type!="4"))
  87. if(state.type=="2"){
  88. navTo(`/subpackage/after-sale/ETC-log-off/log-off-confirm?id=${item.id}&&agencyId=${item.agencyId}`)
  89. }else if(state.type=="3"){
  90. navTo(`/subpackage/after-sale/replace-equipment/replace-equipment-confirm?id=${item.id}&&agencyId=${item.agencyId}`)
  91. }else if(state.type=="4"){
  92. navTo(`/subpackage/after-sale/card-Renewal/renewal-confirm?id=${item.id}&orderId=${item.orderId}&&agencyId=${item.agencyId}`)
  93. }else {
  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. }
  111. }
  112. }
  113. }
  114. </script>
  115. <style>
  116. page {
  117. width: 100%;
  118. height: 100%;
  119. background-color: #eef7f7;
  120. }
  121. </style>
  122. <style lang="scss" scoped>
  123. .flex {
  124. display: flex;
  125. justify-content: center;
  126. }
  127. .selectCar-box {
  128. // width: 100%;
  129. height: 100%;
  130. padding: 30rpx;
  131. .item {
  132. padding: 20rpx;
  133. display: flex;
  134. justify-content: space-between;
  135. align-items: center;
  136. height: 130rpx;
  137. background: #ffffff;
  138. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  139. border-radius: 20rpx;
  140. margin-bottom: 30rpx;
  141. .iten-left {
  142. display: flex;
  143. align-items: center;
  144. image {
  145. width: 150rpx;
  146. height: 90rpx;
  147. }
  148. text {
  149. margin-left: 20rpx;
  150. font-size: 32rpx;
  151. font-family: Noto Sans S Chinese;
  152. font-weight: 400;
  153. color: #333333;
  154. }
  155. }
  156. .choose-item {
  157. width: 44rpx;
  158. height: 44rpx;
  159. background: #ffffff;
  160. border: 2rpx solid #00b38b;
  161. border-radius: 50%;
  162. margin-right: 20rpx;
  163. display: flex;
  164. justify-content: center;
  165. align-items: center;
  166. box-sizing: content-box;
  167. }
  168. .active {
  169. width: 34rpx;
  170. height: 34rpx;
  171. background: #00b38b;
  172. border-radius: 50%;
  173. }
  174. }
  175. }
  176. </style>