| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420 |
- <template>
- <view :style="colorStyle">
- <view class="payment-top acea-row row-column row-center-wrapper">
- <span class="name">{{$t(`我的余额`)}}</span>
- <view class="pic">
- <span class="pic-font"><span class="num"> {{$t(`¥`)}}</span>{{ userInfo.now_money || 0 }}</span>
- </view>
- </view>
- <view class='cash-withdrawal'>
- <view class='wrapper'>
- <view class='list'>
- <form @submit="subCash">
- <view class='item acea-row row-between-wrapper'>
- <view class='name' style="font-size: 36rpx;"><text class='red'>*</text> {{$t(`接收人ID`)}}</view>
- <view class='input'><input type="number" :placeholder='$t(`请输入接收人ID`)' placeholder-class='placeholder'
- name="to_uid" style="font-size: 60rpx;"></input></view>
- </view>
- <view class='item acea-row row-between-wrapper'>
- <view class='name' style="font-size: 36rpx;"><text class='red'>*</text> {{$t(`金额`)}}</view>
- <view class='input'><input type='digit' :placeholder='$t(`请输入转账金额`)' placeholder-class='placeholder'
- name="num" style="font-size: 60rpx;"></input></view>
- </view>
- <view class='item acea-row row-between-wrapper'>
- <view class='name' style="font-size: 36rpx;"><text class='red'>*</text> {{$t(`交易密码`)}}</view>
- <view class='input' ><input :placeholder='$t(`请填写交易密码`)'
- placeholder-class='placeholder' name="trade" type='password' style="font-size: 60rpx;"></input></view>
- </view>
- <button formType="submit" class='bnt bg-color'>{{$t(`提现`)}}</button>
- </form>
- </view>
- </view>
- </view>
- <!-- #ifdef MP -->
- <!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
- <!-- #endif -->
- </view>
- </template>
- <script>
- import {
- extractCash,
- extractBank,
- getUserInfo,
- recharge,
- tradeMoney
- } from '@/api/user.js';
- import {
- toLogin
- } from '@/libs/login.js';
- import {
- mapGetters
- } from "vuex";
- // #ifdef MP
- import authorize from '@/components/Authorize';
- import {
- openRevenueSubscribe
- } from '@/utils/SubscribeMessage.js';
- // #endif
- import colors from '@/mixins/color.js';
- export default {
- components: {
- // #ifdef MP
- authorize
- // #endif
- },
- mixins: [colors],
- data() {
- return {
- navList: [],
- currentTab: 0,
- index: 0,
- array: [], //提现银行
- minPrice: 0.00, //最低提现金额
- userInfo: [],
- isClone: false,
- isAuto: false, //没有授权的不会自动授权
- isShowAuth: false, //是否隐藏授权
- qrcodeUrlW: "",
- qrcodeUrlZ: "",
- prevent: false, //避免重复提交成功多次
- weixinExtractType: 0, // 佣金到账方式
- alipayExtractType: 0, // 佣金到账方式
- withdrawal_fee: 0, //提现手续费
- true_money: 0
- };
- },
- computed: mapGetters(['isLogin']),
- watch: {
- isLogin: {
- handler: function(newV, oldV) {
- if (newV) {
- this.getUserInfo();
- }
- },
- deep: true
- }
- },
- onLoad() {
- if (this.isLogin) {
- this.getUserInfo();
- } else {
- toLogin();
- }
- },
- methods: {
- inputNum: function(e) {
- let val = e.detail.value;
- let dot = val.indexOf('.');
- if (dot > -1) {
- this.moneyMaxLeng = dot + 3;
- } else {
- this.moneyMaxLeng = 8
- }
- this.true_money = Math.floor((this.$util.$h.Mul(val, this.$util.$h.Div(this.$util.$h.Sub(100, this
- .withdrawal_fee), 100))) * 100) / 100 || 0;
- },
- // uploadpicW(){
- // this.uploadpic(this.qrcodeUrlW);
- // },
- // uploadpicZ(){
- // this.uploadpic(this.qrcodeUrlZ);
- // },
- /**
- * 上传文件
- *
- */
- uploadpic: function(type) {
- let that = this;
- that.$util.uploadImageOne('upload/image', function(res) {
- if (type === 'W') {
- that.qrcodeUrlW = res.data.url;
- } else {
- that.qrcodeUrlZ = res.data.url;
- }
- });
- },
- /**
- * 删除图片
- *
- */
- DelPicW: function() {
- this.qrcodeUrlW = "";
- },
- DelPicZ: function() {
- this.qrcodeUrlZ = "";
- },
- onLoadFun: function() {
- this.getUserInfo();
- this.getUserExtractBank();
- },
- // 授权关闭
- authColse: function(e) {
- this.isShowAuth = e
- },
- getUserExtractBank: function() {
- let that = this;
- extractBank().then(res => {
- let array = res.data.extractBank;
- array.unshift('请选择银行');
- array.forEach((v, i) => {
- array.splice(i, 1, that.$t(v))
- })
- that.$set(that, 'array', array);
- that.minPrice = res.data.minPrice;
- that.withdrawal_fee = res.data.withdrawal_fee;
- that.alipayExtractType = res.data.alipayExtractType ? parseInt(res.data.alipayExtractType) : 0;
- that.weixinExtractType = res.data.weixinExtractType ? parseInt(res.data.weixinExtractType) : 0;
- });
- },
- /**
- * 获取个人用户信息
- */
- getUserInfo: function() {
- let that = this;
- getUserInfo().then(res => {
- that.userInfo = res.data;
- });
- },
- swichNav: function(current) {
- this.currentTab = current;
- },
- bindPickerChange: function(e) {
- this.index = e.detail.value;
- },
- subCash(e) {
- let that = this,
- value = e.detail.value;
- if (this.prevent) return
- if (!value.to_uid) return this.$util.Tips({
- title: this.$t(`请填写接受人ID`)
- });
- if (!value.num) return this.$util.Tips({
- title: this.$t(`请填写转账金额`)
- });
- if (value.num *1 < 0) return this.$util.Tips({
- title: this.$t(`转账金额不能为负数`)
- });
- if (value.num *1 > that.userInfo.now_money * 1) return this.$util.Tips({
- title: this.$t(`您当前余额不足`)
- });
- if(!value.trade) return this.$util.Tips({
- title: this.$t(`请填写交易密码`)
- });
- this.prevent = true
- tradeMoney(value).then(res => {
- that.getUserInfo();
- return this.$util.Tips({
- title: res.msg,
- icon: 'success'
- }, {
- url: '/pages/users/user_money/index',
- tab: 2
- });
- setTimeout(e => {
- this.prevent = false
- }, 1000)
- }).catch(err => {
- setTimeout(e => {
- this.prevent = false
- }, 1000)
- return this.$util.Tips({
- title: err
- });
- });
- },
- }
- }
- </script>
- <style lang="scss">
- page {
- background-color: #fff !important;
- }
- .fontcolor {
- color: var(--view-theme) !important;
- }
- .cash-withdrawal .nav {
- height: 130rpx;
- box-shadow: 0 10rpx 10rpx #f8f8f8;
- }
- .cash-withdrawal .nav .item {
- font-size: 26rpx;
- flex: 1;
- text-align: center;
- }
- .cash-withdrawal .nav .item~.item {
- border-left: 1px solid #f0f0f0;
- }
- .cash-withdrawal .nav .item .iconfont {
- width: 40rpx;
- height: 40rpx;
- border-radius: 50%;
- border: 2rpx solid var(--view-theme);
- text-align: center;
- line-height: 37rpx;
- margin: 0 auto 6rpx auto;
- font-size: 22rpx;
- box-sizing: border-box;
- }
- .cash-withdrawal .nav .item .iconfont.on {
- background-color: var(--view-theme);
- color: #fff;
- border-color: var(--view-theme);
- }
- .cash-withdrawal .nav .item .line {
- width: 2rpx;
- height: 20rpx;
- margin: 0 auto;
- transition: height 0.3s;
- }
- .cash-withdrawal .nav .item .line.on {
- height: 39rpx;
- }
- .cash-withdrawal .wrapper .list {
- padding: 0 30rpx;
- }
- .cash-withdrawal .wrapper .list .item {
- border-bottom: 1rpx solid #eee;
- min-height: 28rpx;
- font-size: 30rpx;
- color: #333;
- padding: 39rpx 0;
- }
- .cash-withdrawal .wrapper .list .item .name {
- width: 180rpx;
- }
- .cash-withdrawal .wrapper .list .item .input {
- width: 505rpx;
- }
- .cash-withdrawal .wrapper .list .item .input .placeholder {
- color: #bbb;
- }
- .cash-withdrawal .wrapper .list .item .picEwm,
- .cash-withdrawal .wrapper .list .item .pictrue {
- width: 140rpx;
- height: 140rpx;
- border-radius: 3rpx;
- position: relative;
- margin-right: 23rpx;
- }
- .cash-withdrawal .wrapper .list .item .picEwm image {
- width: 100%;
- height: 100%;
- border-radius: 3rpx;
- }
- .cash-withdrawal .wrapper .list .item .picEwm .icon-guanbi1 {
- position: absolute;
- right: -14rpx;
- top: -16rpx;
- font-size: 40rpx;
- }
- .cash-withdrawal .wrapper .list .item .pictrue {
- border: 1px solid rgba(221, 221, 221, 1);
- font-size: 22rpx;
- color: #BBBBBB;
- }
- .cash-withdrawal .wrapper .list .item .pictrue .icon-icon25201 {
- font-size: 47rpx;
- color: #DDDDDD;
- margin-bottom: 3px;
- }
- .cash-withdrawal .wrapper .list .tip {
- font-size: 26rpx;
- color: #999;
- margin-top: 25rpx;
- }
- .cash-withdrawal .wrapper .list .bnt {
- font-size: 32rpx;
- color: #fff;
- width: 690rpx;
- height: 90rpx;
- text-align: center;
- border-radius: 50rpx;
- line-height: 90rpx;
- margin: 64rpx auto;
- }
- .cash-withdrawal .wrapper .list .tip2 {
- font-size: 26rpx;
- color: #999;
- text-align: center;
- margin: 44rpx 0 20rpx 0;
- }
- .cash-withdrawal .wrapper .list .value {
- height: 135rpx;
- line-height: 135rpx;
- border-bottom: 1rpx solid #eee;
- width: 690rpx;
- margin: 0 auto;
- }
- .cash-withdrawal .wrapper .list .value input {
- font-size: 80rpx;
- color: #282828;
- height: 135rpx;
- text-align: center;
- }
- .cash-withdrawal .wrapper .list .value .placeholder2 {
- color: #bbb;
- }
- .price {
- color: var(--view-priceColor);
- }
- .pos{
- padding-left: 26rpx;
- }
- .red{
- padding-right: 10rpx;
- color: var(--view-theme) !important;
- }
- .payment-top {
- width: 100%;
- height: 350rpx;
- background-color: var(--view-theme);
-
- .name {
- font-size: 26rpx;
- color: rgba(255, 255, 255, 0.8);
- margin-top: -38rpx;
- margin-bottom: 30rpx;
- }
-
- .pic {
- font-size: 32rpx;
- color: #fff;
-
- .num {
- font-size: 56rpx;
- }
- }
-
- .pic-font {
- font-size: 78rpx;
- color: #fff;
- }
- }
- </style>
|