mybank.vue 16 KB

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