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.

преди 2 години
преди 2 години
преди 2 години
преди 2 години
преди 2 години
преди 2 години
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. <template>
  2. <view class="selectCar-box">
  3. <view class="details">
  4. <view class="title">
  5. 基础信息
  6. </view>
  7. <view class="details-item">
  8. <view>
  9. 订单编号:
  10. </view>
  11. <text>{{state.data.orderId}}</text>
  12. </view>
  13. <view class="details-item">
  14. <view>
  15. 用户名称:
  16. </view>
  17. <text>{{state.data.customerName}}</text>
  18. </view>
  19. <view class="details-item">
  20. <view>
  21. 用户证件类型:
  22. </view>
  23. <text>{{getCodeName('CERTIFICATE_TYPE',state.data.customerIdtype)}}</text>
  24. </view>
  25. <view class="details-item">
  26. <view>
  27. 用户证件号:
  28. </view>
  29. <text>{{state.data.customerIdnum}}</text>
  30. </view>
  31. <view class="details-item">
  32. <view>
  33. 订单车牌号:
  34. </view>
  35. <text style="color: #00B38B;;">{{state.data.vehiclePlate}}</text>
  36. </view>
  37. <view class="details-item">
  38. <view>
  39. 收费车型:
  40. </view>
  41. <text>{{state.data.vehicleType}}</text>
  42. </view>
  43. </view>
  44. <view class="title">
  45. 卡信息
  46. </view>
  47. <view class="card">
  48. <view class="card-left">
  49. <image :src="`${$imgUrl}card2.png`" mode=""></image>
  50. <view class="card-center">
  51. <view class="card-center-head">
  52. {{state.data.cardId}}
  53. </view>
  54. <view class="tips">
  55. <text>储蓄卡</text>
  56. <text class="tips-card">{{getCodeName('CARD_STATE_TYPE',state.data.cardStatus)}}</text>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="choose-item" @click="choose(1)">
  61. <view class="active" v-if="flag.includes(1)">
  62. </view>
  63. </view>
  64. </view>
  65. <view class="title">
  66. OBU设备信息
  67. </view>
  68. <view class="card">
  69. <view class="card-left">
  70. <image :src="`${$imgUrl}card1.png`" mode=""></image>
  71. <view class="card-center">
  72. <view class="card-center-head">
  73. {{state.data.obuId}}
  74. </view>
  75. <view class="tips">
  76. <!-- <text>储蓄卡</text> -->
  77. <text class="tips-card">{{getCodeName('OBU_STATE_TYPE',state.data.obuStatus)}}</text>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="choose-item" @click="choose(2)">
  82. <view class="active" v-if="flag.includes(2)">
  83. </view>
  84. </view>
  85. </view>
  86. <button class="submit" @click="nextACtion">下一步</button>
  87. </view>
  88. </template>
  89. <script lang="ts" setup>
  90. import {
  91. getCodeName
  92. } from "@/datas/queryKey.js";
  93. import {
  94. reactive,
  95. ref
  96. } from "vue"
  97. import {
  98. navTo
  99. } from "@/utils/utils"
  100. import {
  101. onLoad,
  102. onUnload
  103. } from "@dcloudio/uni-app";
  104. import {
  105. request
  106. } from "@/utils/network/request.js";
  107. import {
  108. orderDetail,
  109. CardlossStatus
  110. } from "@/utils/network/api.js";
  111. import {
  112. msg
  113. } from "@/utils/utils";
  114. import {
  115. getCredentialType
  116. } from "@/datas/credentialType.js";
  117. import {
  118. getEtcCardStatus
  119. } from "@/datas/etcCardStatus.js";
  120. import {
  121. getObuStatus
  122. } from "@/datas/obuStatus.js";
  123. import {
  124. stringToJson
  125. } from "@/utils/network/encryption";
  126. const state = reactive({
  127. data: {
  128. cardStatus: undefined,
  129. obuStatus: undefined,
  130. }
  131. });
  132. const flag = reactive([])
  133. const type = ref('')
  134. /*视图进入后操作*/
  135. onLoad((option) => {
  136. queryOrderDetail(option.id).then((val: any) => {
  137. state.data = val
  138. })
  139. /*监听手机号验证后的回调*/
  140. uni.$on('queryCardlossStatus', function(type) {
  141. queryCardlossStatusType(type.type).then((val: any) => {
  142. navTo(
  143. `/subpackage/after-sale/card-loss-reporting/card-result`
  144. )
  145. });
  146. })
  147. });
  148. onUnload(() => {
  149. /*移除监听*/
  150. uni.$off('queryCardlossStatus')
  151. });
  152. /*下一步*/
  153. const nextACtion = () => {
  154. console.log(flag.length)
  155. if (flag.length === 0) {
  156. uni.showToast({
  157. title: '请至少勾选一项',
  158. });
  159. } else if (flag.length === 1) {
  160. if (type.value === '1') {
  161. //卡正常
  162. if (state.data.cardStatus === 1) {
  163. showModelAction('卡挂失', '请确认是否执行卡挂失操作', 1)
  164. } else if (state.data.cardStatus === 6) {
  165. showModelAction('卡解挂', '请确认是否执行卡解挂操作', 4)
  166. } else {
  167. msg('当前的卡不支持设备挂失/解挂操作')
  168. }
  169. } else if (type.value === '2') {
  170. //obu正常
  171. if (state.data.obuStatus === 1) {
  172. showModelAction('设备挂失', '请确认是否执行设备挂失操作', 2)
  173. } else if (state.data.obuStatus === 6) {
  174. showModelAction('设备解挂', '请确认是否执行签解挂操作', 5)
  175. } else {
  176. msg('当前的卡不支持设备挂失/解挂操作')
  177. }
  178. }
  179. } else if (flag.length === 2) {
  180. console.log('两个一起')
  181. if ((state.data.cardStatus !== state.data.obuStatus)) {
  182. msg('当前的卡状态和obu状态不支持批量操作')
  183. return;
  184. }
  185. if (type.value === '3') {
  186. if (state.data.cardStatus && state.data.obuStatus === 1) {
  187. showModelAction('卡签挂失', '请确认是否执行卡签挂失操作', 3)
  188. } else {
  189. showModelAction('卡签解挂', '请确认是否执行卡签解挂操作', 6)
  190. }
  191. }
  192. }
  193. }
  194. const showModelAction = (title, content, type) => {
  195. wx.showModal({
  196. title: title,
  197. content: content,
  198. success: function(res) {
  199. if (res.confirm) {
  200. navTo(
  201. `/subpackage/after-sale/card-loss-reporting/cardloss?type=${type}&&mobile=${state.data.customerTel}`
  202. )
  203. }
  204. }
  205. });
  206. }
  207. const choose = (data) => {
  208. if (!flag.includes(data)) {
  209. flag.push(data)
  210. console.log(flag);
  211. } else {
  212. flag.splice(flag.indexOf(data), 1)
  213. console.log(flag);
  214. }
  215. if (flag.length == 2) {
  216. type.value = '3'
  217. } else if (flag[0] == 1) {
  218. type.value = '1'
  219. } else {
  220. type.value = '2'
  221. }
  222. }
  223. const queryOrderDetail = (id) => {
  224. return new Promise(async (resolve, reject) => {
  225. const res = await request(orderDetail, {
  226. type: 2,
  227. data: {
  228. id: id
  229. },
  230. method: "POST",
  231. showLoading: true,
  232. });
  233. const data = stringToJson(res.bizContent);
  234. resolve(data);
  235. }).catch((error) => {
  236. reject(error);
  237. });
  238. }
  239. const queryCardlossStatusType = (val: any) => {
  240. var data = {
  241. cardId: state.data.cardId,
  242. obuId: state.data.obuId,
  243. operation: val,
  244. orderId: state.data.orderId
  245. };
  246. const options = {
  247. type: 2,
  248. data: data,
  249. method: "POST",
  250. showLoading: true,
  251. };
  252. return new Promise(async (resolve, reject) => {
  253. const res = await request(CardlossStatus, options);
  254. const data = stringToJson(res.bizContent);
  255. resolve(data);
  256. }).catch((error) => {
  257. reject(error);
  258. });
  259. }
  260. </script>
  261. <style>
  262. page {
  263. width: 100%;
  264. height: 100%;
  265. background-color: #fff;
  266. }
  267. </style>
  268. <style lang="scss" scoped>
  269. .selectCar-box {
  270. // width: 100%;
  271. // height: 100%;
  272. padding: 30rpx;
  273. .title {
  274. font-size: 30rpx;
  275. font-family: Microsoft YaHei UI;
  276. font-weight: 400;
  277. color: #333333;
  278. margin-bottom: 30rpx;
  279. }
  280. .details {
  281. .title {
  282. font-size: 30rpx;
  283. font-family: Microsoft YaHei UI;
  284. font-weight: 400;
  285. color: #333333;
  286. margin-bottom: 30rpx;
  287. }
  288. .details-item {
  289. display: flex;
  290. font-size: 26rpx;
  291. font-family: Noto Sans S Chinese;
  292. font-weight: 400;
  293. color: #999999;
  294. margin-bottom: 30rpx;
  295. text {
  296. font-size: 26rpx;
  297. font-family: Noto Sans S Chinese;
  298. font-weight: 400;
  299. color: #333333;
  300. }
  301. }
  302. }
  303. .card {
  304. height: 150rpx;
  305. background: #FFFFFF;
  306. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  307. border-radius: 20rpx;
  308. padding: 30rpx;
  309. display: flex;
  310. justify-content: space-between;
  311. align-items: center;
  312. margin-bottom: 60rpx;
  313. .card-left {
  314. display: flex;
  315. align-items: center;
  316. image {
  317. width: 100rpx;
  318. height: 90rpx;
  319. }
  320. .card-center {
  321. margin-left: 30rpx;
  322. .card-center-head {
  323. font-size: 32rpx;
  324. font-family: Noto Sans S Chinese;
  325. font-weight: 400;
  326. color: #333333;
  327. }
  328. .tips {
  329. font-size: 26rpx;
  330. font-family: Noto Sans S Chinese;
  331. font-weight: 400;
  332. color: #666666;
  333. .tips-card {
  334. width: 70rpx;
  335. height: 40rpx;
  336. background: #D3F2EF;
  337. border-radius: 6rpx;
  338. font-size: 20rpx;
  339. font-family: Noto Sans S Chinese;
  340. font-weight: 400;
  341. color: #0A8F8A;
  342. padding: 5rpx 10rpx;
  343. margin-left: 20rpx;
  344. }
  345. }
  346. }
  347. }
  348. .choose-item {
  349. margin-right: 20rpx;
  350. width: 50rpx;
  351. height: 50rpx;
  352. border: 1rpx solid #00B38B;
  353. border-radius: 50%;
  354. display: flex;
  355. justify-content: center;
  356. align-items: center;
  357. .active {
  358. width: 38rpx;
  359. height: 38rpx;
  360. background: #00B38B;
  361. border-radius: 50%;
  362. }
  363. }
  364. }
  365. .remark {
  366. font-size: 26rpx;
  367. font-family: Microsoft YaHei UI;
  368. font-weight: 400;
  369. color: #666666;
  370. text-indent: 30rpx;
  371. margin-bottom: 30rpx;
  372. }
  373. .submit {
  374. margin-top: 100rpx;
  375. width: 670rpx;
  376. height: 80rpx;
  377. background: linear-gradient(-90deg, #43A1E0 0%, #13E7C1 100%);
  378. border-radius: 40rpx;
  379. font-size: 32rpx;
  380. font-family: Noto Sans S Chinese;
  381. font-weight: 400;
  382. color: #FFFFFF;
  383. line-height: 80rpx;
  384. }
  385. }
  386. </style>