gqtx.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view class="content">
  3. <view class="tx-wrap">
  4. <view class="tx-tit">
  5. 提现股权至提成
  6. </view>
  7. <input type="digit" v-model="txnum" placeholder="请输入提现股权" class="tx-inp" placeholder-class="tx-inp-p">
  8. <view class="gq-detail">
  9. <view class="">
  10. 可提现: {{userInfo.use_stock }}(股权)
  11. </view>
  12. <view class="right" @click="txnum = userInfo.use_stock">
  13. 全部提现
  14. </view>
  15. </view>
  16. <view class="tx-btn" @click="gqtx">
  17. 提现
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. txnum: '',
  27. userInfo:{},
  28. txloading: 'loading',
  29. }
  30. },
  31. onLoad() {
  32. },
  33. onShow() {
  34. this.getCustomerInfo()
  35. },
  36. onReachBottom() {
  37. },
  38. onReady() {
  39. },
  40. methods: {
  41. gqtx() {
  42. let that = this
  43. if(this.txloading == 'loading') {
  44. return
  45. }
  46. if(this.txnum == '') {
  47. return this.$u.toast('请输入提现股权')
  48. }
  49. if(this.txnum == 0) {
  50. return this.$u.toast('提现股权不能为零')
  51. }
  52. if(this.txnum*1 > this.userInfo.use_stock*1) {
  53. return this.$u.toast('股权不足')
  54. }
  55. this.txloading = 'loading'
  56. this.$u.api.txGq({
  57. number: this.txnum
  58. }).then(({data})=> {
  59. // uni.showToast({
  60. // title:'提现成功',
  61. // icon: 'success',
  62. // duration: 2000
  63. // })
  64. // this.getCustomerInfo()
  65. this.$u.toast('提现成功')
  66. setTimeout(()=> {
  67. that.getCustomerInfo()
  68. },1500)
  69. }).catch(err => {
  70. this.txloading = 'no'
  71. })
  72. },
  73. getCustomerInfo() {
  74. this.$u.api.getYgdetail({
  75. request_id: this.$store.state.userInfo.staffId
  76. }).then(({
  77. data
  78. }) => {
  79. this.userInfo = data
  80. if(!this.userInfo.use_stock) {
  81. this.userInfo.use_stock = 0
  82. }
  83. this.txloading = 'no'
  84. })
  85. },
  86. }
  87. }
  88. </script>
  89. <style lang="scss">
  90. .content {
  91. padding-top: 1rpx;
  92. }
  93. .tx-wrap {
  94. width: 700rpx;
  95. // height: 420rpx;
  96. padding: 20rpx 0 50rpx 0;
  97. margin: 19rpx auto;
  98. background-color: #fff;
  99. border-radius: 20rpx;
  100. // display: flex;
  101. // flex-direction: color;
  102. .tx-tit {
  103. margin: auto;
  104. width: 660rpx;
  105. font-size: 32rpx;
  106. color: #333;
  107. font-weight: bold;
  108. border-bottom: 1px solid #eee;
  109. line-height: 87rpx;
  110. }
  111. .tx-inp {
  112. display: block;
  113. width: 660rpx;
  114. height: 114rpx;
  115. font-size: 56rpx;
  116. font-weight: bold;
  117. color: #000;
  118. // padding-left: 20rpx;
  119. border-bottom: 1rpx solid #eee;
  120. margin: auto;
  121. }
  122. .tx-inp-p {
  123. font-size: 36rpx;
  124. }
  125. .gq-detail {
  126. display: flex;
  127. justify-content: space-between;
  128. padding: 20rpx;
  129. font-size: 28rpx;
  130. .left {}
  131. .right {
  132. color: #d74f3a;
  133. }
  134. }
  135. .tx-btn {
  136. width: 660rpx;
  137. height: 70rpx;
  138. line-height: 70rpx;
  139. background-color: #ec643e;
  140. color: #fff;
  141. font-size: 32rpx;
  142. text-align: center;
  143. margin: 30rpx auto 0;
  144. border-radius: 35rpx;
  145. }
  146. }
  147. </style>