zhifubao.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view class="container" v-if="XCXIsSelect!='否'">
  3. <list-cell title="收款人姓名" type="text" placeholder="请输入支付宝收款人姓名" v-model="zhiFuBaoName"></list-cell>
  4. <list-cell title="支付宝账号" type="text" placeholder="请输入要绑定的支付宝账号" v-model="zhiFuBao"></list-cell>
  5. <wButton text="绑定账户" :rotate="logining" @click.native="toLogin()"></wButton>
  6. <view style="padding: 32upx 64upx;font-size: 24upx;color: #999999;">提示:请正确填写收款人的支付宝账户和真实的收款人姓名,否则将无法正常收款</view>
  7. </view>
  8. </template>
  9. <script>
  10. import listCell from '@/components/com-input.vue';
  11. import wButton from '@/components/watch-login/watch-button.vue'; //button
  12. export default {
  13. components: {
  14. listCell,
  15. wButton
  16. },
  17. data() {
  18. return {
  19. zhiFuBao: '',
  20. zhiFuBaoName: '',
  21. logining: false,
  22. XCXIsSelect: '否'
  23. }
  24. },
  25. onLoad() {
  26. this.XCXIsSelect = this.$queue.getData('xcxSelect');
  27. if (this.XCXIsSelect == '否') {
  28. uni.setNavigationBarTitle({
  29. title: '隐私政策'
  30. });
  31. } else {
  32. uni.setNavigationBarTitle({
  33. title: '提现账号'
  34. });
  35. }
  36. this.getUserInfo()
  37. },
  38. methods: {
  39. inputChange(e) {
  40. const key = e.currentTarget.dataset.key;
  41. this[key] = e.detail.value;
  42. },
  43. navBack() {
  44. uni.navigateBack();
  45. },
  46. toLogin() {
  47. let userId = this.$queue.getData("userId");
  48. let token = uni.getStorageSync("token");
  49. const {
  50. zhiFuBao,
  51. zhiFuBaoName
  52. } = this;
  53. if (!zhiFuBao) {
  54. this.$queue.showToast("请设置收款人支付宝账号");
  55. } else if (!zhiFuBaoName) {
  56. this.$queue.showToast("请设置收款人姓名");
  57. } else {
  58. this.$queue.showLoading("修改中...");
  59. let data = {
  60. zhiFuBao: this.zhiFuBao,
  61. zhiFuBaoName: this.zhiFuBaoName
  62. }
  63. this.$Request.postJson('/app/user/updateUser', data).then(res => {
  64. if (res.code === 0) {
  65. // uni.setStorageSync('zhiFuBao',zhiFuBao)
  66. // uni.setStorageSync('zhiFuBaoName',zhiFuBaoName)
  67. uni.showToast({
  68. title: '修改成功',
  69. icon: 'none',
  70. complete() {
  71. setTimeout(function() {
  72. uni.navigateBack();
  73. }, 1000)
  74. }
  75. })
  76. } else {
  77. this.$queue.showToast(res.msg)
  78. }
  79. uni.hideLoading();
  80. });
  81. }
  82. },
  83. getUserInfo() {
  84. this.$Request.getT("/app/user/selectUserById").then(res => {
  85. if (res.code == 0) {
  86. this.zhiFuBao = res.data.zhiFuBao
  87. this.zhiFuBaoName = res.data.zhiFuBaoName
  88. }
  89. });
  90. },
  91. },
  92. }
  93. </script>
  94. <style lang='scss'>
  95. page {
  96. background-color: #FFFFFF;
  97. }
  98. .container {
  99. padding-top: 32upx;
  100. position: relative;
  101. width: 100%;
  102. height: 100%;
  103. overflow: hidden;
  104. background: #FFFFFF;
  105. }
  106. .confirm-btn {
  107. width: 300px;
  108. height: 42px;
  109. line-height: 42px;
  110. border-radius: 30px;
  111. margin-top: 70upx;
  112. background: #e10a07;
  113. color: #fff;
  114. font-size: 32rpx;
  115. &:after {
  116. border-radius: 60px;
  117. }
  118. }
  119. </style>