withdmoenys.vue 6.7 KB

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