withdraws.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <view>
  3. <view class="top">
  4. <text class="left">金额</text>
  5. <input v-model.number="numData" type="number" step="1" placeholder="请输入提现金额" />
  6. <text class="right">手续费{{info.withdraw_rate}}%</text>
  7. </view>
  8. <view class="title">提现方式</view>
  9. <view class="payment">
  10. <image src="../../static/wx.png" mode=""></image>
  11. <text>微信提现</text>
  12. </view>
  13. <button class="button" type="primary" @tap="post">确认提现</button>
  14. </view>
  15. </template>
  16. <script>
  17. import helper from '../../common/helper.js';
  18. import api from '../../common/api.js';
  19. export default {
  20. data() {
  21. return {
  22. numData: '',
  23. info:{}
  24. };
  25. },
  26. onShow() {
  27. this.getInfo();
  28. },
  29. methods: {
  30. async getInfo() {
  31. let res = await api.getSetting();
  32. this.info = res.data;
  33. },
  34. navigateTo(url) {
  35. uni.navigateTo({
  36. url: url
  37. });
  38. },
  39. async post() {
  40. if(this.numData<=0){
  41. helper.toast('请输入正确金额');
  42. return false;
  43. }
  44. let res = await api.withdraw(this.numData);
  45. uni.showModal({
  46. title: '操作提示',
  47. content: res.msg,
  48. showCancel: false,
  49. success(res) {
  50. if(res.confirm){
  51. uni.navigateBack({
  52. });
  53. }
  54. }
  55. });
  56. }
  57. }
  58. };
  59. </script>
  60. <style lang="scss">
  61. .top {
  62. display: flex;
  63. align-items: center;
  64. font-size: 28upx;
  65. padding: 30upx;
  66. input {
  67. width: 65%;
  68. }
  69. .left {
  70. width: 10%;
  71. }
  72. .right {
  73. width: 25%;
  74. font-size: 20upx;
  75. color: #e51c23;
  76. }
  77. }
  78. .title {
  79. padding: 30upx;
  80. font-size: 28upx;
  81. background-color: #f5f5f5;
  82. }
  83. .payment {
  84. display: flex;
  85. width: 90%;
  86. margin-left: 30upx;
  87. padding: 30upx 0;
  88. align-items: center;
  89. font-size: 28upx;
  90. border-bottom: 1px solid #f5f5f5;
  91. image {
  92. width: 50upx;
  93. height: 50upx;
  94. margin-right: 20upx;
  95. }
  96. }
  97. .button {
  98. background-color: #32c45e;
  99. width: 90%;
  100. font-size: 28upx;
  101. margin-top: 20%;
  102. }
  103. </style>