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.

changeInformation.vue 24KB

1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847
  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" :images="state.images"
  231. :showStartPhoto="state.showImg" @confirmReturn="confirmReturn" @camera="camera"></viewfinder>
  232. </template>
  233. <script setup lang="ts">
  234. import viewfinder from "../../components/viewfinder.vue"
  235. import navBgCar from "./components/nav-bg-car3";
  236. import {
  237. reactive,
  238. ref,
  239. } from "vue";
  240. import {
  241. msg,
  242. checkStr,
  243. strReplace,
  244. uploadFile
  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. showImg: true,
  275. isMy: "",//自己办理 他人办理
  276. phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
  277. choiceIndex: 1, // 1 身份证正面 2 身份证反面
  278. isTakePhotoModeShow: false, //选择拍照方式是否出来
  279. images: '',
  280. genderList: [{
  281. value: '男',
  282. label: '男'
  283. },
  284. {
  285. value: '女',
  286. label: '女'
  287. }
  288. ],
  289. form: {
  290. orderId: "", //订单ID
  291. userName: "", //开户人姓名
  292. userIdType: "101", //用户证件类型 101//身份证
  293. userIdNum: "", //用户证件号码
  294. userPosImgUrl: "", //身份证正面
  295. userNegImgUrl: "", //身份证反面
  296. tel: "", //开户人手机号
  297. address: "", //开户人地址
  298. sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议)
  299. channelId: "", //渠道id
  300. gender: "",
  301. customerIdVld: "",
  302. agentName: "",
  303. agentGender: "",
  304. agentTel: '',
  305. agentPhone: "",
  306. agentIdType: "101",
  307. agentIdNum: "",
  308. agentPosImgUrl: "",
  309. agentNegImgUrl: "",
  310. proxyUrl: "",
  311. agentAddress: "",
  312. agentIdVld: '',
  313. opId: '',
  314. orderSource: 'WECHAT',
  315. },
  316. genderShow: false,
  317. orderId: "",
  318. vehiclePlateColor: undefined,
  319. isMyPeopple: true,
  320. isSign: '',
  321. type: 1,
  322. isEnableOther: true, //小程序是否支持他人办理
  323. isEnableBook: true, //他人办理时是否上传委托书
  324. isEnableInfo: true, //小程序信息带出
  325. isEnableOCRData: true, //允许修改OCR识别出来的数据
  326. });
  327. const userGenderAction = () => {
  328. state.genderShow = true;
  329. };
  330. const genderSelectConfirm = (e) => {
  331. state.form.gender = ''
  332. e.map((val, index) => {
  333. state.form.gender = val.label;
  334. })
  335. };
  336. const camera = () => {
  337. state.phoneType = 0
  338. }
  339. const savaHandle = () => {
  340. if (!checkStr(state.form.userIdNum, 'card')) {
  341. msg('请输入正确身份证');
  342. return;
  343. }
  344. if (!checkStr(state.form.tel, 'mobile')) {
  345. msg('请输入正确手机号');
  346. return;
  347. }
  348. //如果未登录||新用户
  349. if (!getItem('openId')) {
  350. let data = {
  351. userType: "PERSONAL",
  352. idNum: state.form.userIdNum,
  353. idType: state.form.userIdType,
  354. mobile: state.form.tel,
  355. userName: state.form.userName,
  356. gender: state.form.gender == '男' ? 'MALE' : 'FEMALE',
  357. certifyChannel: "BAIDUOCR",
  358. address: state.form.address,
  359. agentIdNum: state.form.agentIdNum,
  360. agentIdType: state.form.agentIdType,
  361. agentName: state.form.agentName,
  362. department: "",
  363. userIdImgUrl: state.form.userPosImgUrl,
  364. userIdImgBase64: "",
  365. }
  366. const options = {
  367. type: 2,
  368. data: data,
  369. method: "POST",
  370. showLoading: true,
  371. };
  372. request(register, options).then((res) => {
  373. let result = stringToJson(res.bizContent);
  374. if (result.accessToken && result.openId) {
  375. setItem('token', result.accessToken)
  376. setItem('openId', result.openId)
  377. state.form.opId = result.openId;
  378. let data = state.form;
  379. const options = {
  380. type: 2,
  381. data: data,
  382. method: "POST",
  383. showLoading: true,
  384. };
  385. request(etcUserCardInfoSubmit, options).then((res) => {
  386. // let result = stringToJson(res.bizContent);
  387. console.log(res);
  388. uni.redirectTo({
  389. url: `/subpackage/orders/car-release?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}&type=${state.type}&isSign=${state.isSign}`,
  390. });
  391. });
  392. }
  393. })
  394. } else {
  395. // 已经登录
  396. let data = state.form;
  397. const options = {
  398. type: 2,
  399. data: data,
  400. method: "POST",
  401. showLoading: true,
  402. };
  403. request(etcUserCardInfoSubmit, options).then((res) => {
  404. // let result = stringToJson(res.bizContent);
  405. console.log(res);
  406. uni.redirectTo({
  407. url: `/subpackage/orders/car-release?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}&type=${state.type}&isSign=${state.isSign}`,
  408. });
  409. });
  410. }
  411. };
  412. const cardFileImageUpdate = () => {
  413. uni.chooseImage({
  414. count: 1, //只能选取一张照片
  415. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  416. sourceType: ["camera", "album"], //从相册选择
  417. success: function (res) {
  418. uploadFile(res.tempFilePaths[0], "", "").then((data) => {
  419. state.form.proxyUrl = data;
  420. })
  421. },
  422. });
  423. };
  424. //tab切换
  425. const tabChange = (val : any) => {
  426. state.isTakePhotoModeShow = false
  427. if (val) {
  428. state.isMyPeopple = true;
  429. } else {
  430. state.isMyPeopple = false;
  431. }
  432. state.form = {
  433. orderId: state.orderId, //订单ID
  434. userName: "", //开户人姓名
  435. userIdType: "101", //用户证件类型 101//身份证
  436. userIdNum: "", //用户证件号码
  437. userPosImgUrl: "", //身份证正面
  438. userNegImgUrl: "", //身份证反面
  439. tel: "", //开户人手机号
  440. address: "", //开户人地址
  441. sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议)
  442. channelId: "", //渠道id
  443. gender: "",
  444. customerIdVld: "",
  445. agentName: "",
  446. agentGender: "",
  447. agentTel: '',
  448. agentPhone: "",
  449. agentIdType: "101",
  450. agentIdNum: "",
  451. agentPosImgUrl: "",
  452. agentNegImgUrl: "",
  453. proxyUrl: "",
  454. agentAddress: "",
  455. agentIdVld: '',
  456. };
  457. };
  458. onLoad((option : any) => {
  459. state.form.orderId = option.orderId;
  460. state.orderId = option.orderId;
  461. state.vehiclePlateColor = option.vehiclePlateColor;
  462. state.form.opId = getItem('openId') ? getItem('openId') : '';
  463. state.isSign = option.isSign;
  464. state.type = option.type;
  465. //state.fromOrder = option.fromOrder //是否来自订单-修改资料
  466. getGlobalParam(); //全局配置数据
  467. console.log("option", option)
  468. });
  469. //监听页面滚动
  470. onPageScroll((e) => {
  471. scrollTop.value = e.scrollTop;
  472. });
  473. const replaceInput = (event) => {
  474. console.log("event", event)
  475. const screeningStr = /[^\u4E00-\u9FA5]/g; //想禁止什么类型,在这里替换正则就可以了
  476. if (screeningStr.test(event)) {
  477. setTimeout(() => {
  478. state.form.userName = event.replace(screeningStr, '');
  479. }, 100)
  480. } else {
  481. setTimeout(() => {
  482. state.form.userName = event;
  483. }, 100)
  484. }
  485. console.log("event.replace(screeningStr, '')", event.replace(screeningStr, ''), event, state.form.userName)
  486. }
  487. const getGlobalParam = () => {
  488. const data = getItem('globalParam')
  489. console.log("全局配置数据", getCodeName('IS_ENABLE', data.miniSupportOther), getCodeName('IS_ENABLE', data.otherUploadProxy), getCodeName('IS_ENABLE', data.miniInfoShow), getCodeName('IS_ENABLE', data.changeOCRData))
  490. // 小程序是否支持他人办理
  491. if (getCodeName('IS_ENABLE', data.miniSupportOther) == '启用') {
  492. state.isEnableOther = true;
  493. } else {
  494. state.isEnableOther = false;
  495. }
  496. // 他人办理时是否上传委托书
  497. if (getCodeName('IS_ENABLE', data.otherUploadProxy) == '启用') {
  498. state.isEnableBook = true;
  499. } else {
  500. state.isEnableBook = false;
  501. }
  502. // 小程序信息带出
  503. if (getCodeName('IS_ENABLE', data.miniInfoShow) == '启用') {
  504. state.isEnableInfo = true;
  505. uni.showModal({
  506. // title: '提示',
  507. content: '是否允许带出用户信息',
  508. success: function (res) {
  509. if (res.confirm) {
  510. console.log('用户点击确定');
  511. queryUserMsg() //通过opneId查询用户信息
  512. } else if (res.cancel) {
  513. console.log('用户点击取消');
  514. }
  515. }
  516. });
  517. } else {
  518. state.isEnableInfo = false;
  519. }
  520. // 允许修改OCR识别出来的数据
  521. if (getCodeName('IS_ENABLE', data.changeOCRData) == '启用') {
  522. state.isEnableOCRData = false;
  523. } else {
  524. state.isEnableOCRData = true;
  525. }
  526. }
  527. // 通过opneId查询用户信息
  528. const queryUserMsg = () => {
  529. const options = {
  530. type: 2,
  531. data: {
  532. "openId": getItem('openId')
  533. },
  534. method: "POST",
  535. showLoading: true,
  536. };
  537. request(getUserMsg, options).then((res) => {
  538. console.log("通过opneId查询用户信息", stringToJson(res.bizContent))
  539. const data = stringToJson(res.bizContent);
  540. state.form.userPosImgUrl = data.customerPosImgUrl;
  541. state.form.userNegImgUrl = data.customerNegImgUrl;
  542. state.form.userName = data.customerName;
  543. state.form.userIdNum = data.customerIdNum;
  544. state.form.address = data.customerAddress;
  545. state.form.tel = data.customerTel;
  546. })
  547. }
  548. const takePhotoMode = (index, isMy) => {
  549. console.log("index", index, isMy)
  550. state.isTakePhotoModeShow = true
  551. state.choiceIndex = index
  552. state.isMy = isMy
  553. }
  554. const xiangce = (val) => {
  555. console.log("val", val)
  556. var imageType = val;
  557. uni.chooseImage({
  558. count: 1, //只能选取一张照片
  559. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  560. sourceType: ["album"], //从相册选择
  561. success: function (res) {
  562. state.showImg = false
  563. state.images = res.tempFilePaths[0]
  564. state.phoneType = state.choiceIndex
  565. state.isTakePhotoModeShow = false
  566. console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
  567. },
  568. })
  569. }
  570. const takePhoto = (val) => {
  571. state.showImg = true
  572. console.log("拍照", val)
  573. state.phoneType = val;
  574. }
  575. const confirmReturn = (val) => {
  576. state.phoneType = 0
  577. state.isTakePhotoModeShow = false
  578. var imageType = state.choiceIndex;
  579. console.log("图片地址val", val.tempImagePath)
  580. uploadFile(val.tempImagePath, imageType, etcOcrCard).then((data) => {
  581. console.log("身份证上传", data)
  582. if (state.isMy == "my") {
  583. if (state.choiceIndex == "1") {
  584. state.form.userName = data.name;
  585. state.form.gender = data.gender;
  586. state.form.userIdNum = data.idno;
  587. state.form.userPosImgUrl = data.imageUrl;
  588. state.form.address = data.address;
  589. } else {
  590. state.form.customerIdVld = data.enddate;
  591. state.form.userNegImgUrl = data.imageUrl;
  592. }
  593. state.isTakePhotoModeShow = false
  594. } else {
  595. if (state.choiceIndex == "1") {
  596. state.form.agentName = data.name;
  597. state.form.agentGender = data.gender;
  598. state.form.agentIdNum = data.idno;
  599. state.form.agentPosImgUrl = data.imageUrl;
  600. state.form.agentAddress = data.address;
  601. } else {
  602. console.log("state.isMy", state.isMy, state.choiceIndex, state.choiceIndex == "1", data)
  603. state.form.agentIdVld = data.enddate;
  604. state.form.agentNegImgUrl = data.imageUrl;
  605. }
  606. state.isTakePhotoModeShow = false
  607. }
  608. })
  609. }
  610. const cancle = () => {
  611. state.isTakePhotoModeShow = false
  612. }
  613. </script>
  614. <style lang="scss" scoped>
  615. .title {
  616. font-size: 35rpx;
  617. font-family: Microsoft YaHei;
  618. font-weight: 400;
  619. color: #000000;
  620. line-height: 80rpx;
  621. margin-bottom: 10rpx;
  622. }
  623. .content-wrap {
  624. position: relative;
  625. margin-top: -50rpx;
  626. padding: 0rpx 30rpx;
  627. display: flex;
  628. .big {
  629. font-size: 30rpx;
  630. font-family: Microsoft YaHei;
  631. font-weight: 400;
  632. color: #333333;
  633. line-height: 24rpx;
  634. }
  635. .nomal {
  636. font-size: 26rpx;
  637. font-family: Microsoft YaHei;
  638. font-weight: 400;
  639. color: #666666;
  640. line-height: 24rpx;
  641. }
  642. .tip {
  643. margin-top: -5px;
  644. width: 117rpx;
  645. height: 16rpx;
  646. background: #00b38b;
  647. opacity: 0.3;
  648. }
  649. }
  650. .content {
  651. padding: 50rpx 30rpx 50rpx 30rpx;
  652. .action {
  653. padding-left: 20rpx;
  654. padding-right: 20rpx;
  655. padding-bottom: 30rpx;
  656. .button {
  657. height: 80rpx;
  658. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  659. border-radius: 40rpx;
  660. font-size: 32rpx;
  661. font-weight: 400;
  662. color: #ffffff;
  663. line-height: 80rpx;
  664. }
  665. }
  666. .item-tips {
  667. .title {
  668. font-size: 30rpx;
  669. font-family: Microsoft YaHei;
  670. font-weight: 400;
  671. color: #000000;
  672. line-height: 24rpx;
  673. }
  674. .tip {
  675. margin-top: 16rpx;
  676. font-size: 24rpx;
  677. font-family: Microsoft YaHei;
  678. font-weight: 400;
  679. color: #999999;
  680. line-height: 24rpx;
  681. }
  682. }
  683. .picture-wrapper {
  684. margin-top: 40rpx;
  685. .bg {
  686. background: #ffffff;
  687. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  688. border-radius: 20rpx;
  689. padding: 40rpx;
  690. display: flex;
  691. // align-items: center;
  692. justify-content: space-between;
  693. .name {
  694. font-size: 34rpx;
  695. font-family: Microsoft YaHei;
  696. font-weight: 400;
  697. color: #000000;
  698. line-height: 34rpx;
  699. }
  700. .value {
  701. margin-top: 20rpx;
  702. font-size: 24rpx;
  703. font-family: Microsoft YaHei;
  704. font-weight: 400;
  705. color: #999999;
  706. line-height: 24rpx;
  707. }
  708. .tip {
  709. margin-top: 20rpx;
  710. text-align: center;
  711. width: 110rpx;
  712. height: 40rpx;
  713. background: rgba(33, 190, 177, 0.2);
  714. border-radius: 6rpx;
  715. .tip-value {
  716. font-size: 20rpx;
  717. font-family: Microsoft YaHei;
  718. font-weight: 400;
  719. color: #0a8f8a;
  720. line-height: 40rpx;
  721. opacity: 1;
  722. }
  723. }
  724. }
  725. .icon {
  726. width: 294rpx;
  727. height: 188rpx;
  728. }
  729. }
  730. .shibie-wrapper {
  731. margin-top: 60rpx;
  732. .title {
  733. font-size: 30rpx;
  734. font-family: Microsoft YaHei;
  735. font-weight: 400;
  736. color: #000000;
  737. line-height: 30rpx;
  738. }
  739. }
  740. .buchong-wrapper {
  741. margin-top: 60rpx;
  742. .title {
  743. font-size: 30rpx;
  744. font-family: Microsoft YaHei;
  745. font-weight: 400;
  746. color: #000000;
  747. line-height: 30rpx;
  748. }
  749. }
  750. .green-tip {
  751. margin-top: 50rpx;
  752. font-size: 24rpx;
  753. font-family: Microsoft YaHei;
  754. font-weight: 400;
  755. color: #00b38b;
  756. line-height: 24rpx;
  757. margin-bottom: 60rpx;
  758. }
  759. }
  760. .choice-takePhoto {
  761. position: absolute;
  762. bottom: 0;
  763. background-color: white;
  764. width: 100%;
  765. border-radius: 20rpx 20rpx 0 0;
  766. }
  767. .choice-takePhoto>view:first-child {
  768. text-align: center;
  769. height: 80rpx;
  770. line-height: 80rpx;
  771. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  772. background-color: white;
  773. }
  774. .choice-takePhoto>view:last-child {
  775. text-align: center;
  776. height: 80rpx;
  777. line-height: 80rpx;
  778. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  779. background-color: white;
  780. }
  781. .choice-takePhoto>view {
  782. text-align: center;
  783. height: 80rpx;
  784. line-height: 80rpx;
  785. background-color: white;
  786. }
  787. .choice-takePhoto-wrap {
  788. width: 100%;
  789. height: 100vh;
  790. background-color: rgba(127, 127, 127, 0.2);
  791. position: fixed;
  792. left: 0;
  793. top: 0;
  794. z-index: 11111;
  795. }
  796. </style>