withdrawal.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <template>
  2. <view class="content">
  3. <view class="content-money">
  4. <view class="flex ">
  5. <view class="buttom">
  6. <view class="icon">{{ money | getMoneyStyle }}</view>
  7. <text class="text">可转换金额</text>
  8. </view>
  9. </view>
  10. </view>
  11. <view class="row-box">
  12. <view class="title">转换金额</view>
  13. <view class="row">
  14. <text class="tit">¥</text>
  15. <input class="input" type="number" v-model="withdrawal" placeholder="请输入佣金数量" placeholder-class="placeholder" />
  16. <view class="buttom" @click="withdrawal = money">全部转换</view>
  17. </view>
  18. </view>
  19. <button class="add-btn up" @click="confirm">提交申请</button>
  20. <view class="tip" v-if="withdrawal != 0">
  21. 实际到账{{ realmoney }}现金,{{ gy }}响亮积分
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import { getMoneyStyle } from '@/utils/rocessor.js';
  27. import { extractCash, extractBank, aliInfo, bankInfo } from '@/api/wallet.js';
  28. import uniNoticeBar from '@/components/uni-notice-bar/uni-notice-bar.vue';
  29. export default {
  30. filters: {
  31. getMoneyStyle
  32. },
  33. components: {
  34. uniNoticeBar
  35. },
  36. data() {
  37. return {
  38. type: 'weixin', //提现方式
  39. money: '0.00', //可提现金额
  40. withdrawal: '', //提现金额
  41. aliData: {},
  42. bankData: {},
  43. // #ifdef H5
  44. weichatBsrowser: false
  45. // #endif
  46. };
  47. },
  48. onLoad(options) {
  49. // #ifdef H5
  50. this.weichatBsrowser = uni.getStorageSync('weichatBrowser');
  51. // #endif
  52. //加载提现信息
  53. this.loadData();
  54. // 加载提款账号信息
  55. this.loadAli();
  56. this.loadBank();
  57. },
  58. computed:{
  59. realmoney() {
  60. return (this.withdrawal * 0.7).toFixed(2) * 1
  61. },
  62. gy() {
  63. return (this.withdrawal * 0.3).toFixed(2) * 1
  64. }
  65. },
  66. methods: {
  67. // 更新数据
  68. dataUp(){
  69. this.loadAli();
  70. this.loadBank();
  71. },
  72. //加载数据
  73. async loadAli(source) {
  74. aliInfo({}).then(e => {
  75. this.aliData = e.data;
  76. });
  77. },
  78. // 加载银行卡信息
  79. async loadBank() {
  80. bankInfo({}).then(e => {
  81. this.bankData = e.data;
  82. });
  83. },
  84. // 加载余额信息
  85. async loadData() {
  86. extractBank({}).then(({ data }) => {
  87. this.money = data.moneyCount;//可提现余额
  88. this.minPrice = data.minPrice;//最小提现
  89. this.freeze =data.inmoneyCount//提现中的余额
  90. });
  91. },
  92. // 跳转
  93. navTo(url) {
  94. uni.navigateTo({
  95. url: url
  96. });
  97. },
  98. // 切换选中对象
  99. tabRadio(e) {
  100. this.type = e.detail.value;
  101. },
  102. // 提交
  103. confirm() {
  104. let data = {
  105. extract_type: this.type, //bank -银行卡 alipay-支付宝 weixin-微信
  106. money: this.withdrawal, //金额
  107. money_type: 1//0佣金1余额
  108. }
  109. if (this.type=='alipay') {
  110. data.name = this.aliData.fullname;
  111. data.alipay_code = this.aliData.alino;
  112. }
  113. if (this.type=='bank') {
  114. data.name = this.bankData.fullname;
  115. data.bankname = this.bankData.bank;
  116. data.cardnum = this.bankData.bankno;
  117. }
  118. extractCash(data)
  119. .then(e => {
  120. uni.showToast({
  121. title: '提交成功',
  122. duration: 2000,
  123. position: 'top'
  124. });
  125. })
  126. .catch(e => {
  127. console.log();
  128. });
  129. }
  130. }
  131. };
  132. </script>
  133. <style lang="scss">
  134. page {
  135. height: 100%;
  136. }
  137. .content-money {
  138. padding: 30rpx 0;
  139. background: #ffffff;
  140. }
  141. .flex {
  142. background-color: #ffffff;
  143. text-align: center;
  144. margin: 0 30rpx;
  145. border-radius: $border-radius-sm;
  146. .buttom {
  147. width: 100%;
  148. text-align: center;
  149. font-size: $font-lg;
  150. }
  151. .interval {
  152. width: 2px;
  153. height: 60rpx;
  154. background-color: #eeeeee;
  155. }
  156. .icon {
  157. background-size: 100%;
  158. font-size: 42rpx;
  159. color: $font-color-dark;
  160. font-weight: bold;
  161. background-repeat: no-repeat;
  162. background-position: center;
  163. }
  164. .text {
  165. color: $font-color-light;
  166. }
  167. }
  168. .row-box {
  169. margin-top: 30rpx;
  170. padding: 20rpx 30rpx;
  171. background: #fff;
  172. .title {
  173. font-size: $font-base + 2rpx;
  174. color: $font-color-dark;
  175. }
  176. .row {
  177. display: flex;
  178. align-items: center;
  179. position: relative;
  180. height: 80rpx;
  181. .tit {
  182. flex-shrink: 0;
  183. width: 40rpx;
  184. font-size: 30rpx;
  185. color: $font-color-dark;
  186. }
  187. .input {
  188. flex: 1;
  189. font-size: 30rpx;
  190. color: $font-color-dark;
  191. }
  192. .iconlocation {
  193. font-size: 36rpx;
  194. color: $font-color-light;
  195. }
  196. .buttom {
  197. color: $font-color-spec;
  198. font-size: $font-base;
  199. }
  200. }
  201. }
  202. .add-btn {
  203. &.modified {
  204. color: $base-color;
  205. }
  206. &.up {
  207. background-color: $base-color;
  208. color: #fff;
  209. }
  210. display: flex;
  211. align-items: center;
  212. justify-content: center;
  213. width: 690rpx;
  214. height: 80rpx;
  215. margin: 0 auto;
  216. margin-top: 30rpx;
  217. font-size: $font-lg;
  218. border-radius: 10rpx;
  219. // box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  220. }
  221. .list {
  222. padding-left: 30rpx;
  223. margin-top: 30rpx;
  224. background-color: #ffffff;
  225. .box {
  226. display: flex;
  227. align-items: center;
  228. width: 100%;
  229. height: 120rpx;
  230. border-bottom: 1px solid $border-color-light;
  231. .icon {
  232. font-size: 48rpx;
  233. padding-right: 20rpx;
  234. .icon-img {
  235. height: 50rpx;
  236. width: 50rpx;
  237. }
  238. }
  239. .iconweixin1 {
  240. color: #18bf16;
  241. }
  242. .iconzhifubao {
  243. color: #08aaec;
  244. }
  245. .title-box {
  246. flex-grow: 1;
  247. text-align: left;
  248. .title {
  249. font-size: $font-base + 2rpx;
  250. color: $font-color-base;
  251. }
  252. .node {
  253. font-size: $font-sm;
  254. color: $font-color-light;
  255. }
  256. }
  257. }
  258. }
  259. .tip {
  260. padding: 20rpx 40rpx;
  261. color: #FD3B39;
  262. }
  263. /deep/ .uni-radio-input {
  264. width: 45rpx;
  265. height: 45rpx;
  266. }
  267. </style>