extract.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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;padding-right: 10rpx;">¥{{detail.canMoney}} </span> (冻结金额:{{detail.freezeMoney}}) </view>
  16. </view>
  17. <view class="tishi" style="padding:20rpx 20rpx 100rpx 20rpx ; ">
  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;padding-top: 20rpx;
  140. }
  141. .tishiY{
  142. width: 10rpx;
  143. height: 10rpx;
  144. background: #DDDDDD;
  145. margin-top: 16rpx;
  146. border-radius: 50%;
  147. }
  148. .tishiTxt{
  149. padding-left: 18rpx;
  150. }
  151. .tixiancs{
  152. display: flex;
  153. justify-content: space-between;
  154. font-size: 24rpx;
  155. padding-left: 24rpx;
  156. padding-right: 24rpx;
  157. padding-bottom: 20rpx;
  158. }
  159. .tixiancsLeft{
  160. color: #999999;
  161. }
  162. .tixiancsRight{
  163. color: #1677FF;
  164. }
  165. .header {
  166. background-color: #FFFFFF;
  167. margin: 0 24rpx;
  168. border-radius: 10rpx;
  169. padding: 30rpx 20rpx;
  170. }
  171. .title {
  172. font-size: 28rpx;
  173. color: #3C3C3C;
  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. }
  185. .moneyInput {
  186. font-size: 70rpx;
  187. color: #222222;
  188. font-weight: bold;
  189. /* flex-grow: 1; */
  190. height: 98rpx;
  191. width: 100%;
  192. }
  193. .allBtn {
  194. font-size: 26rpx;
  195. color: #FF0000;
  196. width: 200rpx;
  197. height: 50rpx;
  198. line-height: 50rpx;
  199. margin-left: 10rpx;
  200. text-align: right;
  201. }
  202. .zongMoney {
  203. font-size: 26rpx;
  204. color: #999999;
  205. }
  206. .line {
  207. background-color: #EEEEEE;
  208. height: 1rpx;
  209. }
  210. .name {
  211. display: flex;
  212. justify-content: flex-start;
  213. padding: 28rpx 0;
  214. }
  215. .leftTitle {
  216. font-size: 30rpx;
  217. color: #3C3C3C;
  218. margin-right: 90rpx;
  219. }
  220. .Input {
  221. font-size: 30rpx;
  222. color: #333333;
  223. }
  224. .tishi {
  225. padding: 0 44rpx;
  226. font-size: 26rpx;
  227. color: #999999;
  228. line-height: 1.5;
  229. }
  230. .sureBtn {
  231. width: 690rpx;
  232. margin: 20rpx 30rpx;
  233. border-radius: 37rpx;
  234. height: 74rpx;
  235. background: #D53533;
  236. color: #FFFFFF;
  237. font-size: 30rpx;
  238. text-align: center;
  239. line-height: 74rpx;
  240. }
  241. </style>