mybank.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
  1. <template>
  2. <view style="position: relative;">
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view :style="{marginTop:navH}"></view>
  6. <view>
  7. <!-- 银行卡信息绑定 -->
  8. <view style="margin: 0 20rpx;">
  9. <font style="margin: 30rpx 20rpx 20rpx;color: #878994;">银行卡信息绑定</font>
  10. <uni-forms :modelValue="formData" err-show-type="undertext">
  11. <uni-forms-item name="name" required label="户主姓名">
  12. <uni-easyinput type="text" :inputBorder="false" v-model="formData.name" placeholder="姓名">
  13. </uni-easyinput>
  14. </uni-forms-item>
  15. <uni-forms-item name="cardid" required label="身份证号">
  16. <uni-easyinput type="text" :inputBorder="false" v-model="formData.bank_card_id"
  17. placeholder="18位身份证号">
  18. </uni-easyinput>
  19. </uni-forms-item>
  20. <uni-forms-item name="bankcard" required label="银行卡号">
  21. <uni-easyinput type="number" maxlength="19" :inputBorder="false"
  22. v-model="formData.bank_card_number" placeholder="请填写卡号">
  23. </uni-easyinput>
  24. </uni-forms-item>
  25. <uni-forms-item name="bank" required label="银行">
  26. <picker @change="bindPickerChange1" :value="index1" :range="array1" range-key="name">
  27. <view>{{ array1[index1].name }}</view>
  28. </picker>
  29. </uni-forms-item>
  30. <uni-forms-item name="vregion" required label="开户地">
  31. <picker class="picker" mode="multiSelector" :range="region" range-key="name"
  32. :value="regionIndex" @change="pickerChange" @columnchange="pickerColumnchange">
  33. <view class="pbox" :class="{'pbox_hover':regionStr != '请选择省市区'}">
  34. <view>{{regionStr}}</view>
  35. <text class="iconfont icon-you"></text>
  36. </view>
  37. </picker>
  38. </uni-forms-item>
  39. <uni-forms-item name="phone" required label="手机号">
  40. <uni-easyinput type="number" maxlength="11" :inputBorder="false" v-model="formData.phone"
  41. placeholder="请填写手机号">
  42. </uni-easyinput>
  43. </uni-forms-item>
  44. </uni-group>
  45. </uni-forms>
  46. </view>
  47. <view>
  48. <button class="btn1" @click="submitForm()">保存</button>
  49. </view>
  50. <view style="margin: 30rpx;padding: 30rpx 10rpx;background-color: #eaeaea;border-radius: 5rpx;">
  51. <p style="color: #878994;font-size: 28rpx;">*提现需绑定用户个人名下真实使用的银行卡与身份等信息</p>
  52. <p style="color: #878994;font-size: 28rpx;">*平台严格按照《用户协议》及《隐私政策》保护个人隐私</p>
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import region from '@/components/pca-code.json';
  59. import mvBar from "@/components/mys_navBar/mysNavBar";
  60. export default {
  61. components: {
  62. mvBar,
  63. },
  64. data() {
  65. return {
  66. navH: getApp().globalData.navHeight,
  67. index1: 0,
  68. formData: {
  69. name: '',
  70. phone: '',
  71. bank_id: '',
  72. bank_card_number: '',
  73. bank_open_address: '',
  74. bank_card_id: '',
  75. alipay_number: '',
  76. alipay_real_name: '',
  77. alipay_card_id: '',
  78. },
  79. oldRegion: region,
  80. region: [
  81. [],
  82. [],
  83. []
  84. ],
  85. // 选择省市区的下标Index 传则默认选中传递的
  86. regionIndex: [0, 0, 0],
  87. // 省市区字符串
  88. regionStr: '请选择省市区',
  89. array1: [{
  90. name: '请选择',
  91. id: 0
  92. }, {
  93. name: '中国农业银行',
  94. id: 1
  95. }, {
  96. name: '中国工商银行',
  97. id: 2
  98. }],
  99. mysNavConfig: {
  100. /* 开启单页显示首页图标 */
  101. isHome: true,
  102. /* 固定导航 */
  103. navFixed: true,
  104. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  105. navTitle: {
  106. text: "银行卡信息绑定",
  107. color: "",
  108. fontSize: "32rpx", // px upx rpx
  109. fontWeight: "normal", // 100 - 700
  110. },
  111. btnType: "type2",
  112. onLeftClick: '',
  113. /* type2 按钮 */
  114. type2Config: {
  115. // 左图标
  116. leftPath: "/static/img/png2.png",
  117. // 右图标
  118. rightPath: "/static/img/png4.png",
  119. // 圆角
  120. radius: "40rpx",
  121. },
  122. },
  123. }
  124. },
  125. onShow() {
  126. this.getInfo();
  127. this.initRegion();
  128. },
  129. methods: {
  130. initRegion() {
  131. // 声明城市数组
  132. let cityArr = [];
  133. let countyArr = [];
  134. // 设置下标
  135. this.regionIndex = [0, 0, 0];
  136. // 改变城市列表
  137. this.region[1] = this.oldRegion[0].children.map(item => {
  138. cityArr.push({
  139. name: item.name,
  140. code: item.code
  141. });
  142. })
  143. this.$set(this.region, 1, cityArr);
  144. // 改变县区列表
  145. this.oldRegion[0].children[0].children.map(item => {
  146. countyArr.push({
  147. name: item.name,
  148. code: item.code
  149. });
  150. })
  151. this.$set(this.region, 2, countyArr);
  152. },
  153. // 默认信息表,获取平台logo
  154. getInfo() {
  155. this.$https.get('/youngee/c/g/get-info-tables')
  156. .then(res => {
  157. this.array1 = res.data.data.Bank
  158. })
  159. this.getBankInfo()
  160. },
  161. getBankInfo() {
  162. this.$https.get('/youngee/c/t/g/get-talent-bank-info')
  163. .then(res => {
  164. console.log(res)
  165. if (res.data.data != null) {
  166. this.formData = res.data.data
  167. if (this.formData.bank_id != '') {
  168. this.index1 = this.formData.bank_id
  169. }
  170. if (this.formData.bank_open_address == 0) {
  171. this.formData.bank_open_address = ''
  172. } else {
  173. let a = this.formData.bank_open_address.toString().slice(0, 2)
  174. let b = this.formData.bank_open_address.toString().slice(0, 4)
  175. let c = 0
  176. for (var i = 0; i < region.length; i++) {
  177. if (region[i].code == a) {
  178. a = region[i].name
  179. for (var j = 0; j < region[i].children.length; j++) {
  180. if (region[i].children[j].code == b) {
  181. b = region[i].children[j].name
  182. for (var o = 0; o < region[i].children[j].children.length; o++) {
  183. if (region[i].children[j].children[o].code == this.formData
  184. .bank_open_address) {
  185. c = region[i].children[j].children[o].name
  186. }
  187. }
  188. }
  189. }
  190. }
  191. }
  192. this.regionStr = a + ' ' + b + ' ' + c
  193. }
  194. }
  195. })
  196. },
  197. submitForm() {
  198. let f1 = true
  199. let message1 = ""
  200. // 检查是否填写银行卡信息
  201. if (this.formData.name == "") {
  202. f1 = false;
  203. message1 = "请输入正确的户主姓名"
  204. } else if (this.formData.bank_card_id.length != 18) {
  205. f1 = false;
  206. message1 = "请输入正确的身份证号"
  207. } else if (this.formData.bank_card_number == "" || (this.formData.bank_card_number.length != 16 && this
  208. .formData.bank_card_number.length != 17 && this.formData.bank_card_number.length != 19)) {
  209. f1 = false;
  210. message1 = "请输入正确的银行卡号"
  211. } else if (this.formData.bank_id == 0) {
  212. f1 = false;
  213. message1 = "请选择银行"
  214. } else if (this.formData.bank_open_address == "") {
  215. f1 = false;
  216. message1 = "请选择开户地"
  217. } else if (this.formData.phone == "" || this.formData.phone.length != 11) {
  218. f1 = false;
  219. message1 = "请输入正确的手机号"
  220. };
  221. if (f1) {
  222. console.log(this.formData)
  223. console.log(message1)
  224. this.$https.post('/youngee/c/t/p/add-talent-bank', this.formData)
  225. .then(res => {
  226. console.log(res)
  227. uni.showToast({
  228. title: "提现信息绑定成功",
  229. icon: 'none'
  230. })
  231. let pages = getCurrentPages(); // 当前页面
  232. let beforePage = pages[pages.length - 2]; // 上一页
  233. uni.navigateBack({
  234. success: function() {
  235. beforePage
  236. .onLoad(); // 执行上一页的onLoad方法
  237. }
  238. })
  239. })
  240. } else {
  241. uni.showToast({
  242. title: message1,
  243. icon: 'none'
  244. })
  245. }
  246. },
  247. bindPickerChange1: function(e) {
  248. console.log(e)
  249. this.index1 = e.detail.value;
  250. this.formData.bank_id = this.array1[this.index1].id
  251. console.log(this.formData.bank_id)
  252. },
  253. //城市选择
  254. pickerChange(e) {
  255. // console.log(e, '1');
  256. this.regionIndex = e.detail.value;
  257. this.regionStr = this.region[0][this.regionIndex[0]].name + ' ' + this.region[1][this.regionIndex[
  258. 1]]
  259. .name + ' ' +
  260. this.region[2][this.regionIndex[2]].name;
  261. // 组件传值
  262. this.$emit('region', [this.region[0][this.regionIndex[0]].code, this.region[1][this.regionIndex[1]]
  263. .code,
  264. this.region[
  265. 2][this.regionIndex[2]].code
  266. ]);
  267. this.formData.bank_open_address = this.region[2][this.regionIndex[2]].code;
  268. },
  269. pickerColumnchange(e) {
  270. // console.log(e);
  271. // 第几列滑动
  272. // console.log(e.detail.column);
  273. // 第几列滑动的下标
  274. // console.log(e.detail.value)
  275. if (e.detail.column === 0) {
  276. // 声明城市数组
  277. let cityArr = [];
  278. let countyArr = [];
  279. // 设置下标
  280. this.regionIndex = [e.detail.value, 0, 0];
  281. // 改变城市列表
  282. this.region[1] = this.oldRegion[e.detail.value].children.map(item => {
  283. cityArr.push({
  284. name: item.name,
  285. code: item.code
  286. });
  287. })
  288. this.$set(this.region, 1, cityArr);
  289. // 改变县区列表
  290. this.oldRegion[e.detail.value].children[0].children.map(item => {
  291. countyArr.push({
  292. name: item.name,
  293. code: item.code
  294. });
  295. })
  296. this.$set(this.region, 2, countyArr);
  297. }
  298. if (e.detail.column === 1) {
  299. this.regionIndex[1] = e.detail.value;
  300. this.regionIndex[2] = 0;
  301. let countyArr = [];
  302. this.oldRegion[this.regionIndex[0]].children[this.regionIndex[1]].children.map(item => {
  303. countyArr.push({
  304. name: item.name,
  305. code: item.code
  306. });
  307. })
  308. this.$set(this.region, 2, countyArr);
  309. }
  310. if (e.detail.column === 2) {
  311. this.regionIndex[2] = e.detail.value;
  312. }
  313. }
  314. },
  315. created() {
  316. let provinceArr = [];
  317. let cityArr = [];
  318. this.oldRegion.map((item, index) => {
  319. this.region[0].push({
  320. name: item.name,
  321. code: item.code
  322. });
  323. if (this.previnceId == item.code) {
  324. provinceArr = item.children;
  325. this.regionIndex[0] = index;
  326. }
  327. })
  328. // console.log(provinceArr);
  329. provinceArr.map((item, index) => {
  330. this.region[1].push({
  331. name: item.name,
  332. code: item.code
  333. });
  334. if (this.cityId == item.code) {
  335. cityArr = item.children;
  336. this.regionIndex[1] = index;
  337. }
  338. })
  339. cityArr.map((item, index) => {
  340. this.region[2].push({
  341. name: item.name,
  342. code: item.code
  343. });
  344. if (this.countyId == item.code)
  345. this.regionIndex[2] = index;
  346. })
  347. if (this.isRevise)
  348. this.regionStr = this.region[0][this.regionIndex[0]].name + ' ' + this.region[1][this.regionIndex[1]]
  349. .name + ' ' + this.region[2][this.regionIndex[2]].name;
  350. else
  351. this.regionStr = '请选择省市区';
  352. }
  353. }
  354. </script>
  355. <style>
  356. picker {
  357. position: relative;
  358. display: block;
  359. cursor: pointer;
  360. padding-left: 20rpx !important;
  361. padding-top: 14rpx !important;
  362. color: grey !important;
  363. }
  364. /deep/.uni-forms-item__inner {
  365. border-bottom: none !important;
  366. margin-bottom: 0 !important;
  367. }
  368. </style>
  369. <style lang="scss" scoped>
  370. view {
  371. font-size: 14px;
  372. line-height: inherit;
  373. }
  374. .menu {
  375. position: fixed;
  376. top: 180rpx;
  377. border-bottom: #FCCF41;
  378. background-color: #FFFFFF;
  379. justify-content: space-around;
  380. height: 5%;
  381. width: 100%;
  382. display: flex;
  383. z-index: 10;
  384. }
  385. .menu-item p {
  386. font-weight: 600;
  387. &.lor {
  388. border-bottom: 5rpx solid #F0D232;
  389. color: #F0D232;
  390. padding-bottom: 15rpx;
  391. }
  392. }
  393. .btn1 {
  394. margin: 30rpx;
  395. font-size: 35rpx;
  396. color: #000;
  397. background-color: #F0D232;
  398. border: none;
  399. border-radius: 0;
  400. }
  401. .uni-input-border,
  402. .uni-textarea-border {
  403. flex: 1;
  404. font-size: 14px;
  405. color: #666;
  406. border: 1px #FFFFFF solid;
  407. border-radius: 5px;
  408. /* #ifndef APP-NVUE */
  409. box-sizing: border-box;
  410. /* #endif */
  411. }
  412. .uni-input-border {
  413. padding: 0 10px;
  414. height: 35px;
  415. }
  416. .uni-textarea-border {
  417. padding: 10px;
  418. height: 80px;
  419. }
  420. .label-box {
  421. margin-right: 10px;
  422. }
  423. .transform-scale {
  424. transform: scale(0.7);
  425. }
  426. .butto {
  427. text-align: center;
  428. }
  429. .option {
  430. padding: 20rpx;
  431. }
  432. .uni-margin-wrap {
  433. width: 690rpx;
  434. width: 100%;
  435. ;
  436. }
  437. .swiper {
  438. height: 300rpx;
  439. }
  440. .swiper-item {
  441. display: block;
  442. height: 300rpx;
  443. line-height: 300rpx;
  444. text-align: center;
  445. }
  446. .swiper-list {
  447. margin-top: 40rpx;
  448. margin-bottom: 0;
  449. }
  450. .uni-common-mt {
  451. margin-top: 60rpx;
  452. position: relative;
  453. }
  454. .info {
  455. position: absolute;
  456. right: 20rpx;
  457. }
  458. .uni-padding-wrap {
  459. width: 550rpx;
  460. padding: 0 100rpx;
  461. }
  462. .signup {
  463. box-shadow: 0rpx 5rpx 40rpx #ccc;
  464. width: 100%;
  465. position: fixed;
  466. bottom: 0rpx;
  467. display: flex;
  468. height: 90rpx;
  469. padding-top: 2%;
  470. background-color: #FFFFFF;
  471. justify-content: space-around;
  472. }
  473. .signuptext {
  474. text-align: center;
  475. margin-top: 2%;
  476. }
  477. .signuptext p {
  478. font-size: 60%;
  479. color: #333333;
  480. }
  481. .signupbut {
  482. text-align: center;
  483. margin-top: 2%;
  484. }
  485. .but1 {
  486. width: 120%;
  487. text-align: center;
  488. background-color: #FCCF41;
  489. border-radius: 10rpx;
  490. color: #464100;
  491. font-size: 28rpx;
  492. line-height: 156%;
  493. font-weight: 500;
  494. height: 65%;
  495. }
  496. /deep/.uni-searchbar__box {
  497. border-color: #267CFF !important;
  498. border-width: 2rpx !important;
  499. }
  500. /deep/.uni-searchbar__box {
  501. background-color: #FFFFFF !important;
  502. }
  503. /deep/.uni-searchbar__text-placeholder {
  504. font-size: 30rpx !important;
  505. }
  506. /deep/.segmented-control__text {
  507. font-size: 34rpx !important;
  508. }
  509. /deep/.uni-data-checklist {
  510. padding-left: 20upx;
  511. }
  512. uni-picker {
  513. position: relative;
  514. display: block;
  515. cursor: pointer;
  516. padding-left: 20rpx !important;
  517. padding-top: 14rpx !important;
  518. color: grey !important;
  519. }
  520. /deep/.uni-date-x--border {
  521. border: 0px solid #dcdfe6 !important;
  522. }
  523. /deep/.is-input-border {
  524. border: 0px solid #c8c7cc !important;
  525. }
  526. /deep/.uni-progress-info {
  527. font-size: 25rpx !important;
  528. }
  529. /deep/.uni-error-message {
  530. position: absolute;
  531. bottom: -20rpx !important;
  532. left: 20rpx !important;
  533. text-align: left;
  534. }
  535. /deep/.uni-forms-item__inner {
  536. padding-bottom: 0rpx !important;
  537. margin-bottom: 30rpx !important;
  538. border-bottom: 0.5rpx solid #CCCCCC;
  539. }
  540. /deep/.uni-group__title {
  541. background-color: #FFFFFF !important;
  542. }
  543. /deep/.uni-list-item__content-title {
  544. font-size: 30rpx !important;
  545. color: #111111 !important;
  546. }
  547. /deep/.uni-progress-bar {
  548. border-radius: 10rpx !important;
  549. }
  550. /deep/.uni-progress-inner-bar {
  551. border-radius: 10rpx !important;
  552. }
  553. /deep/.is-input-border {
  554. border-radius: 20px !important;
  555. background-color: #fff;
  556. }
  557. .uni-easyinput__content-input {
  558. font-size: 30upx !important;
  559. }
  560. .content-clear-icon {
  561. font-size: 40upx !important;
  562. }
  563. /deep/.input-box {
  564. padding: 50upx;
  565. font-size: 30upx;
  566. .input-item {
  567. display: flex;
  568. border: 1upx solid #F8F8F8;
  569. line-height: 90upx;
  570. height: 90upx;
  571. margin-top: 20upx;
  572. background: #F8F8F8;
  573. border-radius: 48upx;
  574. .input-label {
  575. width: 150upx;
  576. text-align: center;
  577. }
  578. .input-body {
  579. position: relative;
  580. height: 100upx;
  581. width: calc(100% - 150upx);
  582. .input {
  583. line-height: 90upx;
  584. height: 90upx;
  585. position: relative;
  586. font-size: 28upx;
  587. }
  588. .eye {
  589. position: absolute;
  590. height: 50upx;
  591. width: 50upx;
  592. right: 20upx;
  593. top: 50%;
  594. transform: translateY(-50%);
  595. }
  596. .btn-code {
  597. position: absolute;
  598. right: 0upx;
  599. top: 50%;
  600. transform: translateY(-50%);
  601. background: none;
  602. color: #205592;
  603. width: 160upx;
  604. font-size: 24upx;
  605. box-sizing: border-box;
  606. text-align: center;
  607. padding: 0;
  608. height: 100upx;
  609. line-height: 100upx;
  610. }
  611. }
  612. }
  613. .select {
  614. // padding-top: 40upx;
  615. display: flex;
  616. justify-content: space-between;
  617. color: #003B67;
  618. }
  619. }
  620. /deep/.title-left {
  621. width: 3px;
  622. height: 16px;
  623. background: #267CFF;
  624. display: inline-block;
  625. border-radius: 3px;
  626. margin-top: 3px;
  627. vertical-align: top;
  628. margin-right: 10px;
  629. }
  630. </style>