withdrawal.vue 7.3 KB

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