companyIdentity.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. <template>
  2. <view class="center">
  3. <view v-if='!status' class="top">
  4. <text @click='consent' v-bind:class="switchs1">公司</text>
  5. <text @click='consent' v-bind:class="switchs2">个人</text>
  6. </view>
  7. <view class="content">
  8. <view v-if="consentStatus == true">
  9. <!-- 公司营业执照上传 -->
  10. <view v-if="license1 != ''">
  11. <upload :file-list='businesslicense' v-if="consentStatus == true" class="upload" ref="upload" :action="action"
  12. :max-size="maxSize" delIconSize='30' delBgColor='rgba(0,0,0,0.4)' delIcon="trash" :max-count="1" :size-type="['compressed']" @on-success="getImgUrl"
  13. @on-remove="onRemove" @on-uploaded="isAdd = true" :before-upload="filterFileType"
  14. :options="uploadOptions" :custom="uploadCustom"></upload>
  15. </view>
  16. <view class="person-info">
  17. <view class="c-row b-b">
  18. <text class="tit_red">*</text>
  19. <text class="tit">公司名称</text>
  20. <view class="con-list">
  21. <input placeholder="请填写公司名称" name="input"
  22. v-model="identityAuthenticationInfo.compName"></input>
  23. </view>
  24. </view>
  25. <view class="c-row">
  26. <text class="tit">纳税人识别号</text>
  27. <view class="con-list">
  28. <input type='number' placeholder="请填写纳税人识别号" name="input"
  29. v-model="identityAuthenticationInfo.payTaxesCard"></input>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view v-else>
  35. <view>
  36. <!-- <image src="../../static/img/authentication/business.png" mode=""></image> -->
  37. <!-- 个人身份证正面 -->
  38. <upload class="upload" ref="upload1" delIcon="trash" :action="action" :max-size="maxSize" :max-count="1"
  39. :size-type="['compressed']" @on-success="getImgUrl1" @on-remove="onRemove"
  40. @on-uploaded="isAdd = true" :before-upload="filterFileType" :options="uploadOptions1"
  41. :custom="uploadCustom1"></upload>
  42. <!-- 个人身份证反面 -->
  43. <upload class="upload" ref="upload2" delIcon="trash" :action="action" :max-size="maxSize" :max-count="1"
  44. :size-type="['compressed']" @on-success="getImgUrl2" @on-remove="onRemove"
  45. @on-uploaded="isAdd = true" :before-upload="filterFileType" :options="uploadOptions2"
  46. :custom="uploadCustom2"></upload>
  47. </view>
  48. <view class="person-info">
  49. <view class="c-row b-b">
  50. <text class="tit_red">*</text>
  51. <text class="tit">姓名</text>
  52. <view class="con-list">
  53. <input placeholder="请填写姓名" name="input"
  54. v-model="identityAuthenticationInfo.customerName"></input>
  55. </view>
  56. </view>
  57. <view class="c-row b-b">
  58. <text class="tit_red">*</text>
  59. <text class="tit">身份证号</text>
  60. <view class="con-list">
  61. <input placeholder="请填写身份证号" name="input"
  62. v-model="identityAuthenticationInfo.customerNumberCard"></input>
  63. </view>
  64. </view>
  65. <view class="c-row">
  66. <text class="tit_red">*</text>
  67. <text class="tit">联系地址</text>
  68. <view class="con-list">
  69. <input placeholder="请填写联系地址" name="input"
  70. v-model="identityAuthenticationInfo.compAddress"></input>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. <button class="btns btn" @click="jumpUrl">下一步</button>
  76. </view>
  77. </view>
  78. </template>
  79. <script>
  80. import upload from '@/components/upload.vue';
  81. import {
  82. mapState
  83. } from 'vuex';
  84. export default {
  85. components: {
  86. upload
  87. },
  88. name: "buy",
  89. data() {
  90. return {
  91. isShowPerson:false,
  92. action: this.$uploadUrl,
  93. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  94. btnLoading: false, //防止重复点击
  95. isAdd: true,
  96. uploadCustom: true,
  97. uploadCustom1: true,
  98. uploadCustom2: true,
  99. businesslicense:[],
  100. uploadOptions: {
  101. "text": "上传营业执照",
  102. "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/admin/0dd1401f54e34affaa11c711d808a0a0.png"
  103. },
  104. uploadOptions1: {
  105. "text": "上传身份证头像页",
  106. "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/identityup%282%29.png"
  107. },
  108. uploadOptions2: {
  109. "text": "上传身份证国徽页",
  110. "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/identitylow%282%29.png"
  111. },
  112. tupian: "",
  113. inputContent: null,
  114. customerPhone: '',
  115. consentStatus: true,
  116. consentStatus1: false,
  117. codestatus: false,
  118. verifyCode: null,
  119. inputStatus: 'none',
  120. sendText: '获取验证码',
  121. platform: '',
  122. sendDisabled: false,
  123. license1: "../../static/img/authentication/business@3x.png",
  124. switchs1: "switchs1",
  125. switchs2: "switchs2",
  126. id: [],
  127. id1: "../../static/img/authentication/identityup(3).png",
  128. id2: "../../static/img/authentication/identitylow(3).png",
  129. identityImgs1: {},
  130. status:false,
  131. identityAuthenticationInfo: {},
  132. tempFilePaths: [],
  133. businessLicenseAddressUrl: "",
  134. certificates: true,
  135. isEdit:false
  136. };
  137. },
  138. computed: {
  139. ...mapState(['hasLogin', 'userInfo'])
  140. },
  141. onLoad(options) {
  142. // this.isEdit = options.isEdit;
  143. if(options.status){
  144. this.status=true
  145. this.consentStatus = false
  146. this.consentStatus1 = true
  147. this.switchs1 = "switchs2"
  148. this.switchs2 = "switchs1"
  149. }
  150. if(options.id){
  151. this.$api.doRequest('get', '/identityAuthenticationInfo/api/getIdentityAuthenticationInfo', {id:options.id},
  152. 'application/json;charset=UTF-8').then(res => {
  153. console.log("成功连接")
  154. this.identityAuthenticationInfo = res.data.data
  155. if (this.identityAuthenticationInfo.businessLicenseAddressUrl != "") {
  156. this.businesslicense=[{url:this.identityAuthenticationInfo.businessLicenseAddressUrl}]
  157. }
  158. console.log(this.businesslicense)
  159. // if (this.deptList.cardAddressUrl != "") {
  160. // this.id = this.deptList.cardAddressUrl.split(",")
  161. // this.idup = this.id[0]
  162. // this.idlow = this.id[1]
  163. // }
  164. // if (this.deptList.payeeAddressUrl != "") {
  165. // this.payeeAddress = this.deptList.payeeAddressUrl.split(","),
  166. // this.bank1 = this.payeeAddress[0]
  167. // this.bank2 = this.payeeAddress[1]
  168. // }
  169. // console.log(this.deptList.customerTypeFlag, "判断")
  170. if (this.identityAuthenticationInfo.customerTypeFlag == 2) {
  171. this.consentStatus = true
  172. this.consentStatus1 = true
  173. this.switchs1 = "switchs1"
  174. this.switchs2 = "switchs2"
  175. } else {
  176. this.consentStatus = false
  177. this.consentStatus1 = true
  178. this.switchs1 = "switchs2"
  179. this.switchs2 = "switchs1"
  180. }
  181. })
  182. .catch(res => {
  183. if (res.errmsg) {
  184. uni.showToast({
  185. title: res.errmsg,
  186. icon: 'none',
  187. duration: 2000
  188. })
  189. } else {
  190. uni.showToast({
  191. title: "系统异常,请联系管理员",
  192. icon: 'none',
  193. duration: 2000
  194. })
  195. }
  196. });
  197. }
  198. },
  199. onShow(){
  200. },
  201. methods: {
  202. filterFileType(index, lists) {
  203. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  204. lists.splice(index, 1);
  205. // 当前文件不支持
  206. uni.showModal({
  207. title: '暂不支持当前图片类型',
  208. showCancel: false
  209. });
  210. } else {
  211. this.isAdd = false;
  212. }
  213. },
  214. // 营业执照上传
  215. getImgUrl(res) {
  216. console.log(res)
  217. console.log('------------res-----------')
  218. this.identityAuthenticationInfo.businessLicenseAddressUrl = res
  219. },
  220. // 身份证正面
  221. getImgUrl1(res) {
  222. console.log(res)
  223. let that = this
  224. that.id[0] = res
  225. that.id1 = res
  226. that.identityImgs1.personImg = res
  227. that.$api.doRequest('get', '/driverViewInfo/personShibie', that
  228. .identityImgs1).then(res => {
  229. if (res.data.data.recPerson != null) {
  230. if (res.data.data.recPerson != "") {
  231. that.$set(that.identityAuthenticationInfo,
  232. 'customerName', res.data.data.recPerson)
  233. }
  234. }
  235. if (res.data.data.recPersonNo != null) {
  236. if (res.data.data.recPersonNo != "") {
  237. that.$set(that.identityAuthenticationInfo,
  238. 'customerNumberCard', res.data.data
  239. .recPersonNo)
  240. }
  241. }
  242. if (res.data.data.recPersonAddr != null) {
  243. if (res.data.data.recPersonAddr != "") {
  244. that.$set(that.identityAuthenticationInfo, 'compAddress', res.data.data
  245. .recPersonAddr)
  246. }
  247. }
  248. }).catch(res => {
  249. uni.showToast({
  250. title: res.data.message,
  251. icon: 'none',
  252. duration: 2000
  253. })
  254. })
  255. },
  256. // 身份证反面
  257. getImgUrl2(res) {
  258. console.log(res)
  259. let that = this
  260. that.id[1] = res
  261. that.id2 = res
  262. that.identityImgs1.personImg = res
  263. that.$api.doRequest('get', '/driverViewInfo/personShibie', that
  264. .identityImgs1).then(res => {
  265. if (res.data.data.recPerson != null) {
  266. if (res.data.data.recPerson != "") {
  267. that.$set(that.identityAuthenticationInfo,
  268. 'customerName', res.data.data.recPerson)
  269. }
  270. }
  271. if (res.data.data.recPersonNo != null) {
  272. if (res.data.data.recPersonNo != "") {
  273. that.$set(that.identityAuthenticationInfo,
  274. 'customerNumberCard', res.data.data
  275. .recPersonNo)
  276. }
  277. }
  278. if (res.data.data.recPersonAddr != null) {
  279. if (res.data.data.recPersonAddr != "") {
  280. that.$set(that.identityAuthenticationInfo, 'compAddress', res.data.data
  281. .recPersonAddr)
  282. }
  283. }
  284. }).catch(res => {
  285. uni.showToast({
  286. title: res.data.message,
  287. icon: 'none',
  288. duration: 2000
  289. })
  290. })
  291. },
  292. onError(error) {
  293. alert(error)
  294. console.log('------------error-----------')
  295. console.log(error)
  296. },
  297. onProgress(e) {
  298. console.log(e)
  299. },
  300. onRemove(index) {},
  301. jumpUrl() {
  302. if (this.consentStatus) {
  303. if (!this.identityAuthenticationInfo.compName) {
  304. this.$api.msg('公司名称不能为空')
  305. return
  306. }
  307. if (this.identityAuthenticationInfo.compName.length < 2 || this.identityAuthenticationInfo.compName
  308. .length > 25) {
  309. this.$api.msg('公司名称输入错误')
  310. return
  311. }
  312. // if (!this.identityAuthenticationInfo.payTaxesCard) {
  313. // this.$api.msg('纳税人识别号不能为空')
  314. // return
  315. // }
  316. // if (this.identityAuthenticationInfo.payTaxesCard.length < 15 || this.identityAuthenticationInfo
  317. // .payTaxesCard.length > 20) {
  318. // this.$api.msg('纳税人识别号输入错误')
  319. // return
  320. // }
  321. // if (this.identityAuthenticationInfo.businessLicenseAddressUrl == "" || this.identityAuthenticationInfo
  322. // .businessLicenseAddressUrl == null) {
  323. // this.$api.msg('请上传营业执照')
  324. // return
  325. // }
  326. this.identityAuthenticationInfo.customerTypeFlag = "2"
  327. this.identityAuthenticationInfo.customerType = "企业"
  328. var model = JSON.stringify(this.identityAuthenticationInfo);
  329. uni.navigateTo({
  330. url: `/pageD/identity/companyIdentityTwo?identityAuthenticationInfo=` + model,
  331. })
  332. } else if (this.consentStatus1) {
  333. this.identityAuthenticationInfo.cardAddressUrl = this.id.toString()
  334. if (this.id[0] == '' || this.id[0] == null) {
  335. this.$api.msg('请上传身份证正面')
  336. return
  337. }
  338. // if (this.id[1] == '' || this.id[1] == null) {
  339. // this.$api.msg('请上传身份证反面')
  340. // return
  341. // }
  342. if (!this.identityAuthenticationInfo.customerName) {
  343. this.$api.msg('姓名不能为空')
  344. return
  345. }
  346. if (this.identityAuthenticationInfo.customerName.length < 2 || this.identityAuthenticationInfo
  347. .customerName.length > 10) {
  348. this.$api.msg('姓名输入错误')
  349. return
  350. }
  351. if (!this.identityAuthenticationInfo.customerNumberCard) {
  352. this.$api.msg('身份证号不能为空')
  353. return
  354. }
  355. if (this.identityAuthenticationInfo.customerNumberCard.length != 18) {
  356. this.$api.msg('身份证号输入错误')
  357. return
  358. }
  359. this.identityAuthenticationInfo.customerTypeFlag = "1"
  360. this.identityAuthenticationInfo.customerType = "个人"
  361. var model = JSON.stringify(this.identityAuthenticationInfo);
  362. uni.navigateTo({
  363. url: `/pageD/identity/companyIdentityThree?identityAuthenticationInfo=` + model,
  364. })
  365. }
  366. },
  367. consent() {
  368. if (this.consentStatus == false && this.consentStatus1 == true) {
  369. this.consentStatus = true
  370. this.consentStatus1 = false
  371. this.switchs1 = "switchs1"
  372. this.switchs2 = "switchs2"
  373. } else if (this.consentStatus == true && this.consentStatus1 == false) {
  374. this.consentStatus = false
  375. this.consentStatus1 = true
  376. this.switchs1 = "switchs2"
  377. this.switchs2 = "switchs1"
  378. }
  379. },
  380. phoneinput(e) {
  381. if (e.detail.value.length == 11) {
  382. this.codestatus = true
  383. }
  384. },
  385. verifyCodeInput(e) {
  386. this.verifyCode = e.detail.value
  387. },
  388. cancel() {
  389. this.inputShow = false
  390. this.inputStatus = 'none'
  391. this.isPhone = false
  392. },
  393. },
  394. }
  395. </script>
  396. <style>
  397. .center {
  398. /* padding: 10px 20px; */
  399. }
  400. .top {
  401. background: white;
  402. padding: 10px 20px;
  403. border-radius: 0 0 20rpx 20rpx;
  404. }
  405. .content {
  406. padding: 10px 20px;
  407. }
  408. .c-row {
  409. display: -webkit-box;
  410. display: -webkit-flex;
  411. display: flex;
  412. -webkit-box-align: center;
  413. -webkit-align-items: center;
  414. align-items: center;
  415. padding: 20rpx 30rpx;
  416. position: relative;
  417. }
  418. .con-list {
  419. -webkit-box-flex: 1;
  420. -webkit-flex: 1;
  421. flex: 1;
  422. display: -webkit-box;
  423. display: -webkit-flex;
  424. display: flex;
  425. -webkit-box-orient: vertical;
  426. -webkit-box-direction: normal;
  427. -webkit-flex-direction: column;
  428. flex-direction: column;
  429. color: #303133;
  430. line-height: 40rpx;
  431. text-align: right;
  432. padding-right: 20rpx;
  433. font-size: 14px;
  434. }
  435. .uni-navigator {
  436. display: inline-block;
  437. color: #22C572;
  438. }
  439. .getcode.active {
  440. background: #22C572;
  441. color: #fff;
  442. }
  443. .btn {
  444. margin-top: 10px;
  445. background-color: #FFFFFF;
  446. border-radius: 25px;
  447. border: none;
  448. }
  449. .btns {
  450. background-color: #22C572;
  451. color: white;
  452. }
  453. .switchs1 {
  454. font-size: 20px;
  455. font-weight: 700;
  456. margin-right: 16px;
  457. position: relative;
  458. }
  459. .switchs1::after,
  460. .switchs2::after {
  461. background: #22C572;
  462. width: 20px;
  463. height: 4px;
  464. content: ' ';
  465. position: absolute;
  466. bottom: -20rpx;
  467. left: 0;
  468. right: 0;
  469. margin: auto;
  470. }
  471. .switchs2 {
  472. font-size: 20px;
  473. margin-right: 16px;
  474. }
  475. .picture {
  476. width: 100%;
  477. height: 220px;
  478. text-align: center;
  479. margin-top: 10px;
  480. }
  481. .words {
  482. font-size: 18px;
  483. font-weight: 600;
  484. color: #617E8B;
  485. }
  486. .floats {
  487. position: relative;
  488. top: -150px;
  489. text-align: center;
  490. }
  491. .upload {
  492. margin: 20rpx 0;
  493. }
  494. .tit_red {
  495. color: #E54D42;
  496. }
  497. .person-info{
  498. background: white;
  499. padding: 20rpx;
  500. border-radius: 20rpx;
  501. margin-bottom: 50rpx;
  502. }
  503. </style>