zfb.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="content">
  3. <view class="box">
  4. <view class="item top">
  5. <text>真实姓名</text>
  6. <input type="text" v-model="name" value="" placeholder="请输入真实姓名" />
  7. </view>
  8. <view class="item">
  9. <text>支付宝账号</text>
  10. <input type="text" v-model="id" value="" placeholder="请输入支付宝账号" />
  11. </view>
  12. <view class="item">
  13. <text>手机号</text>
  14. <input type="text" v-model="phone" value="" placeholder="请输入手机号" />
  15. </view>
  16. </view>
  17. <view class="button" @click="confirm()">确认</view>
  18. </view>
  19. </template>
  20. <script>
  21. import { orderData, getUserInfo } from '@/api/user.js';
  22. import { mapState, mapMutations } from 'vuex';
  23. import { auction,pay_list } from '@/api/wallet.js';
  24. export default {
  25. computed: {
  26. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  27. },
  28. data() {
  29. return {
  30. name: '',
  31. id: '',
  32. phone:''
  33. };
  34. },
  35. onLoad() {
  36. pay_list().then(({data}) =>{
  37. if(data.zfb != ''){
  38. this.name = data.zfb.name
  39. this.id = data.zfb.payment
  40. this.phone = data.zfb.phone
  41. }
  42. })
  43. },
  44. methods: {
  45. ...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
  46. confirm() {
  47. let obj = this;
  48. if (!obj.name) {
  49. return this.$api.msg('请输入提款人姓名');
  50. }
  51. if (!obj.id) {
  52. return this.$api.msg('请输入支付宝账号');
  53. }
  54. if (!obj.phone) {
  55. return this.$api.msg('请输入手机号码');
  56. }
  57. auction({
  58. type:2,
  59. name: obj.name,
  60. payment: obj.id,
  61. phone: obj.phone,
  62. })
  63. .then(e => {
  64. obj.$api.msg('修改成功');
  65. })
  66. .catch(e => {
  67. console.log(e);
  68. });
  69. },
  70. }
  71. };
  72. </script>
  73. <style lang="scss">
  74. page,
  75. .content {
  76. height: 100%;
  77. padding: 0;
  78. margin: 0;
  79. }
  80. .top {
  81. border-bottom: 1rpx solid #f3f3f3;
  82. }
  83. .box {
  84. background: #ffffff;
  85. margin: 20rpx 0 70rpx 0;
  86. .item {
  87. display: flex;
  88. align-items: center;
  89. text {
  90. margin: 0 40rpx 0 25rpx;
  91. width: 150rpx;
  92. font-size: 30rpx;
  93. font-family: PingFang SC;
  94. font-weight: 400;
  95. color: #333333;
  96. line-height: 100rpx;
  97. }
  98. input {
  99. font-size: 28rpx;
  100. font-family: PingFang SC;
  101. font-weight: 400;
  102. color: #999999;
  103. line-height: 100rpx;
  104. }
  105. }
  106. }
  107. .button {
  108. text-align: center;
  109. width: 560rpx;
  110. height: 80rpx;
  111. background: #FD3B39;
  112. border-radius: 40rpx;
  113. font-size: 30rpx;
  114. font-family: PingFangSC;
  115. font-weight: 500;
  116. color: #ffffff;
  117. line-height: 80rpx;
  118. margin: 0 auto;
  119. }
  120. </style>