companyIdentityThree.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  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. },
  134. methods: {
  135. obtain(){
  136. if(this.sendText == "获取验证码")
  137. this.getcode()
  138. },
  139. bankUp() {
  140. var that = this
  141. wx.chooseImage({
  142. success: function(res) {
  143. wx.uploadFile({
  144. url: 'https://www.zthymaoyi.com/upload/admin',
  145. filePath: res.tempFilePaths[0],
  146. name: 'file',
  147. success(res) {
  148. var data = res.data
  149. var strToObj = JSON.parse(data)
  150. that.bankid[0] = strToObj.url
  151. that.bank1 = strToObj.url
  152. that.certificates = false
  153. that.bankImgs1.bankImg = strToObj.url
  154. that.$api.doRequest('get', '/driverViewInfo/bankShibie', that
  155. .bankImgs1).then(res => {
  156. that.$set(that.identityAuthenticationInfo, 'bankCard', res
  157. .data.data.bankNo)
  158. that.$set(that.identityAuthenticationInfo, 'bankDeposit',
  159. res.data.data.bankName)
  160. that.bankType = res.data.data.bankNameZhihang
  161. }).catch(res => {
  162. uni.showToast({
  163. title: res.data.message,
  164. icon: 'none',
  165. duration: 2000
  166. })
  167. })
  168. }
  169. })
  170. }
  171. })
  172. },
  173. bankLow() {
  174. var that = this
  175. wx.chooseImage({
  176. success: function(res) {
  177. wx.uploadFile({
  178. url: 'https://www.zthymaoyi.com/upload/admin',
  179. filePath: res.tempFilePaths[0],
  180. name: 'file',
  181. success(res) {
  182. var data = res.data
  183. var strToObj = JSON.parse(data)
  184. that.bankid[1] = strToObj.url
  185. that.bank2 = strToObj.url
  186. that.certificatesTwo = false
  187. }
  188. })
  189. }
  190. })
  191. },
  192. bankChange(e) {
  193. this.bankIndex = e.detail.value
  194. this.Model = this.bankType[this.bankIndex];
  195. this.identityAuthenticationInfo.bankDepositBranch = this.bankType[this.bankIndex];
  196. },
  197. changeZhihang(){
  198. this.zhihangStatus = !this.zhihangStatus
  199. },
  200. commit() {
  201. var that=this
  202. if (this.bankid[0] == '' || this.bankid[0] == null) {
  203. this.$api.msg('请上传银行卡正面')
  204. return
  205. }
  206. if (this.bankid[1] == '' || this.bankid[1] == null) {
  207. this.$api.msg('请上传银行卡反面')
  208. return
  209. }
  210. if (!this.identityAuthenticationInfo.bankCard) {
  211. this.$api.msg('银行卡号不能为空')
  212. return
  213. }
  214. if (!this.identityAuthenticationInfo.bankDeposit) {
  215. this.$api.msg('开户行不能为空')
  216. return
  217. }
  218. if (!this.identityAuthenticationInfo.bankDepositBranch) {
  219. this.$api.msg('开户支行不能为空')
  220. return
  221. }
  222. if (!this.identityAuthenticationInfo.customerPhone) {
  223. this.$api.msg('手机号不能为空')
  224. return
  225. }
  226. if (this.identityAuthenticationInfo.customerPhone.length != 11) {
  227. this.$api.msg('手机号填写不正确')
  228. return
  229. }
  230. if(this.identityAuthenticationInfo.customerTypeFlag == 1){
  231. if (!this.identityAuthenticationInfo.payeeName) {
  232. this.$api.msg('收款人姓名不能为空')
  233. return
  234. }
  235. if (!this.identityAuthenticationInfo.payeeNumberCard) {
  236. this.$api.msg('收款人身份证号不能为空')
  237. return
  238. }
  239. if (!this.identityAuthenticationInfo.compAddress) {
  240. this.$api.msg('联系地址不能为空')
  241. return
  242. }
  243. }else if(this.identityAuthenticationInfo.customerTypeFlag == 2){
  244. if (!this.identityAuthenticationInfo.compAddress) {
  245. this.$api.msg('公司地址不能为空')
  246. return
  247. }
  248. }
  249. this.identityAuthenticationInfo.commonId = this.userInfo.id
  250. this.identityAuthenticationInfo.payeeAddressUrl = this.bankid.toString()
  251. this.identityAuthenticationInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
  252. this.amendprice()
  253. if(this.verification == false){
  254. return
  255. }
  256. this.$api.doRequest('post', '/identityAuthenticationInfo/api/addIdentityAuthenticationInfo', this
  257. .identityAuthenticationInfo)
  258. .then(res => {
  259. // console.log(res.data.message)
  260. // if(res.data.message == "Success"){
  261. // uni.navigateTo({
  262. // url: `/pages/attestation/indexTwo` ,
  263. // })
  264. // }else{
  265. // this.$api.msg(res.data.message)
  266. // return
  267. // }
  268. if(res.data.code=='11018'){
  269. uni.showModal({
  270. title: '提示',
  271. content: '该手机号已认证过个人粮商,再次认证将覆盖之前的认证信息,是否确定认证?',
  272. success: function (res) {
  273. if (res.confirm) {
  274. that.identityAuthenticationInfo.cover=1
  275. that.$api.doRequest('post', '/identityAuthenticationInfo/api/editIdentityAuthenticationInfo', that.identityAuthenticationInfo).then(res => {
  276. uni.showToast({
  277. title: '提交成功',
  278. icon: 'none',
  279. duration: 2000
  280. })
  281. uni.navigateTo({
  282. url: `/pages/attestation/indexTwo` ,
  283. })
  284. }).catch(res => {
  285. uni.showToast({
  286. title: res.data.message,
  287. icon: 'none',
  288. duration: 2000
  289. })
  290. })
  291. } else if (res.cancel) {
  292. uni.showToast({
  293. title: '提交失败',
  294. icon: 'none',
  295. duration: 2000
  296. })
  297. }
  298. }
  299. });
  300. }else if(res.data.code==200){
  301. uni.showToast({
  302. title: '提交成功',
  303. icon: 'none',
  304. duration: 2000
  305. })
  306. uni.navigateTo({
  307. url: `/pages/attestation/indexTwo` ,
  308. })
  309. }else{
  310. uni.showToast({
  311. title: res.data.message,
  312. icon: 'none',
  313. duration: 2000
  314. })
  315. }
  316. }).catch(res => {
  317. uni.showToast({
  318. title: res.data.message,
  319. icon: 'none',
  320. duration: 2000
  321. })
  322. })
  323. },
  324. phoneinput(e){
  325. if(e.detail.value.length==11){
  326. this.codestatus=true
  327. }
  328. },
  329. amendprice(item) {
  330. var that = this
  331. this.$api.doRequest('get', '/commonUser/loginVerifyCode', {
  332. phone: this.identityAuthenticationInfo.customerPhone,
  333. verifyCode: this.verifyCode
  334. }).then(res => {
  335. if (res.data.code == 200) {
  336. } else {
  337. that.verification = false
  338. uni.showToast({
  339. title: res.data.message,
  340. icon: 'none',
  341. duration: 2000
  342. })
  343. return false
  344. }
  345. })
  346. .catch(res => {
  347. that.verification = false
  348. uni.showToast({
  349. title: res.data.message,
  350. icon: 'none',
  351. duration: 2000
  352. })
  353. return false
  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. return
  381. }
  382. })
  383. .catch(res => {
  384. uni.showToast({
  385. title: res.data.message,
  386. icon: 'none',
  387. duration: 2000
  388. })
  389. return
  390. });
  391. } else {
  392. uni.showToast({
  393. title: '请输入正确的手机号',
  394. icon: 'none',
  395. duration: 2000
  396. })
  397. }
  398. },
  399. }
  400. }
  401. </script>
  402. <style>
  403. .center {
  404. padding: 10px 20px;
  405. background-color: #F5F6FA;
  406. }
  407. .c-row {
  408. display: -webkit-box;
  409. display: -webkit-flex;
  410. display: flex;
  411. -webkit-box-align: center;
  412. -webkit-align-items: center;
  413. align-items: center;
  414. padding: 20rpx 30rpx;
  415. position: relative;
  416. }
  417. .con-list {
  418. -webkit-box-flex: 1;
  419. -webkit-flex: 1;
  420. flex: 1;
  421. display: -webkit-box;
  422. display: -webkit-flex;
  423. display: flex;
  424. -webkit-box-orient: vertical;
  425. -webkit-box-direction: normal;
  426. -webkit-flex-direction: column;
  427. flex-direction: column;
  428. color: #303133;
  429. line-height: 40rpx;
  430. text-align: right;
  431. padding-right: 20rpx;
  432. font-size: 14px;
  433. }
  434. .btn {
  435. margin-top: 10px;
  436. background-color: #FFFFFF;
  437. border-radius: 25px;
  438. border: none;
  439. }
  440. .btns {
  441. background-color: #22C572;
  442. }
  443. .picture {
  444. width: 100%;
  445. height: 220px;
  446. text-align: center;
  447. margin-top: 10px;
  448. }
  449. .getcode {
  450. font-size: 14px;
  451. position: absolute;
  452. top: 50%;
  453. transform: translateY(-50%);
  454. color: #AFB3BF;
  455. background: #F5F6F9;
  456. height: 30px;
  457. line-height: 30px;
  458. }
  459. .getcode.active {
  460. border: none;
  461. }
  462. .words{
  463. font-size: 18px;
  464. font-weight: 600;
  465. color: #617E8B;
  466. }
  467. .floats{
  468. position: relative;
  469. top: -150px;
  470. text-align: center;
  471. }
  472. </style>