您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

select-car.vue 4.8KB

11 个月前
11 个月前
11 个月前
11 个月前
11 个月前
11 个月前
11 个月前
11 个月前
11 个月前
11 个月前
11 个月前
11 个月前
11 个月前
11 个月前
11 个月前
11 个月前
11 个月前
11 个月前
11 个月前
11 个月前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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. jump(state.type, params)
  99. } else {
  100. if (state.type == "1") {
  101. // #ifdef MP-WEIXIN
  102. navTo(
  103. `/subpackage/after-sale/activation-once-again/activation-once-again?id=${item.id}`
  104. );
  105. // #endif
  106. // #ifdef MP-ALIPAY
  107. navTo(
  108. `/subpackage/after-sale/activation-once-again/activation-once-again-ali?id=${item.id}`
  109. );
  110. // #endif
  111. } else if (state.type == "2") {
  112. navTo(`/subpackage/after-sale/ETC-log-off/log-off-confirm?id=${item.id}`)
  113. } else if (state.type == "3") {
  114. navTo(`/subpackage/after-sale/replace-equipment/replace-equipment-confirm?id=${item.id}`)
  115. } else if (state.type == "4") {
  116. navTo(`/subpackage/after-sale/card-Renewal/renewal-confirm?id=${item.id}&orderId=${item.orderId}`)
  117. } else if (state.type == "5") {
  118. navTo(`/subpackage/after-sale/card-loss-reporting/cardloss-confirm?id=${item.id}`)
  119. }else if (state.type == "6") {
  120. navTo(`/subpackage/after-sale/additional-equipment/additional-equipment-confirm?id=${item.id}`)
  121. }
  122. }
  123. }
  124. </script>
  125. <style>
  126. page {
  127. width: 100%;
  128. height: 100%;
  129. background-color: #eef7f7;
  130. }
  131. </style>
  132. <style lang="scss" scoped>
  133. .flex {
  134. display: flex;
  135. justify-content: center;
  136. }
  137. .selectCar-box {
  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>