withdrawal.vue 5.4 KB

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