cash_out.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. //通知模板订阅消息
  82. uni.requestSubscribeMessage({
  83. tmplIds: ['PtdKbqfzmpvGsJPx_YekDX4-cljbhOXcvoUB3XJaVLg', 'NIqSQq0j765o9Iz9gMiSelnuxMgPIPeCnk3lvEnWJlo'],
  84. complete: (c) => {
  85. uni.showModal({
  86. title: '提示',
  87. content: '提现申请成功,等待平台审核打款',
  88. showCancel: false,
  89. success: (res) => {
  90. uni.$emit('payMoney');
  91. uni.navigateBack();
  92. }
  93. });
  94. }
  95. });
  96. }
  97. });
  98. }
  99. }
  100. });
  101. }
  102. }
  103. };
  104. </script>
  105. <style lang="scss">
  106. .bgm {
  107. .input {
  108. width: 50%;
  109. }
  110. }
  111. .lit {
  112. padding: 15px 0px 10px 0px;
  113. border-bottom: 1px solid $line;
  114. .tb {
  115. padding-right: 5px;
  116. font-size: 25px;
  117. float: left;
  118. }
  119. .desc {
  120. font-size: 13px;
  121. padding-left: 5px;
  122. color: #a8a8a8;
  123. }
  124. .check {
  125. float: right;
  126. color: $main-color;
  127. margin-top: -18px;
  128. }
  129. &:last-child {
  130. border: 0px;
  131. padding-bottom: 0px;
  132. }
  133. }
  134. </style>