Information.vue 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588
  1. <template>
  2. <view class="page">
  3. <public-module></public-module>
  4. <view class="fixed dis a-c j-start" :style="headerStyle">
  5. <u-icon name="arrow-left" size="40" @tap="back"></u-icon>
  6. <text style="margin: auto;">{{headerText}}</text>
  7. </view>
  8. <view class="banner"></view>
  9. <view v-show="carInfoShow" class="Information" style="margin-top: -84px;">
  10. <text class="title">车辆信息</text>
  11. <view class="collapse">
  12. <view class="top-ocr dis j-c a-c" v-show="!carimg">
  13. <image src="../../static/image/car-insure/Frame.png" mode="">
  14. </image>
  15. <text @tap="ocrIdentify('carInfo')" style="margin-left: 5px;">点击上传/拍摄行驶证 自动填写信息</text>
  16. </view>
  17. <view v-show="!carExpand && !carimg" class="btn-collapse dis a-c j-c" @click="expand('carExpand')">
  18. <text>展开手动输入车辆信息</text>
  19. <u-icon name="arrow-down" size="30" color="rgb(60 60 60 / 60%)" style="margin-left: 5px;"></u-icon>
  20. </view>
  21. <view v-show="carExpand" class="">
  22. <view v-if=" carimg" class="movable-view dis f-c a-c">
  23. <movable-area>
  24. <movable-view direction="all" out-of-bounds :scale="true">
  25. <image :src="carimg" mode=""
  26. :style="{width:'100%',height:'100%',transform:`rotate(-${cardeg}deg)`}">
  27. </image>
  28. </movable-view>
  29. </movable-area>
  30. <view class="operate-img dis j-s a-c">
  31. <view class="dis a-c" @tap="rotatefront('cardeg')">
  32. <image src="/static/image/car-insure/rotate1.png" mode=""></image>
  33. 左转
  34. </view>
  35. <view class="dis a-c" @tap="ocrIdentify('carInfo')">
  36. <image src="/static/image/car-insure/upload.png" mode=""></image>
  37. 上传
  38. </view>
  39. <view class="dis a-c" @tap="rotateback('cardeg')">
  40. <image src="/static/image/car-insure/rotate2.png" mode=""></image>
  41. 右转
  42. </view>
  43. </view>
  44. </view>
  45. <uni-forms :rules="carRules" :value="carInfo" ref="carForm" validate-trigger="bind"
  46. style="padding: 0 15px;" err-show-type="toast" label-width="100">
  47. <uni-forms-item label="车牌号: ">
  48. <input class="uni-input-input textColor" placeholder="输入车牌号" v-model="carInfo.licenseNo"
  49. placeholder-style="font-size:28upx" @input="upperCaseType('licenseNo')" />
  50. </uni-forms-item>
  51. <uni-forms-item name="frameNo" required label="车辆识别码:">
  52. <view class="d-flex a-center" style="height: 100%;">
  53. <input class="uni-input-input flex-1 textColor" placeholder="请输入车辆识别码"
  54. v-model="carInfo.frameNo" maxlength="17" placeholder-style="font-size:28upx"
  55. @input="upperCaseType('frameNo')" />
  56. <image src="/static/image/car-insure/search.png" mode=""
  57. style="width: 22px;height: 22px;" @tap="toChooseVin(carInfo.frameNo)">
  58. </image>
  59. </view>
  60. </uni-forms-item>
  61. <uni-forms-item name="modelcname" required label="品牌型号: ">
  62. <view class="d-flex a-center textColor" style="height: 100%;">
  63. <input class="uni-input-input flex-1 textColor" placeholder="请输入品牌型号"
  64. v-model="carInfo.modelcname"
  65. @blur="binddata('modelcname', $event.detail.value,'carForm')"
  66. placeholder-style="font-size:28upx" @input="upperCaseType('modelcname')" />
  67. <image src="/static/image/car-insure/search.png" mode=""
  68. style="width: 22px;height: 22px;" @tap="toChooseVehicleType(carInfo.modelcname)">
  69. </image>
  70. </view>
  71. </uni-forms-item>
  72. <uni-forms-item name="engineNo" required label="发动机号: ">
  73. <input class="uni-input-input textColor" placeholder="请输入发动机号" v-model="carInfo.engineNo"
  74. @blur="binddata('engineNo', $event.detail.value,'carForm')"
  75. placeholder-style="font-size:28upx" @input="upperCaseType('engineNo')" />
  76. </uni-forms-item>
  77. <uni-forms-item required label="注册日期" name="registerDate">
  78. <u-input type="select" :custom-style="{textAlign:'right'}" :select-open="registerDateShow"
  79. v-model="carInfo.registerDate" placeholder="请选择注册日期" @click="registerDateShow = true"
  80. placeholder-style="color:#808080"></u-input>
  81. <u-picker v-model="registerDateShow" mode="time" :params="params" :end-year="endYear"
  82. :end-month="endMonth" @confirm="e=> Dateconfirm(e,'carInfo','registerDate')"></u-picker>
  83. </uni-forms-item>
  84. <uni-forms-item required label="发证日期" name="issueDate">
  85. <u-input type="select" :custom-style="{textAlign:'right'}" :select-open="issueDateShow"
  86. v-model="carInfo.issueDate" placeholder="请选择发证日期" @click="issueDateShow = true"
  87. placeholder-style="color:#808080"></u-input>
  88. <u-picker v-model="issueDateShow" mode="time" :params="params"
  89. @confirm="e=> Dateconfirm(e,'carInfo','issueDate')"></u-picker>
  90. </uni-forms-item>
  91. <uni-forms-item v-if="carInfo.transferFlag" required label="转移登记日期" name="transferDate">
  92. <u-input type="select" :custom-style="{textAlign:'right'}" :select-open="transferDateShow"
  93. v-model="carInfo.transferDate" placeholder="请选择过户日期" @click="transferDateShow = true"
  94. placeholder-style="color:#808080"></u-input>
  95. <u-picker v-model="transferDateShow" mode="time" :params="params" :end-year="endYear"
  96. :end-month="endMonth" @confirm="e=> Dateconfirm(e,'carInfo','transferDate')"></u-picker>
  97. </uni-forms-item>
  98. <uni-forms-item label="整备质量: " required name="completeKerbMass">
  99. <input class="uni-input-input textColor" placeholder="请输入整备质量"
  100. v-model="carInfo.completeKerbMass" placeholder-style="font-size:28upx" />
  101. </uni-forms-item>
  102. <uni-forms-item label="核定载质量: ">
  103. <input class="uni-input-input textColor" placeholder="请输入核定载质量" v-model="carInfo.limitLoad"
  104. placeholder-style="font-size:28upx" />
  105. </uni-forms-item>
  106. <uni-forms-item label="使用性质: " required name="carnature">
  107. <u-input v-model="carInfo1.carnature" type="select" :select-open="carnatureShow"
  108. @click="carnatureShow = true" :custom-style="{textAlign:'right'}"
  109. placeholder-style="color:#808080" placeholder="请选择使用性质" />
  110. <u-select mode="single-column" :list="natureOfVehicleUseoptions" v-model="carnatureShow"
  111. label-name="dictTag" value-name="dictValue"
  112. @confirm="dictionaryConfirm($event,'carnature')"></u-select>
  113. </uni-forms-item>
  114. <uni-forms-item label="能源种类: " required name="energyType">
  115. <u-input v-model="carInfo1.energyType" type="select" :select-open="energyTypeShow"
  116. @click="energyTypeShow = true" :custom-style="{textAlign:'right'}"
  117. placeholder-style="color:#808080" placeholder="请选择能源种类" />
  118. <u-select mode="single-column" :list="energyTypeoptions" v-model="energyTypeShow"
  119. label-name="dictTag" value-name="dictValue"
  120. @confirm="dictionaryConfirm($event,'energyType')"></u-select>
  121. </uni-forms-item>
  122. <uni-forms-item label="车辆用途: " required name="vehicleUse">
  123. <u-input v-model="carInfo1.vehicleUse" type="select" :select-open="vehicleUseShow"
  124. @click="vehicleUseShow = true" :custom-style="{textAlign:'right'}"
  125. placeholder-style="color:#808080" placeholder="请选择车辆用途" />
  126. <u-select v-if="carInfo.carnature=='01'" mode="single-column"
  127. :list="businessVehicleUseoptions" v-model="vehicleUseShow" label-name="dictTag"
  128. value-name="dictValue" @confirm="dictionaryConfirm($event,'vehicleUse')"></u-select>
  129. <u-select v-else mode="single-column" :list="outOfBusinessVehicleUseoptions"
  130. v-model="vehicleUseShow" label-name="dictTag" value-name="dictValue"
  131. @confirm="dictionaryConfirm($event,'vehicleUse')"></u-select>
  132. </uni-forms-item>
  133. <uni-forms-item label="车辆类型: " required name="cartype">
  134. <u-input v-model="carInfo1.cartype" type="select" :select-open="cartypeShow"
  135. @click="cartypeShow = true" :custom-style="{textAlign:'right'}"
  136. placeholder-style="color:#808080" placeholder="请选择车辆类型" />
  137. <u-select mode="single-column" :list="trafficManagementVehicleTypeoptions"
  138. v-model="cartypeShow" label-name="dictTag" value-name="dictValue"
  139. @confirm="dictionaryConfirm($event,'cartype')"></u-select>
  140. </uni-forms-item>
  141. <uni-forms-item label="车辆种类: " required name="cimodelclass">
  142. <u-input v-model="carInfo1.cimodelclass" type="select" :select-open="cimodelclassShow"
  143. @click="cimodelclassShow = true" :custom-style="{textAlign:'right'}"
  144. placeholder-style="color:#808080" placeholder="请选择车辆种类" />
  145. <u-select mode="single-column" :list="vehicleTypeoptions" v-model="cimodelclassShow"
  146. label-name="dictTag" value-name="dictValue"
  147. @confirm="dictionaryConfirm($event,'cimodelclass')"></u-select>
  148. </uni-forms-item>
  149. <uni-forms-item label="年款: ">
  150. <input class="uni-input-input textColor" placeholder="请输入年款" v-model="carInfo.caryear"
  151. placeholder-style="font-size:28upx" />
  152. </uni-forms-item>
  153. <uni-forms-item label="座位数: ">
  154. <input class="uni-input-input textColor" placeholder="请输入座位数" maxlength="1"
  155. v-model="carInfo.seatCount" placeholder-style="font-size:28upx" />
  156. </uni-forms-item>
  157. <uni-forms-item label="排量: ">
  158. <input class="uni-input-input textColor" placeholder="请输入排量" v-model="carInfo.enginedesc"
  159. placeholder-style="font-size:28upx" />
  160. </uni-forms-item>
  161. <uni-forms-item label="功率: ">
  162. <input class="uni-input-input textColor" placeholder="请输入功率" v-model="carInfo.powerScale"
  163. placeholder-style="font-size:28upx" />
  164. </uni-forms-item>
  165. <uni-forms-item label="新车购置价: " required name="purchasePrice">
  166. <input class="uni-input-input textColor" placeholder="请输入新车购置价"
  167. v-model="carInfo.purchasePrice" placeholder-style="font-size:28upx"
  168. @blur="binddata('purchasePrice', $event.detail.value,'carForm')"
  169. @input="upperCaseType('purchasePrice')" />
  170. </uni-forms-item>
  171. <uni-forms-item label="是否过户: ">
  172. <view class="d-flex j-end a-c" style="height:100%">
  173. <u-switch v-model="carInfo.transferFlag" active-color="#0052FF " size="30"
  174. @change="transferFlagchange"></u-switch>
  175. </view>
  176. </uni-forms-item>
  177. </uni-forms>
  178. </view>
  179. </view>
  180. </view>
  181. <view class="Information">
  182. <text class="title">车主信息</text>
  183. <view class="collapse">
  184. <view class="top-ocr dis j-c a-c" v-show="!ownerimg">
  185. <image src="../../static/image/car-insure/Frame1.png" mode="">
  186. </image>
  187. <text @tap="ocrIdentify('ownerInfo')" style="margin-left: 5px;">点击上传/拍摄身份证 自动填写信息</text>
  188. </view>
  189. <view v-show="!ownersExpand && !ownerimg" class="btn-collapse dis a-c j-c"
  190. @click="expand('ownersExpand')">
  191. <text>展开手动输入车主信息</text>
  192. <u-icon name="arrow-down" size="30" color="rgb(60 60 60 / 60%)" style="margin-left: 5px;"></u-icon>
  193. </view>
  194. <view v-show="ownersExpand">
  195. <view v-show=" ownerimg" class="movable-view dis f-c a-c">
  196. <movable-area>
  197. <movable-view direction="all" out-of-bounds :scale="true">
  198. <image :src="ownerimg" mode=""
  199. :style="{width:'100%',height:'100%',transform:`rotate(-${user1deg}deg)`}">
  200. </image>
  201. </movable-view>
  202. </movable-area>
  203. <view class="operate-img dis j-s a-c">
  204. <view class="dis a-c" @tap="rotatefront('user1deg')">
  205. <image src="/static/image/car-insure/rotate1.png" mode=""></image>
  206. 左转
  207. </view>
  208. <view class="dis a-c" @tap="ocrIdentify('ownerInfo')">
  209. <image src="/static/image/car-insure/upload.png" mode=""></image>
  210. 上传
  211. </view>
  212. <view class="dis a-c" @tap="rotateback('user1deg')">
  213. <image src="/static/image/car-insure/rotate2.png" mode=""></image>
  214. 右转
  215. </view>
  216. </view>
  217. </view>
  218. <uni-forms :rules="ownerRules" :value="ownerInfo" ref="ownerForm" validate-trigger="bind"
  219. style="padding: 0 15px;" err-show-type="toast" label-width="80">
  220. <uni-forms-item name="name" required label="姓名: ">
  221. <input class="uni-input-input textColor" placeholder="请输入姓名" v-model="ownerInfo.name"
  222. maxlength="5" placeholder-style="font-size:28upx" />
  223. </uni-forms-item>
  224. <uni-forms-item name="identifyType" required label="证件类型:">
  225. <view class="dis a-c j-end" style="width:100%;height: 100%;">
  226. 身份证
  227. </view>
  228. </uni-forms-item>
  229. <uni-forms-item required name="identifyNumber" label="证件号: ">
  230. <input class="uni-input-input textColor" placeholder="请输入证件号"
  231. v-model="ownerInfo.identifyNumber" maxlength="18"
  232. @blur="binddata('identifyNumber', $event.detail.value,'ownerInfo')"
  233. placeholder-style="font-size:28upx" />
  234. </uni-forms-item>
  235. <uni-forms-item required name="age" label="年龄: ">
  236. <input class="uni-input-input textColor" disabled placeholder="请输入年龄"
  237. v-model="ownerInfo.age" maxlength="18" placeholder-style="font-size:28upx" />
  238. </uni-forms-item>
  239. <uni-forms-item name="gender" required label="性别:">
  240. <u-input v-model="ownerInfo.gender" type="select" :select-open="ownergenderShow"
  241. @click="ownergenderShow = true" :custom-style="{textAlign:'right'}"
  242. placeholder-style="color:#808080" placeholder="请选择性别" />
  243. <u-select mode="single-column" :list="genderList" v-model="ownergenderShow"
  244. @confirm="e=>genderConfirm(e,'ownerInfo')"></u-select>
  245. </uni-forms-item>
  246. <uni-forms-item required name="mobile" label="手机号: ">
  247. <input class="uni-input-input textColor" placeholder="请输入手机号" v-model="ownerInfo.mobile"
  248. maxlength="11" placeholder-style="font-size:28upx" />
  249. </uni-forms-item>
  250. <uni-forms-item required name="addr" label="地址: ">
  251. <u-input type="textarea" v-model="ownerInfo.addr" :custom-style="{textAlign:'right'}"
  252. placeholder-style="color:#808080" :auto-height="true" placeholder="请输入地址" />
  253. </uni-forms-item>
  254. <uni-forms-item name="email" label="邮箱: ">
  255. <input class="uni-input-input textColor" placeholder="请输入邮箱" v-model="ownerInfo.email"
  256. placeholder-style="font-size:28upx" />
  257. </uni-forms-item>
  258. <uni-forms-item required label="有效期起期" name="identifyValidDate">
  259. <u-input type="select" :select-open="ownerDateShow" v-model="ownerInfo.identifyValidDate"
  260. placeholder="请选择有效期起期" @click="ownerDateShow = true" :custom-style="{textAlign:'right'}"
  261. placeholder-style="color:#808080"></u-input>
  262. <u-picker v-model="ownerDateShow" mode="time" :params="params"
  263. @confirm="e=> Dateconfirm(e,'ownerInfo','identifyValidDate')"></u-picker>
  264. </uni-forms-item>
  265. <uni-forms-item required label="有效期止期" name="identifyValidEndDate">
  266. <u-input v-model="ownerInfo.identifyValidEndDate" :custom-style="{textAlign:'right'}"
  267. type="select" placeholder="请输入有效期止期" :select-open="ownerEndDateShow"
  268. placeholder-style="color:#808080" @click="ownerEndDateShow=true"></u-input>
  269. <u-select mode="single-column" :list="endDateList" v-model="ownerEndDateShow"
  270. @confirm="e=>endDateConfirm(e,'ownerInfo','identifyValidDate','identifyValidEndDate')"></u-select>
  271. </uni-forms-item>
  272. </uni-forms>
  273. </view>
  274. </view>
  275. </view>
  276. <view class="Information" style="padding-bottom: 10px;border-bottom: 1px solid #f2f2f2;">
  277. <view class=" dis j-s a-c">
  278. <text class="title">投保人信息</text>
  279. <view class="dis a-c j-c">
  280. <view class="status-data" :class="item.value==policyHolderholder? 'active':''"
  281. v-for="(item,index) in holderstatusList" @tap="applicantholderClick(item.value)" :key="index">
  282. {{item.label}}
  283. </view>
  284. </view>
  285. </view>
  286. <uni-forms :rules="policyHolderRules" :value="policyHolderInfo" ref="policyHolderForm"
  287. validate-trigger="bind" err-show-type="toast" label-width="80">
  288. <view v-show="policyHolderholder=='99'" class="collapse">
  289. <view class="top-ocr dis j-c a-c" v-show="!policyHolderimg">
  290. <image src="../../static/image/car-insure/Frame1.png" mode="">
  291. </image>
  292. <text @tap="ocrIdentify('policyHolderInfo')" style="margin-left: 5px;">点击上传/拍摄身份证 自动填写信息</text>
  293. </view>
  294. <view v-show="!policyHolderExpand && !policyHolderimg" class="btn-collapse dis a-c j-c"
  295. @click="expand('policyHolderExpand')">
  296. <text>展开手动输入投保人信息</text>
  297. <u-icon name="arrow-down" size="30" color="rgb(60 60 60 / 60%)"
  298. style="margin-left: 5px;"></u-icon>
  299. </view>
  300. <view v-show="policyHolderExpand">
  301. <view v-show=" policyHolderimg" class="movable-view dis f-c a-c">
  302. <movable-area>
  303. <movable-view direction="all" out-of-bounds :scale="true">
  304. <image :src="policyHolderimg" mode=""
  305. :style="{width:'100%',height:'100%',transform:`rotate(-${user2deg}deg)`}">
  306. </image>
  307. </movable-view>
  308. </movable-area>
  309. <view class="operate-img dis j-s a-c">
  310. <view class="dis a-c" @tap="rotatefront('user2deg')">
  311. <image src="/static/image/car-insure/rotate1.png" mode=""></image>
  312. 左转
  313. </view>
  314. <view class="dis a-c" @tap="ocrIdentify('policyHolderInfo')">
  315. <image src="/static/image/car-insure/upload.png" mode=""></image>
  316. 上传
  317. </view>
  318. <view class="dis a-c" @tap="rotateback('user2deg')">
  319. <image src="/static/image/car-insure/rotate2.png" mode=""></image>
  320. 右转
  321. </view>
  322. </view>
  323. </view>
  324. <view style="padding: 0 15px;">
  325. <uni-forms-item name="name" required label="姓名: ">
  326. <input class="uni-input-input textColor" placeholder="请输入姓名"
  327. v-model="policyHolderInfo.name" maxlength="5" placeholder-style="font-size:28upx" />
  328. </uni-forms-item>
  329. <uni-forms-item name="identifyType" required label="证件类型:">
  330. <view class="dis a-c j-end" style="width:100%;height: 100%;">
  331. 身份证
  332. </view>
  333. </uni-forms-item>
  334. <uni-forms-item required name="identifyNumber" label="证件号: ">
  335. <input class="uni-input-input textColor" placeholder="请输入证件号"
  336. v-model="policyHolderInfo.identifyNumber" maxlength="18"
  337. @blur="binddata('identifyNumber', $event.detail.value,'policyHolderInfo')"
  338. placeholder-style="font-size:28upx" />
  339. </uni-forms-item>
  340. <uni-forms-item required name="age" label="年龄: ">
  341. <input class="uni-input-input textColor" disabled placeholder="请输入年龄"
  342. v-model="policyHolderInfo.age" maxlength="18" placeholder-style="font-size:28upx" />
  343. </uni-forms-item>
  344. <uni-forms-item name="gender" required label="性别:">
  345. <u-input v-model="policyHolderInfo.gender" type="select"
  346. :select-open="applicantgenderShow" @click="applicantgenderShow = true"
  347. :custom-style="{textAlign:'right'}" placeholder-style="color:#808080"
  348. placeholder="请选择性别" />
  349. <u-select mode="single-column" :list="genderList" v-model="applicantgenderShow"
  350. @confirm="e=>genderConfirm(e,'policyHolderInfo')"></u-select>
  351. </uni-forms-item>
  352. <uni-forms-item required name="mobile" label="手机号: ">
  353. <input class="uni-input-input textColor" placeholder="请输入手机号"
  354. v-model="policyHolderInfo.mobile" maxlength="11"
  355. placeholder-style="font-size:28upx" />
  356. </uni-forms-item>
  357. <uni-forms-item required name="addr" label="地址: ">
  358. <u-input type="textarea" v-model="policyHolderInfo.addr"
  359. :custom-style="{textAlign:'right'}" placeholder-style="color:#808080"
  360. placeholder="请输入地址" />
  361. </uni-forms-item>
  362. <uni-forms-item name="email" label="邮箱: ">
  363. <input class="uni-input-input textColor" placeholder="请输入邮箱"
  364. v-model="policyHolderInfo.email" placeholder-style="font-size:28upx" />
  365. </uni-forms-item>
  366. <uni-forms-item required label="有效期起期" name="identifyValidDate">
  367. <u-input type="select" :select-open="applicantDateShow"
  368. v-model="policyHolderInfo.identifyValidDate" placeholder="请选择有效期起期"
  369. @click="applicantDateShow = true" :custom-style="{textAlign:'right'}"
  370. placeholder-style="color:#808080"></u-input>
  371. <u-picker v-model="applicantDateShow" mode="time" :params="params"
  372. @confirm="e=> Dateconfirm(e,'policyHolderInfo','identifyValidDate')"></u-picker>
  373. </uni-forms-item>
  374. <uni-forms-item required label="有效期止期" name="identifyValidEndDate">
  375. <u-input v-model="policyHolderInfo.identifyValidEndDate"
  376. :custom-style="{textAlign:'right'}" type="select" placeholder="请输入有效期止期"
  377. :select-open="applicantEndDateShow" placeholder-style="color:#808080"
  378. @click="applicantEndDateShow=true"></u-input>
  379. <u-select mode="single-column" :list="endDateList" v-model="applicantEndDateShow"
  380. @confirm="e=>endDateConfirm(e,'policyHolderInfo','identifyValidDate','identifyValidEndDate')"></u-select>
  381. </uni-forms-item>
  382. </view>
  383. </view>
  384. </view>
  385. </uni-forms>
  386. </view>
  387. <view class="Information " style="padding-bottom: 10px;border-bottom: 1px solid #f2f2f2;">
  388. <view class="dis j-s a-c">
  389. <text class="title">被保人信息</text>
  390. <view class="dis a-c j-c">
  391. <view class="status-data" :class="item.value==Insuredholder? 'active':''"
  392. v-for="(item,index) in insuredstatusList" @tap="InsuredholderClick(item.value)" :key="index">
  393. {{item.label}}
  394. </view>
  395. </view>
  396. </view>
  397. <uni-forms :rules="InsuredRules" :value="insuredPersonInfo" ref="InsuredForm" validate-trigger="bind"
  398. err-show-type="toast" label-width="80">
  399. <view v-show="Insuredholder=='99'" class="collapse">
  400. <view class="top-ocr dis j-c a-c" v-show="!Insuredimg">
  401. <image src="../../static/image/car-insure/Frame1.png" mode="">
  402. </image>
  403. <text @tap="ocrIdentify('insuredPersonInfo')" style="margin-left: 5px;">点击上传/拍摄身份证 自动填写信息</text>
  404. </view>
  405. <view v-show="!InsuredExpand && !Insuredimg" class="btn-collapse dis a-c j-c"
  406. @click="expand('InsuredExpand')">
  407. <text>展开手动输入被保人信息</text>
  408. <u-icon name="arrow-down" size="30" color="rgb(60 60 60 / 60%)"
  409. style="margin-left: 5px;"></u-icon>
  410. </view>
  411. <view v-show='InsuredExpand'>
  412. <view v-show=" Insuredimg" class="movable-view dis f-c a-c">
  413. <movable-area>
  414. <movable-view direction="all" out-of-bounds :scale="true">
  415. <image :src="Insuredimg" mode=""
  416. :style="{width:'100%',height:'100%',transform:`rotate(-${user3deg}deg)`}">
  417. </image>
  418. </movable-view>
  419. </movable-area>
  420. <view class="operate-img dis j-s a-c">
  421. <view class="dis a-c" @tap="rotatefront('user3deg')">
  422. <image src="/static/image/car-insure/rotate1.png" mode=""></image>
  423. 左转
  424. </view>
  425. <view class="dis a-c" @tap="ocrIdentify('insuredPersonInfo')">
  426. <image src="/static/image/car-insure/upload.png" mode=""></image>
  427. 上传
  428. </view>
  429. <view class="dis a-c" @tap="rotateback('user3deg')">
  430. <image src="/static/image/car-insure/rotate2.png" mode=""></image>
  431. 右转
  432. </view>
  433. </view>
  434. </view>
  435. <view style="padding: 0 15px;">
  436. <uni-forms-item name="name" required label="姓名: ">
  437. <input class="uni-input-input textColor" placeholder="请输入姓名"
  438. v-model="insuredPersonInfo.name" maxlength="5"
  439. placeholder-style="font-size:28upx" />
  440. </uni-forms-item>
  441. <uni-forms-item name="identifyType" required label="证件类型:">
  442. <view class="dis a-c j-end" style="width:100%;height: 100%;">
  443. 身份证
  444. </view>
  445. </uni-forms-item>
  446. <uni-forms-item required name="identifyNumber" label="证件号: ">
  447. <input class="uni-input-input textColor" placeholder="请输入证件号"
  448. v-model="insuredPersonInfo.identifyNumber" maxlength="18"
  449. @blur="binddata('identifyNumber', $event.detail.value,'insuredPersonInfo')"
  450. placeholder-style="font-size:28upx" />
  451. </uni-forms-item>
  452. <uni-forms-item required name="age" label="年龄: ">
  453. <input class="uni-input-input textColor" disabled placeholder="请输入年龄"
  454. v-model="insuredPersonInfo.age" maxlength="18"
  455. placeholder-style="font-size:28upx" />
  456. </uni-forms-item>
  457. <uni-forms-item name="gender" required label="性别:">
  458. <u-input v-model="insuredPersonInfo.gender" type="select"
  459. :select-open="InsuredgenderShow" @click="InsuredgenderShow = true"
  460. :custom-style="{textAlign:'right'}" placeholder-style="color:#808080"
  461. placeholder="请选择性别" />
  462. <u-select mode="single-column" :list="genderList" v-model="InsuredgenderShow"
  463. @confirm="e=>genderConfirm(e,'insuredPersonInfo')"></u-select>
  464. </uni-forms-item>
  465. <uni-forms-item required name="mobile" label="手机号: ">
  466. <input class="uni-input-input textColor" placeholder="请输入手机号"
  467. v-model="insuredPersonInfo.mobile" maxlength="11"
  468. placeholder-style="font-size:28upx" />
  469. </uni-forms-item>
  470. <uni-forms-item required name="addr" label="地址: ">
  471. <u-input type="textarea" v-model="insuredPersonInfo.addr"
  472. :custom-style="{textAlign:'right'}" :auto-height="true"
  473. placeholder-style="color:#808080" placeholder="请输入地址" />
  474. </uni-forms-item>
  475. <uni-forms-item name="email" label="邮箱: ">
  476. <input class="uni-input-input textColor" placeholder="请输入邮箱"
  477. v-model="insuredPersonInfo.email" placeholder-style="font-size:28upx" />
  478. </uni-forms-item>
  479. <uni-forms-item required label="有效期起期" name="identifyValidDate">
  480. <u-input type="select" :select-open="InsuredDateShow"
  481. v-model="insuredPersonInfo.identifyValidDate" placeholder="请选择有效期起期"
  482. @click="InsuredDateShow = true" :custom-style="{textAlign:'right'}"
  483. placeholder-style="color:#808080"></u-input>
  484. <u-picker v-model="InsuredDateShow" mode="time" :params="params"
  485. @confirm="e=> Dateconfirm(e,'insuredPersonInfo','identifyValidDate')"></u-picker>
  486. </uni-forms-item>
  487. <uni-forms-item required label="有效期止期" name="identifyValidEndDate">
  488. <u-input v-model="insuredPersonInfo.identifyValidEndDate"
  489. :custom-style="{textAlign:'right'}" type="select" placeholder="请输入有效期止期"
  490. :select-open="InsuredEndDateShow" placeholder-style="color:#808080"
  491. @click="InsuredEndDateShow=true"></u-input>
  492. <u-select mode="single-column" :list="endDateList" v-model="InsuredEndDateShow"
  493. @confirm="e=>endDateConfirm(e,'insuredPersonInfo','identifyValidDate','identifyValidEndDate')"></u-select>
  494. </uni-forms-item>
  495. </view>
  496. </view>
  497. </view>
  498. </uni-forms>
  499. </view>
  500. <view class="footer-btn">
  501. <u-button type="primary" style="background:#0052FF;" @tap="next">下一步</u-button>
  502. </view>
  503. <OCRComponent :showModal='OCRShow' @closePopup="closePopup" :tabslist="tabslist" @tabschange="OCRtabschange"
  504. :tabsCurrent="tabsCurrent" :checkType='checkType' @carCallback="carCallback"
  505. @ownerInfoCallback="ownerInfoCallback" @applicantInfoCallback="applicantInfoCallback"
  506. @InsuredInfoCallback="InsuredInfoCallback">
  507. </OCRComponent>
  508. </view>
  509. </template>
  510. <script>
  511. import OCRComponent from '@/components/modules/carInsure/OCRComponent/OCRComponent.vue'; //引用图片信息检查插件
  512. import {
  513. getAgeByIdCard
  514. } from '@/plugins/utils';
  515. var dateTime = new Date();
  516. let Year = dateTime.getFullYear();
  517. let Month = Number(dateTime.getMonth() + 1);
  518. export default {
  519. components: {
  520. OCRComponent
  521. },
  522. data() {
  523. return {
  524. carInfo: {
  525. licenseNo: "", //车牌号
  526. brandName: "", //车辆品牌型号
  527. vinNo: "", //车架号
  528. engineNo: "", //发动机号
  529. modelCode: "", //车型编码
  530. seatCount: "0", //核定载客量 核定载人数
  531. purchasePrice: "", //新车购置价最低,行业实际价值,协商价值
  532. carBrand: "", //车型品牌
  533. ciCarName: "", //行业车型名称
  534. ciModelCode: "", //行业车型编码
  535. completeKerbMass: "", //整备质量
  536. exhaustScale: "", //排量
  537. factory: "", //工厂名称
  538. factoryid: "", //工厂编码
  539. frameNo: "", //车架号
  540. licenseTypeCode: "02", //号牌种类
  541. vehicleclass: "", //车辆类型
  542. familyName: "", //车型
  543. modelcname: "", //车型名称
  544. powertypecode: "", //燃料类型编码
  545. vehicleweight: "", //总质量
  546. limitLoad: "", //核定载质量
  547. caryear: "0", //年款
  548. cimodelclass: "A0", //车辆种类
  549. powertype: "汽油", //燃料类型
  550. energyType: "0", //能源种类
  551. enginedesc: "", //排量
  552. powerScale: "", //功率
  553. registerDate: "", //注册日期
  554. issueDate: "", //发证日期
  555. transferFlag: false, //过户标志
  556. transferFlagBi: false, //商业过户标志
  557. transferDate: "", //过户日期
  558. loanStatus: 0, //贷款标志
  559. firstBeneMan: "", //第一受益人
  560. noLicenseFlag: false, //是否新车
  561. cartype: "K33", //客车A0 货车H0          
  562. carnature: "02", //使用性质 家庭自用8A 非营业企业8B 非营业党政机关,事业团体8C 非营业货车8D
  563. property: "1", //所属性质 1个人 2企业 3个人
  564. outOfInsurance: false, //脱保
  565. usedCar: false, //二手车
  566. vehicleUse: "05" //车辆用途
  567. },
  568. ownerInfo: {
  569. name: "",
  570. identifyType: "01",
  571. identifyNumber: "",
  572. addr: "",
  573. gender: "", //性别
  574. email: "", //邮箱
  575. mobile: "",
  576. identifyValidDate: "", //有效期起期
  577. identifyValidEndDate: "", //有效期止期
  578. age: "", //年龄
  579. },
  580. policyHolderInfo: {
  581. name: "",
  582. identifyType: "01",
  583. identifyNumber: "",
  584. addr: "",
  585. gender: "", //性别
  586. email: "",
  587. mobile: "",
  588. identifyValidDate: "", //有效期起期
  589. identifyValidEndDate: "", //有效期止期
  590. age: "", //年龄
  591. },
  592. insuredPersonInfo: {
  593. name: "",
  594. identifyType: "01",
  595. identifyNumber: "",
  596. addr: "",
  597. gender: "", //性别
  598. email: "",
  599. mobile: "",
  600. identifyValidDate: "", //有效期起期
  601. identifyValidEndDate: "", //有效期止期
  602. age: "", //年龄
  603. },
  604. //影像信息
  605. riskList: [], //交强险和商业险的选择
  606. kindList: [], //商业险险种的选择
  607. carInfoPositiveList: [], //车辆
  608. ownerInfoPositiveList: [], //车主
  609. policyHolderInfoPositiveList: [], //投保人
  610. insuredPersonInfoPositiveList: [], //被保人
  611. //影像信息
  612. carimg: "", //显示图片
  613. ownerimg: "", //显示图片
  614. policyHolderimg: "", //显示图片
  615. Insuredimg: "", //显示图片
  616. OCRShow: false,
  617. tabsCurrent: 0,
  618. checkType: "carInfo", //组件类型
  619. tabslist: [{
  620. name: '行驶证识别'
  621. }],
  622. params: {
  623. year: true, //年
  624. month: true, //月
  625. day: true, //日
  626. hour: false, //时
  627. minute: false, //分
  628. second: false, //秒
  629. },
  630. errorType: ['message', 'toast'],
  631. carRules: {
  632. frameNo: {
  633. rules: [{
  634. required: true,
  635. errorMessage: '请输入车辆识别码',
  636. }, {
  637. pattern: /^([0-9A-Z]){17}$/,
  638. errorMessage: '请输入正确的车辆识别码',
  639. }]
  640. },
  641. modelcname: {
  642. rules: [{
  643. required: true,
  644. errorMessage: '请输入品牌型号',
  645. }, ]
  646. },
  647. engineNo: {
  648. rules: [{
  649. required: true,
  650. errorMessage: '请输入发动机号',
  651. }, ]
  652. },
  653. purchasePrice: {
  654. rules: [{
  655. required: true,
  656. errorMessage: '请输入新车购置价',
  657. }, {
  658. validateField: function(rule, value, data, callback) {
  659. if (value == 0) {
  660. callback('新车购置价不能为零')
  661. }
  662. return true
  663. }
  664. }]
  665. },
  666. completeKerbMass: {
  667. rules: [{
  668. required: true,
  669. errorMessage: '请输入整备质量',
  670. }, ]
  671. },
  672. carnature: {
  673. rules: [{
  674. required: true,
  675. errorMessage: '使用性质必选',
  676. }, ]
  677. },
  678. vehicleUse: {
  679. rules: [{
  680. required: true,
  681. errorMessage: '车辆用途必选',
  682. }, ]
  683. },
  684. registerDate: {
  685. rules: [{
  686. required: true,
  687. errorMessage: '请选择注册日期',
  688. }, {
  689. pattern: /^\d{4}-\d{2}-\d{2}$/,
  690. errorMessage: '注册日期格式错误',
  691. }]
  692. },
  693. issueDate: {
  694. rules: [{
  695. required: true,
  696. errorMessage: '请选择发证日期',
  697. }, {
  698. pattern: /^\d{4}-\d{2}-\d{2}$/,
  699. errorMessage: '发证日期日期格式错误',
  700. }]
  701. }
  702. },
  703. ownerRules: {
  704. name: {
  705. rules: [{
  706. required: true,
  707. errorMessage: '请输入车主姓名',
  708. },
  709. {
  710. minLength: 2,
  711. maxLength: 5,
  712. errorMessage: '车主姓名长度在 {minLength} 到 {maxLength} 个字符',
  713. },
  714. {
  715. pattern: /^([\u4e00-\u9fa5]{1,6}|[a-zA-Z\.\s]{1,6})$/,
  716. errorMessage: '请输入正确的车主姓名',
  717. }
  718. ]
  719. },
  720. identifyNumber: {
  721. rules: [{
  722. required: true,
  723. errorMessage: '请输入车主证件号',
  724. },
  725. {
  726. pattern: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  727. errorMessage: '请输入正确的车主证件号',
  728. }
  729. ]
  730. },
  731. mobile: {
  732. rules: [{
  733. required: true,
  734. errorMessage: '请输入车主手机号',
  735. },
  736. {
  737. pattern: /^1[3-9]\d{9}$/,
  738. errorMessage: '请输入正确的手机号',
  739. }
  740. ]
  741. },
  742. addr: {
  743. rules: [{
  744. required: true,
  745. errorMessage: '请输入车主地址',
  746. },
  747. {
  748. minLength: 8,
  749. maxLength: 40,
  750. errorMessage: '车主地址长度在 {minLength} 到 {maxLength} 个字符',
  751. },
  752. ]
  753. },
  754. identifyValidDate: {
  755. rules: [{
  756. required: true,
  757. errorMessage: '请选择身份证起期',
  758. }, {
  759. pattern: /^\d{4}-\d{2}-\d{2}$/,
  760. errorMessage: '身份证起期格式错误',
  761. }]
  762. },
  763. identifyValidEndDate: {
  764. rules: [{
  765. required: true,
  766. errorMessage: '请选择身份证止期',
  767. }, {
  768. pattern: /^\d{4}-\d{2}-\d{2}$/,
  769. errorMessage: '身份证止期格式错误',
  770. }]
  771. },
  772. },
  773. policyHolderRules: {
  774. name: {
  775. rules: [{
  776. required: true,
  777. errorMessage: '请输入投保人姓名',
  778. },
  779. {
  780. minLength: 2,
  781. maxLength: 5,
  782. errorMessage: '投保人姓名长度在 {minLength} 到 {maxLength} 个字符',
  783. },
  784. {
  785. pattern: /^([\u4e00-\u9fa5]{1,6}|[a-zA-Z\.\s]{1,6})$/,
  786. errorMessage: '请输入正确的投保人姓名',
  787. }
  788. ]
  789. },
  790. identifyNumber: {
  791. rules: [{
  792. required: true,
  793. errorMessage: '请输入投保人证件号',
  794. },
  795. {
  796. pattern: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  797. errorMessage: '请输入正确的投保人证件号',
  798. }
  799. ]
  800. },
  801. mobile: {
  802. rules: [{
  803. required: true,
  804. errorMessage: '请输入投保人手机号',
  805. },
  806. {
  807. pattern: /^1[3-9]\d{9}$/,
  808. errorMessage: '请输入正确的手机号',
  809. }
  810. ]
  811. },
  812. addr: {
  813. rules: [{
  814. required: true,
  815. errorMessage: '请输入投保人地址',
  816. },
  817. {
  818. minLength: 8,
  819. maxLength: 40,
  820. errorMessage: '投保人地址长度在 {minLength} 到 {maxLength} 个字符',
  821. },
  822. ]
  823. },
  824. identifyValidDate: {
  825. rules: [{
  826. required: true,
  827. errorMessage: '请选择身份证起期',
  828. }, {
  829. pattern: /^\d{4}-\d{2}-\d{2}$/,
  830. errorMessage: '身份证起期格式错误',
  831. }]
  832. },
  833. identifyValidEndDate: {
  834. rules: [{
  835. required: true,
  836. errorMessage: '请选择身份证止期',
  837. }, {
  838. pattern: /^\d{4}-\d{2}-\d{2}$/,
  839. errorMessage: '身份证止期格式错误',
  840. }]
  841. },
  842. },
  843. InsuredRules: {
  844. name: {
  845. rules: [{
  846. required: true,
  847. errorMessage: '请输入被保人姓名',
  848. },
  849. {
  850. minLength: 2,
  851. maxLength: 5,
  852. errorMessage: '被保人姓名长度在 {minLength} 到 {maxLength} 个字符',
  853. },
  854. {
  855. pattern: /^([\u4e00-\u9fa5]{1,6}|[a-zA-Z\.\s]{1,6})$/,
  856. errorMessage: '请输入正确的被保人姓名',
  857. }
  858. ]
  859. },
  860. identifyNumber: {
  861. rules: [{
  862. required: true,
  863. errorMessage: '请输入被保人证件号',
  864. },
  865. {
  866. pattern: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  867. errorMessage: '请输入正确的被保人证件号',
  868. }
  869. ]
  870. },
  871. mobile: {
  872. rules: [{
  873. required: true,
  874. errorMessage: '请输入被保人手机号',
  875. },
  876. {
  877. pattern: /^(13[0-9]|14[01456879]|15[0-3,5-9]|16[2567]|17[0-8]|18[0-9]|19[0-3,5-9])\d{8}$/,
  878. errorMessage: '请输入正确的手机号',
  879. }
  880. ]
  881. },
  882. addr: {
  883. rules: [{
  884. required: true,
  885. errorMessage: '请输入被保人地址',
  886. },
  887. {
  888. minLength: 8,
  889. maxLength: 40,
  890. errorMessage: '被保人地址长度在 {minLength} 到 {maxLength} 个字符',
  891. },
  892. ]
  893. },
  894. identifyValidDate: {
  895. rules: [{
  896. required: true,
  897. errorMessage: '请选择身份证起期',
  898. }, {
  899. pattern: /^\d{4}-\d{2}-\d{2}$/,
  900. errorMessage: '身份证起期格式错误',
  901. }]
  902. },
  903. identifyValidEndDate: {
  904. rules: [{
  905. required: true,
  906. errorMessage: '请选择身份证止期',
  907. }, {
  908. pattern: /^\d{4}-\d{2}-\d{2}$/,
  909. errorMessage: '身份证止期格式错误',
  910. }]
  911. },
  912. },
  913. endYear: Year,
  914. endMonth: Month,
  915. ownergenderShow: false, //性别选择
  916. applicantgenderShow: false, //性别选择
  917. InsuredgenderShow: false, //性别选择
  918. registerDateShow: false, //注册日期
  919. issueDateShow: false, //发证日期
  920. transferDateShow: false, //转移登记日期
  921. ownerDateShow: false, //
  922. ownerEndDateShow: false, //止期选择
  923. applicantDateShow: false, //
  924. applicantEndDateShow: false, //止期选择
  925. InsuredDateShow: false, //
  926. InsuredEndDateShow: false, //止期选择
  927. identifyType: "身份证",
  928. carExpand: false,
  929. ownersExpand: false,
  930. policyHolderExpand: false,
  931. InsuredExpand: false,
  932. carInfoShow: true, //车辆信息显示
  933. headerText: '信息录入',
  934. headerStyle: {
  935. backgroundColor: 'transparent',
  936. },
  937. prevScrollTop: 0,
  938. policyHolderholder: "1",
  939. Insuredholder: "2",
  940. holderstatusList: [{
  941. label: '同车主',
  942. value: "1",
  943. },
  944. {
  945. label: '其他人',
  946. value: "99",
  947. },
  948. ],
  949. insuredstatusList: [{
  950. label: '同车主',
  951. value: '1',
  952. },
  953. {
  954. label: '同投保人',
  955. value: '2',
  956. },
  957. {
  958. label: '其他人',
  959. value: '99',
  960. },
  961. ],
  962. endDateList: [{
  963. label: '10年',
  964. value: "10年"
  965. },
  966. {
  967. label: '20年',
  968. value: "20年"
  969. },
  970. {
  971. label: '长期',
  972. value: "长期"
  973. },
  974. ],
  975. genderList: [{
  976. label: '男',
  977. value: "男"
  978. },
  979. {
  980. label: '女',
  981. value: "女"
  982. },
  983. ],
  984. cardeg: 0, //旋转角度
  985. user1deg: 0, //旋转角度
  986. user2deg: 0, //旋转角度
  987. user3deg: 0, //旋转角度
  988. routepage: "",
  989. carInfo1: {
  990. carnature: "非营业",
  991. energyType: "燃油",
  992. vehicleUse: "家庭自用",
  993. cartype: "轿车",
  994. cimodelclass: "客车",
  995. },
  996. carnatureShow: false, //使用性质
  997. energyTypeShow: false, //能源种类
  998. vehicleUseShow: false, //车辆用途
  999. cartypeShow: false, //车辆类型
  1000. cimodelclassShow: false, //车辆种类
  1001. natureOfVehicleUseoptions: [],
  1002. vehicleTypeoptions: [],
  1003. trafficManagementVehicleTypeoptions: [],
  1004. energyTypeoptions: [],
  1005. businessVehicleUseoptions: [],
  1006. outOfBusinessVehicleUseoptions: [],
  1007. }
  1008. },
  1009. watch: {
  1010. checkType: {
  1011. handler(val) {
  1012. switch (val) {
  1013. case 'carInfo':
  1014. this.tabslist = [{
  1015. name: '行驶证识别'
  1016. }]
  1017. break;
  1018. default:
  1019. this.tabslist = [{
  1020. name: '证件识别'
  1021. }]
  1022. break;
  1023. }
  1024. },
  1025. deep: true
  1026. }
  1027. },
  1028. onShow() {
  1029. },
  1030. onLoad(params) {
  1031. let pages = getCurrentPages(); // 当前页面路由
  1032. if (pages.length > 1) {
  1033. let beforePage = pages[pages.length - 2].route; // 上一个页面路由
  1034. this.routepage = beforePage;
  1035. }
  1036. if (!!params.licenseNo) {
  1037. this.carExpand = true;
  1038. this.carInfo.licenseNo = decodeURIComponent(params.licenseNo);
  1039. } else {
  1040. const eventChannel = this.getOpenerEventChannel()
  1041. eventChannel.on('acceptData', (data) => {
  1042. console.log(data);
  1043. if (!!data) {
  1044. let info = JSON.parse(JSON.stringify(data));
  1045. let page = this.routepage;
  1046. switch (page) {
  1047. case 'pages/carInsure2/entry':
  1048. this.carInfoShow = false;
  1049. this.carInfo = info.carInfo; //车辆信息
  1050. this.ownerInfo.name = info.carInfo.carOwner; //车主
  1051. this.carInfoPositiveList = info.carInfoPositiveList; //车辆
  1052. break;
  1053. case 'pages/carInsure2/quote':
  1054. case 'pages/carInsure2/quoteDetail':
  1055. this.carInfo = info.carInfo; //车辆信息
  1056. this.ownerInfo = info.ownerInfo; //车主信息
  1057. this.policyHolderInfo = info.policyHolderInfo; //投保人信息
  1058. this.insuredPersonInfo = info.insuredPersonInfo; //被保人信息
  1059. this.riskList = info.riskList; //险种大类
  1060. this.kindList = info.kindList; //商业险险别
  1061. this.carInfoPositiveList = info.carInfoPositiveList; //车辆
  1062. this.ownerInfoPositiveList = info.ownerInfoPositiveList; //车主
  1063. this.policyHolderInfoPositiveList = info.policyHolderInfoPositiveList; //投保
  1064. this.insuredPersonInfoPositiveList = info.insuredPersonInfoPositiveList; //被保人
  1065. this.carExpand = true;
  1066. this.ownersExpand = true;
  1067. this.policyHolderExpand = true;
  1068. this.InsuredExpand = true;
  1069. this.policyHolderholder = "99";
  1070. this.Insuredholder = "99";
  1071. break;
  1072. default:
  1073. break;
  1074. }
  1075. }
  1076. })
  1077. }
  1078. this.getDicType("businessVehicleUse"); //车辆用途(营业)
  1079. this.getDicType("outOfBusinessVehicleUse"); //车辆用途(非营业)
  1080. this.getDicType("natureOfVehicleUse"); //车辆性质
  1081. this.getDicType("vehicleType"); //车辆种类
  1082. this.getDicType("trafficManagementVehicleType"); //车辆类型
  1083. this.getDicType("energyType"); //能源种类
  1084. },
  1085. onPageScroll(e) {
  1086. this.handleScroll(e);
  1087. },
  1088. mounted() {
  1089. uni.pageScrollTo({
  1090. scrollTop: 0,
  1091. duration: 0
  1092. });
  1093. uni.$on('scroll', this.handleScroll);
  1094. },
  1095. destroyed() {
  1096. uni.$off('scroll', this.handleScroll);
  1097. },
  1098. methods: {
  1099. async getDicType(type) {
  1100. let res = await this.$http.get('/sysDict/dictDetails/' + type);
  1101. if (res.code == 200) {
  1102. this[type + 'options'] = res.data.ddList;
  1103. // if (type == "trafficManagementVehicleType") {
  1104. // this.carInfo1.cartype = this.dictionaryMatching(this.trafficManagementVehicleTypeoptions, this
  1105. // .carInfo
  1106. // .cartype)
  1107. // this.carInfo1.cimodelclass = this.dictionaryMatching(this.vehicleTypeoptions,
  1108. // this
  1109. // .carInfo
  1110. // .cimodelclass)
  1111. // }
  1112. }
  1113. },
  1114. dictionaryConfirm(e, name) {
  1115. if (name == 'carnature') {
  1116. this.carInfo1['vehicleUse'] = "";
  1117. }
  1118. this.carInfo[name] = e[0].value;
  1119. this.carInfo1[name] = e[0].label;
  1120. },
  1121. async toChooseVin(cctype) {
  1122. if (cctype == '' || cctype == null) {
  1123. return uni.showToast({
  1124. icon: 'none',
  1125. title: '请输入车架号',
  1126. duration: 1500
  1127. });
  1128. } else {
  1129. if (!this.isFrameno(cctype.trim())) {
  1130. return uni.showToast({
  1131. title: '请输入正确的车辆识别码',
  1132. icon: "none"
  1133. });
  1134. }
  1135. this.navigate({
  1136. url: '/pages/carInsure2/carType?frameNo=' + encodeURIComponent(cctype)
  1137. }, "navigateTo", true);
  1138. }
  1139. },
  1140. //跳转选择车辆类型页面
  1141. toChooseVehicleType(cctype) {
  1142. if (cctype == '' || cctype == null) {
  1143. uni.showToast({
  1144. icon: 'none',
  1145. title: '请输入车型名称',
  1146. duration: 1500
  1147. });
  1148. } else {
  1149. let cctypeName = cctype.replace(/[^u4e00-u9fa5|,]+/ig, '')
  1150. this.navigate({
  1151. url: '/pages/carInsure2/carType?modelName=' + encodeURIComponent(cctypeName)
  1152. }, "navigateTo", true);
  1153. }
  1154. },
  1155. //验证车架号
  1156. isFrameno(str) {
  1157. let mPattern = /^([0-9A-Z]){17}$/;
  1158. return mPattern.test(str);
  1159. },
  1160. rotatefront(int) {
  1161. this[int] = this[int] == 270 ? 0 : this[int] + 90;
  1162. },
  1163. rotateback(int) {
  1164. this[int] = this[int] == 0 ? 270 : this[int] - 90;
  1165. },
  1166. onMove(e) {
  1167. this.x = e.detail.x;
  1168. this.y = e.detail.y;
  1169. },
  1170. //OC识别返回信息
  1171. carCallback(obj) {
  1172. this.carimg = obj.img;
  1173. this.carInfoPositiveList = obj.ImgList;
  1174. Object.assign(this.carInfo, obj.Info);
  1175. this.OCRShow = false;
  1176. this.carExpand = true;
  1177. },
  1178. ownerInfoCallback(obj) {
  1179. console.log(obj);
  1180. this.ownerimg = obj.img;
  1181. this.ownerInfoPositiveList = obj.ImgList;
  1182. Object.assign(this.ownerInfo, obj.Info);
  1183. this.OCRShow = false;
  1184. this.ownersExpand = true;
  1185. },
  1186. applicantInfoCallback(obj) {
  1187. console.log(obj);
  1188. this.policyHolderimg = obj.img;
  1189. this.policyHolderInfoPositiveList = obj.ImgList;
  1190. Object.assign(this.policyHolderInfo, obj.Info);
  1191. this.OCRShow = false;
  1192. this.policyHolderExpand = true;
  1193. },
  1194. InsuredInfoCallback(obj) {
  1195. console.log(obj);
  1196. this.Insuredimg = obj.img;
  1197. this.insuredPersonInfoPositiveList = obj.ImgList;
  1198. Object.assign(this.insuredPersonInfo, obj.Info);
  1199. this.OCRShow = false;
  1200. this.InsuredExpand = true;
  1201. },
  1202. OCRtabschange(e) {
  1203. this.tabsCurrent = e;
  1204. },
  1205. closePopup() {
  1206. this.OCRShow = false;
  1207. },
  1208. ocrIdentify(name) {
  1209. this.checkType = name;
  1210. this.OCRShow = !this.OCRShow;
  1211. },
  1212. transferFlagchange(status) {
  1213. if (status) {
  1214. this.carInfo.transferDate = this.carInfo.issueDate;
  1215. } else {
  1216. this.carInfo.transferDate = ""
  1217. }
  1218. },
  1219. binddata(name, value, type) {
  1220. if (name == 'identifyNumber') {
  1221. this[type].age = getAgeByIdCard(value)
  1222. }
  1223. },
  1224. //转变大写(车型/车架号/发动机号)
  1225. upperCaseType(type) {
  1226. this.carInfo[type] = this.carInfo[type].toUpperCase();
  1227. if (type == 'frameNo') {
  1228. this.carInfo.vinNo = this.carInfo.frameNo.trim();
  1229. }
  1230. },
  1231. //身份证止期(10/20/长期)处理
  1232. endDateConfirm(e, obj, param1, param2) {
  1233. switch (e[0].label) {
  1234. case '10年':
  1235. this[obj][param2] = this.endDateInt(this[obj][param1], 10)
  1236. break;
  1237. case '20年':
  1238. this[obj][param2] = this.endDateInt(this[obj][param1], 20)
  1239. break;
  1240. case '长期':
  1241. this[obj][param2] = "9999-12-31"
  1242. break;
  1243. default:
  1244. }
  1245. },
  1246. Dateconfirm(e, obj, param) {
  1247. this[obj][param] = e.year + '-' + e.month + '-' + e.day;
  1248. },
  1249. //性别匹配
  1250. genderConfirm(val, name) {
  1251. this[name].gender = val[0].label;
  1252. },
  1253. //(同车主/同投保人)数据处理
  1254. setPersonInfoAndImageType(sourceInfo, targetInfo, imageType) {
  1255. let obj = Object.assign({}, this[sourceInfo]);
  1256. this[targetInfo] = obj;
  1257. if (this[sourceInfo + 'PositiveList'].length > 0) {
  1258. this[targetInfo + 'PositiveList'] = JSON.parse(JSON.stringify(this[sourceInfo + 'PositiveList']));
  1259. if (this[targetInfo + 'PositiveList'].length == 1) {
  1260. this[targetInfo + 'PositiveList'][0].imageType = imageType;
  1261. } else {
  1262. this[targetInfo + 'PositiveList'][0].imageType = imageType;
  1263. this[targetInfo + 'PositiveList'][1].imageType = `D${imageType.substr(1)}`;
  1264. }
  1265. }
  1266. },
  1267. //校验事件
  1268. next() {
  1269. //投保人同车主
  1270. if (this.policyHolderholder == '1') {
  1271. this.setPersonInfoAndImageType('ownerInfo', 'policyHolderInfo', "C03");
  1272. }
  1273. if (this.Insuredholder == '1') {
  1274. this.setPersonInfoAndImageType('ownerInfo', 'insuredPersonInfo', "C04");
  1275. }
  1276. if (this.Insuredholder == '2') {
  1277. this.setPersonInfoAndImageType('policyHolderInfo', 'insuredPersonInfo', "C04");
  1278. }
  1279. if (this.ownerInfo.name && this.policyHolderInfo.name && this.insuredPersonInfo.name) {
  1280. this.navigate({
  1281. url: '/pages/carInsure2/insureItems',
  1282. success: (res) => {
  1283. res.eventChannel.emit(
  1284. "acceptData", {
  1285. carInfo: this
  1286. .carInfo,
  1287. ownerInfo: this
  1288. .ownerInfo,
  1289. policyHolderInfo: this
  1290. .policyHolderInfo,
  1291. insuredPersonInfo: this
  1292. .insuredPersonInfo,
  1293. riskList: this
  1294. .riskList,
  1295. kindList: this
  1296. .kindList,
  1297. carInfoPositiveList: this
  1298. .carInfoPositiveList, //车辆
  1299. ownerInfoPositiveList: this
  1300. .ownerInfoPositiveList, //车主
  1301. policyHolderInfoPositiveList: this
  1302. .policyHolderInfoPositiveList, //投保人
  1303. insuredPersonInfoPositiveList: this
  1304. .insuredPersonInfoPositiveList, //被保人
  1305. })
  1306. }
  1307. }, "navigateTo", true);
  1308. } else {
  1309. this.$refs.carForm.submit().then(res => {
  1310. this.$refs.ownerForm.submit().then(res1 => {
  1311. this.$refs.policyHolderForm.submit().then(res2 => {
  1312. this.$refs.InsuredForm.submit().then(res3 => {}).catch(err => {
  1313. console.log('表单错误信息:', err);
  1314. })
  1315. }).catch(err => {
  1316. console.log('表单错误信息:', err);
  1317. })
  1318. }).catch(err => {})
  1319. }).catch(err => {})
  1320. }
  1321. },
  1322. expand(int) {
  1323. this[int] = true;
  1324. },
  1325. //投保人同车主
  1326. applicantholderClick(value) {
  1327. this.policyHolderholder = value;
  1328. if (value == '99') {
  1329. for (let key in this.policyHolderInfo) {
  1330. if (key !== 'identifyType') {
  1331. this.policyHolderInfo[key] = '';
  1332. }
  1333. }
  1334. }
  1335. },
  1336. //被保人同车主/投保人
  1337. InsuredholderClick(value) {
  1338. this.Insuredholder = value;
  1339. if (value == '99') {
  1340. for (let key in this.insuredPersonInfo) {
  1341. if (key !== 'identifyType') {
  1342. this.insuredPersonInfo[key] = '';
  1343. }
  1344. }
  1345. }
  1346. },
  1347. //头部颜色变化js
  1348. handleScroll(e) {
  1349. const scrollTop = e.scrollTop;
  1350. let opacity = 1;
  1351. let shadowOpacity = 0;
  1352. if (scrollTop > this.prevScrollTop) {
  1353. // 向下滚动
  1354. opacity = Math.min((scrollTop - 50) / 100, 1); // 根据滚动距离计算透明度,最大为1
  1355. shadowOpacity = Math.min((scrollTop - 50) / 500, 0.3); // 根据滚动距离计算阴影透明度,最大为0.3
  1356. } else if (scrollTop < 50) {
  1357. // 在顶部附近,设置透明度和阴影透明度均为0
  1358. opacity = 0;
  1359. shadowOpacity = 0;
  1360. } else {
  1361. // 向上滚动
  1362. opacity = Math.max(0, 1 - (scrollTop / 100)); // 根据滚动距离计算透明度,最小为0
  1363. shadowOpacity = Math.max(0, 0.3 - (scrollTop / 500)); // 根据滚动距离计算阴影透明度,最小为0
  1364. }
  1365. const rgbaOpacity = opacity * 100; // 将透明度转换为百分比形式
  1366. const backgroundColor = `rgb(255 255 255 / ${rgbaOpacity}%)`; // 根据透明度设置背景颜色
  1367. // 计算阴影的颜色和大小
  1368. const shadowBlur = shadowOpacity * 10; // 阴影模糊程度为阴影透明度的10像素
  1369. const shadowColor = `rgba(218, 227, 244, ${shadowOpacity})`; // 阴影颜色为黑色,透明度根据阴影透明度计算
  1370. const boxShadow = `0 0 ${shadowBlur}px ${shadowColor}`; // 生成box-shadow属性值
  1371. this.headerStyle.backgroundColor = backgroundColor;
  1372. this.headerStyle.boxShadow = boxShadow;
  1373. this.prevScrollTop = scrollTop;
  1374. },
  1375. //页面返回按钮
  1376. back() {
  1377. uni.navigateBack({
  1378. delta: 1, // 返回的页面数,如果是1表示返回上一页
  1379. success: function() {}
  1380. });
  1381. },
  1382. endDateInt(time, sum) {
  1383. let currentDate = new Date(time);
  1384. currentDate.setFullYear(currentDate.getFullYear() + sum);
  1385. let year = currentDate.getFullYear();
  1386. let month = ('0' + (currentDate.getMonth() + 1)).slice(-2);
  1387. let day = ('0' + currentDate.getDate()).slice(-2);
  1388. let formattedDate = year + '-' + month + '-' + day;
  1389. return formattedDate;
  1390. }
  1391. },
  1392. }
  1393. </script>
  1394. <style lang="scss" scoped>
  1395. .uni-forms-item ::v-deep .uni-input-input {
  1396. text-align: end;
  1397. }
  1398. .uni-forms-item ::v-deep .u-input__textarea {
  1399. min-height: auto !important;
  1400. }
  1401. ::v-deep .uni-forms-item {
  1402. border-bottom: 1px solid #f2f2f2;
  1403. }
  1404. ::v-deep .uni-forms-item:last-child {
  1405. border: none;
  1406. }
  1407. .page {
  1408. height: auto;
  1409. background: #F8FAFE;
  1410. padding: 12px 16px 50px 16px;
  1411. }
  1412. .fixed {
  1413. position: fixed;
  1414. top: 0;
  1415. left: 0;
  1416. width: 100%;
  1417. height: auto;
  1418. background-color: transparent;
  1419. padding: 50px 16px 16px 16px;
  1420. z-index: 99;
  1421. transition: background-color 0.2s;
  1422. text {
  1423. font-size: 18px;
  1424. font-weight: bold;
  1425. }
  1426. }
  1427. .banner {
  1428. width: 100%;
  1429. height: 168px;
  1430. background-image: url("/static/image/car-insure/carban2.png");
  1431. background-size: cover;
  1432. background-position: center;
  1433. }
  1434. .Information {
  1435. width: 100%;
  1436. height: auto;
  1437. margin-bottom: 24px;
  1438. .title {
  1439. font-size: 15px;
  1440. font-weight: bold;
  1441. }
  1442. .collapse {
  1443. width: 100%;
  1444. height: auto;
  1445. background: #FFFFFF;
  1446. margin-top: 10px;
  1447. box-shadow: 0px 4px 10px 0px #DAE3F4;
  1448. border-radius: 12px 12px 12px 12px;
  1449. >view:nth-child(1) {
  1450. width: 100%;
  1451. height: 42px;
  1452. }
  1453. .top-ocr {
  1454. background-color: #F9F9F9;
  1455. border-top-left-radius: 12px;
  1456. border-top-right-radius: 12px;
  1457. color: #0052FF;
  1458. font-size: 14px;
  1459. image {
  1460. width: 20px;
  1461. height: 20px;
  1462. }
  1463. }
  1464. .btn-collapse {
  1465. height: 42px;
  1466. font-size: 12px;
  1467. background-color: white;
  1468. border-bottom-left-radius: 12px;
  1469. border-bottom-right-radius: 12px;
  1470. color: rgba(60, 60, 60, 0.6);
  1471. }
  1472. }
  1473. }
  1474. .movable-view {
  1475. .operate-img {
  1476. width: 90%;
  1477. height: 38px;
  1478. background-color: #F9F9F9;
  1479. border-radius: 8px;
  1480. padding: 10px 25px;
  1481. margin-top: 10px;
  1482. image {
  1483. width: 20px;
  1484. height: 20px;
  1485. margin-right: 5px;
  1486. }
  1487. }
  1488. }
  1489. .status-data {
  1490. width: 66px;
  1491. height: 30px;
  1492. margin: 0 7px;
  1493. font-size: 14px;
  1494. border: 1px solid #CDCDCD;
  1495. cursor: pointer;
  1496. text-align: center;
  1497. line-height: 30px;
  1498. }
  1499. .active {
  1500. position: relative;
  1501. background: rgba(0, 82, 255, 0.1);
  1502. color: #0052FF;
  1503. border: 1px solid #0052FF;
  1504. font-weight: 700;
  1505. }
  1506. .active::before {
  1507. content: "";
  1508. position: absolute;
  1509. top: 0;
  1510. left: 0;
  1511. width: 10px;
  1512. height: 10px;
  1513. background-image: url("/static/image/car-insure/before.png");
  1514. background-size: cover;
  1515. }
  1516. .footer-btn {
  1517. position: fixed;
  1518. bottom: 0;
  1519. left: 0;
  1520. width: 100%;
  1521. height: 62px;
  1522. background: #FFFFFF;
  1523. box-shadow: 0px -4px 10px 0px #DAE3F4;
  1524. border-radius: 0px 0px 0px 0px;
  1525. padding: 12px 16px;
  1526. z-index: 99;
  1527. }
  1528. movable-area {
  1529. height: 220px;
  1530. width: 100%;
  1531. border-top-left-radius: 12px;
  1532. border-top-right-radius: 12px;
  1533. background-color: #D8D8D8;
  1534. overflow: hidden;
  1535. }
  1536. movable-view {
  1537. display: flex;
  1538. align-items: center;
  1539. justify-content: center;
  1540. height: 100%;
  1541. width: 100%;
  1542. }
  1543. </style>