wx.vue 3.2 KB

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