Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

opening-account-people.vue 24KB

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