withdrawal.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. <template>
  2. <view class="content">
  3. <!-- <uni-notice-bar single="true" text="实际到账98%"></uni-notice-bar> -->
  4. <view class="content-money">
  5. <view class="flex " style="width: 750rpx;justify-content: space-around;margin-left: 0;">
  6. <view class="buttom">
  7. <view class="icon">{{ money | getMoneyStyle }}</view>
  8. <text class="text">可提现佣金</text>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="row-box">
  13. <view class="title">提现金额</view>
  14. <view class="row">
  15. <text class="tit">¥</text>
  16. <input class="input" type="number" v-model="withdrawal" :placeholder="'最低提现金额' + minPrice + '元'"
  17. placeholder-class="placeholder" />
  18. <view class="buttom" @click="withdrawal = money">全部提现</view>
  19. </view>
  20. </view>
  21. <view class="list">
  22. <radio-group @change="tabRadio">
  23. <!-- <label>
  24. <view class="box">
  25. <view class="icon iconfont iconweixin1"></view>
  26. <view class="title-box">
  27. <view class="title">
  28. <text v-if="weixin_no">提现至微信</text>
  29. <text v-else>请创建微信账号</text>
  30. </view>
  31. <view class="node">
  32. <text v-if="weixin_no">账号({{ weixin_no }})</text>
  33. </view>
  34. </view>
  35. <view class="right">
  36. <radio value="weixin" color="#c29963" :checked="type == 'weixin'" />
  37. </view>
  38. </view>
  39. </label> -->
  40. <!-- <label>
  41. <view class="box">
  42. <view class="icon iconfont iconzhifubao"></view>
  43. <view class="title-box">
  44. <view class="title">
  45. <text v-if="aliData.name">提现至支付宝</text>
  46. <text v-else>请创建支付宝账号</text>
  47. </view>
  48. <view class="node">
  49. <text v-if="aliData.name">真实姓名({{ aliData.name }})</text>
  50. </view>
  51. </view>
  52. <view class="right">
  53. <radio value="alipay" color="#ff4072" :checked="type == 'alipay'" />
  54. </view>
  55. </view>
  56. </label> -->
  57. <!-- <label>
  58. <view class="box">
  59. <view class="icon iconfont">
  60. <image class="icon-img" src="/static/icon/i8.png" mode="aspectFit"></image>
  61. </view>
  62. <view class="title-box">
  63. <view class="title">
  64. <text v-if="bankData.name">{{ bankData.bank + ' ' + bankData.payment }}</text>
  65. <text v-else>请创建银行账号</text>
  66. </view>
  67. <view class="node">
  68. <text v-if="bankData.name">真实姓名({{ bankData.name }})</text>
  69. </view>
  70. </view>
  71. <view class="right">
  72. <radio value="bank" color="#ff4072" :checked="type == 'bank'" />
  73. </view>
  74. </view>
  75. </label> -->
  76. </radio-group>
  77. </view>
  78. <view class="row b-b" v-if="type == 'weixin'">
  79. <text class="tit">微信账号</text>
  80. <input class="input" type="text" v-model="weixin_no" placeholder="请输入微信账号"
  81. placeholder-class="placeholder" />
  82. </view>
  83. <view class="row b-b" v-if="type == 'alipay'">
  84. <text class="tit">支付宝账号</text>
  85. <input class="input" type="text" v-model="alipay_code" placeholder="请输入支付宝账号"
  86. placeholder-class="placeholder" />
  87. </view>
  88. <view class="row b-b" v-if="type == 'alipay'">
  89. <text class="tit">支付宝姓名</text>
  90. <input class="input" type="text" v-model="alipay_name" placeholder="请输入支付宝姓名"
  91. placeholder-class="placeholder" />
  92. </view>
  93. <view class="row b-b" v-if="type == 'bank'">
  94. <text class="tit">银行卡号</text>
  95. <input class="input" type="text" v-model="bankInfo.bankno" placeholder="当前未绑定银行卡"
  96. placeholder-class="placeholder" disabled/>
  97. </view>
  98. <view class="row b-b" v-if="type == 'bank'">
  99. <text class="tit">姓名</text>
  100. <input class="input" type="text" v-model="bankInfo.fullname" placeholder="当前未绑定银行卡"
  101. placeholder-class="placeholder" disabled/>
  102. </view>
  103. <view class="row b-b" v-if="type == 'bank'">
  104. <text class="tit">所属银行</text>
  105. <input class="input" type="text" v-model="bankInfo.bank" placeholder="当前未绑定银行卡"
  106. placeholder-class="placeholder" disabled/>
  107. </view>
  108. <view class="row b-b" v-if="type == 'bank'">
  109. <text class="tit">所属支行</text>
  110. <input class="input" type="text" v-model="bankInfo.subbranch" placeholder="当前未绑定银行卡"
  111. placeholder-class="placeholder" disabled/>
  112. </view>
  113. <button class="add-btn modified" @click="navTo('/pages/user/sqdl')">银行卡管理</button>
  114. <button class="add-btn up" @click="confirm">提交申请</button>
  115. </view>
  116. </template>
  117. <script>
  118. import {
  119. getLevelList,
  120. bank,
  121. bankInfo
  122. } from '@/api/user.js'
  123. import {
  124. getMoneyStyle
  125. } from '@/utils/rocessor.js';
  126. import {
  127. extractCash,
  128. extractBank,
  129. aliInfo,
  130. setBank,
  131. getBank
  132. } from '@/api/wallet.js';
  133. import {
  134. orderData,
  135. getUserInfo
  136. } from '@/api/user.js';
  137. import {
  138. mapState,
  139. mapMutations
  140. } from 'vuex';
  141. import uniNoticeBar from '@/components/uni-notice-bar/uni-notice-bar.vue';
  142. export default {
  143. filters: {
  144. getMoneyStyle
  145. },
  146. components: {
  147. uniNoticeBar
  148. },
  149. computed: {
  150. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  151. },
  152. data() {
  153. return {
  154. bankInfo: {},
  155. weixin_no: '',
  156. type: 'bank', //提现方式
  157. money: '0.00', //可提现金额
  158. freeze: '0.0', //冻结金额
  159. withdrawal: '', //提现金额
  160. minPrice: '', //最少提现金额
  161. aliData: {},
  162. weixin: {},
  163. alipay_code: '',
  164. alipay_name: '',
  165. bank_code: '',
  166. bank_people: '',
  167. bank_name: '',
  168. bank_belonging: '',
  169. jftype: 0,
  170. };
  171. },
  172. onLoad(options) {
  173. //加载提现信息
  174. this.loadData();
  175. // // 加载提款账号信息
  176. // this.loadAli();
  177. // this.loadBank();
  178. },
  179. onShow() {
  180. this.dataUp()
  181. },
  182. methods: {
  183. ...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
  184. dataUp() {
  185. let obj = this
  186. bankInfo().then(res => {
  187. // console.log(res.data.);
  188. // console.log(res,res.dat);
  189. if(res.data && res.data.id) {
  190. // console.log('dd');
  191. this.bankInfo = res.data
  192. }
  193. })
  194. },
  195. // 加载余额信息
  196. async loadData() {
  197. extractBank({}).then(({
  198. data
  199. }) => {
  200. console.log(data, 'data+++++++++')
  201. this.minPrice = data.minPrice;
  202. this.money = data.brokerage_price
  203. });
  204. },
  205. // 跳转
  206. navTo(url) {
  207. uni.navigateTo({
  208. url: url
  209. });
  210. },
  211. // 切换选中对象
  212. tabRadio(e) {
  213. this.type = e.detail.value;
  214. },
  215. // 提交
  216. confirm() {
  217. let obj = this
  218. let data = {
  219. extract_type: this.type, //bank -银行卡 alipay-支付宝 weixin-微信
  220. money: this.withdrawal, //金额
  221. type: 0 //0佣金1余额
  222. };
  223. if (this.withdrawal < this.minPrice) {
  224. uni.showToast({
  225. title: '提现金额不可少于' + this.minPrice,
  226. duration: 2000,
  227. mask: false,
  228. icon: 'none'
  229. });
  230. return;
  231. }
  232. if (this.type == 'alipay') {
  233. console.log('alipay');
  234. data.name = this.aliData.name;
  235. data.alipay_code = this.aliData.payment;
  236. }
  237. if (this.type == 'bank') {
  238. console.log('bank');
  239. data.name = this.bankInfo.fullname;
  240. data.bankname = this.bankInfo.bank + this.bankInfo.subbranch;
  241. data.cardnum = this.bankInfo.bankno;
  242. }
  243. if(this.type == 'weixin') {
  244. console.log('weixin');
  245. data.weixin = this.weixin_no
  246. }
  247. extractCash(data)
  248. .then(e => {
  249. obj.loadData()
  250. uni.showToast({
  251. title: '提交成功',
  252. duration: 2000,
  253. position: 'top'
  254. });
  255. })
  256. .catch(e => {
  257. console.log();
  258. });
  259. }
  260. }
  261. };
  262. </script>
  263. <style lang="scss">
  264. page {
  265. height: 100%;
  266. }
  267. .content-money {
  268. padding: 30rpx 0;
  269. background: #ffffff;
  270. }
  271. .flex {
  272. background-color: #ffffff;
  273. text-align: center;
  274. margin: 0 30rpx;
  275. border-radius: $border-radius-sm;
  276. .buttom {
  277. font-size: $font-lg;
  278. width: 50%;
  279. }
  280. .interval {
  281. width: 2px;
  282. height: 60rpx;
  283. background-color: #eeeeee;
  284. }
  285. .icon {
  286. background-size: 100%;
  287. font-size: 42rpx;
  288. color: $font-color-dark;
  289. font-weight: bold;
  290. background-repeat: no-repeat;
  291. background-position: center;
  292. }
  293. .text {
  294. color: $font-color-light;
  295. }
  296. }
  297. .row-box {
  298. margin-top: 30rpx;
  299. padding: 20rpx 30rpx;
  300. background: #fff;
  301. .title {
  302. font-size: $font-base + 2rpx;
  303. color: $font-color-dark;
  304. }
  305. .row {
  306. display: flex;
  307. align-items: center;
  308. position: relative;
  309. height: 80rpx;
  310. .tit {
  311. flex-shrink: 0;
  312. width: 40rpx;
  313. font-size: 30rpx;
  314. color: $font-color-dark;
  315. }
  316. .input {
  317. flex: 1;
  318. font-size: 30rpx;
  319. color: $font-color-dark;
  320. }
  321. .iconlocation {
  322. font-size: 36rpx;
  323. color: $font-color-light;
  324. }
  325. .buttom {
  326. color: $font-color-spec;
  327. font-size: $font-base;
  328. }
  329. }
  330. }
  331. .add-btn {
  332. &.modified {
  333. // color: #ffffff;
  334. border:1px solid #ff4072;
  335. // background-color: #fff;
  336. color: #ff4072;
  337. background-color: #fff;
  338. }
  339. &.up {
  340. background: linear-gradient(90deg, #ff4072, #ff4072);
  341. color: #fff;
  342. }
  343. display: flex;
  344. align-items: center;
  345. justify-content: center;
  346. width: 690rpx;
  347. height: 80rpx;
  348. margin: 0 auto;
  349. margin-top: 30rpx;
  350. font-size: $font-lg;
  351. border-radius: 10rpx;
  352. // box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  353. }
  354. .list {
  355. padding-left: 30rpx;
  356. margin-top: 30rpx;
  357. background-color: #ffffff;
  358. .box {
  359. display: flex;
  360. align-items: center;
  361. width: 100%;
  362. height: 120rpx;
  363. border-bottom: 1px solid $border-color-light;
  364. .icon {
  365. font-size: 48rpx;
  366. padding-right: 20rpx;
  367. .icon-img {
  368. height: 50rpx;
  369. width: 50rpx;
  370. }
  371. }
  372. .iconweixin1 {
  373. color: #18bf16;
  374. }
  375. .iconzhifubao {
  376. color: #08aaec;
  377. }
  378. .title-box {
  379. flex-grow: 1;
  380. text-align: left;
  381. .title {
  382. font-size: $font-base + 2rpx;
  383. color: $font-color-base;
  384. }
  385. .node {
  386. font-size: $font-sm;
  387. color: $font-color-light;
  388. }
  389. }
  390. }
  391. }
  392. /deep/ .uni-radio-input {
  393. width: 45rpx;
  394. height: 45rpx;
  395. }
  396. .row {
  397. display: flex;
  398. align-items: center;
  399. position: relative;
  400. padding: 0 30upx;
  401. height: 110upx;
  402. background: #fff;
  403. .tit {
  404. flex-shrink: 0;
  405. width: 250upx;
  406. font-size: 30upx;
  407. color: $font-color-dark;
  408. }
  409. .input {
  410. flex: 1;
  411. font-size: 30upx;
  412. color: $font-color-dark;
  413. }
  414. .iconlocation {
  415. font-size: 36upx;
  416. color: $font-color-light;
  417. }
  418. }
  419. .tip {
  420. padding: 20rpx;
  421. color: #fd3b39;
  422. }
  423. </style>