transfer.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view class="container">
  3. <view class="top-two">
  4. <view class="count">{{money || 0}}</view>
  5. <view class="text">可转账佣金</view>
  6. </view>
  7. <view class="top-three">
  8. <view class="text">收款人账户</view>
  9. <input class="input" type="text" placeholder="请输入收款人账户" v-model="to_user_account"/>
  10. </view>
  11. <view class="top-three">
  12. <view class="text">收款人UID</view>
  13. <input class="input" type="number" placeholder="请输入收款人UID" v-model="to_uid"/>
  14. </view>
  15. <view class="top-four">
  16. <view class="text">转账数量</view>
  17. <view class="row">
  18. <text class="tit">¥</text>
  19. <input class="input" type="number" placeholder="请输入转账数量" v-model="num"/>
  20. </view>
  21. </view>
  22. <view class="btn" @click="sub">提交申请</view>
  23. </view>
  24. </template>
  25. <script>
  26. import { trade, getSpreadCount } from '@/api/user.js'
  27. export default {
  28. data () {
  29. return {
  30. num: '',//转账金额
  31. to_user_account: '',//收款人账户
  32. to_uid: '',//收款人UID
  33. money: 0,
  34. }
  35. },
  36. onLoad() {
  37. this.getNum()
  38. },
  39. methods: {
  40. nav (url) {
  41. uni.navigateTo({
  42. url
  43. })
  44. },
  45. sub() {
  46. let obj = this
  47. if(obj.num == '') {
  48. return this.$api.msg('请输入收款人账户!')
  49. }
  50. if(to_user_account == '') {
  51. return this.$api.msg('请输入收款人账户!')
  52. }
  53. if(obj.to_uid == '') {
  54. return this.$api.msg('请输入转账金额!')
  55. }
  56. if( +obj.num > +obj.money)
  57. trade({
  58. type: 'd',
  59. num: obj.num,
  60. to_user_account: obj.to_user_account,
  61. to_uid: obj.to_uid
  62. }).then( res => {
  63. })
  64. },
  65. getNum() {
  66. getSpreadCount({}, 3).then(({ data }) => {
  67. console.log(data);
  68. this.money = +data.count;
  69. });
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang="scss">
  75. .container {
  76. background-color: #F2F3F5;
  77. width: 750rpx;
  78. // height: 1334rpx;
  79. .top-two {
  80. padding-bottom: 20rpx;
  81. background-color: #fff;
  82. .count {
  83. text-align: center;
  84. height: 50rpx;
  85. font-size: 42rpx;
  86. font-family: PingFang SC;
  87. font-weight: bold;
  88. color: #333333;
  89. line-height: 110rpx;
  90. margin: 0 auto;
  91. }
  92. .text {
  93. width: 140rpx;
  94. // height: 26rpx;
  95. font-size: 28rpx;
  96. font-family: PingFang SC;
  97. font-weight: 500;
  98. color: #666666;
  99. margin: 0 auto;
  100. margin-top: 50rpx;
  101. }
  102. }
  103. .top-three {
  104. margin-top: 20rpx;
  105. height: 160rpx;
  106. background-color: #fff;
  107. .text {
  108. width: 150rpx;
  109. height: 29rpx;
  110. font-size: 30rpx;
  111. font-family: PingFang SC;
  112. font-weight: 400;
  113. color: #333333;
  114. line-height: 110rpx;
  115. margin-left: 25rpx;
  116. }
  117. .input {
  118. margin-top: 65rpx;
  119. margin-left: 25rpx;
  120. }
  121. }
  122. .top-four {
  123. margin-top: 20rpx;
  124. height: 160rpx;
  125. background-color: #fff;
  126. .text {
  127. width: 150rpx;
  128. height: 29rpx;
  129. font-size: 30rpx;
  130. font-family: PingFang SC;
  131. font-weight: 400;
  132. color: #333333;
  133. line-height: 110rpx;
  134. margin-left: 25rpx;
  135. }
  136. .row {
  137. display: flex;
  138. // justify-content: center;
  139. margin-top: 65rpx;
  140. margin-left: 20rpx;
  141. .tit {
  142. font-size: 30rpx;
  143. font-family: PingFang SC;
  144. font-weight: 400;
  145. color: #333333;
  146. margin-right: 10rpx;
  147. }
  148. }
  149. }
  150. .btn {
  151. display: flex;
  152. justify-content: center;
  153. align-items: center;
  154. width: 674rpx;
  155. height: 90rpx;
  156. background: linear-gradient(-35deg, #F8DD4F, #FBEB77);
  157. border-radius: 44rpx;
  158. margin-top: 138rpx;
  159. margin-left: 38rpx;
  160. }
  161. }
  162. </style>