Information.vue 56 KB

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