cash_out.vue 3.2 KB

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