form.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. <template>
  2. <view class="shop_auth">
  3. <view class="content">
  4. <!-- <view class="hint">上传并提交您的证件照片</view>
  5. <view class="flexB">
  6. <image :src="authCon.front" class="card" @click="getPhoto(0)"></image>
  7. <image :src="authCon.otherSide" class="card" @click="getPhoto(1)"></image>
  8. </view>
  9. <view class="hint">拍照要求</view>
  10. <view class="rule">
  11. <image src="/static/zbs/card_rule.png"></image>
  12. </view> -->
  13. <view style="padding-bottom: 10rpx;" class="hint">填写相关信息</view>
  14. <view class="auth_inp">
  15. <view class="inp_box">
  16. <view class="label">
  17. <text>开户姓名</text>
  18. </view>
  19. <input type="text" placeholder="请输入银行卡开户姓名" v-model="params.CardName" placeholder-class="place" />
  20. </view>
  21. <view class="inp_box">
  22. <view class="label">
  23. <text>身份证号</text>
  24. </view>
  25. <input type="text" placeholder="请输入身份证号" v-model="params.CertID" maxlength="18"
  26. placeholder-class="place" />
  27. </view>
  28. <view>
  29. <view class="label">
  30. <text>身份证有效期</text>
  31. </view>
  32. <view class="date_picker flexV">
  33. <picker mode="date" :value="params.startDate" @change="bindDateChange1">
  34. <view>
  35. <text :style="{ color: params.startDate ? '#333' : '#a7a7a7' }">
  36. {{ params.startDate ? params.startDate : '年-月-日' }}
  37. </text>
  38. </view>
  39. </picker>
  40. <text style="margin: 0 20rpx;">~</text>
  41. <picker mode="date" :value="params.endDate" @change="bindDateChange2">
  42. <view>
  43. <text :style="{ color: params.endDate ? '#333' : '#a7a7a7' }">
  44. {{ params.endDate ? params.endDate : '年-月-日' }}
  45. </text>
  46. </view>
  47. </picker>
  48. </view>
  49. </view>
  50. <view>
  51. <view class="label">
  52. <text>是否长期有效</text>
  53. </view>
  54. <picker @change="bindPickerChange" :value="params.type" :range="array" range-key="name">
  55. <view class="flexB picker">
  56. <view>{{ array[params.type].name }}</view>
  57. <text class="iconfont iconzhcc_xiangxiajiantou"></text>
  58. </view>
  59. </picker>
  60. </view>
  61. <view>
  62. <view>
  63. <view class="label">
  64. <text>卡号</text>
  65. </view>
  66. <input type="number" placeholder="请输入银行卡号" v-model="params.CardID" class="bank_box"
  67. placeholder-style="color:#999" />
  68. </view>
  69. <!-- <view class="label">
  70. <text>开户行</text>
  71. </view>
  72. <view @click="(showBank = true), getBankList()" class="flexB picker">
  73. <text :style="{ color: params.account_bank ? '#333' : '#999' }"
  74. style="font-size:32rpx;">{{ params.account_bank ? params.account_bank : '请选择开户银行' }}</text>
  75. <text class="iconfont iconzhcc_xiangxiajiantou"></text>
  76. </view>
  77. <u-popup v-model="showBank" mode="bottom" height="700rpx;">
  78. <view class="pop_box">
  79. <view class="box_inp flexC"><input type="text" placeholder="输入关键字查询开户银行" @input="bankInp"
  80. v-model="searchBank" class="search_inp" /></view>
  81. <view class="scroll">
  82. <scroll-view>
  83. <view class="scroll_con">
  84. <view v-for="(item, idx) in bankList" :key="idx" @click="checkBank(item)">
  85. {{ item.name }}
  86. </view>
  87. </view>
  88. </scroll-view>
  89. </view>
  90. </view>
  91. </u-popup> -->
  92. </view>
  93. <view>
  94. <view class="label">
  95. <text>银行卡绑定手机号</text>
  96. </view>
  97. <input type="number" placeholder="请输入银行卡绑定手机号" v-model="params.mobile" class="bank_box"
  98. placeholder-style="color:#999" />
  99. </view>
  100. <view>
  101. <view class="label">
  102. <text>短信验证码</text>
  103. </view>
  104. <view class="inp flexB">
  105. <input type="text" placeholder="请输入验证码" maxlength="6" placeholder-style="font-size:28rpx;color:#999"
  106. v-model="params.sms_code" />
  107. <view v-throttle="2000" class="inp_code" @click="getNew">{{ newDown ? `重新获取(${newDown}s)` : '获取验证码' }}</view>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. <view class="bottom flexC">
  113. <view v-throttle="2000" class="bottom_btn" @click="submitAuth">提交</view>
  114. </view>
  115. </view>
  116. </template>
  117. <script>
  118. import { _API_QuickBankApply, _API_QuickBankConfirm } from '../../apis/zbs.js';
  119. import WPicker from '@/components/w-picker/w-picker.vue';
  120. import cityPicker from '@/components/citypicker/city-picker.vue';
  121. export default {
  122. data() {
  123. return {
  124. array: [
  125. {
  126. name: '非长期有效',
  127. id: 0
  128. },
  129. {
  130. name: '长期有效',
  131. id: 1
  132. }
  133. ],
  134. newDown: 0, //手机验证码倒计时,
  135. params: {
  136. CardName: '', //开户人姓名
  137. mobile: '', //开户人手机号
  138. CertID: '', //证件号码
  139. CardID: '', //银行卡号
  140. startDate: '', //证件开始时间
  141. endDate: '', //证件到期时间
  142. type: 0, // 证件是否长期,
  143. order_id: '', // 申请接口返回
  144. trans_id: '', // 申请接口返回
  145. sms_code: '', // 手机验证码
  146. },
  147. authCon: {
  148. front: '/static/zbs/card_front.png', //身份证正面照
  149. otherSide: '/static/zbs/card_reverse.png', //身份证反面照
  150. }
  151. };
  152. },
  153. onShow() {
  154. },
  155. methods: {
  156. // 身份证是否长期,选择框
  157. bindPickerChange(e) {
  158. this.params.type = e.detail.value
  159. },
  160. /*更换身份证到期时间*/
  161. bindDateChange1: function(e) {
  162. this.params.startDate = e.target.value;
  163. },
  164. bindDateChange2: function(e) {
  165. this.params.endDate = e.target.value;
  166. },
  167. //获取手机号验证码
  168. getNew() {
  169. let that = this;
  170. if (that.newDown) {
  171. uni.showModal({
  172. content: '验证码已发送,请稍后重试',
  173. showCancel: false
  174. });
  175. return false;
  176. }
  177. const { CardName, mobile, CertID, startDate, endDate, CardID, type } = this.params
  178. if (!CardName || !mobile || !CertID || !startDate || !CardID || (!type && !endDate)) {
  179. uni.showModal({
  180. content: '请补全信息',
  181. showCancel: false
  182. })
  183. return false
  184. }
  185. if (!mobile.match(/^[1][3-9]\d{9}$/)) {
  186. uni.showModal({
  187. content: '手机号格式不正确',
  188. showCancel: false
  189. })
  190. return
  191. }
  192. _API_QuickBankApply({
  193. CardName, mobile, CertID, startDate, endDate, CardID, type
  194. })
  195. .then(res => {
  196. if (res.code == 200) {
  197. uni.showModal({
  198. content: '验证码发送成功',
  199. showCancel: false
  200. });
  201. this.params.order_id = res.data.order_id
  202. this.params.trans_id = res.data.trans_id
  203. this.newDown = 180;
  204. this.timer = setInterval(() => {
  205. this.newDown--;
  206. if (!this.newDown) {
  207. this.newDown = 0;
  208. clearInterval(this.timer);
  209. }
  210. }, 1000);
  211. } else {
  212. uni.showModal({
  213. content: res.message || '获取验证码失败',
  214. showCancel: false
  215. });
  216. return false;
  217. }
  218. })
  219. },
  220. /*截取身份证到期时间信息*/
  221. getCaption(obj, type) {
  222. if (type === 0) {
  223. obj = obj.split('-')[0]
  224. } else {
  225. obj = obj.split('-')[1]
  226. }
  227. if (obj != '长期') {
  228. obj = obj.replace(/\./g, '-');
  229. }
  230. return obj;
  231. },
  232. /*提交*/
  233. submitAuth() {
  234. const { CardName, mobile, CertID, CardID, order_id, trans_id, sms_code } = this.params
  235. if (!CardName) {
  236. uni.showModal({
  237. content: '姓名格式不正确!',
  238. showCancel: false
  239. });
  240. return false;
  241. }
  242. if (!mobile.match(/^[1][3-9]\d{9}$/)) {
  243. uni.showModal({
  244. content: '手机号格式不正确',
  245. showCancel: false
  246. })
  247. return
  248. }
  249. if (!CertID) {
  250. uni.showModal({
  251. content: '请输入身份证号!',
  252. showCancel: false
  253. });
  254. return false;
  255. }
  256. if (!CardID) {
  257. uni.showModal({
  258. content: '请输入银行卡号!',
  259. showCancel: false
  260. });
  261. return false;
  262. }
  263. if (!sms_code) {
  264. uni.showModal({
  265. content: '请输入验证码!',
  266. showCancel: false
  267. });
  268. return false;
  269. }
  270. uni.showLoading({
  271. title: '提交中...'
  272. })
  273. _API_QuickBankConfirm({
  274. CardName, mobile, CertID, CardID, order_id, trans_id, sms_code
  275. })
  276. .then(res => {
  277. if (res.code == 200) {
  278. uni.showModal({
  279. title: '提示',
  280. content: '绑定成功',
  281. showCancel: false,
  282. success: (res) => {
  283. if (res.confirm) {
  284. uni.redirectTo({
  285. url: './detail'
  286. })
  287. }
  288. },
  289. })
  290. } else {
  291. uni.showModal({
  292. content: res.message || '银行卡绑定失败',
  293. showCancel: false
  294. });
  295. return false;
  296. }
  297. })
  298. .catch(err => {
  299. uni.hideLoading()
  300. })
  301. }
  302. }
  303. };
  304. </script>
  305. <style lang="scss" scoped>
  306. .bottom {
  307. width: 100%;
  308. height: 102rpx;
  309. background: #FFFFFF;
  310. box-shadow: 0px -4rpx 24rpx 2rpx rgba(0,0,0,0.1);
  311. margin-top: 40rpx;
  312. &_btn {
  313. width: 702rpx;
  314. margin: 0 auto;
  315. height: 88rpx;
  316. background: $base-line-bg;
  317. opacity: 1;
  318. border-radius: 44rpx;
  319. color: #fff;
  320. text-align: center;
  321. line-height: 88rpx;
  322. font-size: 32rpx;
  323. }
  324. }
  325. .how_query {
  326. margin-top: 36rpx;
  327. text {
  328. color: $base-color;
  329. font-size: 32rpx;
  330. }
  331. .query_icon {
  332. width: 40rpx;
  333. height: 40rpx;
  334. margin-right: 10rpx;
  335. }
  336. }
  337. .pop {
  338. width: 100%;
  339. height: 100vh;
  340. position: fixed;
  341. top: 0;
  342. left: 0;
  343. background-color: rgba(0, 0, 0, 0.7);
  344. z-index: 9999999;
  345. .hint_icon {
  346. width: 183rpx;
  347. height: 135rpx;
  348. position: relative;
  349. margin-top: -85rpx;
  350. }
  351. .pop_con {
  352. width: 648rpx;
  353. height: 482rpx;
  354. background: #fff;
  355. border-radius: 26rpx;
  356. display: flex;
  357. flex-direction: column;
  358. align-items: center;
  359. padding: 0 30rpx;
  360. box-sizing: border-box;
  361. .title {
  362. font-size: 38rpx;
  363. font-weight: bold;
  364. margin-top: 24rpx;
  365. }
  366. .con {
  367. min-height: 150rpx;
  368. margin: 24rpx 0 40rpx;
  369. font-size: 34rpx;
  370. line-height: 1.5;
  371. }
  372. .btn_box {
  373. width: 100%;
  374. view {
  375. width: 270rpx;
  376. height: 88rpx;
  377. background: #F5F5F5;
  378. border-radius: 44rpx;
  379. color: #333;
  380. font-size: 32rpx;
  381. font-weight: bold;
  382. }
  383. view:last-child {
  384. background: $base-line-bg;
  385. color: #fff;
  386. }
  387. }
  388. }
  389. .iconfont {
  390. color: #fff;
  391. font-size: 60rpx;
  392. margin-top: 30rpx;
  393. }
  394. }
  395. .shop_auth {
  396. width: 100%;
  397. min-height: 100%;
  398. background: #fff;
  399. .step {
  400. margin-top: 30rpx;
  401. }
  402. .content {
  403. width: 690rpx;
  404. margin: 0 auto;
  405. input {
  406. font-size: 30rpx;
  407. }
  408. .label {
  409. font-size: 32rpx;
  410. padding: 15rpx 0;
  411. font-weight: bold;
  412. // .star {
  413. // color: #f00;
  414. // margin-left: 4rpx;
  415. // font-size: 45rpx;
  416. // }
  417. }
  418. .inp {
  419. height: 88rpx;
  420. background: #f8f8f8;
  421. padding-right: 30rpx;
  422. border-radius: 8rpx 8rpx 8rpx 8rpx;
  423. box-sizing: border-box;
  424. &_code {
  425. width: 188rpx;
  426. height: 64rpx;
  427. border-radius: 32rpx 32rpx 32rpx 32rpx;
  428. opacity: 1;
  429. border: 2rpx solid #FF0000;
  430. text-align: center;
  431. line-height: 64rpx;
  432. font-size: 28rpx;
  433. font-family: PingFang SC, PingFang SC;
  434. font-weight: 400;
  435. color: #FF0000;
  436. }
  437. }
  438. .auth_inp {
  439. input,
  440. .date_picker {
  441. min-height: 96rpx;
  442. background: #f8f8f8;
  443. border-radius: 8rpx;
  444. font-size: 32rpx;
  445. padding: 0 30rpx;
  446. }
  447. .iconfont {
  448. color: #a7a7a7;
  449. font-size: 35rpx;
  450. }
  451. .place {
  452. font-size: 32rpx;
  453. color: #a7a7a7;
  454. }
  455. .picker {
  456. min-height: 96rpx;
  457. background: #f8f8f8;
  458. padding: 0 30rpx;
  459. input {
  460. padding-left: 0;
  461. width: 92%;
  462. min-height: 96rpx;
  463. }
  464. text:first-child {
  465. font-size: 32rpx;
  466. }
  467. }
  468. }
  469. .main_btn {
  470. width: 300rpx;
  471. margin: 0 auto;
  472. height: 88rpx;
  473. background: $base-line-bg;
  474. border-radius: 44rpx;
  475. color: #fff;
  476. text-align: center;
  477. line-height: 88rpx;
  478. font-size: 32rpx;
  479. }
  480. .second_btn {
  481. width: 300rpx;
  482. margin: 0 auto;
  483. height: 88rpx;
  484. border: 2rpx solid $base-color;
  485. background: #fff4f3;
  486. border-radius: 44rpx;
  487. color: #fff;
  488. text-align: center;
  489. line-height: 88rpx;
  490. font-size: 32rpx;
  491. color: $base-color;
  492. }
  493. .next {
  494. margin: 50rpx auto 30rpx;
  495. }
  496. .sub {
  497. margin: 30rpx auto 20rpx;
  498. }
  499. .hint {
  500. font-size: 36rpx;
  501. font-weight: bold;
  502. padding: 24rpx 0;
  503. }
  504. .card {
  505. width: 340rpx;
  506. height: 220rpx;
  507. margin-bottom: 30rpx;
  508. border-radius: 24rpx;
  509. }
  510. .rule {
  511. image {
  512. width: 100%;
  513. height: 140rpx;
  514. }
  515. view {
  516. font-size: 24rpx;
  517. color: #999;
  518. text-align: center;
  519. margin: 30rpx 0 60rpx;
  520. }
  521. }
  522. .notice {
  523. font-size: 28rpx;
  524. color: #999;
  525. text-align: center;
  526. margin: 15rpx 0 50rpx;
  527. }
  528. }
  529. }
  530. .pop_box {
  531. .box_inp {
  532. width: 100%;
  533. padding: 20rpx 0;
  534. box-sizing: border-box;
  535. background: #fff;
  536. top: 0;
  537. left: 0;
  538. z-index: 99;
  539. text-align: center;
  540. input {
  541. height: 90rpx;
  542. width: 90%;
  543. border: 2rpx solid #cccccc;
  544. background: #fff !important;
  545. padding-left: 20rpx;
  546. border-radius: 44rpx;
  547. }
  548. }
  549. .scroll {
  550. height: 600rpx;
  551. .scroll_con {
  552. padding-bottom: 50rpx;
  553. view {
  554. font-size: 36rpx;
  555. padding: 15rpx;
  556. text-align: center;
  557. }
  558. }
  559. .no_branch {
  560. width: 100%;
  561. text-align: center;
  562. margin-top: 30rpx;
  563. color: #999;
  564. font-size: 30rpx;
  565. }
  566. }
  567. }
  568. </style>