mybank.vue 16 KB

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