companyIdentity.vue 13 KB

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