companyIdentityThree.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. <template>
  2. <view class="center">
  3. <view>
  4. <view style="margin: 0 auto;height: 240px;" v-if="bank1 != ''" @click="bankUp()">
  5. <image v-bind:src="bank1" class="picture"></image>
  6. <view class="floats" v-if="certificates == true">
  7. <image src="../../static/img/authentication/xiangji@3x.png" style="width: 60px;height: 50px;">
  8. </image>
  9. <view class="words">
  10. 上传银行卡正面
  11. </view>
  12. </view>
  13. </view>
  14. <view style="margin: 0 auto;height: 240px;" v-if="bank2 != ''" @click="bankLow()">
  15. <image v-bind:src="bank2" class="picture"></image>
  16. <view class="floats" v-if="certificatesTwo == true">
  17. <image src="../../static/img/authentication/xiangji@3x.png" style="width: 60px;height: 50px;">
  18. </image>
  19. <view class="words">
  20. 上传银行卡反面
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="c-row b-b">
  26. <text class="tit">银行卡号</text>
  27. <view class="con-list">
  28. <input placeholder="请填写银行卡号" name="input" v-model="identityAuthenticationInfo.bankCard"></input>
  29. </view>
  30. </view>
  31. <view class="c-row b-b">
  32. <text class="tit">开户行</text>
  33. <view class="con-list">
  34. <input placeholder="请填写开户行" name="input" v-model="identityAuthenticationInfo.bankDeposit"></input>
  35. </view>
  36. </view>
  37. <view class="c-row b-b">
  38. <!-- <text class="tit">开户支行</text>
  39. <picker @change="bankChange" :value="bankIndex" :range="bankType" class="con-list">
  40. <view class="con-list">
  41. {{bankIndex>-1?bankType[bankIndex]:'请选择开户支行'}}
  42. </view>
  43. </picker> -->
  44. <text class="tit">开户支行</text>
  45. <view v-if="zhihangStatus" class="con-list">
  46. <picker @change="bankChange" :value="bankIndex" :range="bankType" class="con-list">
  47. <view class="con-list">
  48. {{bankIndex>-1?bankType[bankIndex]:'请选择开户支行'}}
  49. </view>
  50. </picker>
  51. </view>
  52. <view v-else class="con-list">
  53. <input placeholder="请填写" name="input" v-model="identityAuthenticationInfo.bankDepositBranch"></input>
  54. </view>
  55. <button v-if="zhihangStatus" class='cu-btn bg-green shadow' @click="changeZhihang">填写</button>
  56. <button v-else class='cu-btn bg-green shadow' @click="changeZhihang">识别</button>
  57. </view>
  58. <view class="c-row b-b" v-if="identityAuthenticationInfo.customerTypeFlag == 1">
  59. <text class="tit">收款人姓名</text>
  60. <view class="con-list">
  61. <input placeholder="请填写收款人姓名" name="input" v-model="identityAuthenticationInfo.payeeName"></input>
  62. </view>
  63. </view>
  64. <view class="c-row b-b" v-if="identityAuthenticationInfo.customerTypeFlag == 1">
  65. <text class="tit">收款人身份证号</text>
  66. <view class="con-list">
  67. <input placeholder="请填写收款人身份证号" name="input"
  68. v-model="identityAuthenticationInfo.payeeNumberCard"></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="请填写手机号" v-model="identityAuthenticationInfo.customerPhone"></input>
  75. </view>
  76. </view>
  77. <view style='width:100%;border-bottom:1px solid #E8E9ED;position:relative;padding:10px;' class="flex">
  78. <button :class='codestatus&&!sendDisabled?"active":""' @click='obtain'
  79. class='getcode'>{{sendText}}</button>
  80. <view style='width:70%;position:relative;margin-left: 200px;'>
  81. <input v-model='verifyCode' placeholder="请输入验证码" type="number">
  82. </view>
  83. </view>
  84. <view class="c-row b-b" v-if="identityAuthenticationInfo.customerTypeFlag == 2">
  85. <text class="tit">公司地址</text>
  86. <view class="con-list">
  87. <input placeholder="请填写公司地址" name="input" v-model="identityAuthenticationInfo.compAddress"></input>
  88. </view>
  89. </view>
  90. <view class="c-row b-b" v-if="identityAuthenticationInfo.customerTypeFlag == 1">
  91. <text class="tit">联系地址</text>
  92. <view class="con-list">
  93. <input placeholder="请填写联系地址" name="input" v-model="identityAuthenticationInfo.compAddress"></input>
  94. </view>
  95. </view>
  96. <button class="btns btn" @click="commit">提交</button>
  97. </view>
  98. </template>
  99. <script>
  100. import {
  101. mapState
  102. } from 'vuex';
  103. export default {
  104. name: "buy",
  105. data() {
  106. return {
  107. bank1: "../../static/img/authentication/bankup(3).png",
  108. bank2: "../../static/img/authentication/banklow(3).png",
  109. bankid: [],
  110. consentStatus: true,
  111. consentStatus1: false,
  112. codestatus: false,
  113. verifyCode: null,
  114. inputStatus: 'none',
  115. sendText: '获取验证码',
  116. platform: '',
  117. sendDisabled: false,
  118. identityAuthenticationInfo: {},
  119. bankImgs1: {},
  120. bankIndex: -1,
  121. bankType: [],
  122. certificates:true,
  123. certificatesTwo:true,
  124. zhihangStatus:true,
  125. verification:true,
  126. }
  127. },
  128. computed: {
  129. ...mapState(['hasLogin', 'userInfo'])
  130. },
  131. onLoad(options) {
  132. this.identityAuthenticationInfo = JSON.parse(options.identityAuthenticationInfo)
  133. if(this.identityAuthenticationInfo.customerTypeFlag == 1){
  134. this.identityAuthenticationInfo.payeeName = this.identityAuthenticationInfo.customerName
  135. this.identityAuthenticationInfo.payeeNumberCard = this.identityAuthenticationInfo.customerNumberCard
  136. }
  137. },
  138. methods: {
  139. obtain(){
  140. if(this.sendText == "获取验证码")
  141. this.getcode()
  142. },
  143. bankUp() {
  144. var that = this
  145. wx.chooseImage({
  146. success: function(res) {
  147. wx.uploadFile({
  148. url: 'https://www.zthymaoyi.com/upload/admin',
  149. filePath: res.tempFilePaths[0],
  150. name: 'file',
  151. success(res) {
  152. var data = res.data
  153. var strToObj = JSON.parse(data)
  154. that.bankid[0] = strToObj.url
  155. that.bank1 = strToObj.url
  156. that.certificates = false
  157. that.bankImgs1.bankImg = strToObj.url
  158. that.$api.doRequest('get', '/driverViewInfo/bankShibie', that.bankImgs1).then(res => {
  159. if(res.data.data.bankNo != null){
  160. if(res.data.data.bankNo != ""){
  161. that.$set(that.identityAuthenticationInfo, 'bankCard', res.data.data.bankNo)
  162. }
  163. }
  164. if(res.data.data.bankName != null ){
  165. if(res.data.data.bankName != "") {
  166. that.$set(that.identityAuthenticationInfo, 'bankDeposit',res.data.data.bankName)
  167. }
  168. }
  169. if(res.data.data.bankNameZhihang.length != 0){
  170. that.bankType = res.data.data.bankNameZhihang
  171. }
  172. }).catch(res => {
  173. uni.showToast({
  174. title: res.data.message,
  175. icon: 'none',
  176. duration: 2000
  177. })
  178. })
  179. }
  180. })
  181. }
  182. })
  183. },
  184. bankLow() {
  185. var that = this
  186. wx.chooseImage({
  187. success: function(res) {
  188. wx.uploadFile({
  189. url: 'https://www.zthymaoyi.com/upload/admin',
  190. filePath: res.tempFilePaths[0],
  191. name: 'file',
  192. success(res) {
  193. var data = res.data
  194. var strToObj = JSON.parse(data)
  195. that.bankid[1] = strToObj.url
  196. that.bank2 = strToObj.url
  197. that.certificatesTwo = false
  198. that.bankImgs1.bankImg = strToObj.url
  199. that.$api.doRequest('get', '/driverViewInfo/bankShibie', that.bankImgs1).then(res => {
  200. if(res.data.data.bankNo != null){
  201. if(res.data.data.bankNo != ""){
  202. that.$set(that.identityAuthenticationInfo, 'bankCard', res.data.data.bankNo)
  203. }
  204. }
  205. if(res.data.data.bankName != null ){
  206. if(res.data.data.bankName != "") {
  207. that.$set(that.identityAuthenticationInfo, 'bankDeposit',res.data.data.bankName)
  208. }
  209. }
  210. if(res.data.data.bankNameZhihang != null){
  211. that.bankType = res.data.data.bankNameZhihang
  212. }
  213. }).catch(res => {
  214. uni.showToast({
  215. title: res.data.message,
  216. icon: 'none',
  217. duration: 2000
  218. })
  219. })
  220. }
  221. })
  222. }
  223. })
  224. },
  225. bankChange(e) {
  226. this.bankIndex = e.detail.value
  227. this.Model = this.bankType[this.bankIndex];
  228. this.identityAuthenticationInfo.bankDepositBranch = this.bankType[this.bankIndex];
  229. },
  230. changeZhihang(){
  231. this.zhihangStatus = !this.zhihangStatus
  232. },
  233. commit() {
  234. var that=this
  235. if (this.bankid[0] == '' || this.bankid[0] == null) {
  236. this.$api.msg('请上传银行卡正面')
  237. return
  238. }
  239. if (this.bankid[1] == '' || this.bankid[1] == null) {
  240. this.$api.msg('请上传银行卡反面')
  241. return
  242. }
  243. if (!this.identityAuthenticationInfo.bankCard) {
  244. this.$api.msg('银行卡号不能为空')
  245. return
  246. }
  247. if (this.identityAuthenticationInfo.bankCard.length < 16 || this.identityAuthenticationInfo.bankCard.length > 19 ) {
  248. this.$api.msg('银行卡号输入错误')
  249. return
  250. }
  251. if (!this.identityAuthenticationInfo.bankDeposit) {
  252. this.$api.msg('开户行不能为空')
  253. return
  254. }
  255. if (this.identityAuthenticationInfo.bankDeposit.length < 4 || this.identityAuthenticationInfo.bankDeposit.length > 15) {
  256. this.$api.msg('开户行输入错误')
  257. return
  258. }
  259. if (!this.identityAuthenticationInfo.bankDepositBranch) {
  260. this.$api.msg('开户支行不能为空')
  261. return
  262. }
  263. if (this.identityAuthenticationInfo.bankDepositBranch.length < 4 || this.identityAuthenticationInfo.bankDepositBranch.length > 30) {
  264. this.$api.msg('开户支行输入错误')
  265. return
  266. }
  267. if (!this.identityAuthenticationInfo.customerPhone) {
  268. this.$api.msg('手机号不能为空')
  269. return
  270. }
  271. if (this.identityAuthenticationInfo.customerPhone.length != 11) {
  272. this.$api.msg('手机号填写不正确')
  273. return
  274. }
  275. if(this.identityAuthenticationInfo.customerTypeFlag == 1){
  276. if (!this.identityAuthenticationInfo.payeeName) {
  277. this.$api.msg('收款人姓名不能为空')
  278. return
  279. }
  280. if (this.identityAuthenticationInfo.payeeName < 2 || this.identityAuthenticationInfo.payeeName > 10 ) {
  281. this.$api.msg('收款人姓名输入错误')
  282. return
  283. }
  284. if (!this.identityAuthenticationInfo.payeeNumberCard) {
  285. this.$api.msg('收款人身份证号不能为空')
  286. return
  287. }
  288. if (this.identityAuthenticationInfo.payeeNumberCard.length != 18) {
  289. this.$api.msg('收款人身份证号输入错误')
  290. return
  291. }
  292. if (!this.identityAuthenticationInfo.compAddress) {
  293. this.$api.msg('联系地址不能为空')
  294. return
  295. }
  296. if (this.identityAuthenticationInfo.compAddress.length < 2 || this.identityAuthenticationInfo.compAddress.length > 20) {
  297. this.$api.msg('联系地址输入错误')
  298. return
  299. }
  300. }else if(this.identityAuthenticationInfo.customerTypeFlag == 2){
  301. if (!this.identityAuthenticationInfo.compAddress) {
  302. this.$api.msg('公司地址不能为空')
  303. return
  304. }
  305. if (this.identityAuthenticationInfo.compAddress.length < 2 || this.identityAuthenticationInfo.compAddress.length > 20) {
  306. this.$api.msg('公司地址输入错误')
  307. return
  308. }
  309. }
  310. this.identityAuthenticationInfo.commonId = this.userInfo.id
  311. this.identityAuthenticationInfo.payeeAddressUrl = this.bankid.toString()
  312. this.identityAuthenticationInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
  313. if(this.amendprice() == false){
  314. this.$api.msg('验证码输入有误!')
  315. return
  316. }
  317. this.$api.doRequest('post', '/identityAuthenticationInfo/api/addIdentityAuthenticationInfo', this
  318. .identityAuthenticationInfo)
  319. .then(res => {
  320. if(res.data.code=='11018'){
  321. uni.showModal({
  322. title: '提示',
  323. content: '该手机号已认证过个人粮商,再次认证将覆盖之前的认证信息,是否确定认证?',
  324. success: function (res) {
  325. if (res.confirm) {
  326. that.identityAuthenticationInfo.cover=1
  327. that.$api.doRequest('post', '/identityAuthenticationInfo/api/editIdentityAuthenticationInfo', that.identityAuthenticationInfo).then(res => {
  328. uni.showToast({
  329. title: '提交成功',
  330. icon: 'none',
  331. duration: 2000
  332. })
  333. uni.navigateTo({
  334. url: `/pages/attestation/indexTwo` ,
  335. })
  336. }).catch(res => {
  337. uni.showToast({
  338. title: res.data.message,
  339. icon: 'none',
  340. duration: 2000
  341. })
  342. })
  343. } else if (res.cancel) {
  344. uni.showToast({
  345. title: '提交失败',
  346. icon: 'none',
  347. duration: 2000
  348. })
  349. }
  350. }
  351. });
  352. }else if(res.data.code==200){
  353. uni.showToast({
  354. title: '提交成功',
  355. icon: 'none',
  356. duration: 2000
  357. })
  358. uni.navigateTo({
  359. url: `/pages/attestation/indexTwo` ,
  360. })
  361. }else{
  362. uni.showToast({
  363. title: res.data.message,
  364. icon: 'none',
  365. duration: 2000
  366. })
  367. }
  368. }).catch(res => {
  369. uni.showToast({
  370. title: res.data.message,
  371. icon: 'none',
  372. duration: 2000
  373. })
  374. })
  375. },
  376. phoneinput(e){
  377. if(e.detail.value.length==11){
  378. this.codestatus=true
  379. }
  380. },
  381. amendprice(item) {
  382. var that = this
  383. this.$api.doRequest('get', '/commonUser/loginVerifyCode', {
  384. phone: this.identityAuthenticationInfo.customerPhone,
  385. verifyCode: this.verifyCode
  386. }).then(res => {
  387. if (res.data.code == 200) {
  388. } else {
  389. that.verification = false
  390. uni.showToast({
  391. title: res.data.message,
  392. icon: 'none',
  393. duration: 2000
  394. })
  395. return false
  396. }
  397. })
  398. .catch(res => {
  399. that.verification = false
  400. uni.showToast({
  401. title: res.data.message,
  402. icon: 'none',
  403. duration: 2000
  404. })
  405. return false
  406. });
  407. },
  408. getcode() {
  409. var that = this
  410. if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.identityAuthenticationInfo.customerPhone)) {
  411. this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
  412. phone: this.identityAuthenticationInfo.customerPhone
  413. }).then(res => {
  414. if (res.data.code == 200) {
  415. that.sendDisabled = true
  416. let sec = 60
  417. let interval = setInterval(() => {
  418. sec--;
  419. that.sendText = sec + 's后重发'
  420. if (sec <= 0) {
  421. that.sendDisabled = false
  422. that.sendText = "获取验证码"
  423. clearInterval(interval)
  424. }
  425. }, 1000)
  426. } else {
  427. uni.showToast({
  428. title: res.data.message,
  429. icon: 'none',
  430. duration: 2000
  431. })
  432. return
  433. }
  434. })
  435. .catch(res => {
  436. uni.showToast({
  437. title: res.data.message,
  438. icon: 'none',
  439. duration: 2000
  440. })
  441. return
  442. });
  443. } else {
  444. uni.showToast({
  445. title: '请输入正确的手机号',
  446. icon: 'none',
  447. duration: 2000
  448. })
  449. }
  450. },
  451. }
  452. }
  453. </script>
  454. <style>
  455. .center {
  456. padding: 10px 20px;
  457. background-color: #F5F6FA;
  458. }
  459. .c-row {
  460. display: -webkit-box;
  461. display: -webkit-flex;
  462. display: flex;
  463. -webkit-box-align: center;
  464. -webkit-align-items: center;
  465. align-items: center;
  466. padding: 20rpx 30rpx;
  467. position: relative;
  468. }
  469. .con-list {
  470. -webkit-box-flex: 1;
  471. -webkit-flex: 1;
  472. flex: 1;
  473. display: -webkit-box;
  474. display: -webkit-flex;
  475. display: flex;
  476. -webkit-box-orient: vertical;
  477. -webkit-box-direction: normal;
  478. -webkit-flex-direction: column;
  479. flex-direction: column;
  480. color: #303133;
  481. line-height: 40rpx;
  482. text-align: right;
  483. padding-right: 20rpx;
  484. font-size: 14px;
  485. }
  486. .btn {
  487. margin-top: 10px;
  488. background-color: #FFFFFF;
  489. border-radius: 25px;
  490. border: none;
  491. }
  492. .btns {
  493. background-color: #22C572;
  494. }
  495. .picture {
  496. width: 100%;
  497. height: 220px;
  498. text-align: center;
  499. margin-top: 10px;
  500. }
  501. .getcode {
  502. font-size: 14px;
  503. position: absolute;
  504. top: 50%;
  505. transform: translateY(-50%);
  506. color: #AFB3BF;
  507. background: #F5F6F9;
  508. height: 30px;
  509. line-height: 30px;
  510. }
  511. .getcode.active {
  512. border: none;
  513. }
  514. .words{
  515. font-size: 18px;
  516. font-weight: 600;
  517. color: #617E8B;
  518. }
  519. .floats{
  520. position: relative;
  521. top: -150px;
  522. text-align: center;
  523. }
  524. </style>