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.

cardloss-confirm.vue 7.5KB

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