withdrawal.vue 8.6 KB

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