myzhifubao.vue 13 KB

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