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

select-car.vue 6.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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. <view class="message">
  8. <view>车牌号:{{ item.vehiclePlate }}</view>
  9. <view>车牌颜色:{{ getVehiclePlateColor(item.vehiclePlateColor) }}</view>
  10. <view v-if="item.cardId">卡号:{{ item.cardId }}</view>
  11. <view v-if="item.cardStatus">卡状态:{{getCodeName('CARD_STATE_TYPE',item.cardStatus)}}</view>
  12. <view v-if="item.obuId">签号:{{ item.obuId }}</view>
  13. <view v-if="item.obuStatus">签状态:{{ getCodeName('OBU_STATE_TYPE',item.obuStatus) }}</view>
  14. </view>
  15. </view>
  16. <view class="choose-item">
  17. <view class="active" v-if="flag == i"> </view>
  18. </view>
  19. </view>
  20. <view v-else class="flex"> 暂无车辆订单信息 </view>
  21. </view>
  22. </template>
  23. <script lang="ts" setup>
  24. import { reactive, ref } from "vue";
  25. import { navTo } from "@/utils/utils";
  26. import { onLoad, onShow } from "@dcloudio/uni-app";
  27. import { orderList } from "@/utils/network/api.js";
  28. import { request } from "@/utils/network/request.js";
  29. import { getItem, StorageKeys} from "@/utils/storage";
  30. import { stringToJson } from "@/utils/network/encryption";
  31. import { jump } from "@/datas/9901Jump.js";
  32. import { deviceType } from "@/utils/network/difference";
  33. import {
  34. getCodeName
  35. } from "@/datas/queryKey.js";
  36. import {
  37. getVehiclePlateColor
  38. } from "@/datas/vehiclePlateColor";
  39. const state = reactive({
  40. list: [],
  41. type: "",//1 OBU重新激活 2 卡签注销 3 更换设备 4卡签续期 5挂失解挂 6增补设备
  42. // 30 储值卡转记账卡 31卡pin码解锁 32ETC车牌过户 33 卡签停用/卡签启用
  43. });
  44. onLoad((options) => {
  45. console.log("options", options)
  46. state.type = options.type
  47. if (options.type == "2") {
  48. uni.setNavigationBarTitle({
  49. title: 'ETC注销-选择车辆'
  50. });
  51. } else if (options.type == "3") {
  52. uni.setNavigationBarTitle({
  53. title: '更换ETC设备-选择车辆'
  54. });
  55. } else if (options.type == "4") {
  56. uni.setNavigationBarTitle({
  57. title: '卡签续期-选择车辆'
  58. });
  59. }else if (options.type == "5") {
  60. uni.setNavigationBarTitle({
  61. title: '卡签挂失/解除挂失-选择车辆'
  62. });
  63. }else if (options.type == "6") {
  64. uni.setNavigationBarTitle({
  65. title: '增补设备-选择车辆'
  66. });
  67. }else if (options.type == "30") {
  68. uni.setNavigationBarTitle({
  69. title: '储值卡转记账卡-选择车辆'
  70. });
  71. }else if (options.type == "31") {
  72. uni.setNavigationBarTitle({
  73. title: '卡pin码解锁-选择车辆'
  74. });
  75. }else if (options.type == "32") {
  76. uni.setNavigationBarTitle({
  77. title: 'ETC车牌过户-选择车辆'
  78. });
  79. }else if (options.type == "33") {
  80. uni.setNavigationBarTitle({
  81. title: '卡签停用/卡签启用-选择车辆'
  82. });
  83. }
  84. quanCheckActionTrue().then((item : any) => {
  85. if (options.type == "32") {
  86. let data = item.data
  87. for (var k = 0; k < data.length; k++) {
  88. if (data[k]['orderStatus'] != "99999") {
  89. state.list.push(data[k])
  90. }
  91. }
  92. }else{
  93. state.list = item.data;
  94. }
  95. console.log(item);
  96. });
  97. });
  98. const quanCheckActionTrue = () => {
  99. let source = ""
  100. // #ifdef MP-ALIPAY
  101. source = "ALI"
  102. // #endif
  103. // #ifdef MP-WEIXIN
  104. source = "WECHAT"
  105. // #endif
  106. var data = {
  107. opId: getItem(StorageKeys.OpenId),
  108. source: source,
  109. tabIndex: "0",
  110. orderStep: "11",
  111. isValueCard: "",
  112. orderStatus: "1",
  113. isAfter: true,
  114. };
  115. const options = {
  116. type: 2,
  117. data: data,
  118. method: "POST",
  119. showLoading: true,
  120. };
  121. return new Promise(async (resolve, reject) => {
  122. const res = await request(orderList, options);
  123. const data = stringToJson(res.bizContent);
  124. resolve(data);
  125. }).catch((error) => {
  126. reject(error);
  127. });
  128. };
  129. const flag = ref("0");
  130. const choose = (i, item) => {
  131. console.log(item.cardId);
  132. flag.value = i
  133. // 判断9901
  134. if (item.deviceType == deviceType) {
  135. // OBU重新激活跳转
  136. const params = encodeURIComponent(JSON.stringify(item))
  137. jump(state.type, params)
  138. } else {
  139. if (state.type == "1") {
  140. // #ifdef MP-WEIXIN
  141. navTo(
  142. `/subpackage/after-sale/activation-once-again/activation-once-again?id=${item.id}`
  143. );
  144. // #endif
  145. // #ifdef MP-ALIPAY
  146. navTo(
  147. `/subpackage/after-sale/activation-once-again/activation-once-again-ali?id=${item.id}`
  148. );
  149. // #endif
  150. } else if (state.type == "2") {
  151. navTo(`/subpackage/after-sale/ETC-log-off/log-off-confirm?id=${item.id}`)
  152. } else if (state.type == "3") {
  153. navTo(`/subpackage/after-sale/replace-equipment/replace-equipment-confirm?id=${item.id}`)
  154. } else if (state.type == "4") {
  155. navTo(`/subpackage/after-sale/card-Renewal/renewal-confirm?id=${item.id}&orderId=${item.orderId}`)
  156. } else if (state.type == "5") {
  157. navTo(`/subpackage/after-sale/card-loss-reporting/cardloss-confirm?id=${item.id}`)
  158. }else if (state.type == "6") {
  159. navTo(`/subpackage/after-sale/additional-equipment/additional-equipment-confirm?id=${item.id}`)
  160. }else if (state.type == "30") {
  161. navTo(`/subpackage/after-sale/to-bookkeeping-card/confirm?id=${item.id}`)
  162. }else if (state.type == "31") {
  163. navTo(`/subpackage/after-sale/pin-code-deblocking/pin-code-confirm?id=${item.id}`);
  164. }else if (state.type == "32") {
  165. navTo(`/subpackage/after-sale/transfer-ownership/transfer-confirm?id=${item.id}`)
  166. }else if (state.type == "33") {
  167. navTo(`/subpackage/after-sale/card-deactivation-activation/deactivation-activation-confirm?id=${item.id}`)
  168. }
  169. }
  170. }
  171. </script>
  172. <style>
  173. page {
  174. width: 100%;
  175. height: 100%;
  176. background-color: #eef7f7;
  177. }
  178. </style>
  179. <style lang="scss" scoped>
  180. .flex {
  181. display: flex;
  182. justify-content: center;
  183. }
  184. .selectCar-box {
  185. height: 100%;
  186. padding: 30rpx;
  187. .item {
  188. padding: 20rpx;
  189. display: flex;
  190. justify-content: space-between;
  191. align-items: center;
  192. // height: 130rpx;
  193. background: #ffffff;
  194. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  195. border-radius: 20rpx;
  196. margin-bottom: 30rpx;
  197. .iten-left {
  198. display: flex;
  199. align-items: center;
  200. image {
  201. width: 150rpx;
  202. height: 90rpx;
  203. }
  204. text {
  205. margin-left: 20rpx;
  206. font-size: 32rpx;
  207. font-family: Noto Sans S Chinese;
  208. font-weight: 400;
  209. color: #333333;
  210. }
  211. }
  212. .choose-item {
  213. width: 44rpx;
  214. height: 44rpx;
  215. background: #ffffff;
  216. border: 2rpx solid #00b38b;
  217. border-radius: 50%;
  218. margin-right: 20rpx;
  219. display: flex;
  220. justify-content: center;
  221. align-items: center;
  222. box-sizing: content-box;
  223. }
  224. .active {
  225. width: 34rpx;
  226. height: 34rpx;
  227. background: #00b38b;
  228. border-radius: 50%;
  229. }
  230. }
  231. }
  232. .message{
  233. font-size: 26rpx;
  234. margin-left: 6rpx;
  235. }
  236. </style>