Information.vue 50 KB

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