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

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