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.

etc-activation.vue 24KB

2 hafta önce
2 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
2 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
2 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
1 hafta önce
2 hafta önce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996
  1. <template>
  2. <view class="container">
  3. <!-- 主要内容 -->
  4. <view class="content">
  5. <!-- 基本信息 -->
  6. <view class="info-section">
  7. <view class="section-title">基本信息</view>
  8. <!-- 激活类型选择 -->
  9. <view class="activation-type">
  10. <view
  11. :class="['type-item', { active: activationType === 'self' }]"
  12. @click="changeActivationType('self')"
  13. >
  14. 本人激活
  15. </view>
  16. <view
  17. :class="['type-item', { active: activationType === 'other' }]"
  18. @click="changeActivationType('other')"
  19. >
  20. 非本人激活
  21. </view>
  22. </view>
  23. <!-- 表单字段 -->
  24. <view v-if="activationType === 'other'" class="form-item car-number-row">
  25. <view class="form-label">车牌号</view>
  26. <car-number-input
  27. v-model="formData.carNumber"
  28. @numberInputResult="carNumberInputResult"
  29. inputColor="#ECF1F4"
  30. style="width: 100%;"
  31. />
  32. </view>
  33. <view v-else class="form-item">
  34. <view class="form-label">车牌号</view>
  35. <view class="form-input">
  36. <picker
  37. class="picker-disabled--test"
  38. @change="bindPickerChange"
  39. :value="formData.vehicleIndex"
  40. :range="vehicles"
  41. range-key="vehiclePlate">
  42. <view class="uni-input">
  43. <view class="text">{{vehicles[formData.vehicleIndex]? vehicles[formData.vehicleIndex].vehiclePlate : '请选择车牌号'}}</view>
  44. <view class="arrow-down">▼</view>
  45. </view>
  46. <!-- <view class="uni-input">{{vehicles[formData.vehicleIndex]?.vehiclePlate}}</view> -->
  47. </picker>
  48. </view>
  49. </view>
  50. <view class="form-item">
  51. <view class="form-label">车牌颜色</view>
  52. <view class="form-input">
  53. <picker
  54. class="picker-disabled--test"
  55. :disabled="activationType == 'self'"
  56. @change="bindColorPickerChange"
  57. :value="formData.colorIndex"
  58. :range="getDicWithType('VEHICLE_COLOR_TYPE')"
  59. range-key="name">
  60. <view class="uni-input">
  61. <view class="text">{{formData.colorName ? formData.colorName : '请选择车辆颜色'}}</view>
  62. <view class="arrow-down">▼</view>
  63. </view>
  64. <!-- <view class="uni-input">{{vehicles[formData.vehicleIndex]?.vehiclePlate}}</view> -->
  65. </picker>
  66. </view>
  67. </view>
  68. <!-- <view class="form-input" >
  69. <view class="uni-list-cell-db">
  70. <picker class="picker-selector--test" @change="bindPickerChange" :value="formData.vehicleIndex" :range="vehicles" range-key="name">
  71. <view class="uni-input picker-selector--value">{{vehicles[formData.vehicleIndex]}}</view>
  72. </picker>
  73. </view>
  74. </view> -->
  75. <!-- </view> -->
  76. <!-- <view class="form-item">
  77. <view class="form-label">车牌颜色</view>
  78. <view class="form-input" @click="selectCarColor">
  79. <text :class="['input-text', { placeholder: !formData.carColor }]">
  80. {{ formData.carColor || '请选择车牌颜色' }}
  81. </text>
  82. <view class="arrow-down">▼</view>
  83. </view>
  84. </view> -->
  85. <view class="form-item">
  86. <view class="form-label">申请手机号</view>
  87. <input
  88. class="form-input-text"
  89. placeholder="请输入手机号码"
  90. v-model="formData.phoneNumber"
  91. disabled="true"
  92. type="number"
  93. maxlength="11"
  94. />
  95. </view>
  96. <!-- 非本人激活时显示验证码 -->
  97. <view v-if="activationType === 'other'" class="form-item">
  98. <view class="form-label">短信验证码</view>
  99. <view class="form-input" style="display:flex;align-items:center;">
  100. <input
  101. class="form-input-text"
  102. placeholder="请输入验证码"
  103. v-model="formData.smsCode"
  104. maxlength="6"
  105. style="flex:1;"
  106. />
  107. <button class="send-code-btn" @click="sendCode" :disabled="waitTime>0">
  108. {{ waitTime > 0 ? waitTime + 's后重试' : '发送验证码' }}
  109. </button>
  110. </view>
  111. </view>
  112. </view>
  113. <!-- 上传照片 -->
  114. <view class="upload-section" v-if="formData.activeType == '2'">
  115. <view class="section-title">上传照片</view>
  116. <view class="picture-wrapper" @click="takePhotoMode('3')">
  117. <view class="bg">
  118. <view class="">
  119. <view class="name"> 行驶证主页 </view>
  120. <view class="value"> 上传行驶证的主页 </view>
  121. <view class="tip">
  122. <view class="tip-value"> 拍摄规范 </view>
  123. </view>
  124. </view>
  125. <image v-if="!vehicleFrontData.imageName" class="icon" :src="`${$imgUrl}issuance/xz.png`"
  126. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  127. </image>
  128. <image v-else class="icon" :src="vehicleFrontData.imageName"
  129. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
  130. </view>
  131. </view>
  132. <view class="picture-wrapper" @click="takePhotoMode('4')">
  133. <view class="bg">
  134. <view class="">
  135. <view class="name"> 行驶证副页 </view>
  136. <view class="value"> 上传行驶证的副页 </view>
  137. <view class="tip">
  138. <view class="tip-value"> 拍摄规范 </view>
  139. </view>
  140. </view>
  141. <image v-if="!vehicleBackData.imageName" class="icon" :src="`${$imgUrl}issuance/xf.png`"
  142. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  143. </image>
  144. <image v-else class="icon" :src="imgPathMontage(vehicleBackData.imageName)"
  145. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
  146. </view>
  147. </view>
  148. <view class="picture-wrapper" @click="cardFileImageUpdate(102)">
  149. <view class="bg">
  150. <view class="">
  151. <view class="name"> 上传激活车辆45度照 </view>
  152. <view class="value"> 上传车辆45度角照片 </view>
  153. <view class="tip">
  154. <view class="tip-value"> 拍摄规范 </view>
  155. </view>
  156. </view>
  157. <image v-if="!formData.vehBodyUrl" class="icon" :src="`${$imgUrl}issuance/chetou.png`"
  158. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  159. </image>
  160. <image v-else class="icon" :src="imgPathMontage(formData.vehBodyUrlName)"
  161. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
  162. </view>
  163. </view>
  164. <view class="picture-wrapper" @click="cardFileImageUpdate(103)">
  165. <view class="bg">
  166. <view class="">
  167. <view class="name"> 上传ETC设备安装照 </view>
  168. <view class="value"> 上传ETC设备安装位置照片 </view>
  169. <view class="tip">
  170. <view class="tip-value"> 拍摄规范 </view>
  171. </view>
  172. </view>
  173. <image v-if="!formData.deviceImageUrl" class="icon" :src="``"
  174. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  175. </image>
  176. <image v-else class="icon" :src="imgPathMontage(formData.deviceImageName)"
  177. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
  178. </view>
  179. </view>
  180. </view>
  181. </view>
  182. <!-- 底部按钮 -->
  183. <view class="bottom-button" @click="nextStep">
  184. 下一步
  185. </view>
  186. <uploadImg :isTakePhotoModeShow="isTakePhotoModeShow" :phoneType="choiceIndex" @close="close"
  187. @ocrResult="ocrResult">
  188. </uploadImg>
  189. </view>
  190. </template>
  191. <script setup lang="ts">
  192. import { ref, reactive, onMounted, onUnmounted } from 'vue'
  193. import { onLoad } from '@dcloudio/uni-app'
  194. import carNumberInput from './components/car-number-input.vue'
  195. import { requestNew } from "@/utils/network/request.js";
  196. import {
  197. queryVehicle, sendMessage, vehicCharge
  198. } from "@/utils/network/api.js";
  199. import {
  200. getCodeName, getDicWithType
  201. } from "@/datas/queryKey.js";
  202. import { msg, strReplace, imgPathMontage, hasLogin, uploadFile, compressImage, chooseImageCompress, navTo } from "@/utils/utils";
  203. import uploadImg from '@/components/uploadOcr';
  204. import useOrderSkip from "@/composables/order/useOrderSkip";
  205. import { setItem,getItem } from "@/utils/storage";
  206. //办理订单按钮跳转业务逻辑
  207. const {
  208. gotoCancelOrder,
  209. gotoEditUserOrUnitInfo,
  210. gotoConfirmReceipt,
  211. gotoCheckLogistics,
  212. gotoEvaluateProduct,
  213. gotoActiveOrder,
  214. gotoPay,
  215. gotoReturnOrder,
  216. gotoExchangeOrder,
  217. gotoOrderDetailsPay,
  218. gotoOrderDetails,
  219. gotoAgainUseOrder,
  220. gotoOrderSign,
  221. closeOrder,
  222. gotoReplenishmentOrder,
  223. gotoAddressOrder,
  224. placeAnOrder,
  225. gotoEditAddressNew
  226. } = useOrderSkip();
  227. // 响应式数据
  228. const statusBarHeight = ref(0)
  229. const barHeight = ref(0)
  230. const activationType = ref('self') // 'self' 本人激活, 'other' 非本人激活
  231. const waitTime = ref(0)
  232. let timer: any = null
  233. const formData = reactive({
  234. vehicleType: '',
  235. carNumber: '',
  236. vehicleIndex: '',
  237. vehiclePlate: '',
  238. colorCode: '',
  239. colorIndex: '',
  240. colorName: '',
  241. carColor: '',
  242. phoneNumber: '',
  243. vehPosImgUrl: '',
  244. vehPosImgUrlName: '',
  245. vehNegImgUrl: '',
  246. vehNegImgUrlName: '',
  247. vehBodyUrl: '',
  248. vehBodyUrlName: '',
  249. deviceImageUrl: '',
  250. deviceImageName: '',
  251. smsCode: '',
  252. activeType: '',
  253. orderId: '',
  254. orderNo: '',
  255. cardId: '',
  256. obuId: ''
  257. })
  258. const reset = () => {
  259. Object.assign(formData, {
  260. carNumber: '',
  261. vehicleIndex: '',
  262. vehiclePlate: '',
  263. colorCode: '',
  264. colorIndex: '',
  265. colorName: '',
  266. carColor: '',
  267. phoneNumber: '',
  268. vehPosImgUrl: '',
  269. vehPosImgUrlName: '',
  270. vehNegImgUrl: '',
  271. vehNegImgUrlName: '',
  272. vehBodyUrl: '',
  273. vehBodyUrlName: '',
  274. deviceImageUrl: '',
  275. deviceImageName: '',
  276. smsCode: '',
  277. activeType: ''
  278. })
  279. }
  280. const changeActivationType = (type:string) => {
  281. if(activationType.value != type) {
  282. activationType.value = type;
  283. }
  284. reset();
  285. }
  286. // 页面加载
  287. onLoad(() => {
  288. getSystemInfo()
  289. queryVehicleData();
  290. })
  291. const close = (e) => {
  292. console.log("e", e)
  293. isTakePhotoModeShow.value = e
  294. }
  295. const vehicleFrontData = reactive({});
  296. const vehicleBackData = reactive({})
  297. const ocrResult = (data) => {
  298. console.log('输出内容=====================', choiceIndex.value);
  299. console.log("上传数据:", data)
  300. console.log("上传数据:", data)
  301. if (choiceIndex.value == "3") {
  302. Object.assign(vehicleFrontData, data);
  303. } else if (choiceIndex.value === "4") {
  304. Object.assign(vehicleBackData, data);
  305. }
  306. }
  307. const isTakePhotoModeShow = ref(false);
  308. const choiceIndex = ref('');
  309. const takePhotoMode = (index) => {
  310. console.log("index", index)
  311. isTakePhotoModeShow.value = true
  312. choiceIndex.value = index
  313. }
  314. const vehiclesShow = ref(true);
  315. const vehicles = ref([]);
  316. const queryVehicleData = (vehicleId) => {
  317. let data = {
  318. vehicleId: ''
  319. }
  320. if(vehicleId) {
  321. data.vehicleId = vehicleId;
  322. }
  323. const options = {
  324. type: 2,
  325. method: "POST",
  326. data,
  327. showLoading: true,
  328. }
  329. requestNew('/iaw/active/queryVehicle', options).then(res => {
  330. vehicles.value = res.modelList;
  331. if(vehicleId) {
  332. let vehicle = res.modelList[0];
  333. formData.phoneNumber = vehicle.mobile;
  334. formData.activeType = vehicle.activeType;
  335. formData.orderId = vehicle.orderId;
  336. formData.orderNo = vehicle.orderNo;
  337. formData.vehicleType = vehicle.vehicleType;
  338. formData.cardId = vehicle.cardId;
  339. formData.obuId = vehicle.obuId;
  340. }
  341. })
  342. }
  343. //车头照图片上传 val 100行驶证证明 101行驶证反面 102车头照 103
  344. const cardFileImageUpdate = (val) => {
  345. uni.chooseImage({
  346. count: 1, //只能选取一张照片
  347. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  348. sourceType: ["camera", "album"], //从相册选择
  349. success: function (res) {
  350. uploadFile(res.tempFilePaths[0], val).then((data : any) => {
  351. if (val == 100) {
  352. formData.vehPosImgUrl = data.imageUrl;
  353. formData.vehPosImgUrlName = res.tempFilePaths[0];
  354. } else if (val == 101) {
  355. formData.vehNegImgUrl = data.imageUrl;
  356. formData.vehNegImgUrlName = res.tempFilePaths[0];
  357. } else if (val == 102){
  358. formData.vehBodyUrl = data.imageUrl;
  359. formData.vehBodyUrlName = res.tempFilePaths[0];
  360. } else {
  361. formData.deviceImageUrl = data.imageUrl;
  362. formData.deviceImageName = res.tempFilePaths[0];
  363. }
  364. })
  365. },
  366. });
  367. };
  368. const bindPickerChange = (e) => {
  369. console.log('picker发送选择改变,携带值为:' + e.detail.value)
  370. let index = e.detail.value;
  371. formData.vehicleIndex = index;
  372. let vehicle = vehicles.value[index];
  373. formData.vehiclePlate = vehicle.vehiclePlate;
  374. formData.colorCode = vehicle.vehiclePlateColor;
  375. formData.activeType = vehicle.activeType;
  376. formData.vehicleType = vehicle.vehicleType;
  377. const colorItem = getDicWithType('VEHICLE_COLOR_TYPE').find(item => item.code == formData.colorCode);
  378. formData.colorName = colorItem.name;
  379. formData.phoneNumber = vehicle.mobile
  380. formData.orderId = vehicle.orderId;
  381. formData.orderNo = vehicle.orderNo;
  382. formData.cardId = vehicle.cardId;
  383. formData.obuId = vehicle.obuId;
  384. };
  385. const bindColorPickerChange = (e) => {
  386. console.log('picker发送选择改变,携带值为:' + e.detail.value)
  387. let index = e.detail.value
  388. formData.colorIndex = index;
  389. let colorItem = getDicWithType('VEHICLE_COLOR_TYPE')[index];
  390. formData.colorCode = colorItem.code;
  391. formData.colorName = colorItem.name;
  392. if(formData.carNumber) {
  393. queryVehicleData(`${formData.carNumber}_${formData.colorCode}`);
  394. }
  395. };
  396. // 获取系统信息
  397. const getSystemInfo = () => {
  398. const systemInfo = uni.getSystemInfoSync()
  399. statusBarHeight.value = systemInfo.statusBarHeight || 0
  400. const { top, height } = uni.getMenuButtonBoundingClientRect()
  401. barHeight.value = height ? height + (top - statusBarHeight.value) * 2 : 38
  402. }
  403. // 返回上一页
  404. const goBack = () => {
  405. uni.navigateBack()
  406. }
  407. // 选择车牌号
  408. const selectCarNumber = () => {
  409. // 这里可以调用车牌号选择组件
  410. // uni.showActionSheet({
  411. // itemList: vehicles.value,
  412. // success: (res) => {
  413. // const colors = ['蓝色', '绿色', '黄色', '白色', '黑色']
  414. // formData.carColor = colors[res.tapIndex]
  415. // }
  416. // })
  417. vehiclesShow.value = true;
  418. }
  419. // 上传图片
  420. const uploadImage = (type: 'vehicle' | 'device') => {
  421. uni.chooseImage({
  422. count: 1, //只能选取一张照片
  423. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  424. sourceType: ["camera", "album"], //从相册选择
  425. success: function (res) {
  426. // 这里可以添加文件上传逻辑
  427. const tempFilePath = res.tempFilePaths[0]
  428. if (type === 'vehicle') {
  429. formData.vehicleImage = tempFilePath
  430. } else {
  431. formData.deviceImage = tempFilePath
  432. }
  433. }
  434. })
  435. }
  436. // 显示拍摄规范
  437. const showSpec = (type: 'vehicle' | 'device') => {
  438. const title = type === 'vehicle' ? '车辆45度照拍摄规范' : 'ETC设备安装照拍摄规范'
  439. const content = type === 'vehicle'
  440. ? '请从车辆前45度角拍摄,确保车牌清晰可见,车辆完整入镜。'
  441. : '请拍摄ETC设备安装位置,确保设备清晰可见,安装牢固。'
  442. uni.showModal({
  443. title,
  444. content,
  445. showCancel: false
  446. })
  447. }
  448. // 发送验证码
  449. const sendCode = () => {
  450. if (!/^1[3-9]\d{9}$/.test(formData.phoneNumber)) {
  451. uni.showToast({ title: '请输入正确手机号', icon: 'none' })
  452. return
  453. }
  454. const options = {
  455. type: 2,
  456. data: {
  457. mobile: formData.phoneNumber,
  458. businessType:4
  459. },
  460. method: "POST",
  461. showLoading: true,
  462. };
  463. requestNew(sendMessage, options).then((res) => {
  464. // 这里调用后端发送验证码接口
  465. msg("验证码发送成功!");
  466. uni.showToast({ title: '验证码已发送', icon: 'success' })
  467. waitTime.value = 60
  468. timer = setInterval(() => {
  469. waitTime.value--
  470. if (waitTime.value <= 0) clearInterval(timer)
  471. }, 1000)
  472. });
  473. }
  474. onUnmounted(() => { if (timer) clearInterval(timer) })
  475. const carNumberInputResult = (val: string) => {
  476. formData.carNumber = val.replaceAll(' ', '');
  477. if(formData.colorCode && formData.carNumber.length >= 7) {
  478. queryVehicleData(`${formData.carNumber}_${formData.colorCode}`);
  479. }
  480. };
  481. // 下一步
  482. const nextStep = () => {
  483. // return;
  484. // 表单验证
  485. if (!formData.carNumber && activationType.value === 'other') {
  486. uni.showToast({
  487. title: '请输入车牌号',
  488. icon: 'none'
  489. })
  490. return
  491. }
  492. if (!formData.vehiclePlate && activationType.value === 'self') {
  493. uni.showToast({
  494. title: '请选择车牌号',
  495. icon: 'none'
  496. })
  497. return
  498. }
  499. if (formData.colorCode == undefined || formData.colorCode == null) {
  500. uni.showToast({
  501. title: '请选择车牌颜色',
  502. icon: 'none'
  503. })
  504. return
  505. }
  506. if (!formData.phoneNumber) {
  507. uni.showToast({
  508. title: '请输入手机号码',
  509. icon: 'none'
  510. })
  511. return
  512. }
  513. if (!/^1[3-9]\d{9}$/.test(formData.phoneNumber)) {
  514. uni.showToast({
  515. title: '请输入正确的手机号码',
  516. icon: 'none'
  517. })
  518. return
  519. }
  520. if (!formData.smsCode && activationType.value === 'other') {
  521. uni.showToast({
  522. title: '请输入验证码',
  523. icon: 'none'
  524. })
  525. return
  526. }
  527. if(formData.activeType == '2') {
  528. if (!vehicleFrontData.imageName) {
  529. uni.showToast({
  530. title: '请上传行驶证正面照',
  531. icon: 'none'
  532. })
  533. return
  534. }
  535. if (!vehicleBackData.imageName) {
  536. uni.showToast({
  537. title: '请上传行驶证反面照',
  538. icon: 'none'
  539. })
  540. return
  541. }
  542. if (!formData.vehBodyUrl) {
  543. uni.showToast({
  544. title: '请上传车辆45度照',
  545. icon: 'none'
  546. })
  547. return
  548. }
  549. if (!formData.deviceImageUrl) {
  550. uni.showToast({
  551. title: '请上传ETC设备安装照',
  552. icon: 'none'
  553. })
  554. return
  555. }
  556. }
  557. // 提交数据
  558. console.log('表单数据:', formData)
  559. let requests = [];
  560. if(activationType.value === 'other') {
  561. const options = {
  562. type: 2,
  563. method: "POST",
  564. data: {
  565. mobile: formData.phoneNumber,
  566. code: formData.smsCode
  567. },
  568. showLoading: true,
  569. }
  570. requests.push(requestNew('/iaw/active/checkSendCode', options));
  571. }
  572. // if(formData.activeType == '2') {
  573. // requests.push(getCharacter());
  574. // }
  575. if(requests.length == 0) {
  576. next();
  577. return;
  578. }
  579. Promise.all(requests).then(res => {
  580. next();
  581. })
  582. }
  583. // 获取车辆使用性质
  584. const getCharacter = () => {
  585. let approvedCount;
  586. if (vehicleBackData.apc.indexOf('人') > 0) {
  587. approvedCount = vehicleBackData.apc.replace("人", "");
  588. } else {
  589. approvedCount = vehicleBackData.apc;
  590. }
  591. let totalMass;
  592. if (vehicleBackData.gross.toString().indexOf('kg') > 0) {
  593. totalMass = vehicleBackData.gross.replace("kg", "");
  594. } else {
  595. totalMass = vehicleBackData.gross;
  596. }
  597. let data = {
  598. "approvedCount": approvedCount,
  599. // "axleCount": state.form.axleCount,
  600. "totalMass": totalMass,
  601. // "vanType": state.form.vanType,
  602. "vehicleDimensions": vehicleBackData.overall.replaceAll("x", "X"),
  603. "plateNum": activationType.value === 'other' ? formData.carNumber : formData.vehiclePlate,
  604. "vehicleTypeName": vehicleFrontData.vehicle,
  605. "vehicleUsePropertName": vehicleFrontData.character
  606. }
  607. let params = {
  608. type: 2,
  609. data: data,
  610. method: "POST",
  611. showLoading: true,
  612. };
  613. return requestNew(vehicCharge, params)
  614. }
  615. const next = () => {
  616. console.log('formData', formData);
  617. let carNumber = activationType.value == 'self' ? formData.vehiclePlate : formData.carNumber;
  618. // setItem('vehicleId', )
  619. // if(formData.activeType == '1') {
  620. setItem('currentActivateData', {
  621. vehicleFrontImgUrl: vehicleFrontData.imageName,
  622. vehicleBackImgUrl: vehicleBackData.imageName,
  623. vehicleId: `${carNumber}_${formData.colorCode}`,
  624. vehiclePlate: activationType.value === 'other' ? formData.carNumber : formData.vehiclePlate,
  625. vehiclePlateColorStr: formData.colorName,
  626. customerTel: formData.phoneNumber,
  627. vehicleType: formData.vehicleType,
  628. cardId: formData.cardId,
  629. obuId: formData.obuId
  630. // obuId: 'dsjfslkfjlsa'
  631. })
  632. navTo(`/subpackage/after-sale/activation/operation-tips?id=${formData.orderId}&orderId=${formData.orderNo}&cardStatus=${undefined}&obuStatus=${undefined}&transfer=${formData.activeType}`);
  633. }
  634. </script>
  635. <style lang="scss" scoped>
  636. .picture-wrapper {
  637. margin-top: 30rpx;
  638. .bg {
  639. background: #F5F9FB;
  640. border-radius: 10rpx;
  641. padding: 40rpx 30rpx;
  642. display: flex;
  643. // align-items: center;
  644. justify-content: space-between;
  645. .name {
  646. padding-top: 30rpx;
  647. font-size: 32rpx;
  648. font-family: SourceHanSansSC, SourceHanSansSC;
  649. font-weight: 500;
  650. color: #111;
  651. line-height: 34rpx;
  652. }
  653. .value {
  654. margin-top: 20rpx;
  655. font-size: 22rpx;
  656. font-family: SourceHanSansSC, SourceHanSansSC;
  657. font-weight: 400;
  658. color: #999999;
  659. line-height: 24rpx;
  660. }
  661. .tip {
  662. margin-top: 20rpx;
  663. text-align: center;
  664. width: 100rpx;
  665. height: 30rpx;
  666. // background: rgba(204, 179, 117);
  667. border-radius: 6rpx;
  668. border: 1rpx solid #CCB375;
  669. .tip-value {
  670. font-size: 20rpx;
  671. font-family: Microsoft YaHei;
  672. font-weight: 400;
  673. color: #CCB375;
  674. line-height: 30rpx;
  675. opacity: 1;
  676. }
  677. }
  678. }
  679. .icon {
  680. width: 304rpx;
  681. height: 190rpx;
  682. background-image: var(--bgimg);
  683. background-size: 100% 100%;
  684. background-repeat: no-repeat;
  685. }
  686. }
  687. .container {
  688. min-height: 100vh;
  689. background-color: #f2f5f7;
  690. }
  691. .nav-bar {
  692. background-color: #fff;
  693. position: fixed;
  694. top: 0;
  695. left: 0;
  696. right: 0;
  697. z-index: 100;
  698. .nav-content {
  699. display: flex;
  700. align-items: center;
  701. justify-content: space-between;
  702. padding: 0 30rpx;
  703. .nav-left, .nav-right {
  704. width: 60rpx;
  705. height: 60rpx;
  706. display: flex;
  707. align-items: center;
  708. justify-content: center;
  709. .back-icon {
  710. width: 40rpx;
  711. height: 40rpx;
  712. }
  713. .more-dots {
  714. display: flex;
  715. flex-direction: column;
  716. gap: 4rpx;
  717. .dot {
  718. width: 6rpx;
  719. height: 6rpx;
  720. background-color: #333;
  721. border-radius: 50%;
  722. }
  723. }
  724. }
  725. .nav-title {
  726. font-size: 36rpx;
  727. font-weight: bold;
  728. color: #333;
  729. }
  730. }
  731. }
  732. .content {
  733. padding: 60rpx 30rpx 120rpx;
  734. }
  735. .info-section, .upload-section {
  736. background-color: #fff;
  737. border-radius: 20rpx;
  738. padding: 30rpx;
  739. margin-bottom: 30rpx;
  740. .section-title {
  741. font-size: 32rpx;
  742. font-weight: bold;
  743. color: #333;
  744. margin-bottom: 30rpx;
  745. }
  746. }
  747. .activation-type {
  748. display: flex;
  749. background-color: #f5f5f5;
  750. border-radius: 10rpx;
  751. padding: 4rpx;
  752. margin-bottom: 30rpx;
  753. .type-item {
  754. flex: 1;
  755. text-align: center;
  756. padding: 20rpx 0;
  757. border-radius: 8rpx;
  758. font-size: 28rpx;
  759. color: #666;
  760. transition: all 0.3s;
  761. &.active {
  762. background-color: #c2a75f;
  763. color: #fff;
  764. }
  765. }
  766. }
  767. .form-item {
  768. display: flex;
  769. align-items: center;
  770. margin-bottom: 30rpx;
  771. .form-label {
  772. width: 160rpx;
  773. font-size: 28rpx;
  774. color: #333;
  775. }
  776. .form-input {
  777. flex: 1;
  778. display: flex;
  779. align-items: center;
  780. justify-content: space-between;
  781. height: 80rpx;
  782. padding: 0 20rpx;
  783. background-color: #f8f8f8;
  784. border-radius: 10rpx;
  785. .picker-disabled--test {
  786. width: 100%;
  787. height: 100%;
  788. line-height: 80rpx;
  789. .uni-input {
  790. display: flex;
  791. flex-direction: row;
  792. align-items: center;
  793. .text {
  794. flex: 1;
  795. height: 100%;
  796. }
  797. }
  798. }
  799. .input-text {
  800. font-size: 28rpx;
  801. color: #333;
  802. &.placeholder {
  803. color: #999;
  804. }
  805. }
  806. .arrow-down {
  807. font-size: 20rpx;
  808. color: #999;
  809. }
  810. }
  811. .form-input-text {
  812. flex: 1;
  813. height: 80rpx;
  814. padding: 0 20rpx;
  815. background-color: #f8f8f8;
  816. border-radius: 10rpx;
  817. font-size: 28rpx;
  818. color: #333;
  819. }
  820. }
  821. .car-number-row {
  822. flex-direction: column;
  823. align-items: flex-start;
  824. .form-label {
  825. margin-bottom: 12rpx;
  826. }
  827. :deep(.car-number-input-root) {
  828. width: 100%;
  829. justify-content: flex-start;
  830. }
  831. }
  832. // .picture-wrapper {
  833. // margin-top: 30rpx;
  834. // .bg1 {
  835. // background: #F5F9FB;
  836. // border-radius: 10rpx;
  837. // padding: 40rpx 30rpx;
  838. // display: flex;
  839. // justify-content: space-between;
  840. // .name {
  841. // padding-top: 30rpx;
  842. // font-size: 32rpx;
  843. // font-family: SourceHanSansSC, SourceHanSansSC;
  844. // font-weight: 500;
  845. // color: #111;
  846. // line-height: 34rpx;
  847. // }
  848. // .value {
  849. // margin-top: 20rpx;
  850. // font-size: 22rpx;
  851. // font-family: SourceHanSansSC, SourceHanSansSC;
  852. // font-weight: 400;
  853. // color: #999999;
  854. // line-height: 24rpx;
  855. // }
  856. // .tip {
  857. // margin-top: 20rpx;
  858. // text-align: center;
  859. // width: 100rpx;
  860. // height: 30rpx;
  861. // border-radius: 6rpx;
  862. // border: 1rpx solid #CCB375;
  863. // .tip-value {
  864. // font-size: 20rpx;
  865. // font-family: Microsoft YaHei;
  866. // font-weight: 400;
  867. // color: #CCB375;
  868. // line-height: 30rpx;
  869. // opacity: 1;
  870. // }
  871. // }
  872. // }
  873. // .icon {
  874. // width: 304rpx;
  875. // height: 190rpx;
  876. // background-image: var(--bgimg);
  877. // background-size: 100% 100%;
  878. // background-repeat: no-repeat;
  879. // }
  880. // }
  881. .bottom-button {
  882. position: fixed;
  883. bottom: 0;
  884. left: 0;
  885. right: 0;
  886. height: 100rpx;
  887. background-color: #133850;
  888. color: #fff;
  889. font-size: 32rpx;
  890. font-weight: bold;
  891. display: flex;
  892. align-items: center;
  893. justify-content: center;
  894. }
  895. .send-code-btn {
  896. margin-left: 16rpx;
  897. background: #f8f4e7;
  898. color: #ccb375;
  899. border: 1px solid #ccb375;
  900. border-radius: 10rpx;
  901. font-size: 24rpx;
  902. height: 60rpx;
  903. line-height: 60rpx;
  904. padding: 0 20rpx;
  905. }
  906. </style>