withdmoenys.vue 7.2 KB

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