耀实惠小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

179 lines
3.6 KiB

  1. <template>
  2. <view class="wallte">
  3. <text class="title">钱包余额</text>
  4. <view class="money_num">
  5. <text></text>
  6. <text class="num">{{user_info.wallet}}</text>
  7. </view>
  8. <view class="grid">
  9. <text class="title">提现到微信零钱</text>
  10. <view class="input_box">
  11. <text class="text_icon"></text>
  12. <input type="number" v-model="money" >
  13. <text class="withdraw_deposit" @click="allMoney">全部提现</text>
  14. </view>
  15. <text class="info_text">提现手续费为10%</text>
  16. </view>
  17. <view class="info flex align-center justify-between">
  18. <view>
  19. <text class="dit">·</text>
  20. <text>预计24小时到账</text>
  21. </view>
  22. <view class="theme-color" @click="toInfo">余额明细</view>
  23. </view>
  24. <button class="btn_money" @click="addMoney">立即提现</button>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. money: null,
  32. showMoney: 0,
  33. user_info: {},
  34. type: 0
  35. }
  36. },
  37. onLoad(options) {
  38. this.type = options.type
  39. this.getUserInfo()
  40. },
  41. methods: {
  42. toInfo () {
  43. uni.navigateTo({
  44. url: '/pagesA/my_other_list/webmaster/reward_centers/index?title=余额明细&type=' + this.type
  45. })
  46. },
  47. // 全部提现
  48. allMoney(){
  49. this.money = this.user_info.wallet
  50. },
  51. getUserInfo(){
  52. uni.showLoading();
  53. this.$api('getUserInfo',{money: this.money}).then(res => {
  54. let { code, result, message} = res;
  55. if( code == 200) {
  56. this.user_info = {...result.account,...result.userInfo}
  57. }else{
  58. this.$Toast(message);
  59. }
  60. uni.hideLoading();
  61. }).catch(err => {
  62. uni.hideLoading();
  63. this.$Toast(err.message);
  64. })
  65. },
  66. // 立即体现
  67. addMoney(){
  68. uni.showLoading();
  69. this.$api('getMoneyStation',{money: this.money}).then(res => {
  70. let { code, result, message} = res;
  71. uni.hideLoading();
  72. if( code == 200) {
  73. that.user_info.wallet = 0
  74. this.$Toast(result)
  75. }else{
  76. this.$Toast(message);
  77. }
  78. }).catch(err => {
  79. uni.hideLoading();
  80. this.$Toast(err.message);
  81. })
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang="scss">
  87. .wallte{
  88. display: flex;
  89. flex-direction: column;
  90. text-align: center;
  91. .money_num{
  92. padding-top: 44rpx;
  93. padding-bottom: 40rpx;
  94. color: #DB0618;
  95. .num{
  96. font-size: 62rpx;
  97. }
  98. }
  99. .grid{
  100. width: 689rpx;
  101. height: 300rpx;
  102. margin: 0 auto;
  103. border-radius: 26rpx;
  104. padding-top: 23rpx;
  105. box-sizing: border-box;
  106. background-color: #F5F5F5;
  107. .title{
  108. font-size: 30rpx;
  109. font-weight: bold;
  110. }
  111. .input_box{
  112. width: 669rpx;
  113. margin-top: 78rpx;
  114. margin-bottom: 33rpx;
  115. display: flex;
  116. justify-content: flex-start;
  117. border-bottom: 1px solid #B5B0B0;
  118. .text_icon{
  119. padding-left: 20rpx;
  120. color: #707070;
  121. font-size: 35rpx;
  122. font-weight: bold;
  123. }
  124. .withdraw_deposit{
  125. font-size: 26rpx;
  126. padding-right: 35rpx;
  127. color: #01AEEA;
  128. }
  129. input{
  130. flex: 1;
  131. text-align: left;
  132. font-size: 35rpx;
  133. }
  134. }
  135. .info_text{
  136. display: flex;
  137. justify-content: flex-start;
  138. margin-left: 28rpx;
  139. font-size: 26rpx;
  140. color: #707070;
  141. }
  142. }
  143. .info{
  144. display: flex;
  145. margin-top: 28rpx;
  146. padding: 0 50rpx;
  147. color: #707070;
  148. .dit{
  149. font-size: 48rpx;
  150. font-weight: bold;
  151. line-height: 40rpx;
  152. padding-right: 20rpx;
  153. }
  154. }
  155. }
  156. .title{
  157. padding-top: 60rpx;
  158. font-size: 32rpx;
  159. font-weight: bold;
  160. }
  161. .money_num{
  162. }
  163. .btn_money{
  164. width: 668rpx;
  165. height: 88rpx;
  166. font-size: 34rpx;
  167. line-height: 88rpx;
  168. position: fixed;
  169. left: 45rpx;
  170. bottom: 66rpx;
  171. background-color: #01AEEA;
  172. color: #fff;
  173. border-radius: 38rpx;
  174. }
  175. </style>