You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

opening-account-people.vue 29KB

преди 2 години
преди 2 години
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 2 години
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 2 години
преди 2 години
преди 1 година
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 2 години
преди 2 години
преди 1 година
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 2 години
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 1 година
преди 2 години
преди 1 година
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 2 години
преди 2 години
преди 2 години
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 2 години
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 2 години
преди 1 година
преди 2 години
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 1 година
преди 1 година
преди 1 година
преди 1 година
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
преди 1 година
преди 2 години
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016
  1. <template>
  2. <navBar title="ETC开户新办申请-个人" :scrollTop="scrollTop"></navBar>
  3. <navBgCar></navBgCar>
  4. <view class="content-wrap">
  5. <view @click="tabChange(true)">
  6. <view :class="state.isMyPeopple ? 'big' : 'nomal'"> 本人车辆 </view>
  7. <view :class="state.isMyPeopple ? 'tip' : ''"> </view>
  8. </view>
  9. <view @click="tabChange(false)" style="margin-left: 60rpx" class="" v-if="state.isEnableOther">
  10. <view :class="state.isMyPeopple ? 'nomal' : 'big'"> 他人车辆 </view>
  11. <view :class="state.isMyPeopple ? '' : 'tip'"> </view>
  12. </view>
  13. </view>
  14. <view v-if="state.isMyPeopple" class="content">
  15. <view class="item-tips">
  16. <view class="title"> 上传后请核对识别信息 </view>
  17. <view class="tip"> 如有错误请及时手动修改 </view>
  18. </view>
  19. <view class="picture-wrapper" @click="takePhotoMode('1','my')">
  20. <view class="bg">
  21. <view class="">
  22. <view class="name"> 人像面 </view>
  23. <view class="value"> 上传身份证的人像面 </view>
  24. <view class="tip">
  25. <view class="tip-value"> 拍摄规范 </view>
  26. </view>
  27. </view>
  28. <image v-if="!state.form.userPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`">
  29. </image>
  30. <image v-else class="icon" :src="strReplace(state.form.userPosImgUrl)"></image>
  31. </view>
  32. </view>
  33. <view class="picture-wrapper" @click="takePhotoMode('2','my')">
  34. <view class="bg">
  35. <view class="">
  36. <view class="name"> 国徽面 </view>
  37. <view class="value"> 上传身份证的国徽面 </view>
  38. <view class="tip">
  39. <view class="tip-value"> 拍摄规范 </view>
  40. </view>
  41. </view>
  42. <image v-if="!state.form.userNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/guohui.png`">
  43. </image>
  44. <image v-else class="icon" :src="strReplace(state.form.userNegImgUrl)"></image>
  45. </view>
  46. </view>
  47. <view class="shibie-wrapper">
  48. <view class="title"> 识别内容如下 </view>
  49. <u-form label-width="230" :model="state.form" ref="uForm">
  50. <u-form-item label="姓名">
  51. <u-input v-model="state.form.userName" placeholder='请输入姓名' :disabled="state.isEnableOCRData"
  52. maxlength="20" @input="replaceInput" />
  53. </u-form-item>
  54. <!-- <u-form-item label="性别">
  55. <u-input placeholder='请选择性别' v-model="state.form.gender" @click="userGenderAction()"
  56. type="select" />
  57. </u-form-item> -->
  58. <u-form-item label="身份证号">
  59. <u-input placeholder='请输入身份证' type="idcard" v-model="state.form.userIdNum"
  60. :disabled="state.isEnableOCRData" maxlength="18" />
  61. </u-form-item>
  62. <u-form-item label="地址">
  63. <u-input placeholder='请输入地址' height='38' type='textarea' :autoHeight='true'
  64. v-model="state.form.address" :disabled="state.isEnableOCRData" maxlength="100" />
  65. </u-form-item>
  66. <!-- <u-form-item label="证件有效期">
  67. <u-input v-model="state.form.begindate" type="select" />
  68. </u-form-item> -->
  69. <u-form-item label="联系方式">
  70. <u-input placeholder='请输入联系方式' type="number" v-model="state.form.tel" maxlength="11" />
  71. </u-form-item>
  72. </u-form>
  73. </view>
  74. <view class="green-tip">
  75. 如识别信息有误,请手动修改,确认无误后,点击下一步!
  76. </view>
  77. <view class="action">
  78. <button type="default" class="button" @click="savaHandle()">
  79. 下一步
  80. </button>
  81. </view>
  82. </view>
  83. <view v-else class="content">
  84. <view class="title"> 车主信息 </view>
  85. <view class="item-tips">
  86. <view class="title"> 上传后请核对识别信息 </view>
  87. <view class="tip"> 如有错误请及时手动修改 </view>
  88. </view>
  89. <view class="picture-wrapper" @click="takePhotoMode('1','my')">
  90. <view class="bg">
  91. <view class="">
  92. <view class="name"> 人像面 </view>
  93. <view class="value"> 上传身份证的人像面 </view>
  94. <view class="tip">
  95. <view class="tip-value"> 拍摄规范 </view>
  96. </view>
  97. </view>
  98. <image v-if="!state.form.userPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`">
  99. </image>
  100. <image v-else class="icon" :src="strReplace(state.form.userPosImgUrl)"></image>
  101. </view>
  102. </view>
  103. <view class="picture-wrapper" @click="takePhotoMode('2','my')">
  104. <view class="bg">
  105. <view class="">
  106. <view class="name"> 国徽面 </view>
  107. <view class="value"> 上传身份证的国徽面 </view>
  108. <view class="tip">
  109. <view class="tip-value"> 拍摄规范 </view>
  110. </view>
  111. </view>
  112. <image v-if="!state.form.userNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/guohui.png`">
  113. </image>
  114. <image v-else class="icon" :src="strReplace(state.form.userNegImgUrl)"></image>
  115. </view>
  116. </view>
  117. <view class="shibie-wrapper">
  118. <view class="title"> 识别内容如下 </view>
  119. <u-form label-width="200" :model="state.form" ref="uForm">
  120. <u-form-item label="姓名">
  121. <u-input inputAlign="right" placeholder='请输入姓名' v-model="state.form.userName"
  122. :disabled="state.isEnableOCRData" maxlength="20" />
  123. </u-form-item>
  124. <!-- <u-form-item label="性别">
  125. <u-input inputAlign="right" placeholder='请选择性别' v-model="state.form.gender" type="select" />
  126. </u-form-item> -->
  127. <u-form-item label="身份证号">
  128. <u-input inputAlign="right" placeholder='请输入身份证号' v-model="state.form.userIdNum"
  129. :disabled="state.isEnableOCRData" type="idcard" />
  130. </u-form-item>
  131. <!-- <u-form-item label="">
  132. <u-input v-model="state.form.userIdNum" />
  133. </u-form-item> -->
  134. <!-- <u-form-item label="证件有效期">
  135. <u-input v-model="state.form.begindate" type="select" />
  136. </u-form-item> -->
  137. <u-form-item label="联系方式">
  138. <u-input inputAlign="right" placeholder='请输入联系方式' v-model="state.form.tel" maxlength="11" />
  139. </u-form-item>
  140. </u-form>
  141. </view>
  142. <view style="margin-top: 30rpx" class="title"> 代办人信息 </view>
  143. <view class="item-tips">
  144. <view class="title"> 上传后请核对识别信息 </view>
  145. <view class="tip"> 如有错误请及时手动修改 </view>
  146. </view>
  147. <view class="picture-wrapper" @click="takePhotoMode('1','other')">
  148. <view class="bg">
  149. <view class="">
  150. <view class="name"> 人像面 </view>
  151. <view class="value"> 上传身份证的人像面 </view>
  152. <view class="tip">
  153. <view class="tip-value"> 拍摄规范 </view>
  154. </view>
  155. </view>
  156. <image v-if="!state.form.agentPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`">
  157. </image>
  158. <image v-else class="icon" :src="strReplace(state.form.agentPosImgUrl)"></image>
  159. </view>
  160. </view>
  161. <view class="picture-wrapper" @click="takePhotoMode('2','other')">
  162. <view class="bg">
  163. <view class="">
  164. <view class="name"> 国徽面 </view>
  165. <view class="value"> 上传身份证的国徽面 </view>
  166. <view class="tip">
  167. <view class="tip-value"> 拍摄规范 </view>
  168. </view>
  169. </view>
  170. <image v-if="!state.form.agentNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/guohui.png`">
  171. </image>
  172. <image v-else class="icon" :src="strReplace(state.form.agentNegImgUrl)"></image>
  173. </view>
  174. </view>
  175. <view class="picture-wrapper" @click="cardFileImageUpdate()" v-if='state.isEnableBook'>
  176. <view class="bg">
  177. <view class="">
  178. <view class="name"> 委托书 </view>
  179. <view class="value"> 上传文字清晰的委托书 </view>
  180. <view class="tip">
  181. <view class="tip-value"> 拍摄规范 </view>
  182. </view>
  183. </view>
  184. <image v-if="!state.form.proxyUrl" class="icon" :src="`${$imgUrl}applyCard/weituoshu.png`">
  185. </image>
  186. <image v-else class="icon" :src="strReplace(state.form.proxyUrl)"></image>
  187. </view>
  188. </view>
  189. <view class="shibie-wrapper">
  190. <view class="title"> 识别内容如下 </view>
  191. <u-form label-width="200" :model="state.form" ref="uForm">
  192. <u-form-item label="经办人姓名">
  193. <u-input inputAlign="right" placeholder='请输入经办人姓名' v-model="state.form.agentName"
  194. :disabled="state.isEnableOCRData" maxlength="20" />
  195. </u-form-item>
  196. <!-- <u-form-item label="性别">
  197. <u-input v-model="state.form.agentGender" type="select" />
  198. </u-form-item> -->
  199. <u-form-item label="身份证号">
  200. <u-input inputAlign="right" placeholder='请输入身份证号' v-model="state.form.agentIdNum"
  201. :disabled="state.isEnableOCRData" maxlength="18" type="idcard" />
  202. </u-form-item>
  203. <!-- <u-form-item label="证件有效期">
  204. <u-input v-model="state.form.begindate" type="select" />
  205. </u-form-item> -->
  206. <u-form-item label="联系方式">
  207. <u-input inputAlign="right" placeholder='请输入联系方式' v-model="state.form.agentTel" type="number"
  208. maxlength="11" />
  209. </u-form-item>
  210. </u-form>
  211. </view>
  212. <view class="green-tip">
  213. 如识别信息有误,请手动修改,确认无误后,点击下一步!
  214. </view>
  215. <view class="action">
  216. <button type="default" class="button" @click="savaHandle()">
  217. 下一步
  218. </button>
  219. </view>
  220. </view>
  221. <u-select mode="single-column" :list="state.genderList" v-model="state.genderShow" @confirm="genderSelectConfirm">
  222. </u-select>
  223. <view class="choice-takePhoto-wrap" v-if="state.isTakePhotoModeShow" @click="cancle">
  224. <view class="choice-takePhoto">
  225. <view @click.stop="takePhoto(state.choiceIndex)" style="border-radius: 20rpx 20rpx 0 0;">拍照</view>
  226. <view @click.stop="xiangce(state.choiceIndex)">从手机相册选择</view>
  227. <view @click.stop="cancle">取消</view>
  228. </view>
  229. </view>
  230. <viewfinder v-if="state.phoneType" :phoneType="state.phoneType" @confirmReturn="confirmReturn"></viewfinder>
  231. </template>
  232. <script setup lang="ts">
  233. import viewfinder from "../../components/viewfinder.vue"
  234. import navBgCar from "./components/nav-bg-car3";
  235. import {
  236. pathToBase64
  237. } from "@/utils/image-tools/index.js";
  238. import {
  239. reactive,
  240. ref,
  241. } from "vue";
  242. import {
  243. msg,
  244. checkStr
  245. } from "@/utils/utils";
  246. import {
  247. onLoad,
  248. onPageScroll,
  249. } from "@dcloudio/uni-app";
  250. import {
  251. etcOcrCard,
  252. etcUserCardInfoSubmit,
  253. fileUpload,
  254. register,
  255. envs,
  256. getUserMsg
  257. } from "@/utils/network/api.js";
  258. import {
  259. request
  260. } from "@/utils/network/request.js";
  261. import {
  262. stringToJson
  263. } from "@/utils/network/encryption";
  264. import {
  265. setItem,
  266. getItem,
  267. } from "@/utils/storage";
  268. import {
  269. getCodeName
  270. } from "@/datas/queryKey.js";
  271. import navBar from "@/components/nav-bar/nav-bar2.vue";
  272. const scrollTop = ref(0)
  273. const state = reactive({
  274. isMy: "",//自己办理 他人办理
  275. phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
  276. choiceIndex: 1, // 1 身份证正面 2 身份证反面
  277. isTakePhotoModeShow: false, //选择拍照方式是否出来
  278. genderList: [{
  279. value: '男',
  280. label: '男'
  281. },
  282. {
  283. value: '女',
  284. label: '女'
  285. }
  286. ],
  287. form: {
  288. orderId: "", //订单ID
  289. userName: "", //开户人姓名
  290. userIdType: "101", //用户证件类型 101//身份证
  291. userIdNum: "", //用户证件号码
  292. userPosImgUrl: "", //身份证正面
  293. userNegImgUrl: "", //身份证反面
  294. tel: "", //开户人手机号
  295. address: "", //开户人地址
  296. sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议)
  297. channelId: "", //渠道id
  298. gender: "",
  299. customerIdVld: "",
  300. agentName: "",
  301. agentGender: "",
  302. agentTel: '',
  303. agentPhone: "",
  304. agentIdType: "101",
  305. agentIdNum: "",
  306. agentPosImgUrl: "",
  307. agentNegImgUrl: "",
  308. proxyUrl: "",
  309. agentAddress: "",
  310. agentIdVld: '',
  311. opId: '',
  312. orderSource: 'WECHAT',
  313. },
  314. genderShow: false,
  315. orderId: "",
  316. vehiclePlateColor: undefined,
  317. isMyPeopple: true,
  318. isSign: '',
  319. type: 1,
  320. isEnableOther: true, //小程序是否支持他人办理
  321. isEnableBook: true, //他人办理时是否上传委托书
  322. isEnableInfo: true, //小程序信息带出
  323. isEnableOCRData: true, //允许修改OCR识别出来的数据
  324. });
  325. const userGenderAction = () => {
  326. state.genderShow = true;
  327. };
  328. const genderSelectConfirm = (e) => {
  329. state.form.gender = ''
  330. e.map((val, index) => {
  331. state.form.gender = val.label;
  332. })
  333. };
  334. const savaHandle = () => {
  335. if (!checkStr(state.form.userIdNum, 'card')) {
  336. msg('请输入正确身份证');
  337. return;
  338. }
  339. if (!checkStr(state.form.tel, 'mobile')) {
  340. msg('请输入正确手机号');
  341. return;
  342. }
  343. //如果未登录||新用户
  344. if (!getItem('openId')) {
  345. let data = {
  346. userType: "PERSONAL",
  347. idNum: state.form.userIdNum,
  348. idType: state.form.userIdType,
  349. mobile: state.form.tel,
  350. userName: state.form.userName,
  351. gender: state.form.gender == '男' ? 'MALE' : 'FEMALE',
  352. certifyChannel: "BAIDUOCR",
  353. address: state.form.address,
  354. agentIdNum: state.form.agentIdNum,
  355. agentIdType: state.form.agentIdType,
  356. agentName: state.form.agentName,
  357. department: "",
  358. userIdImgUrl: state.form.userPosImgUrl,
  359. userIdImgBase64: "",
  360. }
  361. const options = {
  362. type: 2,
  363. data: data,
  364. method: "POST",
  365. showLoading: true,
  366. };
  367. request(register, options).then((res) => {
  368. let result = stringToJson(res.bizContent);
  369. if (result.accessToken && result.openId) {
  370. setItem('token', result.accessToken)
  371. setItem('openId', result.openId)
  372. state.form.opId = result.openId;
  373. let data = state.form;
  374. const options = {
  375. type: 2,
  376. data: data,
  377. method: "POST",
  378. showLoading: true,
  379. };
  380. request(etcUserCardInfoSubmit, options).then((res) => {
  381. // let result = stringToJson(res.bizContent);
  382. console.log(res);
  383. uni.redirectTo({
  384. url: `/subpackage/orders/car-release?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}&type=${state.type}&isSign=${state.isSign}`,
  385. });
  386. });
  387. }
  388. })
  389. } else {
  390. // 已经登录
  391. let data = state.form;
  392. const options = {
  393. type: 2,
  394. data: data,
  395. method: "POST",
  396. showLoading: true,
  397. };
  398. request(etcUserCardInfoSubmit, options).then((res) => {
  399. // let result = stringToJson(res.bizContent);
  400. console.log(res);
  401. uni.redirectTo({
  402. url: `/subpackage/orders/car-release?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}&type=${state.type}&isSign=${state.isSign}`,
  403. });
  404. });
  405. }
  406. };
  407. const cardFileImageUpdate = () => {
  408. uni.chooseImage({
  409. count: 1, //只能选取一张照片
  410. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  411. sourceType: ["camera", "album"], //从相册选择
  412. success: function (res) {
  413. pathToBase64(res.tempFilePaths[0])
  414. .then((path) => {
  415. var data = {
  416. fileBase64: path,
  417. };
  418. const options = {
  419. type: 2,
  420. data: data,
  421. method: "POST",
  422. showLoading: true,
  423. };
  424. request(fileUpload, options).then((res) => {
  425. const data = stringToJson(res.bizContent);
  426. console.log(data);
  427. state.form.proxyUrl = data.data.url;
  428. });
  429. })
  430. .catch((error) => { });
  431. },
  432. });
  433. };
  434. //tab切换
  435. const tabChange = (val : any) => {
  436. state.isTakePhotoModeShow = false
  437. if (val) {
  438. state.isMyPeopple = true;
  439. } else {
  440. state.isMyPeopple = false;
  441. }
  442. state.form = {
  443. orderId: state.orderId, //订单ID
  444. userName: "", //开户人姓名
  445. userIdType: "101", //用户证件类型 101//身份证
  446. userIdNum: "", //用户证件号码
  447. userPosImgUrl: "", //身份证正面
  448. userNegImgUrl: "", //身份证反面
  449. tel: "", //开户人手机号
  450. address: "", //开户人地址
  451. sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议)
  452. channelId: "", //渠道id
  453. gender: "",
  454. customerIdVld: "",
  455. agentName: "",
  456. agentGender: "",
  457. agentTel: '',
  458. agentPhone: "",
  459. agentIdType: "101",
  460. agentIdNum: "",
  461. agentPosImgUrl: "",
  462. agentNegImgUrl: "",
  463. proxyUrl: "",
  464. agentAddress: "",
  465. agentIdVld: '',
  466. };
  467. };
  468. onLoad((option : any) => {
  469. state.form.orderId = option.orderId;
  470. state.orderId = option.orderId;
  471. state.vehiclePlateColor = option.vehiclePlateColor;
  472. state.form.opId = getItem('openId') ? getItem('openId') : '';
  473. state.isSign = option.isSign;
  474. state.type = option.type;
  475. //state.fromOrder = option.fromOrder //是否来自订单-修改资料
  476. getGlobalParam(); //全局配置数据
  477. console.log("option", option)
  478. });
  479. //监听页面滚动
  480. onPageScroll((e) => {
  481. scrollTop.value = e.scrollTop;
  482. });
  483. const replaceInput = (event) => {
  484. console.log("event", event)
  485. const screeningStr = /[^\u4E00-\u9FA5]/g; //想禁止什么类型,在这里替换正则就可以了
  486. if (screeningStr.test(event)) {
  487. setTimeout(() => {
  488. state.form.userName = event.replace(screeningStr, '');
  489. }, 100)
  490. } else {
  491. setTimeout(() => {
  492. state.form.userName = event;
  493. }, 100)
  494. }
  495. console.log("event.replace(screeningStr, '')", event.replace(screeningStr, ''), event, state.form.userName)
  496. }
  497. // const cardDbImageOcr = (val : any) => {
  498. // var imageType = val;
  499. // uni.chooseImage({
  500. // count: 1, //只能选取一张照片
  501. // sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  502. // sourceType: ["camera", "album"], //从相册选择
  503. // success: function (res) {
  504. // pathToBase64(res.tempFilePaths[0])
  505. // .then((path) => {
  506. // var data = {
  507. // source: "1",
  508. // agencyId: "52010106004",
  509. // imageType: imageType,
  510. // fileName: res.tempFilePaths[0],
  511. // imageBase64: path,
  512. // };
  513. // const options = {
  514. // type: 2,
  515. // data: data,
  516. // method: "POST",
  517. // showLoading: true,
  518. // };
  519. // request(etcOcrCard, options).then((res) => {
  520. // const data = stringToJson(res.bizContent);
  521. // if (val === "1") {
  522. // state.form.agentName = data.name;
  523. // state.form.agentGender = data.gender;
  524. // state.form.agentIdNum = data.idno;
  525. // state.form.agentPosImgUrl = data.imageUrl;
  526. // state.form.agentAddress = data.address;
  527. // } else {
  528. // state.form.agentIdVld = data.enddate;
  529. // state.form.agentNegImgUrl = data.imageUrl;
  530. // }
  531. // });
  532. // })
  533. // .catch((error) => { });
  534. // },
  535. // });
  536. // };
  537. //orc接口调用
  538. // const cardImageOcr = (val : any) => {
  539. // console.log("点击了", val, state.isEnableOCRData)
  540. // // if (state.isEnableOCRData) {
  541. // // return;
  542. // // }
  543. // var imageType = val;
  544. // console.log("点击了", val)
  545. // uni.chooseImage({
  546. // count: 1, //只能选取一张照片
  547. // sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  548. // sourceType: ["camera", "album"], //从相册选择
  549. // success: function (res) {
  550. // console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
  551. // pathToBase64(res.tempFilePaths[0])
  552. // .then((path) => {
  553. // var data = {
  554. // source: "1",
  555. // agencyId: "52010106004",
  556. // imageType: imageType,
  557. // fileName: res.tempFilePaths[0],
  558. // imageBase64: path,
  559. // };
  560. // const options = {
  561. // type: 2,
  562. // data: data,
  563. // method: "POST",
  564. // showLoading: true,
  565. // };
  566. // request(etcOcrCard, options).then((res) => {
  567. // const data = stringToJson(res.bizContent);
  568. // if (val === "1") {
  569. // state.form.userName = data.name;
  570. // state.form.gender = data.gender;
  571. // state.form.userIdNum = data.idno;
  572. // state.form.userPosImgUrl = data.imageUrl;
  573. // state.form.address = data.address;
  574. // } else {
  575. // state.form.customerIdVld = data.enddate;
  576. // state.form.userNegImgUrl = data.imageUrl;
  577. // }
  578. // });
  579. // })
  580. // .catch((error) => { });
  581. // },
  582. // });
  583. // };
  584. //替换图片地址
  585. const strReplace = (str : string) => {
  586. let imgUrl = str.replace("http://192.168.101.145:9000", envs[process.env.NODE_ENV].baseUrl);
  587. imgUrl = imgUrl.replace("http://100.64.2.113:9000", envs[process.env.NODE_ENV].baseUrl);
  588. console.log(imgUrl)
  589. return imgUrl;
  590. }
  591. const getGlobalParam = () => {
  592. const data = getItem('globalParam')
  593. console.log("全局配置数据", getCodeName('IS_ENABLE', data.miniSupportOther), getCodeName('IS_ENABLE', data.otherUploadProxy), getCodeName('IS_ENABLE', data.miniInfoShow), getCodeName('IS_ENABLE', data.changeOCRData))
  594. // 小程序是否支持他人办理
  595. if (getCodeName('IS_ENABLE', data.miniSupportOther) == '启用') {
  596. state.isEnableOther = true;
  597. } else {
  598. state.isEnableOther = false;
  599. }
  600. // 他人办理时是否上传委托书
  601. if (getCodeName('IS_ENABLE', data.otherUploadProxy) == '启用') {
  602. state.isEnableBook = true;
  603. } else {
  604. state.isEnableBook = false;
  605. }
  606. // 小程序信息带出
  607. if (getCodeName('IS_ENABLE', data.miniInfoShow) == '启用') {
  608. state.isEnableInfo = true;
  609. uni.showModal({
  610. // title: '提示',
  611. content: '是否允许带出用户信息',
  612. success: function (res) {
  613. if (res.confirm) {
  614. console.log('用户点击确定');
  615. queryUserMsg() //通过opneId查询用户信息
  616. } else if (res.cancel) {
  617. console.log('用户点击取消');
  618. }
  619. }
  620. });
  621. } else {
  622. state.isEnableInfo = false;
  623. }
  624. // 允许修改OCR识别出来的数据
  625. if (getCodeName('IS_ENABLE', data.changeOCRData) == '启用') {
  626. state.isEnableOCRData = false;
  627. } else {
  628. state.isEnableOCRData = true;
  629. }
  630. }
  631. // 通过opneId查询用户信息
  632. const queryUserMsg = () => {
  633. const options = {
  634. type: 2,
  635. data: {
  636. "openId": getItem('openId')
  637. },
  638. method: "POST",
  639. showLoading: true,
  640. };
  641. request(getUserMsg, options).then((res) => {
  642. console.log("通过opneId查询用户信息", stringToJson(res.bizContent))
  643. const data = stringToJson(res.bizContent);
  644. state.form.userPosImgUrl = data.customerPosImgUrl;
  645. state.form.userNegImgUrl = data.customerNegImgUrl;
  646. state.form.userName = data.customerName;
  647. state.form.userIdNum = data.customerIdNum;
  648. state.form.address = data.customerAddress;
  649. state.form.tel = data.customerTel;
  650. })
  651. }
  652. const takePhotoMode = (index, isMy) => {
  653. console.log("index", index, isMy)
  654. state.isTakePhotoModeShow = true
  655. state.choiceIndex = index
  656. state.isMy = isMy
  657. }
  658. const xiangce = (val) => {
  659. console.log("val", val)
  660. var imageType = val;
  661. uni.chooseImage({
  662. count: 1, //只能选取一张照片
  663. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  664. sourceType: ["album"], //从相册选择
  665. success: function (res) {
  666. console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
  667. pathToBase64(res.tempFilePaths[0])
  668. .then((path) => {
  669. var data = {
  670. source: "1",
  671. agencyId: "52010106004",
  672. imageType: imageType,
  673. fileName: res.tempFilePaths[0],
  674. imageBase64: path,
  675. };
  676. const options = {
  677. type: 2,
  678. data: data,
  679. method: "POST",
  680. showLoading: true,
  681. };
  682. request(etcOcrCard, options).then((res) => {
  683. const data = stringToJson(res.bizContent);
  684. if (state.isMy == "my") {
  685. if (state.choiceIndex === "1") {
  686. state.form.userName = data.name;
  687. state.form.gender = data.gender;
  688. state.form.userIdNum = data.idno;
  689. state.form.userPosImgUrl = data.imageUrl;
  690. state.form.address = data.address;
  691. } else {
  692. state.form.customerIdVld = data.enddate;
  693. state.form.userNegImgUrl = data.imageUrl;
  694. }
  695. state.isTakePhotoModeShow = false
  696. } else {
  697. if (state.choiceIndex === "1") {
  698. state.form.agentName = data.name;
  699. state.form.agentGender = data.gender;
  700. state.form.agentIdNum = data.idno;
  701. state.form.agentPosImgUrl = data.imageUrl;
  702. state.form.agentAddress = data.address;
  703. } else {
  704. state.form.agentIdVld = data.enddate;
  705. state.form.agentNegImgUrl = data.imageUrl;
  706. }
  707. state.isTakePhotoModeShow = false
  708. }
  709. });
  710. })
  711. .catch((error) => { });
  712. },
  713. })
  714. }
  715. const takePhoto = (val) => {
  716. console.log("拍照", val)
  717. // uni.navigateTo({
  718. // url: `/subpackage/orders/takePhoto?phoneType=${val}`
  719. // })
  720. state.phoneType = val;
  721. }
  722. const confirmReturn = (val) => {
  723. state.phoneType = 0
  724. state.isTakePhotoModeShow = false
  725. var imageType = state.choiceIndex;
  726. console.log("图片地址val", val.tempImagePath)
  727. pathToBase64(val.tempImagePath)
  728. .then((path) => {
  729. var data = {
  730. source: "1",
  731. agencyId: "52010106004",
  732. imageType: imageType,
  733. fileName: val.tempImagePath,
  734. imageBase64: path,
  735. };
  736. const options = {
  737. type: 2,
  738. data: data,
  739. method: "POST",
  740. showLoading: true,
  741. };
  742. request(etcOcrCard, options).then((res) => {
  743. const data = stringToJson(res.bizContent);
  744. if (state.isMy == "my") {
  745. if (state.choiceIndex === "1") {
  746. state.form.userName = data.name;
  747. state.form.gender = data.gender;
  748. state.form.userIdNum = data.idno;
  749. state.form.userPosImgUrl = data.imageUrl;
  750. state.form.address = data.address;
  751. } else {
  752. state.form.customerIdVld = data.enddate;
  753. state.form.userNegImgUrl = data.imageUrl;
  754. }
  755. state.isTakePhotoModeShow = false
  756. } else {
  757. if (state.choiceIndex === "1") {
  758. state.form.agentName = data.name;
  759. state.form.agentGender = data.gender;
  760. state.form.agentIdNum = data.idno;
  761. state.form.agentPosImgUrl = data.imageUrl;
  762. state.form.agentAddress = data.address;
  763. } else {
  764. console.log("state.isMy", state.isMy, state.choiceIndex, state.choiceIndex === "1", data)
  765. state.form.agentIdVld = data.enddate;
  766. state.form.agentNegImgUrl = data.imageUrl;
  767. }
  768. state.isTakePhotoModeShow = false
  769. }
  770. });
  771. })
  772. .catch((error) => { });
  773. }
  774. const cancle = () => {
  775. state.isTakePhotoModeShow = false
  776. }
  777. </script>
  778. <style lang="scss" scoped>
  779. .title {
  780. font-size: 35rpx;
  781. font-family: Microsoft YaHei;
  782. font-weight: 400;
  783. color: #000000;
  784. line-height: 80rpx;
  785. margin-bottom: 10rpx;
  786. }
  787. .content-wrap {
  788. position: relative;
  789. margin-top: -50rpx;
  790. padding: 0rpx 30rpx;
  791. display: flex;
  792. .big {
  793. font-size: 30rpx;
  794. font-family: Microsoft YaHei;
  795. font-weight: 400;
  796. color: #333333;
  797. line-height: 24rpx;
  798. }
  799. .nomal {
  800. font-size: 26rpx;
  801. font-family: Microsoft YaHei;
  802. font-weight: 400;
  803. color: #666666;
  804. line-height: 24rpx;
  805. }
  806. .tip {
  807. margin-top: -5px;
  808. width: 117rpx;
  809. height: 16rpx;
  810. background: #00b38b;
  811. opacity: 0.3;
  812. }
  813. }
  814. .content {
  815. padding: 50rpx 30rpx 50rpx 30rpx;
  816. .action {
  817. padding-left: 20rpx;
  818. padding-right: 20rpx;
  819. padding-bottom: 30rpx;
  820. .button {
  821. height: 80rpx;
  822. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  823. border-radius: 40rpx;
  824. font-size: 32rpx;
  825. font-weight: 400;
  826. color: #ffffff;
  827. line-height: 80rpx;
  828. }
  829. }
  830. .item-tips {
  831. .title {
  832. font-size: 30rpx;
  833. font-family: Microsoft YaHei;
  834. font-weight: 400;
  835. color: #000000;
  836. line-height: 24rpx;
  837. }
  838. .tip {
  839. margin-top: 16rpx;
  840. font-size: 24rpx;
  841. font-family: Microsoft YaHei;
  842. font-weight: 400;
  843. color: #999999;
  844. line-height: 24rpx;
  845. }
  846. }
  847. .picture-wrapper {
  848. margin-top: 40rpx;
  849. .bg {
  850. background: #ffffff;
  851. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  852. border-radius: 20rpx;
  853. padding: 40rpx;
  854. display: flex;
  855. // align-items: center;
  856. justify-content: space-between;
  857. .name {
  858. font-size: 34rpx;
  859. font-family: Microsoft YaHei;
  860. font-weight: 400;
  861. color: #000000;
  862. line-height: 34rpx;
  863. }
  864. .value {
  865. margin-top: 20rpx;
  866. font-size: 24rpx;
  867. font-family: Microsoft YaHei;
  868. font-weight: 400;
  869. color: #999999;
  870. line-height: 24rpx;
  871. }
  872. .tip {
  873. margin-top: 20rpx;
  874. text-align: center;
  875. width: 110rpx;
  876. height: 40rpx;
  877. background: rgba(33, 190, 177, 0.2);
  878. border-radius: 6rpx;
  879. .tip-value {
  880. font-size: 20rpx;
  881. font-family: Microsoft YaHei;
  882. font-weight: 400;
  883. color: #0a8f8a;
  884. line-height: 40rpx;
  885. opacity: 1;
  886. }
  887. }
  888. }
  889. .icon {
  890. width: 294rpx;
  891. height: 188rpx;
  892. }
  893. }
  894. .shibie-wrapper {
  895. margin-top: 60rpx;
  896. .title {
  897. font-size: 30rpx;
  898. font-family: Microsoft YaHei;
  899. font-weight: 400;
  900. color: #000000;
  901. line-height: 30rpx;
  902. }
  903. }
  904. .buchong-wrapper {
  905. margin-top: 60rpx;
  906. .title {
  907. font-size: 30rpx;
  908. font-family: Microsoft YaHei;
  909. font-weight: 400;
  910. color: #000000;
  911. line-height: 30rpx;
  912. }
  913. }
  914. .green-tip {
  915. margin-top: 50rpx;
  916. font-size: 24rpx;
  917. font-family: Microsoft YaHei;
  918. font-weight: 400;
  919. color: #00b38b;
  920. line-height: 24rpx;
  921. margin-bottom: 60rpx;
  922. }
  923. }
  924. .choice-takePhoto {
  925. position: absolute;
  926. bottom: 0;
  927. background-color: white;
  928. width: 100%;
  929. border-radius: 20rpx 20rpx 0 0;
  930. }
  931. .choice-takePhoto>view:first-child {
  932. text-align: center;
  933. height: 80rpx;
  934. line-height: 80rpx;
  935. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  936. background-color: white;
  937. }
  938. .choice-takePhoto>view:last-child {
  939. text-align: center;
  940. height: 80rpx;
  941. line-height: 80rpx;
  942. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  943. background-color: white;
  944. }
  945. .choice-takePhoto>view {
  946. text-align: center;
  947. height: 80rpx;
  948. line-height: 80rpx;
  949. background-color: white;
  950. }
  951. .choice-takePhoto-wrap {
  952. width: 100%;
  953. height: 100vh;
  954. background-color: rgba(127, 127, 127, 0.2);
  955. position: fixed;
  956. left: 0;
  957. top: 0;
  958. z-index: 11111;
  959. }
  960. </style>