withdmoenys.vue 6.9 KB

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