withdrawal.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <view class="main">
  3. <view class="body_style_money flex justify-center align-center u-flex-col">
  4. <view class="text-white" style="font-size: 70rpx;">
  5. {{vuex_user.balance/100}}<text class="u-font-35 u-margin-left-10">元</text>
  6. </view>
  7. <view class="text-white u-font-28 u-margin-top-30">
  8. 可提现金额
  9. </view>
  10. </view>
  11. <view class="body_style_money u-margin-top-30 padding" style="height: 280rpx;background: #fff;">
  12. <view class="flex justify-between align-center">
  13. <u-input v-model="money" placeholder="请输入提现的金额" type="number" border />
  14. <button @click="allMoney" style="color: #fff;background: #F1C453;border-color: #F1C453;"
  15. hover-class="none" class="left_btn u-margin-left-20">全部提现</button>
  16. </view>
  17. <view class="text-black text-sm u-margin-top-15">
  18. 提现基础额为10元,手续费{{configData.withdraw_ratio}}%
  19. </view>
  20. <view class="text-sm u-margin-top-5" style="color: #F1C453;">
  21. 手续费:{{money*configData.withdraw_ratio/100}}元
  22. </view>
  23. <view class="text-sm u-margin-top-5" style="color: #F1C453;">
  24. 预计到账金额为:{{money-(money*configData.withdraw_ratio/100)}}元
  25. </view>
  26. </view>
  27. <u-button shape="circle" @click="submit_money" hover-class="none"
  28. :custom-style="{...customStyle,width:'500rpx',height:'66rpx'}" throttle-time="1000">立即提现</u-button>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. money: '',
  36. customStyle: {
  37. width: '214rpx',
  38. height: '52rpx',
  39. color: '#fff',
  40. background: '#FBC600',
  41. border: 'none',
  42. marginTop: '30rpx'
  43. },
  44. configData:{}
  45. }
  46. },
  47. onLoad() {
  48. this.getUserConfig()
  49. },
  50. methods: {
  51. async getUserConfig() {
  52. let res = await this.$u.post("manager/sysConfig")
  53. if(res.code == 200){
  54. this.configData = res.data
  55. }
  56. },
  57. allMoney() {
  58. this.money = this.vuex_user.balance / 100
  59. },
  60. async submit_money() {
  61. if (this.vuex_user.bank_card == null) {
  62. uni.showModal({
  63. title: "温馨提示",
  64. content: "尚未绑定银行卡,是否前往绑定?",
  65. success: (res) => {
  66. if (res.confirm) {
  67. uni.navigateTo({
  68. url: "./bank_card"
  69. })
  70. }
  71. }
  72. })
  73. return false
  74. }
  75. if (this.money < 10) {
  76. uni.showToast({
  77. title: "金额最低为10元",
  78. icon: "none"
  79. })
  80. return false
  81. }
  82. let res = await this.$u.post('manager/withdraw', {
  83. money: this.money * 100
  84. })
  85. if (res.code == 200) {
  86. uni.showModal({
  87. title: "温馨提示",
  88. content: "提交成功,请等待后台审核",
  89. showCancel: false,
  90. success: (res) => {
  91. if (res.confirm) {
  92. uni.navigateBack()
  93. }
  94. }
  95. })
  96. }else{
  97. uni.showToast({
  98. title:res.message,
  99. icon:"none"
  100. })
  101. return false
  102. }
  103. }
  104. }
  105. }
  106. </script>
  107. <style>
  108. .main {
  109. padding: 50rpx;
  110. }
  111. .body_style_money {
  112. width: 100%;
  113. height: 300rpx;
  114. background-color: #F1C453;
  115. border-radius: 16rpx;
  116. box-shadow: 6rpx 6rpx 10rpx rgba(122, 122, 122, 0.2);
  117. }
  118. .left_btn::after {
  119. border: none;
  120. }
  121. .left_btn {
  122. padding: 0;
  123. color: #909399;
  124. /* border: 2rpx solid rgba(144, 147, 153, .5); */
  125. border: none;
  126. border-radius: 8rpx;
  127. width: 170rpx;
  128. height: 60rpx;
  129. font-size: 28rpx;
  130. display: flex;
  131. justify-content: center;
  132. align-items: center;
  133. background: #fff;
  134. }
  135. </style>