withdrawal.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  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: 'alipay', //提现方式
  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)
  183. if (this.type == 'alipay') {
  184. data.name = this.aliData.name;
  185. data.alipay_code = this.aliData.payment;
  186. }
  187. if (this.type == 'bank') {
  188. data.name = this.bankData.name;
  189. data.bankname = this.bankData.bank;
  190. data.cardnum = this.bankData.payment;
  191. }
  192. console.log(data)
  193. extractCash(data)
  194. .then(e => {
  195. uni.showToast({
  196. title: '提交成功',
  197. duration: 2000,
  198. position: 'top'
  199. });
  200. })
  201. .catch(e => {
  202. console.log();
  203. });
  204. }
  205. }
  206. };
  207. </script>
  208. <style lang="scss">
  209. page {
  210. height: 100%;
  211. }
  212. .content-money {
  213. padding: 30rpx 0;
  214. background: #ffffff;
  215. }
  216. .flex1 {
  217. background-color: #ffffff;
  218. text-align: center;
  219. margin: 0 30rpx;
  220. border-radius: $border-radius-sm;
  221. display: flex;
  222. justify-content: center;
  223. .buttom {
  224. font-size: $font-lg;
  225. color: $font-color-dark;
  226. width: 50%;
  227. }
  228. .interval {
  229. width: 2px;
  230. height: 60rpx;
  231. background-color: #eeeeee;
  232. }
  233. .icon {
  234. background-size: 100%;
  235. font-size: 42rpx;
  236. color: $font-color-dark;
  237. font-weight: bold;
  238. background-repeat: no-repeat;
  239. background-position: center;
  240. }
  241. .text {
  242. color: $font-color-light;
  243. }
  244. }
  245. .row-box {
  246. margin-top: 30rpx;
  247. padding: 20rpx 30rpx;
  248. background: #fff;
  249. .title {
  250. font-size: $font-base + 2rpx;
  251. color: $font-color-dark;
  252. }
  253. .row {
  254. display: flex;
  255. align-items: center;
  256. position: relative;
  257. height: 80rpx;
  258. .tit {
  259. flex-shrink: 0;
  260. width: 40rpx;
  261. font-size: 30rpx;
  262. color: $font-color-dark;
  263. }
  264. .input {
  265. flex: 1;
  266. font-size: 30rpx;
  267. color: $font-color-dark;
  268. }
  269. .iconlocation {
  270. font-size: 36rpx;
  271. color: $font-color-light;
  272. }
  273. .buttom {
  274. color: #dc262b;
  275. font-size: $font-base;
  276. }
  277. }
  278. }
  279. .add-btn {
  280. &.modified {
  281. color: #303030;
  282. }
  283. &.up {
  284. background: #303030;
  285. color: #F8DABA;
  286. }
  287. display: flex;
  288. align-items: center;
  289. justify-content: center;
  290. width: 690rpx;
  291. height: 80rpx;
  292. margin: 0 auto;
  293. margin-top: 30rpx;
  294. font-size: $font-lg;
  295. border-radius: 10rpx;
  296. }
  297. .list {
  298. padding-left: 30rpx;
  299. margin-top: 30rpx;
  300. background-color: #ffffff;
  301. .box {
  302. display: flex;
  303. align-items: center;
  304. width: 100%;
  305. height: 120rpx;
  306. border-bottom: 1px solid $border-color-light;
  307. .icon {
  308. font-size: 48rpx;
  309. padding-right: 20rpx;
  310. .icon-img {
  311. height: 50rpx;
  312. width: 50rpx;
  313. }
  314. }
  315. .iconweixin1 {
  316. color: #18bf16;
  317. }
  318. .iconzhifubao {
  319. color: #08aaec;
  320. }
  321. .title-box {
  322. flex-grow: 1;
  323. text-align: left;
  324. .title {
  325. font-size: $font-base + 2rpx;
  326. color: $font-color-base;
  327. }
  328. .node {
  329. font-size: $font-sm;
  330. color: $font-color-light;
  331. }
  332. }
  333. }
  334. }
  335. /deep/ .uni-radio-input {
  336. width: 45rpx;
  337. height: 45rpx;
  338. }
  339. </style>