withdrawal.vue 11 KB

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