withdrawal.vue 8.2 KB

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