withdrawal.vue 8.3 KB

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