withdrawal.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <view class="content">
  3. <view class="content-money">
  4. <view class="flex ">
  5. <view class="buttom">
  6. <view class="icon">{{ money | getMoneyStyle }}</view>
  7. <text class="text">可提现金额</text>
  8. </view>
  9. <view class="interval"></view>
  10. <view class="buttom">
  11. <view class=" icon">{{ freeze | getMoneyStyle }}</view>
  12. <text class="text">待审核提现金额</text>
  13. </view>
  14. </view>
  15. </view>
  16. <view class="row-box">
  17. <view class="title">提现金额</view>
  18. <view class="row">
  19. <text class="tit">¥</text>
  20. <input class="input" type="number" v-model="withdrawal" :placeholder="'最低提现金额' + minPrice + '元'" placeholder-class="placeholder" />
  21. <view class="buttom" @click="withdrawal = money">全部提现</view>
  22. </view>
  23. </view>
  24. <button class="add-btn up" @click="confirm">提交申请</button>
  25. </view>
  26. </template>
  27. <script>
  28. import { getMoneyStyle } from '@/utils/rocessor.js';
  29. import { extractCash, extractBank, aliInfo, bankInfo } from '@/api/wallet.js';
  30. import uniNoticeBar from '@/components/uni-notice-bar/uni-notice-bar.vue';
  31. export default {
  32. filters: {
  33. getMoneyStyle
  34. },
  35. components: {
  36. uniNoticeBar
  37. },
  38. data() {
  39. return {
  40. type: 'weixin', //提现方式
  41. money: '0.00', //可提现金额
  42. freeze: '0.0', //冻结金额
  43. withdrawal: '', //提现金额
  44. minPrice: '', //最少提现金额
  45. aliData: {},
  46. bankData: {},
  47. // #ifdef H5
  48. weichatBsrowser: false
  49. // #endif
  50. };
  51. },
  52. onLoad(options) {
  53. // #ifdef H5
  54. this.weichatBsrowser = uni.getStorageSync('weichatBrowser');
  55. // #endif
  56. //加载提现信息
  57. this.loadData();
  58. // 加载提款账号信息
  59. this.loadAli();
  60. this.loadBank();
  61. },
  62. methods: {
  63. // 更新数据
  64. dataUp(){
  65. this.loadAli();
  66. this.loadBank();
  67. },
  68. //加载数据
  69. async loadAli(source) {
  70. aliInfo({}).then(e => {
  71. this.aliData = e.data;
  72. });
  73. },
  74. // 加载银行卡信息
  75. async loadBank() {
  76. bankInfo({}).then(e => {
  77. this.bankData = e.data;
  78. });
  79. },
  80. // 加载余额信息
  81. async loadData() {
  82. extractBank({}).then(({ data }) => {
  83. this.money = data.moneyCount;//可提现余额
  84. this.minPrice = data.minPrice;//最小提现
  85. this.freeze =data.inmoneyCount//提现中的余额
  86. });
  87. },
  88. // 跳转
  89. navTo(url) {
  90. uni.navigateTo({
  91. url: url
  92. });
  93. },
  94. // 切换选中对象
  95. tabRadio(e) {
  96. this.type = e.detail.value;
  97. },
  98. // 提交
  99. confirm() {
  100. let data = {
  101. extract_type: this.type, //bank -银行卡 alipay-支付宝 weixin-微信
  102. money: this.withdrawal, //金额
  103. money_type: 1//0佣金1余额
  104. }
  105. if (this.type=='alipay') {
  106. data.name = this.aliData.fullname;
  107. data.alipay_code = this.aliData.alino;
  108. }
  109. if (this.type=='bank') {
  110. data.name = this.bankData.fullname;
  111. data.bankname = this.bankData.bank;
  112. data.cardnum = this.bankData.bankno;
  113. }
  114. extractCash(data)
  115. .then(e => {
  116. uni.showToast({
  117. title: '提交成功',
  118. duration: 2000,
  119. position: 'top'
  120. });
  121. })
  122. .catch(e => {
  123. console.log();
  124. });
  125. }
  126. }
  127. };
  128. </script>
  129. <style lang="scss">
  130. page {
  131. height: 100%;
  132. }
  133. .content-money {
  134. padding: 30rpx 0;
  135. background: #ffffff;
  136. }
  137. .flex {
  138. background-color: #ffffff;
  139. text-align: center;
  140. margin: 0 30rpx;
  141. border-radius: $border-radius-sm;
  142. .buttom {
  143. font-size: $font-lg;
  144. width: 50%;
  145. }
  146. .interval {
  147. width: 2px;
  148. height: 60rpx;
  149. background-color: #eeeeee;
  150. }
  151. .icon {
  152. background-size: 100%;
  153. font-size: 42rpx;
  154. color: $font-color-dark;
  155. font-weight: bold;
  156. background-repeat: no-repeat;
  157. background-position: center;
  158. }
  159. .text {
  160. color: $font-color-light;
  161. }
  162. }
  163. .row-box {
  164. margin-top: 30rpx;
  165. padding: 20rpx 30rpx;
  166. background: #fff;
  167. .title {
  168. font-size: $font-base + 2rpx;
  169. color: $font-color-dark;
  170. }
  171. .row {
  172. display: flex;
  173. align-items: center;
  174. position: relative;
  175. height: 80rpx;
  176. .tit {
  177. flex-shrink: 0;
  178. width: 40rpx;
  179. font-size: 30rpx;
  180. color: $font-color-dark;
  181. }
  182. .input {
  183. flex: 1;
  184. font-size: 30rpx;
  185. color: $font-color-dark;
  186. }
  187. .iconlocation {
  188. font-size: 36rpx;
  189. color: $font-color-light;
  190. }
  191. .buttom {
  192. color: $font-color-spec;
  193. font-size: $font-base;
  194. }
  195. }
  196. }
  197. .add-btn {
  198. &.modified {
  199. color: $base-color;
  200. }
  201. &.up {
  202. background-color: $base-color;
  203. color: #fff;
  204. }
  205. display: flex;
  206. align-items: center;
  207. justify-content: center;
  208. width: 690rpx;
  209. height: 80rpx;
  210. margin: 0 auto;
  211. margin-top: 30rpx;
  212. font-size: $font-lg;
  213. border-radius: 10rpx;
  214. // box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  215. }
  216. .list {
  217. padding-left: 30rpx;
  218. margin-top: 30rpx;
  219. background-color: #ffffff;
  220. .box {
  221. display: flex;
  222. align-items: center;
  223. width: 100%;
  224. height: 120rpx;
  225. border-bottom: 1px solid $border-color-light;
  226. .icon {
  227. font-size: 48rpx;
  228. padding-right: 20rpx;
  229. .icon-img {
  230. height: 50rpx;
  231. width: 50rpx;
  232. }
  233. }
  234. .iconweixin1 {
  235. color: #18bf16;
  236. }
  237. .iconzhifubao {
  238. color: #08aaec;
  239. }
  240. .title-box {
  241. flex-grow: 1;
  242. text-align: left;
  243. .title {
  244. font-size: $font-base + 2rpx;
  245. color: $font-color-base;
  246. }
  247. .node {
  248. font-size: $font-sm;
  249. color: $font-color-light;
  250. }
  251. }
  252. }
  253. }
  254. /deep/ .uni-radio-input {
  255. width: 45rpx;
  256. height: 45rpx;
  257. }
  258. </style>