withdrawal.vue 6.8 KB

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