companyIdentity.vue 11 KB

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