wx.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view class="content">
  3. <view class="box">
  4. <view class="wx">
  5. <text>姓名</text>
  6. <input type="text" v-model="name" value="" placeholder="请输入姓名" />
  7. </view>
  8. <view class="wx">
  9. <text>微信号</text>
  10. <input type="text" v-model="code" value="" placeholder="请输入微信号" />
  11. </view>
  12. <view class="erweima">
  13. <text>微信收款码</text>
  14. <view class="img" @click="uploads()">
  15. <image src="../../static/user/erweima.png" mode="" v-if="image == ''"></image>
  16. <image :src="image" mode="" v-else></image>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="button" @click="confirm()">
  21. 确认
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import { upload } from '@/api/order.js'
  27. import { auction } from '@/api/wallet.js';
  28. export default {
  29. data() {
  30. return {
  31. code:'',
  32. name:'',
  33. image:''
  34. };
  35. },
  36. methods: {
  37. uploads(){
  38. upload({
  39. filename: ''
  40. }).then(data => {
  41. this.image = data[0].url;
  42. })
  43. },
  44. confirm() {
  45. let obj = this;
  46. if (!obj.name) {
  47. return this.$api.msg('请输入提款人姓名');
  48. }
  49. if (!obj.code) {
  50. return this.$api.msg('请输入微信账号');
  51. }
  52. if (!obj.image) {
  53. return this.$api.msg('请上传微信二维码');
  54. }
  55. auction({
  56. type:1,
  57. name: obj.name,
  58. payment: obj.code,
  59. image: obj.image
  60. })
  61. .then(e => {
  62. obj.$api.msg('修改成功');
  63. obj.getUserInfo();
  64. })
  65. .catch(e => {
  66. console.log(e);
  67. });
  68. },
  69. }
  70. }
  71. </script>
  72. <style lang="scss">
  73. page , .content{
  74. height: 100%;
  75. margin: 0;
  76. padding: 0;
  77. }
  78. .box{
  79. margin:20rpx 0 100rpx 0;
  80. width: 100%;
  81. background: #FFFFFF;
  82. .wx{
  83. border-bottom: #F0F0F0 solid 1rpx;
  84. padding: 20rpx 0 30rpx 0;
  85. display: flex;
  86. text{
  87. width: 150rpx;
  88. margin: 0 30rpx;
  89. }
  90. input{
  91. font-size: 28rpx;
  92. font-family: PingFang SC;
  93. font-weight: 400;
  94. color: #999999;
  95. line-height: 100rpx;
  96. }
  97. }
  98. .erweima{
  99. padding: 30rpx 0;
  100. display: flex;
  101. text{
  102. margin: 0 30rpx;
  103. width: 150rpx;
  104. font-size: 30rpx;
  105. font-family: PingFang SC;
  106. font-weight: 400;
  107. color: #333333;
  108. }
  109. .img{
  110. width: 160rpx;
  111. height: 160rpx;
  112. image{
  113. width: 100%;
  114. height: 100%;
  115. }
  116. }
  117. }
  118. }
  119. .button{
  120. margin: 0 auto;
  121. width: 560rpx;
  122. height: 80rpx;
  123. background: #FD3B39;
  124. border-radius: 40rpx;
  125. font-size: 30rpx;
  126. font-family: PingFangSC;
  127. font-weight: 500;
  128. color: #FFFFFF;
  129. line-height: 80rpx;
  130. text-align: center;
  131. }
  132. </style>