withdraw.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. <template>
  2. <view class="exchangeIntegral">
  3. <view class="integral">
  4. <view class="">
  5. 可提现金额
  6. </view>
  7. <view class="num">
  8. {{integral}}
  9. </view>
  10. </view>
  11. <view class="applyIntegral flex">
  12. <view class="">
  13. 申请提现金额
  14. </view>
  15. <input type="number" class="num" v-model="num" />
  16. </view>
  17. <view class="all" @click="all"> <text>满{{minPrice}}可提现</text><text>全部转换</text></view>
  18. <view class="between">
  19. </view>
  20. <view class="list" v-if="!weichatBsrowser">
  21. <radio-group @change="tabRadio">
  22. <!-- <label>
  23. <view class="box">
  24. <view class="icon iconfont iconweixin1"></view>
  25. <view class="title-box">
  26. <view class="title"><text>提现至微信</text></view>
  27. </view>
  28. <view class="right"><radio value="weixin" color="#5dbc7c" :checked="type == 'weixin'" /></view>
  29. </view>
  30. </label> -->
  31. <label>
  32. <view class="box">
  33. <view class="icon iconfont iconzhifubao"></view>
  34. <view class="title-box">
  35. <view class="title">
  36. <text v-if="aliData.fullname != null">提现至支付宝</text>
  37. <text v-else>请创建支付宝账号</text>
  38. </view>
  39. <view class="node">
  40. <text v-if="aliData.fullname != null">真实姓名({{ aliData.fullname }})</text>
  41. </view>
  42. </view>
  43. <view class="right">
  44. <radio value="alipay" style="transform:scale(0.7)" color="#5395F5"
  45. :checked="type == 'alipay'" />
  46. </view>
  47. </view>
  48. </label>
  49. <label>
  50. <view class="box">
  51. <view class="icon iconfont">
  52. <image class="icon-img" src="/static/icon/i8.png" mode="aspectFit"></image>
  53. </view>
  54. <view class="title-box">
  55. <view class="title">
  56. <text v-if="bankData.bankno != null">{{ bankData.bank + ' ' + bankData.bankno }}</text>
  57. <text v-else>请创建银行账号</text>
  58. </view>
  59. <view class="node">
  60. <text v-if="bankData.fullname != null">真实姓名({{ bankData.fullname}})</text>
  61. </view>
  62. </view>
  63. <view class="right">
  64. <radio value="bank" color="#5395F5" style="transform:scale(0.7)"
  65. :checked="type == 'bank'" />
  66. </view>
  67. </view>
  68. </label>
  69. </radio-group>
  70. </view>
  71. <!-- <view class="bottom">
  72. <view class="box">
  73. <view class="title">
  74. 提现到
  75. </view>
  76. <radio-group name="">
  77. <view class="box-content">
  78. <view class="box-left">
  79. <view class="img">
  80. <image src="../../static/user/wx.png" mode=""></image>
  81. </view>
  82. <text>微信支付</text>
  83. </view>
  84. <label class="radio">
  85. <radio value="" style="transform:scale(0.7)" />
  86. </label>
  87. </view>
  88. <view class="box-content">
  89. <view class="box-left">
  90. <view class="img1 img">
  91. <image src="../../static/user/bank.png" mode=""></image>
  92. </view>
  93. <text>银行账户</text>
  94. </view>
  95. <label class="radio">
  96. <radio value="" style="transform:scale(0.7)" />
  97. </label>
  98. </view>
  99. </radio-group>
  100. </view>
  101. <view class="button" @click="submit">提交申请</view>
  102. </view> -->
  103. <button class="add-btn up" @click="confirm">提交申请</button>
  104. <button class="add-btn modified" v-if="!weichatBsrowser"
  105. @click="navTo('/pages/collection/collection')">账号管理</button>
  106. </view>
  107. </template>
  108. <script>
  109. import {
  110. getMoneyStyle
  111. } from '@/utils/rocessor.js';
  112. import {
  113. extractCash,
  114. extractBank,
  115. aliInfo,
  116. bankInfo
  117. } from '@/api/wallet.js';
  118. import {
  119. mapState,
  120. mapMutations
  121. } from 'vuex';
  122. export default {
  123. computed: {
  124. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  125. },
  126. data() {
  127. return {
  128. type: 'alipay', //提现方式
  129. integral: '', //可提现金额
  130. num: '', //提现金额
  131. withdrawal: '', //提现金额
  132. minPrice: 1000, //最少提现金额
  133. aliData: {
  134. fullname: '',
  135. alino: ''
  136. },
  137. bankData: {
  138. fullname: '',
  139. bank: '',
  140. bankno: ''
  141. },
  142. // #ifdef H5
  143. weichatBsrowser: false
  144. // #endif
  145. }
  146. },
  147. onShow() {
  148. this.weichatBsrowser = uni.getStorageSync('weichatBsrowser')
  149. //加载提现金额信息
  150. this.loadData();
  151. //拿到用户的提现方式信息
  152. this.aliData.fullname = this.userInfo.alipay_name;
  153. console.log(this.userInfo);
  154. this.aliData.alino = this.userInfo.alipay_code;
  155. this.bankData.fullname = this.userInfo.bank_user_name;
  156. this.bankData.bank = this.userInfo.bank_name;
  157. this.bankData.bankno = this.userInfo.bank_code;
  158. },
  159. methods: {
  160. //提交带提现接口
  161. confirm(){
  162. //需要给到提现接口的信息
  163. let data = {
  164. extract_type: this.type, //bank -银行卡 alipay-支付宝 weixin-微信
  165. money: this.withdrawal, //金额
  166. money_type: "brokerage" //0佣金1余额
  167. }
  168. console.log(data);
  169. if(this.type == 'alipay'){
  170. data.name = this.aliData.fullName;
  171. data.alipay_code = this.aliData.alino;
  172. }
  173. if (this.type == 'bank') {
  174. data.name = this.bankData.fullname;
  175. data.bankname = this.bankData.bank;
  176. data.cardnum = this.bankData.bankno;
  177. }
  178. extractCash(data).then(
  179. e=>{
  180. console.log(data,'111111111')
  181. uni.navigateTo({
  182. url:'/pages/money/success?type=1'
  183. })
  184. }).catch(e=>{
  185. console.log()
  186. })
  187. },
  188. //加载余额信息
  189. async loadData() {
  190. extractBank({}).then(({
  191. data
  192. }) => {
  193. console.log(data, '余额');
  194. this.integral = data.brokerage_price //可提现金额
  195. this.minPrice = data.minPrice //最小提现金额
  196. this.num = data.commissionCount //提现金额
  197. })
  198. },
  199. navTo(url) {
  200. uni.navigateTo({
  201. url
  202. })
  203. },
  204. all() {
  205. this.num = this.integral
  206. },
  207. //切换选中对象
  208. tabRadio(e) {
  209. console.log(e, '选中方式')
  210. //type 提现方式
  211. this.type = e.detail.value
  212. }
  213. // submit() {
  214. // if(this.integral < this.num) {
  215. // this.all()
  216. // }
  217. // }
  218. },
  219. // watch: {
  220. // num() {
  221. // if(this.integral < this.num) {
  222. // this.all()
  223. // }
  224. // }
  225. // }
  226. }
  227. </script>
  228. <style lang="scss" scoped>
  229. page,
  230. .exchangeIntegral {
  231. background-color: #FFFFFF;
  232. height: 100%;
  233. .integral,
  234. .applyIntegral {
  235. display: flex;
  236. justify-content: space-between;
  237. padding: 30rpx;
  238. background-color: #FFFFFF;
  239. margin-bottom: 5rpx;
  240. font-size: 30rpx;
  241. .num {
  242. font-size: 40rpx;
  243. text-align: right;
  244. max-width: 400rpx;
  245. }
  246. }
  247. .between {
  248. width: 100%;
  249. height: 20rpx;
  250. background-color: #F7F7F7
  251. }
  252. .all {
  253. display: flex;
  254. justify-content: space-between;
  255. width: 100%;
  256. height: 80rpx;
  257. line-height: 80rpx;
  258. margin-top: 2rpx;
  259. background-color: #fff;
  260. padding: 0 30rpx;
  261. margin-bottom: 20rpx;
  262. text:nth-child(1) {
  263. font-size: 24rpx;
  264. font-family: PingFang SC;
  265. font-weight: 500;
  266. color: #999999;
  267. }
  268. text:nth-child(2) {
  269. font-size: 26rpx;
  270. font-family: SourceHanSansCN;
  271. font-weight: 400;
  272. color: #438BED;
  273. }
  274. }
  275. .bottom {
  276. width: 750rpx;
  277. background: #FFFFFF;
  278. padding: 20rpx;
  279. .box {
  280. margin-bottom: 120rpx;
  281. display: flex;
  282. flex-direction: column;
  283. .title {
  284. display: flex;
  285. margin-bottom: 10rpx;
  286. font-size: 30rpx;
  287. font-family: SourceHanSansCN;
  288. font-weight: 400;
  289. color: #333333;
  290. }
  291. .box-content {
  292. padding: 20rpx;
  293. border-bottom: 1rpx solid #E6E6E6;
  294. display: flex;
  295. justify-content: space-between;
  296. .box-left {
  297. display: flex;
  298. .img {
  299. width: 40rpx;
  300. height: 40rpx;
  301. image {
  302. width: 100%;
  303. height: 100%;
  304. }
  305. }
  306. text {
  307. margin-left: 30rpx;
  308. font-size: 26rpx;
  309. font-family: SourceHanSansCN;
  310. font-weight: 400;
  311. color: #515151;
  312. }
  313. }
  314. .radio {
  315. width: 20rpx;
  316. height: 20rpx;
  317. radio {
  318. width: 20rpx;
  319. height: 20rpx;
  320. }
  321. }
  322. }
  323. }
  324. }
  325. // .img1{
  326. // width: 40rpx;
  327. // height: 30rpx;
  328. // image{
  329. // width: 100%;
  330. // height: 100%;
  331. // }
  332. // }
  333. .button {
  334. background: linear-gradient(90deg, #3C82E6, #5395F5);
  335. color: #fff;
  336. width: 670rpx;
  337. padding: 20rpx;
  338. font-size: 30rpx;
  339. border-radius: 10rpx;
  340. text-align: center;
  341. margin: 0 auto;
  342. }
  343. }
  344. .list {
  345. padding-left: 30rpx;
  346. margin-top: 30rpx;
  347. background-color: #ffffff;
  348. .box {
  349. display: flex;
  350. align-items: center;
  351. width: 100%;
  352. height: 120rpx;
  353. border-bottom: 1px solid $border-color-light;
  354. .icon {
  355. font-size: 48rpx;
  356. padding-right: 20rpx;
  357. .icon-img {
  358. height: 50rpx;
  359. width: 50rpx;
  360. }
  361. }
  362. .iconweixin1 {
  363. color: #18bf16;
  364. }
  365. .iconzhifubao {
  366. color: #08aaec;
  367. }
  368. .title-box {
  369. flex-grow: 1;
  370. text-align: left;
  371. .title {
  372. font-size: $font-base + 2rpx;
  373. color: $font-color-base;
  374. }
  375. .node {
  376. font-size: $font-sm;
  377. color: $font-color-light;
  378. }
  379. }
  380. }
  381. }
  382. .add-btn {
  383. &.modified {
  384. color: #5395F5;
  385. }
  386. &.up {
  387. background: linear-gradient(90deg, #3C82E6, #5395F5);
  388. color: #fff;
  389. }
  390. display: flex;
  391. align-items: center;
  392. justify-content: center;
  393. width: 690rpx;
  394. height: 80rpx;
  395. margin: 0 auto;
  396. margin-top: 30rpx;
  397. font-size: $font-lg;
  398. border-radius: 10rpx;
  399. // box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  400. }
  401. </style>