cash_out.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <view class="main">
  3. <view class="mcard">
  4. <view class="money">{{ money }}</view>
  5. <view class="desc">可提现余额(元)</view>
  6. </view>
  7. <view class="mcard mt10">
  8. <view class="form_group">
  9. <view class="lable re">提现金额</view>
  10. <view class="bgm">
  11. <input type="digit" v-model="item.money" placeholder="请输入提现金额" class="input" />
  12. <view class="msg" @click="all()">提现全部</view>
  13. </view>
  14. </view>
  15. <view class="form_group">
  16. <view class="lable re">提现方式</view>
  17. <view class="item">
  18. <view class="lit">
  19. <text class="icon tb" style="color: #4caf50">&#xe620;</text>
  20. <view class="title">提现到微信</view>
  21. </view>
  22. <view class="lit">
  23. <text class="icon tb" style="color: #ff9800">&#xe635;</text>
  24. <view class="title">
  25. <text>提现到银行卡</text>
  26. <text class="desc" v-if="!bankName">(未填)</text>
  27. </view>
  28. <text class="icon check">&#xe612;</text>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <button class="btn" @click="save()">确认</button>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. data() {
  39. return {
  40. money: 0,
  41. bankName: '',
  42. item: {}
  43. };
  44. },
  45. onShow() {
  46. this.money = uni.getStorageSync('money');
  47. this.bankName = uni.getStorageSync('bankName');
  48. },
  49. methods: {
  50. all() {
  51. this.item.money = this.money;
  52. this.$forceUpdate();
  53. },
  54. save() {
  55. let rule = [{ name: 'money', checkType: 'notnull', errorMsg: '请输入提现金额' }];
  56. if (!this.verify.check(this.item, rule)) {
  57. uni.showModal({ content: this.verify.error, showCancel: false });
  58. return false;
  59. }
  60. if (!this.bankName) {
  61. uni.showModal({
  62. title: '提示',
  63. content: '请先填写银行卡信息',
  64. showCancel: false,
  65. success: (res) => {
  66. uni.navigateTo({ url: '/pages/statement/user/info' });
  67. }
  68. });
  69. return;
  70. }
  71. uni.showModal({
  72. title: '提示',
  73. content: '确定提现' + this.item.money + '元',
  74. success: (res) => {
  75. if (res.confirm) {
  76. this.http.request({
  77. url: '/app/pay/cashOut',
  78. data: this.item,
  79. method: 'POST',
  80. success: (res) => {
  81. uni.showModal({
  82. title: '提示',
  83. content: '提现申请成功,等待平台审核打款',
  84. showCancel: false,
  85. success: (res) => {
  86. uni.$emit('payMoney');
  87. uni.navigateBack();
  88. }
  89. });
  90. }
  91. });
  92. }
  93. }
  94. });
  95. }
  96. }
  97. };
  98. </script>
  99. <style lang="scss">
  100. .bgm {
  101. .input {
  102. width: 50%;
  103. }
  104. }
  105. .lit {
  106. padding: 15px 0px 10px 0px;
  107. border-bottom: 1px solid $line;
  108. .tb {
  109. padding-right: 5px;
  110. font-size: 25px;
  111. float: left;
  112. }
  113. .desc {
  114. font-size: 13px;
  115. padding-left: 5px;
  116. color: #a8a8a8;
  117. }
  118. .check {
  119. float: right;
  120. color: $main-color;
  121. margin-top: -18px;
  122. }
  123. &:last-child {
  124. border: 0px;
  125. padding-bottom: 0px;
  126. }
  127. }
  128. </style>