wx.vue 2.9 KB

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