extract.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <template>
  2. <view class="box">
  3. <view class="tixiancs">
  4. <view class="tixiancsLeft">本月已提现{{detail.count}}次</view>
  5. <view class="tixiancsRight" @click="goRouter('extractList')">提现明细</view>
  6. </view>
  7. <view class="header">
  8. <view class="title">提现金额</view>
  9. <view class="moneyView">
  10. <text class="icon">¥</text>
  11. <input type="digit" class="moneyInput" placeholder-style="color:#999999; font-size:30rpx"
  12. placeholder="请输入提现金额" v-model="money" @input="inputValue" />
  13. <view class="allBtn" @click="allBtn">全部提现</view>
  14. </view>
  15. <view class="zongMoney">可提现金额: <span style="color: #FF0000;">¥{{detail.canMoney}}</span> (冻结金额:{{detail.freezeMoney}}) </view>
  16. </view>
  17. <view class="tishi" style="padding: 20rpx 44rpx;">
  18. <view class="tishiLine">
  19. <view class="tishiY"></view>
  20. <view class="tishiTxt">提现冻结天数:{{detail.explain&&detail.explain.freezeDay}}天</view>
  21. </view>
  22. <view class="tishiLine">
  23. <view class="tishiY"></view>
  24. <view class="tishiTxt">最小提现金额:{{detail.explain&&detail.explain.singleLow}}元</view>
  25. </view>
  26. <view class="tishiLine">
  27. <view class="tishiY"></view>
  28. <view class="tishiTxt">每月可提现次数:{{detail.explain&&detail.explain.monthlyMost}}次</view>
  29. </view>
  30. </view>
  31. <view class="sureBtn" @click="sure">申请提现</view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. okMoney: '',
  39. money: '',
  40. name: '',
  41. account: '',
  42. detail: {},
  43. couContent: '', //提现规则
  44. }
  45. },
  46. onLoad() {
  47. this.getDetailData()
  48. },
  49. methods: {
  50. goRouter(url){
  51. uni.navigateTo({
  52. url:url
  53. })
  54. },
  55. getDetailData() {
  56. uni.showLoading({
  57. title: '加载中'
  58. })
  59. this.$http('openMCustomer/getWithdrawalInfo', {}, 'GET').then(res => {
  60. uni.hideLoading();
  61. this.detail = res.data;
  62. this.okMoney=this.detail.canMoney
  63. })
  64. },
  65. inputValue(event) {
  66. if (event.detail.value < 0) {
  67. setTimeout(() => {
  68. this.money = 0; // 解决
  69. }, 0)
  70. } else {
  71. this.money = event.detail.value;
  72. }
  73. },
  74. allBtn() {
  75. setTimeout(() => {
  76. this.money = this.okMoney; // 解决
  77. }, 0)
  78. console.log('money,allmoney', this.money, this.okMoney);
  79. },
  80. sure() {
  81. if (this.money > this.okMoney) {
  82. uni.showToast({
  83. title: '提现金额不能大于可提现金额',
  84. icon: 'none',
  85. duration: 3000,
  86. });
  87. return;
  88. }
  89. if (this.money <= 0) {
  90. uni.showToast({
  91. title: '提现金额不能为空',
  92. icon: 'none',
  93. duration: 3000,
  94. });
  95. return;
  96. }
  97. this.postData();
  98. },
  99. postData() {
  100. uni.showLoading({
  101. title: '提现中'
  102. })
  103. let url = 'openMCustomer/applyWithdrawal',
  104. params = {
  105. money: this.money,
  106. }
  107. this.$http(url, params, 'POST').then(res => {
  108. uni.hideLoading();
  109. if(res.code==0){
  110. uni.showModal({
  111. title: '提交成功',
  112. content: '请耐心等待平台审核',
  113. showCancel:false,
  114. confirmText:'知道了',
  115. success: function(res) {
  116. uni.navigateBack({
  117. })
  118. }
  119. });
  120. }else{
  121. // uni.showToast({
  122. // title: '提现金额不能为空',
  123. // icon: 'none',
  124. // duration: 3000,
  125. // });
  126. }
  127. })
  128. },
  129. }
  130. }
  131. </script>
  132. <style>
  133. .box {
  134. min-height: 100vh;
  135. background: #F4F5F7;
  136. padding-top: 20rpx;
  137. }
  138. .tishiLine{
  139. display: flex;
  140. }
  141. .tishiY{
  142. width: 10rpx;
  143. height: 10rpx;
  144. background: #DDDDDD;
  145. margin-top: 16rpx;
  146. }
  147. .tishiTxt{
  148. padding-left: 18rpx;
  149. }
  150. .tixiancs{
  151. display: flex;
  152. justify-content: space-between;
  153. font-size: 24rpx;
  154. padding-left: 24rpx;
  155. padding-right: 24rpx;
  156. padding-bottom: 20rpx;
  157. }
  158. .tixiancsLeft{
  159. color: #999999;
  160. }
  161. .tixiancsRight{
  162. color: #1677FF;
  163. }
  164. .header {
  165. background-color: #FFFFFF;
  166. margin: 0 24rpx;
  167. border-radius: 10rpx;
  168. padding: 30rpx 20rpx;
  169. }
  170. .title {
  171. font-size: 28rpx;
  172. color: #3C3C3C;
  173. font-weight: bold;
  174. }
  175. .moneyView {
  176. display: flex;
  177. justify-content: space-between;
  178. align-items: center;
  179. margin: 15rpx 0;
  180. }
  181. .icon {
  182. font-size: 50rpx;
  183. color: #222222;
  184. font-weight: bold;
  185. }
  186. .moneyInput {
  187. font-size: 70rpx;
  188. color: #222222;
  189. font-weight: bold;
  190. /* flex-grow: 1; */
  191. height: 98rpx;
  192. width: 100%;
  193. }
  194. .allBtn {
  195. font-size: 26rpx;
  196. color: #FF0000;
  197. width: 200rpx;
  198. height: 50rpx;
  199. line-height: 50rpx;
  200. margin-left: 10rpx;
  201. text-align: right;
  202. }
  203. .zongMoney {
  204. font-size: 26rpx;
  205. color: #999999;
  206. }
  207. .line {
  208. background-color: #EEEEEE;
  209. height: 1rpx;
  210. }
  211. .name {
  212. display: flex;
  213. justify-content: flex-start;
  214. padding: 28rpx 0;
  215. }
  216. .leftTitle {
  217. font-size: 30rpx;
  218. color: #3C3C3C;
  219. margin-right: 90rpx;
  220. }
  221. .Input {
  222. font-size: 30rpx;
  223. color: #333333;
  224. }
  225. .tishi {
  226. padding: 0 44rpx;
  227. font-size: 26rpx;
  228. color: #999999;
  229. line-height: 1.5;
  230. }
  231. .sureBtn {
  232. width: 690rpx;
  233. margin: 20rpx 30rpx;
  234. border-radius: 37rpx;
  235. height: 74rpx;
  236. background: #D53533;
  237. color: #FFFFFF;
  238. font-size: 30rpx;
  239. text-align: center;
  240. line-height: 74rpx;
  241. }
  242. </style>