withdrawal.vue 7.9 KB

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