时空网前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

158 lines
4.6 KiB

5 years ago
5 years ago
  1. <template>
  2. <view class="wrap">
  3. <view class="lf-p-l-30 lf-p-r-30 lf-m-t-30" style="height: auto;">
  4. <view class="bg-white lf-h-100 lf-p-30 flex align-center" style="border-radius: 10rpx; box-sizing: border-box;">
  5. <view>
  6. <img :src="info.avatar" mode="aspectFill" style="height: 120rpx;width: 120rpx;border-radius: 50%;"></img>
  7. </view>
  8. <view class="lf-m-l-20 text-black1 lf-font-32">
  9. {{info.nickname || ''}}
  10. </view>
  11. </view>
  12. </view>
  13. <view class="lf-p-l-30 lf-p-r-30 lf-m-t-30" style="height: auto;">
  14. <view class="bg-white lf-h-100 lf-p-l-30 lf-p-r-30 flex flex-direction" style="border-radius: 10rpx; box-sizing: border-box;padding-bottom: 50rpx;padding-top: 34rpx;">
  15. <view class="flex align-start flex-direction solid-bottom">
  16. <view class="text-black lf-font-28 lf-m-b-30">支付宝姓名</view>
  17. <input type="text" v-model="name" placeholder="请输入您的姓名" class="lf-font-28 lf-color-999">
  18. </view>
  19. <view style="margin-top: 60rpx;" class="flex align-start flex-direction solid-bottom">
  20. <view class="text-black lf-font-28 lf-m-b-30">支付宝账号</view>
  21. <input type="text" v-model="account" placeholder="请输入支付宝账号" class="lf-font-28 lf-color-999">
  22. </view>
  23. </view>
  24. </view>
  25. <view class="lf-p-30" style="height: 408rpx;">
  26. <view class="bg-white lf-h-100" style="border-radius: 10rpx;">
  27. <view class="text-black lf-font-28 lf-p-l-30 lf-p-t-30">提取金额</view>
  28. <view class="lf-p-l-20 flex solid-bottom align-center" style="padding-top: 90rpx;">
  29. <text class="text-black lf-font-48 unit"></text>
  30. <!-- <u-input v-model="num" :type="type" :border="border" :height="height" :auto-height="autoHeight"/> -->
  31. <input type="number" v-model="num" class="lf-p-l-10 text-black1" style="width: 80%;padding-right: 30rpx;font-size: 72rpx;height: 100rpx;" />
  32. <view v-if="num != ''">
  33. <u-icon @click="clearAble()" name="close-circle" color="#999999" size="40"></u-icon>
  34. </view>
  35. </view>
  36. <view class="lf-font-28 lf-color-999 lf-p-t-26 lf-p-l-30" v-if="!ifshow">
  37. 可用余额
  38. <text>{{info.income || 0}}</text>
  39. </view>
  40. <view v-else class="lf-color-price lf-font-28 lf-p-t-26 lf-p-l-30">输入金额超过可用余额</view>
  41. </view>
  42. </view>
  43. <view class="lf-p-l-30 lf-p-r-30 lf-p-b-30" style="height: auto;">
  44. <view class="bg-white lf-h-100 lf-p-30" style="border-radius: 10rpx; box-sizing: border-box;">
  45. <view class="text-black lf-font-28">提现说明</view>
  46. <view class="flex flex-direction justify-around lf-p-t-20">
  47. <view class="lf-font-28" style="color: #555;">
  48. 1提现到账时间为T+1
  49. </view>
  50. <view class="lf-font-28" style="color: #555;">
  51. 2提现最高单笔金额为1000元
  52. </view>
  53. <view class="lf-font-28" style="color: #555;">
  54. 3提现手续费单笔收费10%
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="lf-m-b-30">
  60. <view class="padding-lr-lg">
  61. <button class="cu-btn block bg-orange lg" style="border-radius: 42rpx;" @tap="submitWidthdraw()">
  62. <text class="lf-font-32 text-white">提现</text>
  63. </button>
  64. </view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. export default {
  70. data() {
  71. return {
  72. userInfo: '',
  73. info: '',
  74. name: '',
  75. account: '',
  76. num: ''
  77. }
  78. },
  79. computed: {
  80. ifshow() {
  81. if(Number(this.num) > Number(this.info.income)) {
  82. return true
  83. }else {
  84. return false
  85. }
  86. }
  87. },
  88. methods: {
  89. getData(){
  90. this.$http(this.API.API_USER_CENTER).then(res => {
  91. this.info = res.data;
  92. console.log(this.info)
  93. })
  94. },
  95. clearAble() {
  96. this.num = ''
  97. this.showClean = false
  98. },
  99. submitWidthdraw() {
  100. if(!this.name) {
  101. this.$msg('请输入支付宝姓名!')
  102. return
  103. }
  104. if(!this.account) {
  105. this.$msg('请输入支付宝账号!')
  106. return
  107. }
  108. if(!this.num) {
  109. this.$msg('请输入提现金额!')
  110. return
  111. }
  112. this.$http(this.API.API_WIDTHDRAW, {
  113. account: this.account,
  114. username: this.name,
  115. extract_price:this.num,
  116. channel:'alipay',
  117. token: this.userInfo.token
  118. }).then(res => {
  119. this.$msg(res.data)
  120. this.name = ''
  121. this.account = ''
  122. this.num = ''
  123. })
  124. }
  125. },
  126. onLoad(e) {
  127. this.userInfo = uni.getStorageSync('userinfo') || {};
  128. this.getData()
  129. }
  130. }
  131. </script>
  132. <style>
  133. page{
  134. background-color: #F5F5F5;
  135. }
  136. </style>
  137. <style scoped>
  138. .wrap {
  139. height: 100%;
  140. width: 100%;
  141. background-color: #F5F5F5;
  142. }
  143. .unit{
  144. display: flex;
  145. height: 100rpx;
  146. align-items: flex-end;
  147. box-sizing: border-box;
  148. padding-bottom: 10rpx;
  149. }
  150. </style>