myzhifubao.vue 14 KB

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