companyIdentity.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. <template>
  2. <view class="center">
  3. <view>
  4. <image @click='consent' style='width:14px;height:14px;position:relative;top:2px;margin-right:5px;'
  5. :src="consentStatus==true?'../../static/img/login/select@2x.png':'../../static/img/login/selected2.png'"
  6. alt=""></image>
  7. <text>公司</text>
  8. <image @click='consent' style='width:14px;height:14px;position:relative;top:2px;margin-right:5px;'
  9. :src="consentStatus1==true?'../../static/img/login/select@2x.png':'../../static/img/login/selected2.png'"
  10. alt=""></image>
  11. <text>个人</text>
  12. </view>
  13. <view v-if="consentStatus == true">
  14. <view>
  15. <button type="default" @click="license">上传营业执照</button>
  16. <view style="width: 100px;margin: 0 auto;" v-if="license1 != ''">
  17. <image v-bind:src = "license1" style="width: 100px;height: 100px;"></image>
  18. </view>
  19. </view>
  20. <view class="c-row b-b">
  21. <text class="tit">公司名称</text>
  22. <view class="con-list">
  23. <input placeholder="请填写公司名称" name="input" v-model="identityAuthenticationInfo.compName"></input>
  24. </view>
  25. </view>
  26. <view class="c-row b-b">
  27. <text class="tit">纳税人识别号</text>
  28. <view class="con-list">
  29. <input placeholder="请填写纳税人识别号" name="input"v-model="identityAuthenticationInfo.payTaxesCard"></input>
  30. </view>
  31. </view>
  32. <view>
  33. <button type="default" @click="idUp">上传身份证正面</button>
  34. <view style="width: 100px;margin: 0 auto;" v-if="id1 != ''">
  35. <image v-bind:src = "id1" style="width: 100px;height: 100px;"></image>
  36. </view>
  37. <button type="default" @click="idLow">上传身份证反面</button>
  38. <view style="width: 100px;margin: 0 auto;" v-if="id2 != ''">
  39. <image v-bind:src = "id2" style="width: 100px;height: 100px;"></image>
  40. </view>
  41. </view>
  42. <view class="c-row b-b">
  43. <text class="tit">姓名</text>
  44. <view class="con-list">
  45. <input placeholder="请填写姓名" name="input" v-model="identityAuthenticationInfo.customerName"></input>
  46. </view>
  47. </view>
  48. <view class="c-row b-b">
  49. <text class="tit">身份证号</text>
  50. <view class="con-list">
  51. <input placeholder="请填写身份证号" name="input"
  52. v-model="identityAuthenticationInfo.customerNumberCard"></input>
  53. </view>
  54. </view>
  55. <view>
  56. <button type="default" @click="bankUp()">上传银行卡正面</button>
  57. <view style="width: 100px;margin: 0 auto;" v-if="bank1 != ''">
  58. <image v-bind:src = "bank1" style="width: 100px;height: 100px;"></image>
  59. </view>
  60. <button type="default" @click="bankLow()">上传银行卡反面</button>
  61. <view style="width: 100px;margin: 0 auto;" v-if="bank2 != ''">
  62. <image v-bind:src = "bank2" style="width: 100px;height: 100px;"></image>
  63. </view>
  64. </view>
  65. <view class="c-row b-b">
  66. <text class="tit">银行卡号</text>
  67. <view class="con-list">
  68. <input placeholder="请填写银行卡号" name="input" v-model="identityAuthenticationInfo.bankCard"></input>
  69. </view>
  70. </view>
  71. <view class="c-row b-b">
  72. <text class="tit">开户行</text>
  73. <view class="con-list">
  74. <input placeholder="请填写开户行" name="input" v-model="identityAuthenticationInfo.bankDeposit"></input>
  75. </view>
  76. </view>
  77. <view class="c-row b-b">
  78. <text class="tit">开户支行</text>
  79. <view class="con-list">
  80. <input placeholder="请填写开户支行" name="input"
  81. v-model="identityAuthenticationInfo.bankDepositBranch"></input>
  82. </view>
  83. </view>
  84. <view class="c-row b-b">
  85. <text class="tit">手机号</text>
  86. <view class="con-list">
  87. <input placeholder="请填写手机号" @input='phoneinput' v-model="identityAuthenticationInfo.customerPhone"></input>
  88. </view>
  89. </view>
  90. <view style='width:100%;border-bottom:1px solid #E8E9ED;position:relative;padding:10px;' class="flex">
  91. <button :class='codestatus&&!sendDisabled?"active":""' @click='getcode'
  92. class='getcode'>{{sendText}}</button>
  93. <view style='width:70%;position:relative;margin-left: 200px;'>
  94. <input v-model='verifyCode' placeholder="请输入验证码" type="text">
  95. </view>
  96. </view>
  97. <view class="c-row b-b">
  98. <text class="tit">公司地址</text>
  99. <view class="con-list">
  100. <input placeholder="请填写公司地址" name="input" v-model="identityAuthenticationInfo.compAddress"></input>
  101. </view>
  102. </view>
  103. </view>
  104. <view v-else>
  105. <view>
  106. <button type="default" @click="idUp">上传身份证正面</button>
  107. <view style="width: 100px;margin: 0 auto;" v-if="id1 != ''">
  108. <image v-bind:src = "id1" style="width: 100px;height: 100px;"></image>
  109. </view>
  110. <button type="default" @click="idLow">上传身份证反面</button>
  111. <view style="width: 100px;margin: 0 auto;" v-if="id2 != ''">
  112. <image v-bind:src = "id2" style="width: 100px;height: 100px;"></image>
  113. </view>
  114. </view>
  115. <view class="c-row b-b">
  116. <text class="tit">姓名</text>
  117. <view class="con-list">
  118. <input placeholder="请填写姓名" name="input" v-model="identityAuthenticationInfo.customerName"></input>
  119. </view>
  120. </view>
  121. <view class="c-row b-b">
  122. <text class="tit">身份证号</text>
  123. <view class="con-list">
  124. <input placeholder="请填写身份证号" name="input"
  125. v-model="identityAuthenticationInfo.customerNumberCard"></input>
  126. </view>
  127. </view>
  128. <view>
  129. <button type="default" @click="bankUp()">上传银行卡正面</button>
  130. <view style="width: 100px;margin: 0 auto;" v-if="bank1 != ''">
  131. <image v-bind:src = "bank1" style="width: 100px;height: 100px;"></image>
  132. </view>
  133. <button type="default" @click="bankLow()">上传银行卡反面</button>
  134. <view style="width: 100px;margin: 0 auto;" v-if="bank2 != ''">
  135. <image v-bind:src = "bank2" style="width: 100px;height: 100px;"></image>
  136. </view>
  137. </view>
  138. <view class="c-row b-b">
  139. <text class="tit">银行卡号</text>
  140. <view class="con-list">
  141. <input placeholder="请填写银行卡号" name="input" v-model="identityAuthenticationInfo.bankCard"></input>
  142. </view>
  143. </view>
  144. <view class="c-row b-b">
  145. <text class="tit">开户行</text>
  146. <view class="con-list">
  147. <input placeholder="请填写开户行" name="input" v-model="identityAuthenticationInfo.bankDeposit"></input>
  148. </view>
  149. </view>
  150. <view class="c-row b-b">
  151. <text class="tit">开户支行</text>
  152. <view class="con-list">
  153. <input placeholder="请填写开户支行" name="input"
  154. v-model="identityAuthenticationInfo.bankDepositBranch"></input>
  155. </view>
  156. </view>
  157. <view class="c-row b-b">
  158. <text class="tit">收款人姓名</text>
  159. <view class="con-list">
  160. <input placeholder="请填写收款人姓名" name="input" v-model="identityAuthenticationInfo.payeeName"></input>
  161. </view>
  162. </view>
  163. <view class="c-row b-b">
  164. <text class="tit">收款人身份证号</text>
  165. <view class="con-list">
  166. <input placeholder="请填写收款身份证号" name="input"
  167. v-model="identityAuthenticationInfo.payeeNumberCard"></input>
  168. </view>
  169. </view>
  170. <view class="c-row b-b">
  171. <text class="tit">手机号</text>
  172. <view class="con-list">
  173. <input placeholder="请填写手机号" @input='phoneinput' v-model="identityAuthenticationInfo.customerPhone"></input>
  174. </view>
  175. </view>
  176. <view style='width:100%;border-bottom:1px solid #E8E9ED;position:relative;padding:10px;' class="flex">
  177. <button :class='codestatus&&!sendDisabled?"active":""' @click='getcode'
  178. class='getcode'>{{sendText}}</button>
  179. <view style='width:70%;position:relative;margin-left: 200px;'>
  180. <input v-model='verifyCode' placeholder="请输入验证码" type="text">
  181. </view>
  182. </view>
  183. <view class="c-row b-b">
  184. <text class="tit">联系地址</text>
  185. <view class="con-list">
  186. <input placeholder="请填写联系地址" name="input" v-model="identityAuthenticationInfo.compAddress"></input>
  187. </view>
  188. </view>
  189. </view>
  190. <view class="padding flex flex-direction">
  191. <button class="cu-btn bg-red margin-tb-sm lg" @click="commit">提交</button>
  192. </view>
  193. </view>
  194. </template>
  195. <script>
  196. import {
  197. mapState
  198. } from 'vuex';
  199. export default {
  200. name: "buy",
  201. data() {
  202. return {
  203. tupian:"",
  204. inputContent: null,
  205. customerPhone: '',
  206. consentStatus: true,
  207. consentStatus1: false,
  208. codestatus: false,
  209. verifyCode: null,
  210. inputStatus: 'none',
  211. sendText: '获取验证码',
  212. platform: '',
  213. sendDisabled: false,
  214. id:[],
  215. id1:"",
  216. id2:"",
  217. license1:"",
  218. bank1:"",
  219. bank2:"",
  220. bankid:[],
  221. identityAuthenticationInfo: {
  222. customerPhone: '',
  223. },
  224. tempFilePaths: [],
  225. businessLicenseAddressUrl:"",
  226. // userInfo:{
  227. // phone: ''
  228. // },
  229. identityAuthenticationInfo: {},
  230. };
  231. },
  232. computed: {
  233. ...mapState(['hasLogin','userInfo'])
  234. },
  235. methods: {
  236. consent() {
  237. if (this.consentStatus == false && this.consentStatus1 == true) {
  238. this.consentStatus = true
  239. this.consentStatus1 = false
  240. } else if (this.consentStatus == true && this.consentStatus1 == false) {
  241. this.consentStatus = false
  242. this.consentStatus1 = true
  243. }
  244. },
  245. license() {
  246. var that = this
  247. wx.chooseImage({
  248. success: function(res) {
  249. wx.uploadFile({
  250. url: 'https://www.zthymaoyi.com/upload/admin',
  251. filePath: res.tempFilePaths[0],
  252. name: 'file',
  253. success(res) {
  254. var data = res.data
  255. var strToObj = JSON.parse(data)
  256. that.identityAuthenticationInfo.businessLicenseAddressUrl = strToObj.url
  257. that.license1 = strToObj.url
  258. }
  259. })
  260. }
  261. })
  262. },
  263. idUp(){
  264. var that = this
  265. wx.chooseImage({
  266. success: function(res) {
  267. wx.uploadFile({
  268. url: 'https://www.zthymaoyi.com/upload/admin',
  269. filePath: res.tempFilePaths[0],
  270. name: 'file',
  271. success(res) {
  272. var data = res.data
  273. var strToObj = JSON.parse(data)
  274. that.id[0] = strToObj.url
  275. that.id1 = strToObj.url
  276. }
  277. })
  278. }
  279. })
  280. },
  281. idLow(){
  282. var that = this
  283. wx.chooseImage({
  284. success: function(res) {
  285. wx.uploadFile({
  286. url: 'https://www.zthymaoyi.com/upload/admin',
  287. filePath: res.tempFilePaths[0],
  288. name: 'file',
  289. success(res) {
  290. var data = res.data
  291. var strToObj = JSON.parse(data)
  292. that.id[1] = strToObj.url
  293. that.id2 = strToObj.url
  294. }
  295. })
  296. }
  297. })
  298. },
  299. bankUp(){
  300. var that = this
  301. wx.chooseImage({
  302. success: function(res) {
  303. wx.uploadFile({
  304. url: 'https://www.zthymaoyi.com/upload/admin',
  305. filePath: res.tempFilePaths[0],
  306. name: 'file',
  307. success(res) {
  308. var data = res.data
  309. var strToObj = JSON.parse(data)
  310. that.bankid[0] = strToObj.url
  311. that.bank1 = strToObj.url
  312. }
  313. })
  314. }
  315. })
  316. },
  317. bankLow(){
  318. var that = this
  319. wx.chooseImage({
  320. success: function(res) {
  321. wx.uploadFile({
  322. url: 'https://www.zthymaoyi.com/upload/admin',
  323. filePath: res.tempFilePaths[0],
  324. name: 'file',
  325. success(res) {
  326. var data = res.data
  327. var strToObj = JSON.parse(data)
  328. that.bankid[1] = strToObj.url
  329. that.bank2 = strToObj.url
  330. }
  331. })
  332. }
  333. })
  334. },
  335. commit() {
  336. this.identityAuthenticationInfo.commonId = this.userInfo.id
  337. this.identityAuthenticationInfo.cardAddressUrl = this.id.toString()
  338. this.identityAuthenticationInfo.payeeAddressUrl = this.bankid.toString()
  339. if(this.consentStatus1 == true){
  340. this.identityAuthenticationInfo.customerTypeFlag = "个人"
  341. }else if(this.consentStatus == true){
  342. this.identityAuthenticationInfo.customerTypeFlag = "企业"
  343. }
  344. this.$api.doRequest('post', '/identityAuthenticationInfo/api/addIdentityAuthenticationInfo', this
  345. .identityAuthenticationInfo)
  346. .then(res => {
  347. console.log(12545645)
  348. }).catch(res => {
  349. uni.showToast({
  350. title: res.data.message,
  351. icon: 'none',
  352. duration: 2000
  353. })
  354. })
  355. },
  356. getcode() {
  357. var that = this
  358. if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.identityAuthenticationInfo.customerPhone)) {
  359. this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
  360. phone: this.identityAuthenticationInfo.customerPhone
  361. }).then(res => {
  362. if (res.data.code == 200) {
  363. that.sendDisabled = true
  364. let sec = 60
  365. let interval = setInterval(() => {
  366. sec--;
  367. that.sendText = sec + 's后重发'
  368. if (sec <= 0) {
  369. that.sendDisabled = false
  370. that.sendText = "获取验证码"
  371. clearInterval(interval)
  372. }
  373. }, 1000)
  374. } else {
  375. uni.showToast({
  376. title: res.data.message,
  377. icon: 'none',
  378. duration: 2000
  379. })
  380. }
  381. })
  382. .catch(res => {
  383. uni.showToast({
  384. title: res.data.message,
  385. icon: 'none',
  386. duration: 2000
  387. })
  388. });
  389. } else {
  390. uni.showToast({
  391. title: '请输入正确的手机号',
  392. icon: 'none',
  393. duration: 2000
  394. })
  395. }
  396. },
  397. phoneinput(e){
  398. if(e.detail.value.length==11){
  399. this.codestatus=true
  400. }
  401. },
  402. verifyCodeInput(e) {
  403. this.verifyCode = e.detail.value
  404. },
  405. cancel() {
  406. this.inputShow = false
  407. this.inputStatus = 'none'
  408. this.isPhone = false
  409. },
  410. },
  411. }
  412. </script>
  413. <style>
  414. .center {
  415. padding: 10px 20px;
  416. }
  417. .c-row {
  418. display: -webkit-box;
  419. display: -webkit-flex;
  420. display: flex;
  421. -webkit-box-align: center;
  422. -webkit-align-items: center;
  423. align-items: center;
  424. padding: 20rpx 30rpx;
  425. position: relative;
  426. }
  427. .con-list {
  428. -webkit-box-flex: 1;
  429. -webkit-flex: 1;
  430. flex: 1;
  431. display: -webkit-box;
  432. display: -webkit-flex;
  433. display: flex;
  434. -webkit-box-orient: vertical;
  435. -webkit-box-direction: normal;
  436. -webkit-flex-direction: column;
  437. flex-direction: column;
  438. color: #303133;
  439. line-height: 40rpx;
  440. text-align: right;
  441. padding-right: 20rpx;
  442. font-size: 14px;
  443. }
  444. .getcode {
  445. font-size: 14px;
  446. position: absolute;
  447. top: 50%;
  448. transform: translateY(-50%);
  449. color: #AFB3BF;
  450. background: #F5F6F9;
  451. height: 30px;
  452. line-height: 30px;
  453. }
  454. .getcode.active {
  455. border: none;
  456. }
  457. .uni-navigator{
  458. display:inline-block;
  459. color:#22C572;
  460. }
  461. .getcode.active {
  462. background: #22C572;
  463. color: #fff;
  464. }
  465. </style>