companyIdentity.vue 12 KB

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