withdrawTwo.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <template>
  2. <view class="container">
  3. <navbar :config="config" backColor="#666666"></navbar>
  4. <view class="u-plr30">
  5. <!-- <view class="wd-bgImg">
  6. <image src="../../../static/my-top-bgImg.png"></image>
  7. <view class="moneyInfo">
  8. <view class="u-flex-center-sb" style="padding: 38rpx 22rpx;">
  9. <view class="u-FFF">
  10. <view class="u-font30">已提现:<text class="u-font24">¥</text> <text class="u-font28">102.00</text> </view>
  11. <view class="u-font30 mt40">待提现:<text class="u-font24">¥</text> <text class="u-font28">102.00</text> </view>
  12. </view>
  13. <view class="detail-btn" @click="goWdDetail">
  14. <button>
  15. <text class="iconfont">&#xe63d;</text>
  16. <text class="u-font24 u-ml10">提现明细</text>
  17. </button>
  18. </view>
  19. </view>
  20. </view>
  21. </view> -->
  22. <view class="u-bg-fff u-p30 u-mt20">
  23. <view class="u-flex-center-sb">
  24. <view>
  25. <text>可转入金额</text>
  26. <text class="u-ml20 u-FF0000 u-bold u-font36">{{walletInfo.commission_able}}</text>
  27. </view>
  28. <view @click="goWallet">
  29. <text class="iconfont">&#xe638;</text>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="wdInput u-mt20">
  34. <view class="u-mt20 input u-flex">
  35. <text>¥</text>
  36. <input class="u-ml10" maxlength="10" type="digit" @input="getMoney" v-model="dataForm.money" placeholder="输入金额" />
  37. </view>
  38. </view>
  39. <view class="apply-btn" @click="requestWithdrawal">
  40. <button class="u-btn-two">确定转入</button>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. config: {
  50. back: true, //false是tolbar页面 是则不写
  51. title: '转入余额',
  52. color: '#1A1A1A',
  53. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  54. backgroundColor: [1, "#FFF"],
  55. statusBarFontColor: '#1A1A1A'
  56. },
  57. bankCardList: [], //银行卡列表
  58. dataForm: {
  59. money: '', //提现金额
  60. },
  61. bankIcon: '',
  62. pitchOnIndex:-3,
  63. walletInfo:{
  64. min_extract:0,
  65. wait_account:0,
  66. freezing:0
  67. },//账户信息
  68. }
  69. },
  70. onLoad() {
  71. let that = this
  72. //获取账户信息
  73. this.$http.get('/withdraw/getWalletInfo', {}).then(async res => {
  74. if (res && res.code == 200) {
  75. if(res.data){
  76. this.walletInfo = res.data
  77. }
  78. }
  79. })
  80. },
  81. methods: {
  82. //跳转到钱包明细
  83. goWallet(){
  84. uni.navigateTo({
  85. url: "./wallet"
  86. })
  87. },
  88. //获取输入提现金额
  89. getMoney(e) {
  90. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  91. //重新赋值给input
  92. this.$nextTick(() => {
  93. this.dataForm.money= e.target.value
  94. })
  95. },
  96. //申请提现
  97. requestWithdrawal() {
  98. if (!this.dataForm.money) {
  99. this.$mUtil.toast('请输入金额')
  100. return false
  101. }
  102. this.$http.post('/withdraw/commission-to-balance', this.dataForm).then( res => {
  103. if (res && res.code == 200) {
  104. this.$mUtil.toast('转入成功')
  105. setTimeout(() => {
  106. uni.navigateBack({
  107. success: () => {
  108. let page = getCurrentPages().pop(); //跳转页面成功之后
  109. if (!page) {
  110. return;
  111. } else {
  112. page.onLoad(page.options);// page自带options对象.
  113. }
  114. }
  115. })
  116. }, 2000)
  117. }else{
  118. this.$mUtil.toast(res.msg)
  119. }
  120. })
  121. }
  122. }
  123. }
  124. </script>
  125. <style lang="scss">
  126. page {
  127. background-color: #F5F5F5;
  128. }
  129. .wt112 {
  130. width: 140rpx;
  131. }
  132. .img30 {
  133. width: 30rpx;
  134. height: 30rpx;
  135. }
  136. .wd-bgImg {
  137. position: relative;
  138. padding: 25rpx 0rpx;
  139. image {
  140. width: 100%;
  141. height: 200rpx;
  142. vertical-align: bottom;
  143. }
  144. .moneyInfo {
  145. position: absolute;
  146. top: 25rpx;
  147. width: 92%;
  148. .mt40 {
  149. margin-top: 40rpx;
  150. }
  151. .detail-btn button {
  152. height: 56rpx;
  153. line-height: 30rpx;
  154. border-radius: 28px;
  155. opacity: 0.82;
  156. padding: 10rpx 30rpx;
  157. background-color: #EED9A9;
  158. color: #0B844A;
  159. }
  160. }
  161. }
  162. .wdInput {
  163. background-color: #FFFFFF;
  164. border-radius: 18rpx 18rpx 0px 0rpx;
  165. padding: 40rpx 22rpx 32rpx;
  166. .input {
  167. height: 80rpx;
  168. line-height: 80rpx;
  169. font-size: 60rpx;
  170. border-bottom: 1rpx solid #D9D9D9;
  171. padding-bottom: 25rpx;
  172. input {
  173. height: 80rpx;
  174. line-height: 80rpx;
  175. font-size: 36rpx;
  176. }
  177. }
  178. }
  179. .bg-fff {
  180. background-color: #FFFFFF;
  181. padding: 26rpx 22rpx 36rpx;
  182. border-radius: 0rpx 0rpx 18px 18rpx;
  183. }
  184. .ml46 {
  185. margin-left: 46rpx;
  186. }
  187. .apply-btn {
  188. margin-top: 80rpx;
  189. button {
  190. background: #0B844A;
  191. color: #FFFFFF;
  192. }
  193. }
  194. .zfb-wx {
  195. padding-bottom: 24rpx;
  196. .payIcon {
  197. color: #00aaef;
  198. font-size: 32rpx;
  199. margin-right: 18rpx;
  200. }
  201. .wxIcon {
  202. color: rgb(37, 171, 56);
  203. font-size: 32rpx;
  204. margin-right: 18rpx;
  205. }
  206. }
  207. .zhInput input {
  208. width: 62%;
  209. height: 70rpx;
  210. line-height: 70rpx;
  211. padding: 0rpx 20rpx;
  212. border: 1rpx solid #D9D9D9;
  213. border-radius: 6rpx;
  214. }
  215. .popup {
  216. width: 100%;
  217. .bg-top {
  218. background-color: #F5F5F5;
  219. padding: 20rpx 30rpx;
  220. border-radius: 18rpx 18rpx 0px 0px;
  221. }
  222. .bankCardList {
  223. background-color: #FFFFFF;
  224. padding: 0rpx 30rpx;
  225. padding-bottom: 185rpx;
  226. .item {
  227. height: 84rpx;
  228. line-height: 84rpx;
  229. image {
  230. width: 48rpx;
  231. height: 42rpx;
  232. margin-top: 20rpx;
  233. vertical-align: bottom;
  234. }
  235. .rh-br {
  236. width: 100%;
  237. border-bottom: 1rpx solid #E6E6E6;
  238. }
  239. .pull-right {
  240. float: right !important;
  241. }
  242. }
  243. }
  244. }
  245. .ml56 {
  246. margin-left: 56rpx;
  247. }
  248. .ml200 {
  249. margin-left: 200rpx;
  250. }
  251. </style>