前端小程序
这个提交包含在:
@@ -0,0 +1,390 @@
|
||||
<!-- 绑定提现账户 -->
|
||||
<template>
|
||||
<view class="bank-bind-page brand-page">
|
||||
<view class="page-wrap">
|
||||
<shopro-navbar variant="gradient" :backText="pageTitle"></shopro-navbar>
|
||||
<view class="page-content">
|
||||
<view class="type-banner brand-card u-flex u-col-center">
|
||||
<image class="type-icon" :src="typeIcon" mode="aspectFit"></image>
|
||||
<view class="type-info">
|
||||
<view class="type-title">{{ typeTitle }}</view>
|
||||
<view class="type-desc">{{ typeDesc }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 微信授权 -->
|
||||
<view class="wechat-box brand-card" v-if="bindType === 'wechat'">
|
||||
<view class="wechat-status" v-if="withdrawInfo">
|
||||
<view class="status-label">已绑定账户</view>
|
||||
<view class="status-value">{{ withdrawInfo.real_name || '' }} {{ withdrawInfo.card_no || '' }}</view>
|
||||
</view>
|
||||
<view class="wechat-empty" v-else>
|
||||
<view class="empty-title">尚未绑定微信</view>
|
||||
<view class="empty-desc">授权后将提现至您的微信零钱账户</view>
|
||||
</view>
|
||||
<button class="u-reset-button bind-wechat-btn" @tap="bindWechat">
|
||||
{{ withdrawInfo ? '重新授权' : '微信授权绑定' }}
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<!-- 银行卡 / 支付宝表单 -->
|
||||
<view class="form-card brand-card" v-else>
|
||||
<u-form :model="form.data" :rules="formRules" ref="bindForm" :errorType="errorType">
|
||||
<u-form-item
|
||||
v-if="bindType === 'bank'"
|
||||
:labelStyle="labelStyle"
|
||||
label-width="150"
|
||||
label-position="left"
|
||||
label="持卡人"
|
||||
prop="real_name"
|
||||
>
|
||||
<u-input
|
||||
placeholder="请输入持卡人姓名"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
v-model="form.data.real_name"
|
||||
type="text"
|
||||
></u-input>
|
||||
</u-form-item>
|
||||
<u-form-item
|
||||
v-if="bindType === 'bank'"
|
||||
:labelStyle="labelStyle"
|
||||
label-width="150"
|
||||
label-position="left"
|
||||
label="开户行"
|
||||
prop="bank_name"
|
||||
>
|
||||
<u-input
|
||||
placeholder="请输入开户银行名称"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
v-model="form.data.bank_name"
|
||||
type="text"
|
||||
></u-input>
|
||||
</u-form-item>
|
||||
<u-form-item
|
||||
v-if="bindType === 'bank'"
|
||||
:labelStyle="labelStyle"
|
||||
label-width="150"
|
||||
label-position="left"
|
||||
label="银行卡号"
|
||||
prop="card_no"
|
||||
>
|
||||
<u-input
|
||||
placeholder="请输入银行卡号"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
v-model="form.data.card_no"
|
||||
type="number"
|
||||
></u-input>
|
||||
</u-form-item>
|
||||
<u-form-item
|
||||
v-if="bindType === 'alipay'"
|
||||
:labelStyle="labelStyle"
|
||||
label-width="150"
|
||||
label-position="left"
|
||||
label="真实姓名"
|
||||
prop="real_name"
|
||||
>
|
||||
<u-input
|
||||
placeholder="请输入真实姓名"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
v-model="form.data.real_name"
|
||||
type="text"
|
||||
></u-input>
|
||||
</u-form-item>
|
||||
<u-form-item
|
||||
v-if="bindType === 'alipay'"
|
||||
:labelStyle="labelStyle"
|
||||
label-width="170"
|
||||
label-position="left"
|
||||
label="支付宝账号"
|
||||
prop="card_no"
|
||||
>
|
||||
<u-input
|
||||
placeholder="请输入支付宝账号"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
v-model="form.data.card_no"
|
||||
type="text"
|
||||
></u-input>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
</view>
|
||||
|
||||
<view class="notice-card brand-card" v-if="bindType !== 'wechat'">
|
||||
<view class="notice-title">安全提示</view>
|
||||
<view class="notice-item">请确保账户信息与本人实名信息一致</view>
|
||||
<view class="notice-item">请仔细核对账号,避免提现失败</view>
|
||||
</view>
|
||||
|
||||
<view class="foot-box safe-area-inset-bottom" v-if="bindType !== 'wechat'">
|
||||
<button class="u-reset-button save-btn" @tap="saveForm">保存</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import FormValidate from '@/shopro/validate/form';
|
||||
import wechat from '@/shopro/wechat/wechat';
|
||||
|
||||
const TYPE_META = {
|
||||
bank: {
|
||||
title: '绑定银行卡',
|
||||
typeTitle: '银行卡转账',
|
||||
desc: '请填写本人实名银行卡信息',
|
||||
icon: 'bank_type.png'
|
||||
},
|
||||
alipay: {
|
||||
title: '绑定支付宝',
|
||||
typeTitle: '支付宝账户',
|
||||
desc: '请填写本人实名支付宝账号',
|
||||
icon: 'ali_type.png'
|
||||
},
|
||||
wechat: {
|
||||
title: '绑定微信',
|
||||
typeTitle: '微信零钱',
|
||||
desc: '授权后提现至微信零钱',
|
||||
icon: 'wx_type.png'
|
||||
}
|
||||
};
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
bindType: 'bank',
|
||||
withdrawInfo: null,
|
||||
errorType: ['message'],
|
||||
labelStyle: {
|
||||
'font-size': '30rpx',
|
||||
'font-weight': '500',
|
||||
color: '#333'
|
||||
},
|
||||
placeholderStyle: 'font-size: 30rpx; font-weight: 400; color: #C2C7CF;',
|
||||
form: {
|
||||
data: {
|
||||
real_name: '',
|
||||
bank_name: '',
|
||||
card_no: ''
|
||||
},
|
||||
bankRules: {
|
||||
real_name: FormValidate.realName,
|
||||
bank_name: FormValidate.bankName,
|
||||
card_no: FormValidate.bankCode
|
||||
},
|
||||
alipayRules: {
|
||||
real_name: FormValidate.realName,
|
||||
card_no: FormValidate.alipayAccount
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
meta() {
|
||||
return TYPE_META[this.bindType] || TYPE_META.bank;
|
||||
},
|
||||
pageTitle() {
|
||||
return this.withdrawInfo ? '修改提现账户' : this.meta.title;
|
||||
},
|
||||
typeTitle() {
|
||||
return this.meta.typeTitle;
|
||||
},
|
||||
typeDesc() {
|
||||
return this.meta.desc;
|
||||
},
|
||||
typeIcon() {
|
||||
return this.$IMG_URL + '/imgs/wallet/' + this.meta.icon;
|
||||
},
|
||||
formRules() {
|
||||
return this.bindType === 'bank' ? this.form.bankRules : this.form.alipayRules;
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.bindType = options.type || 'bank';
|
||||
if (!TYPE_META[this.bindType]) {
|
||||
this.bindType = 'bank';
|
||||
}
|
||||
this.loadInfo();
|
||||
},
|
||||
onReady() {
|
||||
if (this.bindType !== 'wechat') {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.bindForm && this.$refs.bindForm.setRules(this.formRules);
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInfo() {
|
||||
this.$http('money.bankInfo', { type: this.bindType }, '', false).then(res => {
|
||||
if (res.code === 1 && res.data) {
|
||||
this.withdrawInfo = res.data;
|
||||
this.form.data = {
|
||||
real_name: res.data.real_name || '',
|
||||
bank_name: res.data.bank_name || '',
|
||||
card_no: res.data.card_no || ''
|
||||
};
|
||||
}
|
||||
});
|
||||
},
|
||||
bindWechat() {
|
||||
wechat.bind();
|
||||
setTimeout(() => {
|
||||
this.loadInfo();
|
||||
uni.$emit('WITHDRAW_BIND_SUCCESS', { type: 'wechat' });
|
||||
}, 1500);
|
||||
},
|
||||
saveForm() {
|
||||
this.$refs.bindForm.validate().then(valid => {
|
||||
if (!valid) return;
|
||||
this.$http(
|
||||
'money.bankEdit',
|
||||
{ type: this.bindType, ...this.form.data },
|
||||
'提交中...'
|
||||
).then(res => {
|
||||
if (res.code === 1) {
|
||||
this.$u.toast(res.msg || '保存成功');
|
||||
uni.$emit('WITHDRAW_BIND_SUCCESS', { type: this.bindType });
|
||||
setTimeout(() => uni.navigateBack(), 500);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.bank-bind-page {
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.page-wrap {
|
||||
background: $brand-header-gradient;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.page-content {
|
||||
flex: 1;
|
||||
padding: 0 $brand-page-gutter 160rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.type-banner {
|
||||
padding: 32rpx 28rpx;
|
||||
margin-bottom: 24rpx;
|
||||
|
||||
.type-icon {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.type-info {
|
||||
margin-left: 24rpx;
|
||||
|
||||
.type-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: $brand-text;
|
||||
}
|
||||
|
||||
.type-desc {
|
||||
font-size: 24rpx;
|
||||
color: $brand-text-muted;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.form-card {
|
||||
padding: 10rpx 28rpx 20rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.wechat-box {
|
||||
padding: 40rpx 28rpx;
|
||||
margin-bottom: 24rpx;
|
||||
text-align: center;
|
||||
|
||||
.wechat-status,
|
||||
.wechat-empty {
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.status-label,
|
||||
.empty-title {
|
||||
font-size: 28rpx;
|
||||
color: $brand-text-muted;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.status-value,
|
||||
.empty-desc {
|
||||
font-size: 30rpx;
|
||||
color: $brand-text;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.bind-wechat-btn {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
background: #07C160;
|
||||
border-radius: 44rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.notice-card {
|
||||
padding: 28rpx;
|
||||
|
||||
.notice-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: $brand-text;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.notice-item {
|
||||
font-size: 24rpx;
|
||||
color: $brand-text-muted;
|
||||
line-height: 40rpx;
|
||||
padding-left: 20rpx;
|
||||
position: relative;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 18rpx;
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
border-radius: 50%;
|
||||
background: $brand-primary;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.foot-box {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 20rpx $brand-page-gutter;
|
||||
background: rgba(255, 255, 255, 0.96);
|
||||
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
background: $brand-primary-gradient;
|
||||
border-radius: 44rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,435 @@
|
||||
<!-- 我的钱包 -->
|
||||
<template>
|
||||
<view class="wallet-wrap brand-page">
|
||||
<!-- 钱包卡片 -->
|
||||
<view class="head_box">
|
||||
<view class="card-box">
|
||||
<view class="card-head u-flex u-col-center">
|
||||
<view class="card-title">可提现金额(元)</view>
|
||||
<view @tap="showMoney = !showMoney" class="u-iconfont eye-icon"
|
||||
:class="showMoney ? 'uicon-eye' : 'uicon-eye-off'"></view>
|
||||
</view>
|
||||
<view class="money-num font-OPPOSANS">{{ showMoney ? userInfo.money || '0.00' : '*****' }}</view>
|
||||
<view class="card-actions u-flex">
|
||||
<button v-if="initRecharge.enable === '1'" class="u-reset-button topup-btn"
|
||||
@tap="$Router.push('/pages/user/wallet/top-up')">充值</button>
|
||||
<button class="u-reset-button withdraw-btn"
|
||||
@tap="$Router.push('/pages/user/wallet/withdraw')">提现</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 筛选 -->
|
||||
<u-sticky offset-top="0" :enable="true">
|
||||
<view class="filter-sticky">
|
||||
<view class="filter-box u-flex u-row-between">
|
||||
<button class="u-reset-button date-btn u-flex u-col-center" @tap="showCalendar = true">
|
||||
<text class="date-btn__text">{{ selDateText }}</text>
|
||||
<text class="u-iconfont uicon-arrow-down-fill date-btn__arrow"></text>
|
||||
</button>
|
||||
<view class="total-box">
|
||||
收入<text class="total-box__income">¥{{ incomeMoney || '0.00' }}</text>
|
||||
<text class="total-box__gap"> </text>
|
||||
支出<text class="total-box__expend">¥{{ expendMoney || '0.00' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex nav-box">
|
||||
<view class="state-item u-flex-1" v-for="state in statusList" :key="state.value"
|
||||
@tap="onTab(state.value)">
|
||||
<text class="state-title"
|
||||
:class="{ 'title-active': stateCurrent === state.value }">{{ state.name }}</text>
|
||||
<text class="underline" :class="{ 'underline-active': stateCurrent === state.value }"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-sticky>
|
||||
|
||||
<!-- 钱包记录 -->
|
||||
<view class="wallet-list-wrap">
|
||||
<view class="wallet-list u-flex" v-for="item in walletLog" :key="item.id">
|
||||
<image class="head-img u-m-r-20" :src="item.avatar" mode="aspectFill"></image>
|
||||
<view class="list-content">
|
||||
<view class="title-box u-flex u-row-between">
|
||||
<text class="title u-ellipsis-1">{{ item.type_name }}{{ item.title ? '-' + item.title : '' }}</text>
|
||||
<view class="money">
|
||||
<text v-if="item.wallet >= 0" class="add font-OPPOSANS">+{{ item.wallet }}</text>
|
||||
<text v-else class="minus font-OPPOSANS">{{ item.wallet }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<text class="time">{{ $u.timeFormat(item.createtime, 'yyyy-mm-dd hh:MM') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<shopro-empty v-if="isEmpty" marginTop="120rpx" :image="$IMG_URL + '/imgs/empty/empty_goods_null.png'" tipText="暂无数据~">
|
||||
</shopro-empty>
|
||||
<u-loadmore v-if="!isEmpty" height="80rpx" :status="loadStatus" icon-type="flower" color="#ccc" />
|
||||
|
||||
<u-calendar v-model="showCalendar" ref="uCalendar" safeAreaInsetBottom mode="range" start-text="开始"
|
||||
end-text="结束" active-bg-color="#1677FF" active-color="#fff"
|
||||
range-bg-color="rgba(22, 119, 255, 0.18)" range-color="#1677FF"
|
||||
:customStyle="{ background: 'linear-gradient(90deg, #1677FF, #4096FF)', boxShadow: '0 7rpx 11rpx 2rpx rgba(22, 119, 255, 0.28)' }"
|
||||
@change="selDate"></u-calendar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState,
|
||||
mapActions,
|
||||
mapGetters
|
||||
} from 'vuex';
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
isEmpty: false,
|
||||
stateCurrent: 'all', //默认
|
||||
statusList: [{
|
||||
name: '全部',
|
||||
value: 'all'
|
||||
},
|
||||
{
|
||||
name: '收入',
|
||||
value: 'add'
|
||||
},
|
||||
{
|
||||
name: '支出',
|
||||
value: 'reduce'
|
||||
}
|
||||
],
|
||||
showMoney: true,
|
||||
//日期选择
|
||||
showCalendar: false,
|
||||
selDateText: '',
|
||||
walletLog: [], //钱包记录
|
||||
propsDate: '', //日期参数
|
||||
incomeMoney: '', //收入
|
||||
expendMoney: '', //支出
|
||||
loadStatus: 'loadmore', //loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
|
||||
currentPage: 1,
|
||||
lastPage: 1
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['isLogin', 'userInfo', 'initRecharge'])
|
||||
},
|
||||
onShow() {
|
||||
this.isLogin && this.getUserInfo();
|
||||
this.getToday();
|
||||
this.currentPage = 1;
|
||||
this.lastPage = 1;
|
||||
this.walletLog = [];
|
||||
this.getWalletLog();
|
||||
},
|
||||
// 触底加载更多
|
||||
onReachBottom() {
|
||||
if (this.currentPage < this.lastPage) {
|
||||
this.currentPage += 1;
|
||||
this.getWalletLog();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['getUserInfo']),
|
||||
// 今日
|
||||
getToday() {
|
||||
let now = new Date();
|
||||
let dateText = `${now.getFullYear()}/${now.getMonth() + 1}/${now.getDate()}`;
|
||||
this.selDateText = `${now.getFullYear()}.${now.getMonth() + 1}.${now.getDate()}`;
|
||||
this.propsDate = `${dateText}-${dateText}`;
|
||||
},
|
||||
// tab切换
|
||||
onTab(state) {
|
||||
if (this.stateCurrent !== state) {
|
||||
this.stateCurrent = state;
|
||||
this.currentPage = 1;
|
||||
this.lastPage = 1;
|
||||
this.walletLog = [];
|
||||
this.getWalletLog();
|
||||
}
|
||||
},
|
||||
// 日期选择
|
||||
selDate(e) {
|
||||
this.walletLog = [];
|
||||
this.currentPage = 1;
|
||||
this.lastPage = 1;
|
||||
this.selDateText = `${e.startYear}.${e.startMonth}.${e.startDay}-${e.endYear}.${e.endMonth}.${e.endDay}`;
|
||||
let dateText = `${e.startYear}/${e.startMonth}/${e.startDay}-${e.endYear}/${e.endMonth}/${e.endDay}`;
|
||||
this.propsDate = dateText;
|
||||
this.getWalletLog();
|
||||
this.$refs.uCalendar.init();
|
||||
},
|
||||
// 钱包明细
|
||||
getWalletLog() {
|
||||
let that = this;
|
||||
that.loadStatus = 'loading';
|
||||
that.$http('money.walletLog', {
|
||||
wallet_type: 'money',
|
||||
status: that.stateCurrent,
|
||||
date: that.propsDate,
|
||||
page: that.currentPage
|
||||
}).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.walletLog = [...that.walletLog, ...res.data.wallet_logs.data];
|
||||
that.incomeMoney = res.data.income;
|
||||
that.expendMoney = Math.abs(res.data.expend);
|
||||
that.isEmpty = !that.walletLog.length;
|
||||
that.lastPage = res.data.wallet_logs.last_page;
|
||||
that.loadStatus = that.currentPage < res.data.wallet_logs.last_page ? 'loadmore' :
|
||||
'nomore';
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.wallet-wrap {
|
||||
min-height: 100vh;
|
||||
background: $brand-page-bg;
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 32rpx);
|
||||
}
|
||||
|
||||
// 余额卡片
|
||||
.head_box {
|
||||
padding: $brand-page-gutter;
|
||||
padding-bottom: 8rpx;
|
||||
|
||||
.card-box {
|
||||
@include brand-card;
|
||||
width: 100%;
|
||||
min-height: 280rpx;
|
||||
padding: 40rpx 36rpx 36rpx;
|
||||
background: $brand-gold-gradient;
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 0 8rpx 32rpx rgba(22, 119, 255, 0.28);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
right: -40rpx;
|
||||
top: -40rpx;
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.card-head {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(255, 255, 255, 0.92);
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.eye-icon {
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
.money-num {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-top: 28rpx;
|
||||
font-size: 72rpx;
|
||||
line-height: 1;
|
||||
font-weight: 600;
|
||||
color: #ffffff;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
.card-actions {
|
||||
position: absolute;
|
||||
right: 36rpx;
|
||||
top: 36rpx;
|
||||
z-index: 1;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.withdraw-btn {
|
||||
min-width: 120rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
padding: 0 28rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 28rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
color: $brand-gold;
|
||||
}
|
||||
|
||||
.topup-btn {
|
||||
min-width: 120rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
padding: 0 28rpx;
|
||||
border-radius: 28rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #fff;
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.65);
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 筛选 + Tab
|
||||
.filter-sticky {
|
||||
background: $brand-page-bg;
|
||||
}
|
||||
|
||||
.filter-box {
|
||||
height: 96rpx;
|
||||
padding: 0 $brand-page-gutter;
|
||||
align-items: center;
|
||||
|
||||
.date-btn {
|
||||
@include brand-card;
|
||||
line-height: 1;
|
||||
border-radius: 28rpx;
|
||||
padding: 14rpx 24rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: $brand-text;
|
||||
box-shadow: none;
|
||||
border: 1rpx solid $brand-border;
|
||||
|
||||
&__text {
|
||||
max-width: 280rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&__arrow {
|
||||
margin-left: 12rpx;
|
||||
font-size: 20rpx;
|
||||
color: $brand-text-muted;
|
||||
}
|
||||
}
|
||||
|
||||
.total-box {
|
||||
font-size: 24rpx;
|
||||
color: $brand-text-muted;
|
||||
|
||||
&__income {
|
||||
color: $brand-price;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&__expend {
|
||||
color: $brand-text;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&__gap {
|
||||
margin: 0 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.nav-box {
|
||||
background: #fff;
|
||||
border-bottom: 1rpx solid $brand-border;
|
||||
}
|
||||
|
||||
.state-item {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.state-title {
|
||||
color: $brand-text-muted;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
line-height: 88rpx;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
|
||||
.title-active {
|
||||
color: $brand-gold;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.underline {
|
||||
display: block;
|
||||
width: 48rpx;
|
||||
height: 4rpx;
|
||||
background: transparent;
|
||||
border-radius: 2rpx;
|
||||
margin-top: -12rpx;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.underline-active {
|
||||
background: $brand-gold;
|
||||
}
|
||||
}
|
||||
|
||||
// 钱包记录
|
||||
.wallet-list-wrap {
|
||||
margin: $brand-section-gap $brand-page-gutter 0;
|
||||
@include brand-card;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.wallet-list {
|
||||
padding: 28rpx 24rpx;
|
||||
border-bottom: 1rpx solid $brand-border;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.head-img {
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
border-radius: 50%;
|
||||
background: $brand-gold-light;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.list-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
color: $brand-text;
|
||||
flex: 1;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
display: block;
|
||||
margin-top: 8rpx;
|
||||
color: $brand-text-muted;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.money {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
flex-shrink: 0;
|
||||
|
||||
.add {
|
||||
color: $brand-price;
|
||||
}
|
||||
|
||||
.minus {
|
||||
color: $brand-text;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,183 @@
|
||||
<!-- 分账进件绑定 -->
|
||||
<template>
|
||||
<view class="onboard-bind-page brand-page">
|
||||
<view class="page-wrap">
|
||||
<shopro-navbar variant="gradient" backText="绑定银行卡"></shopro-navbar>
|
||||
<view class="page-content" v-if="loaded">
|
||||
<view class="role-card brand-card" v-if="onboardRoleText">
|
||||
<view class="role-text">{{ onboardRoleText }}</view>
|
||||
</view>
|
||||
<view class="onboard-notice" v-if="onboardNoticeText">{{ onboardNoticeText }}</view>
|
||||
<huifu-onboard-form
|
||||
ref="huifuForm"
|
||||
:required="huifuRequired"
|
||||
:statusInfo="huifuStatus"
|
||||
:readonly="huifuFormReadonly"
|
||||
></huifu-onboard-form>
|
||||
<view class="foot-box safe-area-inset-bottom" v-if="showOnboardSubmitBtn">
|
||||
<button
|
||||
class="u-reset-button save-btn"
|
||||
@tap="submitOnboardBind"
|
||||
:disabled="onboardSubmitting"
|
||||
>{{ onboardSubmitText }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HuifuOnboardForm from '@/components/huifu-onboard-form/huifu-onboard-form.vue';
|
||||
|
||||
export default {
|
||||
components: { HuifuOnboardForm },
|
||||
data() {
|
||||
return {
|
||||
loaded: false,
|
||||
huifuRequired: false,
|
||||
huifuStatus: {},
|
||||
onboardRoleLabels: [],
|
||||
canSubmitOnboard: false,
|
||||
onboardSubmitting: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
onboardRoleText() {
|
||||
if (!this.onboardRoleLabels.length) return '';
|
||||
return `适用角色:${this.onboardRoleLabels.join('、')}`;
|
||||
},
|
||||
huifuFormReadonly() {
|
||||
if (!this.huifuRequired) return true;
|
||||
return !this.canSubmitOnboard;
|
||||
},
|
||||
showOnboardSubmitBtn() {
|
||||
return this.canSubmitOnboard;
|
||||
},
|
||||
onboardSubmitText() {
|
||||
if (this.huifuStatus && this.huifuStatus.can_submit) return '重新提交进件资料';
|
||||
return '提交开户认证';
|
||||
},
|
||||
onboardNoticeText() {
|
||||
const h = this.huifuStatus || {};
|
||||
if (h.can_submit) return '汇付进件被驳回,请修改下方资料后重新提交';
|
||||
if (h.await_admin) return '进件资料已提交,请等待后台审核;审核通过后将自动提交汇付';
|
||||
if (h.status === 'busi_pending' || h.status === 'submitting' || h.status === 'basic_ok') {
|
||||
return '汇付进件审核中,请耐心等待';
|
||||
}
|
||||
if (h.status === 'approved') return '汇付进件已通过,分账功能已就绪';
|
||||
if (h.status === 'rejected' || h.status === 'failed') {
|
||||
return h.reject_reason ? `汇付进件被驳回:${h.reject_reason}` : '汇付进件被驳回,请修改后重新提交';
|
||||
}
|
||||
return '请填写实名与银行卡信息,提交后由平台审核';
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.loadOnboardBind();
|
||||
},
|
||||
methods: {
|
||||
loadOnboardBind() {
|
||||
this.$http('money.walletOnboard', {}, '', false).then(res => {
|
||||
if (res.code !== 1) {
|
||||
this.$u.toast(res.msg || '加载失败');
|
||||
setTimeout(() => this.$Router.back(), 1500);
|
||||
return;
|
||||
}
|
||||
const data = res.data || {};
|
||||
if (!data.show) {
|
||||
this.$u.toast('当前无需绑定进件资料');
|
||||
setTimeout(() => this.$Router.back(), 1500);
|
||||
return;
|
||||
}
|
||||
this.huifuRequired = !!data.required;
|
||||
this.huifuStatus = data.huifu_onboard || {};
|
||||
this.onboardRoleLabels = Array.isArray(data.role_labels) ? data.role_labels : [];
|
||||
this.canSubmitOnboard = !!data.can_submit_bind;
|
||||
this.loaded = true;
|
||||
});
|
||||
},
|
||||
submitOnboardBind() {
|
||||
if (!this.$refs.huifuForm) return;
|
||||
const valid = this.$refs.huifuForm.validate();
|
||||
if (valid !== true) return;
|
||||
this.onboardSubmitting = true;
|
||||
this.$http(
|
||||
'money.walletOnboardSubmit',
|
||||
{ huifu_onboard: this.$refs.huifuForm.getPayload() },
|
||||
'提交中...',
|
||||
false
|
||||
).then(res => {
|
||||
this.onboardSubmitting = false;
|
||||
if (res.code === 1) {
|
||||
this.$u.toast(res.msg || '提交成功');
|
||||
if (res.data) {
|
||||
this.huifuStatus = res.data.huifu_onboard || {};
|
||||
this.onboardRoleLabels = Array.isArray(res.data.role_labels) ? res.data.role_labels : [];
|
||||
this.canSubmitOnboard = !!res.data.can_submit_bind;
|
||||
if (!res.data.show) {
|
||||
setTimeout(() => this.$Router.back(), 1500);
|
||||
}
|
||||
} else {
|
||||
this.loadOnboardBind();
|
||||
}
|
||||
} else {
|
||||
this.$u.toast(res.msg || '提交失败');
|
||||
}
|
||||
}).catch(() => {
|
||||
this.onboardSubmitting = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.onboard-bind-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f7fa;
|
||||
|
||||
.page-content {
|
||||
padding: 20rpx 30rpx 160rpx;
|
||||
}
|
||||
|
||||
.role-card {
|
||||
padding: 24rpx 28rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.role-text {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.onboard-notice {
|
||||
margin-bottom: 20rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
background: #f0f7ff;
|
||||
border-radius: 12rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.6;
|
||||
color: #1677FF;
|
||||
}
|
||||
|
||||
.foot-box {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 20rpx 30rpx;
|
||||
background: #fff;
|
||||
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
width: 100%;
|
||||
height: 86rpx;
|
||||
line-height: 86rpx;
|
||||
background: $brand-primary-gradient;
|
||||
border-radius: 43rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,175 @@
|
||||
<!-- 积分余额 -->
|
||||
<template>
|
||||
<view class="page_box">
|
||||
<view class="head_box">
|
||||
<shopro-navbar variant="gradient" :background="{ background: 'none' }" backText="积分余额"></shopro-navbar>
|
||||
<view class="all-box u-flex-col u-row-center u-col-center">
|
||||
<text class="all-num">{{ userInfo.score || 0 }}</text>
|
||||
<text class="all-title u-m-b-30">当前积分</text>
|
||||
<image class="score-card-bg" :src="$IMG_URL + '/imgs/score/score_wallet_bg.png'" mode=""></image>
|
||||
</view>
|
||||
<view class="tab-box u-flex">
|
||||
<view class="tab-item u-flex u-row-center " @tap="onTab('all')"><view class="tab-name" :class="{ 'tab-active': tabCur === 'all' }">全部</view></view>
|
||||
<view class="tab-item u-flex u-row-center" @tap="onTab('add')"><view class="tab-name" :class="{ 'tab-active': tabCur === 'add' }">收入</view></view>
|
||||
<view class="tab-item u-flex u-row-center" @tap="onTab('reduce')"><view class="tab-name" :class="{ 'tab-active': tabCur === 'reduce' }">支出</view></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_box">
|
||||
<scroll-view scroll-y="true" @scrolltolower="loadMore" class="scroll-box">
|
||||
<view class="item-box u-flex u-row-between" v-for="log in scoreLog" :key="log.id">
|
||||
<view class="u-flex-col">
|
||||
<view class="name">{{ log.type_name }}</view>
|
||||
<view class="time">{{ $u.timeFormat(log.createtime) }}</view>
|
||||
</view>
|
||||
<view class="num font-OPPOSANS" v-if="log.wallet >= 0">{{ log.wallet }}</view>
|
||||
<view class="num font-OPPOSANS" v-else>{{ log.wallet }}</view>
|
||||
</view>
|
||||
<!-- 空置页 -->
|
||||
<shopro-empty v-if="isEmpty" marginTop="200rpx" :image="$IMG_URL + '/imgs/empty/comment_empty.png'" tipText="暂无数据~"></shopro-empty>
|
||||
<!-- 更多 -->
|
||||
<u-loadmore v-if="scoreLog.length" height="80rpx" :status="loadStatus" icon-type="flower" color="#ccc" />
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapMutations, mapActions, mapState, mapGetters } from 'vuex';
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
isEmpty: false,
|
||||
tabCur: 'all',
|
||||
scoreLog: [],
|
||||
loadStatus: 'loadmore', //loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
|
||||
currentPage: 1,
|
||||
lastPage: 1
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo'])
|
||||
},
|
||||
onLoad() {
|
||||
this.getScoreLog();
|
||||
},
|
||||
methods: {
|
||||
loadMore() {
|
||||
if (this.currentPage < this.lastPage) {
|
||||
this.currentPage += 1;
|
||||
this.getScoreLog();
|
||||
}
|
||||
},
|
||||
onTab(type) {
|
||||
if (this.tabCur !== type) {
|
||||
this.tabCur = type;
|
||||
this.scoreLog = [];
|
||||
this.currentPage = 1;
|
||||
this.getScoreLog();
|
||||
}
|
||||
},
|
||||
// 积分明细
|
||||
getScoreLog(type) {
|
||||
let that = this;
|
||||
that.loadStatus = 'loading';
|
||||
that.$http('money.walletLog', {
|
||||
wallet_type: 'score',
|
||||
status: that.tabCur,
|
||||
page: that.currentPage
|
||||
}).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.scoreLog = [...that.scoreLog, ...res.data.wallet_logs.data];
|
||||
that.lastPage = res.data.last_page;
|
||||
that.isEmpty = !that.scoreLog.length;
|
||||
that.loadStatus = that.currentPage < res.data.last_page ? 'loadmore' : 'nomore';
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.page_box {
|
||||
background: $brand-page-bg;
|
||||
.head_box {
|
||||
width: 750rpx;
|
||||
height: 480rpx;
|
||||
background: $brand-header-gradient;
|
||||
position: relative;
|
||||
.all-box {
|
||||
height: 360rpx;
|
||||
padding-bottom: var(--status-bar-height);
|
||||
.all-num {
|
||||
font-size: 50rpx;
|
||||
font-weight: 500;
|
||||
color: $brand-price;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.all-title {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
}
|
||||
.score-card-bg {
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
}
|
||||
}
|
||||
.tab-box {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: 0;
|
||||
transform: translateX(-50%);
|
||||
width: 710rpx;
|
||||
height: 90rpx;
|
||||
background: rgba(255, 255, 255, 1);
|
||||
border-radius: 30rpx 30rpx 0px 0px;
|
||||
border-bottom: 1rpx solid #dfdfdf;
|
||||
padding: 0 30rpx;
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
.tab-name {
|
||||
display: inline-block;
|
||||
font-size: 30rpx;
|
||||
font-family: Noto Sans S Chinese;
|
||||
font-weight: 400;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
border-bottom: 4rpx solid transparent;
|
||||
line-height: 86rpx;
|
||||
}
|
||||
.tab-active {
|
||||
border-bottom: 4rpx solid $brand-primary;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.item-box {
|
||||
background: #fff;
|
||||
min-height: 150rpx;
|
||||
border-bottom: 1rpx solid #dfdfdf;
|
||||
padding: 30rpx;
|
||||
.name {
|
||||
font-size: 28rpx;
|
||||
|
||||
font-weight: 500;
|
||||
color: rgba(102, 102, 102, 1);
|
||||
line-height: 28rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.time {
|
||||
font-size: 24rpx;
|
||||
|
||||
font-weight: 500;
|
||||
color: rgba(196, 196, 196, 1);
|
||||
line-height: 24px;
|
||||
}
|
||||
.num {
|
||||
font-size: 30rpx;
|
||||
|
||||
font-weight: 500;
|
||||
color: $brand-price;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,127 @@
|
||||
<!-- 充值记录 -->
|
||||
<template>
|
||||
<view class="wallet-log-box u-p-b-30">
|
||||
<view class="log-list" v-for="item in rechargeLog" :key="item.id">
|
||||
<view class="head u-flex u-col-center u-row-between">
|
||||
<view class="title">{{item.pay_type_text}}充值</view>
|
||||
<view class="num">{{ item.total_fee }} 元</view>
|
||||
</view>
|
||||
<view class="time-box item u-flex u-col-center u-row-between">
|
||||
<view class="item-title u-flex u-col-center"><text class="u-iconfont uicon-order u-m-r-10"></text>充值单号
|
||||
</view>
|
||||
<view class="time">{{item.order_sn}}</view>
|
||||
</view>
|
||||
<view class="time-box item u-flex u-col-center u-row-between">
|
||||
<view class="item-title u-flex u-col-center"><text class="u-iconfont uicon-clock u-m-r-10"></text>充值时间
|
||||
</view>
|
||||
<view class="time">{{$u.timeFormat(item.createtime, 'yyyy.mm.dd hh:MM:ss')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 更多 -->
|
||||
<u-loadmore v-show="!isEmpty" height="80rpx" :status="loadStatus" icon-type="flower" color="#ccc" />
|
||||
<!-- 空置页 -->
|
||||
<shopro-empty v-if="isEmpty" marginTop="300rpx" :image="$IMG_URL + '/imgs/empty/no_data.png'" tipText="暂无数据~">
|
||||
</shopro-empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
rechargeLog: [],
|
||||
loadStatus: 'loadmore', //loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
|
||||
currentPage: 1,
|
||||
lastPage: 1,
|
||||
isEmpty: false,
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
onLoad() {
|
||||
this.getLog();
|
||||
},
|
||||
// 触底加载更多
|
||||
onReachBottom() {
|
||||
if (this.currentPage < this.lastPage) {
|
||||
this.currentPage += 1;
|
||||
this.getLog();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 确认提交表单
|
||||
getLog() {
|
||||
let that = this;
|
||||
that.loadStatus = 'loading';
|
||||
that.$http('money.rechargeLog', {
|
||||
page: that.currentPage
|
||||
}).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.rechargeLog = [...that.rechargeLog, ...res.data.data];
|
||||
that.isEmpty = !that.rechargeLog.length;
|
||||
that.lastPage = res.data.last_page;
|
||||
that.loadStatus = that.currentPage < res.data.last_page ? 'loadmore' : 'nomore';
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
// 记录卡片
|
||||
.log-list {
|
||||
min-height: 213rpx;
|
||||
background: #ffffff;
|
||||
margin-bottom: 10rpx;
|
||||
padding-bottom: 10rpx;
|
||||
|
||||
.head {
|
||||
padding: 0 35rpx;
|
||||
height: 80rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #7063d2;
|
||||
}
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 0 30rpx 10rpx;
|
||||
|
||||
.item-icon {
|
||||
color: #c0c0c0;
|
||||
font-size: 36rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
width: 180rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
color: #c0c0c0;
|
||||
}
|
||||
|
||||
.status-text {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #05c3a1;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
color: #c0c0c0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,284 @@
|
||||
<!-- 充值 -->
|
||||
<template>
|
||||
<view class="draw-money-wrap u-p-b-30">
|
||||
<view class="head-box">
|
||||
<shopro-navbar :background="{ background: navBackground }" :backTextStyle="{ color: '#fff' }" backText="充值"
|
||||
backIconColor="#fff"></shopro-navbar>
|
||||
<!-- 账户 -->
|
||||
<view class="wallet-num-box u-flex u-col-center u-row-between">
|
||||
<view class="">
|
||||
<view class="num-title">账户余额(元)</view>
|
||||
<view class="wallet-num">{{ userInfo.money || '0.00' }}</view>
|
||||
</view>
|
||||
<button class="u-reset-button log-btn"
|
||||
@tap="$Router.push({ path: '/pages/user/wallet/top-up-log' })">充值记录</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 充值输入卡片-->
|
||||
<view class="draw-card">
|
||||
<view class="card-title">充值金额</view>
|
||||
<view class="input-box u-flex u-col-center">
|
||||
<view calss="unit">¥</view>
|
||||
<input class="u-flex-1 u-p-l-10" type="digit" @focus="onTopupFous" @input="onTopupInput" v-model="money"
|
||||
placeholder-style="font-size: 30rpx; font-weight: 500;color:#C2C7CF;" placeholder="请输入充值金额" />
|
||||
</view>
|
||||
<!-- 快捷充值 -->
|
||||
<view class="top-up-content u-p-b-30" v-if="initRecharge.moneys.length">
|
||||
<view class="card-title">快捷充值</view>
|
||||
<view class="u-flex u-flex-wrap">
|
||||
<view class="top-up-card u-flex u-row-center u-col-center u-m-b-30 u-m-r-30"
|
||||
:class="{'top-up-active':curMoneyCard === index}" v-for="(item,index) in initRecharge.moneys"
|
||||
:key="index" @tap="selectCard(index)">
|
||||
<view class="top-up-value">
|
||||
{{item.money}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button class="u-reset-button save-btn" :style="{opacity:!money ? 0.7 : 1 }" :disabled="!money"
|
||||
@tap="confirmTopup">确认充值</button>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 充值说明 -->
|
||||
<view class="draw-notice">
|
||||
<view class="title">充值说明</view>
|
||||
<view class="draw-list">1.充值为在线支付,即时到账,不支持退款;</view>
|
||||
<view class="draw-list">
|
||||
2.充值后金额会自动进入您的余额账户,请注意查收。
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapActions, mapGetters } from 'vuex';
|
||||
import FormValidate from '@/shopro/validate/form';
|
||||
import wechat from '@/shopro/wechat/wechat';
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
money: '', //提现金额
|
||||
showModal: false,
|
||||
curMoneyCard: '',
|
||||
navBackground: 'none'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo', 'initRecharge'])
|
||||
},
|
||||
async onLoad() {},
|
||||
onPageScroll(e) {
|
||||
this.navBackground = e.scrollTop > 50 ?
|
||||
`url(${this.$IMG_URL}/imgs/user/draw_money_head_bg.png) no-repeat top / 100% auto` : 'none';
|
||||
},
|
||||
methods: {
|
||||
// 充值输入框
|
||||
onTopupInput(e) {
|
||||
this.$nextTick(() => {
|
||||
this.money = this.clearNoNum(e.detail.value)
|
||||
})
|
||||
},
|
||||
// 获取焦点
|
||||
onTopupFous() {
|
||||
this.curMoneyCard = ''
|
||||
},
|
||||
|
||||
// 选择充值卡片
|
||||
selectCard(index) {
|
||||
this.curMoneyCard = index
|
||||
this.money = this.initRecharge.moneys[index].money
|
||||
},
|
||||
|
||||
confirmTopup() {
|
||||
const that = this;
|
||||
if (this.money <= 0) {
|
||||
this.$u.toast('请选择或输入充值金额');
|
||||
return;
|
||||
}
|
||||
that.$http(
|
||||
'money.recharge', {
|
||||
recharge_money: that.money
|
||||
},
|
||||
'确认中...'
|
||||
).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.money = '';
|
||||
that.$Router.push({
|
||||
path: `/pages/order/payment/method`,
|
||||
query: {
|
||||
orderId: res.data.id,
|
||||
orderType: 'recharge'
|
||||
}
|
||||
});
|
||||
} else {
|
||||
that.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 校验金额
|
||||
clearNoNum(val) {
|
||||
if (val == ".") {
|
||||
val = "0.";
|
||||
}
|
||||
val = val.replace(/[^\d.]/g, "");
|
||||
//必须保证第一个为数字而不是.
|
||||
val = val.replace(/^\./g, "");
|
||||
//保证只有出现一个.而没有多个.
|
||||
val = val.replace(/\.{2,}/g, ".");
|
||||
//保证.只出现一次,而不能出现两次以上
|
||||
val = val
|
||||
.replace(".", "$#$")
|
||||
.replace(/\./g, "")
|
||||
.replace("$#$", ".");
|
||||
//只能输入两位小数
|
||||
val = val.replace(/^(-)*(\d+)\.(\d\d).*$/, "$1$2.$3");
|
||||
if (val.indexOf(".") < 0 && val != "") {
|
||||
//以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
|
||||
val = parseFloat(val);
|
||||
}
|
||||
return val
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.head-box {
|
||||
background: url($IMG_URL+'/imgs/user/draw_money_head_bg.png') no-repeat;
|
||||
background-size: 100% auto;
|
||||
min-height: 400rpx;
|
||||
padding-bottom: var(--status-bar-height);
|
||||
|
||||
// 可提现
|
||||
.wallet-num-box {
|
||||
padding: 20rpx 40rpx 0;
|
||||
|
||||
.num-title {
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.wallet-num {
|
||||
font-size: 60rpx;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.log-btn {
|
||||
width: 170rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border: 1rpx solid #eeeeee;
|
||||
border-radius: 30rpx;
|
||||
padding: 0;
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 提现输入卡片
|
||||
.draw-card {
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
width: 690rpx;
|
||||
min-height: 400rpx;
|
||||
margin: -70rpx auto 30rpx;
|
||||
padding: 30rpx;
|
||||
|
||||
.card-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.input-box {
|
||||
width: 624rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
height: 100rpx;
|
||||
margin-bottom: 40rpx;
|
||||
|
||||
.unit {
|
||||
font-size: 48rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
width: 616rpx;
|
||||
height: 86rpx;
|
||||
line-height: 86rpx;
|
||||
background: linear-gradient(90deg, #1677FF, #4096FF);
|
||||
box-shadow: 0px 7rpx 11rpx 2rpx rgba(124, 103, 214, 0.34);
|
||||
border-radius: 43rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
// 充值卡片
|
||||
.top-up-card {
|
||||
width: 190rpx;
|
||||
height: 124rpx;
|
||||
background: #F7F6FB;
|
||||
border-radius: 12rpx;
|
||||
transition: all linear 0.2s;
|
||||
|
||||
&:nth-of-type(3n) {
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
|
||||
.top-up-value {
|
||||
font-size: 36rpx;
|
||||
font-weight: 500;
|
||||
color: #999999;
|
||||
|
||||
&::after {
|
||||
content: '元';
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.top-up-active {
|
||||
background: #564BBD;
|
||||
transition: all linear 0.2s;
|
||||
|
||||
.top-up-value {
|
||||
color: #fff
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 提现说明
|
||||
.draw-notice {
|
||||
width: 684rpx;
|
||||
min-height: 180rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
padding: 30rpx 35rpx;
|
||||
margin: 20rpx auto;
|
||||
|
||||
.title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.draw-list {
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,150 @@
|
||||
<!-- 提现记录 -->
|
||||
<template>
|
||||
<!-- 记录卡片 -->
|
||||
<view class="wallet-log-box u-p-b-30">
|
||||
<view class="log-list" v-for="item in withdrawLog" :key="item.id">
|
||||
<view class="head u-flex u-col-center u-row-between">
|
||||
<view class="title">提现至{{ item.apply_type_text }}</view>
|
||||
<view class="num">{{ item.money }} 元</view>
|
||||
</view>
|
||||
<view class="status-box item u-flex u-col-center u-row-between">
|
||||
<view class="item-title">申请状态</view>
|
||||
<view class="status-text" :style="{ color: stausMap[item.status] }">{{ item.status_text }}</view>
|
||||
</view>
|
||||
<view class="time-box item u-flex u-col-center u-row-between">
|
||||
<text class="item-title">账户信息</text>
|
||||
<view class="time u-ellipsis-1">{{ item.apply_info | applyInfoFilter }}</view>
|
||||
</view>
|
||||
<view class="time-box item u-flex u-col-center u-row-between">
|
||||
<text class="item-title">提现单号</text>
|
||||
<view class="time">{{ item.apply_sn }}</view>
|
||||
</view>
|
||||
<view class="time-box item u-flex u-col-center u-row-between">
|
||||
<text class="item-title">手续费</text>
|
||||
<view class="time">{{ item.charge_money }} 元</view>
|
||||
</view>
|
||||
<view class="time-box item u-flex u-col-center u-row-between">
|
||||
<text class="item-title">申请时间</text>
|
||||
<view class="time">{{ $u.timeFormat(item.createtime, 'yyyy.mm.dd hh:MM:ss') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 更多 -->
|
||||
<u-loadmore v-show="!isEmpty" height="80rpx" :status="loadStatus" icon-type="flower" color="#ccc" />
|
||||
<!-- 空置页 -->
|
||||
<shopro-empty v-if="isEmpty" marginTop="300rpx" :image="$IMG_URL + '/imgs/empty/empty_goods_null.png'"
|
||||
tipText="暂无数据~"></shopro-empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
withdrawLog: [],
|
||||
loadStatus: 'loadmore', //loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
|
||||
currentPage: 1,
|
||||
lastPage: 1,
|
||||
isEmpty: false,
|
||||
stausMap: {
|
||||
0: '#999',
|
||||
1: '#EFAF41',
|
||||
2: '#70C140',
|
||||
'-1': '#ED5B56'
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
filters: {
|
||||
applyInfoFilter: function(value) {
|
||||
if (!value) return '-';
|
||||
return Object.values(value).join(' | ');
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getLog();
|
||||
},
|
||||
// 触底加载更多
|
||||
onReachBottom() {
|
||||
if (this.currentPage < this.lastPage) {
|
||||
this.currentPage += 1;
|
||||
this.getLog();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 确认提交表单
|
||||
getLog() {
|
||||
let that = this;
|
||||
that.loadStatus = 'loading';
|
||||
that.$http('money.withdrawLog', {
|
||||
page: that.currentPage
|
||||
}).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.withdrawLog = [...that.withdrawLog, ...res.data.data];
|
||||
that.isEmpty = !that.withdrawLog.length;
|
||||
that.lastPage = res.data.last_page;
|
||||
that.loadStatus = that.currentPage < res.data.last_page ? 'loadmore' : 'nomore';
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
// 记录卡片
|
||||
.log-list {
|
||||
min-height: 213rpx;
|
||||
background: #ffffff;
|
||||
margin-bottom: 10rpx;
|
||||
padding-bottom: 10rpx;
|
||||
|
||||
.head {
|
||||
padding: 0 35rpx;
|
||||
height: 80rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: $brand-primary;
|
||||
}
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 0 30rpx 10rpx;
|
||||
|
||||
.item-icon {
|
||||
color: #c0c0c0;
|
||||
font-size: 36rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
width: 180rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
color: #c0c0c0;
|
||||
}
|
||||
|
||||
.status-text {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #05c3a1;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
color: #c0c0c0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,228 @@
|
||||
<!-- 选择提现方式 -->
|
||||
<template>
|
||||
<view class="withdraw-method-page brand-page">
|
||||
<view class="page-wrap">
|
||||
<shopro-navbar variant="gradient" backText="选择提现方式"></shopro-navbar>
|
||||
<view class="page-content">
|
||||
<view class="tip-card brand-card" v-if="availableMethods.length">
|
||||
<text class="tip-text">请选择您要使用的提现到账方式</text>
|
||||
</view>
|
||||
|
||||
<view class="method-list" v-if="availableMethods.length">
|
||||
<view
|
||||
class="method-item brand-card u-flex u-row-between u-col-center"
|
||||
v-for="item in availableMethods"
|
||||
:key="item.value"
|
||||
:class="{ active: selectedType === item.value }"
|
||||
@tap="selectMethod(item.value)"
|
||||
>
|
||||
<view class="method-left u-flex u-col-center">
|
||||
<image class="method-icon" :src="item.icon" mode="aspectFit"></image>
|
||||
<view class="method-info">
|
||||
<view class="method-title">{{ item.title }}</view>
|
||||
<view class="method-desc">{{ item.desc }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="method-check">
|
||||
<text class="u-iconfont uicon-checkmark-circle-fill" v-if="selectedType === item.value"></text>
|
||||
<text class="u-iconfont uicon-arrow-right" v-else></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<shopro-empty
|
||||
v-if="!loading && !availableMethods.length"
|
||||
marginTop="200rpx"
|
||||
:image="$IMG_URL + '/imgs/empty/empty_goods_null.png'"
|
||||
tipText="暂无可用的提现方式,请联系客服"
|
||||
></shopro-empty>
|
||||
|
||||
<view class="foot-box safe-area-inset-bottom" v-if="availableMethods.length">
|
||||
<button class="u-reset-button confirm-btn" :disabled="!selectedType" @tap="confirmSelect">确认选择</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const WITHDRAW_TYPES = {
|
||||
bank: {
|
||||
icon: '',
|
||||
title: '银行卡转账',
|
||||
desc: '提现至本人银行卡',
|
||||
value: 'bank'
|
||||
},
|
||||
wechat: {
|
||||
icon: '',
|
||||
title: '微信零钱',
|
||||
desc: '提现至微信零钱账户',
|
||||
value: 'wechat'
|
||||
},
|
||||
alipay: {
|
||||
icon: '',
|
||||
title: '支付宝账户',
|
||||
desc: '提现至支付宝账户',
|
||||
value: 'alipay'
|
||||
}
|
||||
};
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
selectedType: '',
|
||||
methods: [],
|
||||
withdrawList: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
availableMethods() {
|
||||
return this.methods
|
||||
.map(key => this.withdrawList[key])
|
||||
.filter(Boolean);
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.initWithdrawList();
|
||||
this.selectedType = options.current || '';
|
||||
this.loadRules();
|
||||
},
|
||||
methods: {
|
||||
initWithdrawList() {
|
||||
const base = this.$IMG_URL + '/imgs/wallet/';
|
||||
this.withdrawList = {
|
||||
bank: { ...WITHDRAW_TYPES.bank, icon: base + 'bank_type.png' },
|
||||
wechat: { ...WITHDRAW_TYPES.wechat, icon: base + 'wx_type.png' },
|
||||
alipay: { ...WITHDRAW_TYPES.alipay, icon: base + 'ali_type.png' }
|
||||
};
|
||||
},
|
||||
loadRules() {
|
||||
this.loading = true;
|
||||
this.$http('money.walletRule').then(res => {
|
||||
this.loading = false;
|
||||
if (res.code === 1) {
|
||||
const methods = res.data && res.data.methods;
|
||||
this.methods = Array.isArray(methods) ? methods : [];
|
||||
if (!this.selectedType && this.methods.length) {
|
||||
this.selectedType = this.methods[0];
|
||||
}
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
selectMethod(type) {
|
||||
this.selectedType = type;
|
||||
},
|
||||
confirmSelect() {
|
||||
if (!this.selectedType) {
|
||||
this.$u.toast('请选择提现方式');
|
||||
return;
|
||||
}
|
||||
uni.$emit('SELECT_WITHDRAW_TYPE', { type: this.selectedType });
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.withdraw-method-page {
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.page-wrap {
|
||||
background: $brand-header-gradient;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.page-content {
|
||||
flex: 1;
|
||||
padding: 0 $brand-page-gutter 160rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.tip-card {
|
||||
padding: 24rpx 28rpx;
|
||||
margin-bottom: 24rpx;
|
||||
|
||||
.tip-text {
|
||||
font-size: 26rpx;
|
||||
color: $brand-text-muted;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
|
||||
.method-item {
|
||||
padding: 32rpx 28rpx;
|
||||
margin-bottom: 20rpx;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&.active {
|
||||
border: 2rpx solid $brand-primary;
|
||||
box-shadow: 0 4rpx 16rpx rgba(22, 119, 255, 0.15);
|
||||
}
|
||||
|
||||
.method-icon {
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.method-info {
|
||||
margin-left: 24rpx;
|
||||
|
||||
.method-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: $brand-text;
|
||||
}
|
||||
|
||||
.method-desc {
|
||||
font-size: 24rpx;
|
||||
color: $brand-text-muted;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.method-check {
|
||||
.uicon-checkmark-circle-fill {
|
||||
font-size: 40rpx;
|
||||
color: $brand-primary;
|
||||
}
|
||||
|
||||
.uicon-arrow-right {
|
||||
font-size: 28rpx;
|
||||
color: #C4C4C4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.foot-box {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 20rpx $brand-page-gutter;
|
||||
background: rgba(255, 255, 255, 0.96);
|
||||
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.confirm-btn {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
background: $brand-primary-gradient;
|
||||
border-radius: 44rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #fff;
|
||||
|
||||
&[disabled] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,585 @@
|
||||
<!-- 提现 -->
|
||||
<template>
|
||||
<view class="draw-money-wrap">
|
||||
<view class="head-box">
|
||||
<shopro-navbar :background="{ background: 'none' }" :backTextStyle="{ color: '#fff' }" backText="提现"
|
||||
backIconColor="#fff"></shopro-navbar>
|
||||
<!-- 可提现 -->
|
||||
<view class="wallet-num-box u-flex u-col-center u-row-between">
|
||||
<view class="">
|
||||
<view class="num-title">可提现金额(元)</view>
|
||||
<view class="wallet-num">{{ userInfo.money || '0.00' }}</view>
|
||||
</view>
|
||||
<button class="u-reset-button log-btn"
|
||||
@tap="$Router.push({ path: '/pages/user/wallet/withdraw-log' })">提现记录</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 提现输入卡片-->
|
||||
<view class="draw-card">
|
||||
<!-- 分账进件绑定入口(分销商 / 区域公司) -->
|
||||
<view class="onboard-entry u-flex u-row-between u-col-center" v-if="showOnboardBind" @tap="goToOnboardBind">
|
||||
<view class="onboard-entry-left">
|
||||
<view class="onboard-entry-title">分账进件绑定</view>
|
||||
<view class="onboard-entry-desc">{{ onboardEntryDesc }}</view>
|
||||
</view>
|
||||
<view class="onboard-entry-right u-flex u-col-center">
|
||||
<text class="onboard-status" :class="onboardStatusClass" v-if="onboardStatusText">{{ onboardStatusText }}</text>
|
||||
<text class="u-iconfont uicon-arrow-right arrow-icon"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-title">提现金额</view>
|
||||
<view class="input-box u-flex u-col-center">
|
||||
<view calss="unit">¥</view>
|
||||
<input class="u-flex-1 u-p-l-10" type="number" @input="onWithdrawInput" v-model="money"
|
||||
:placeholder-style="placeholderStyle" placeholder="请输入提现金额" />
|
||||
</view>
|
||||
<view class="bank-box u-flex u-col-center u-row-between u-m-b-30" @tap="openWithdrawMethod">
|
||||
<view class="name">提现至</view>
|
||||
<view class="bank-list u-flex u-col-center">
|
||||
<view class="empty-text" v-if="!withdrawType">请选择提现方式</view>
|
||||
<view class="sel-box u-flex u-col-center" v-else>
|
||||
<image class="item-img" :src="withdrawList[withdrawType].icon" mode=""></image>
|
||||
<view class="item-title u-m-l-20">{{ withdrawList[withdrawType].title }}</view>
|
||||
</view>
|
||||
<text class="u-iconfont uicon-arrow-right arrow-icon"></text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 提现账户信息 -->
|
||||
<view class="bank-info u-m-b-80" v-if="withdrawType">
|
||||
<view class="account-card u-flex u-row-between u-col-center" @tap="goToBind">
|
||||
<view class="bank-info-title">
|
||||
<block v-if="withdrawType === 'wechat'">
|
||||
{{ !withdrawInfo ? '暂未绑定微信,点击去绑定' : `${withdrawInfo.real_name || ''} ${withdrawInfo.card_no || ''}` }}
|
||||
</block>
|
||||
<block v-else>
|
||||
{{
|
||||
!withdrawInfo
|
||||
? `暂未绑定${withdrawList[withdrawType].title},点击去添加`
|
||||
: `${withdrawInfo.bank_name || ''} ${withdrawInfo.card_no || ''} ${withdrawInfo.real_name || ''}`
|
||||
}}
|
||||
</block>
|
||||
</view>
|
||||
<view class="bind-link u-flex u-col-center">
|
||||
<text>{{ withdrawInfo ? '修改' : (withdrawType === 'wechat' ? '绑定' : '添加') }}</text>
|
||||
<text class="u-iconfont uicon-arrow-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 提现规则(审核要求清晰展示) -->
|
||||
<view class="draw-notice in-card" v-if="ruleInfo">
|
||||
<view class="title">提现规则</view>
|
||||
<view class="rule-row">
|
||||
<text class="rule-label">可提现额度</text>
|
||||
<text class="rule-value">当前余额 {{ userInfo.money || '0.00' }} 元;单次 {{ ruleInfo.min }}~{{ ruleInfo.max }} 元</text>
|
||||
</view>
|
||||
<view class="rule-row">
|
||||
<text class="rule-label">每日提现次数</text>
|
||||
<text class="rule-value">{{ perdayNumText }}</text>
|
||||
</view>
|
||||
<view class="rule-row">
|
||||
<text class="rule-label">每日提现总额</text>
|
||||
<text class="rule-value">{{ perdayAmountText }}</text>
|
||||
</view>
|
||||
<view class="rule-row">
|
||||
<text class="rule-label">提现时间</text>
|
||||
<text class="rule-value">全天 24 小时可提交申请;人工审核时间为工作日 9:00-18:00</text>
|
||||
</view>
|
||||
<view class="rule-row">
|
||||
<text class="rule-label">到账时间</text>
|
||||
<text class="rule-value">{{ arrivalTimeText }}</text>
|
||||
</view>
|
||||
<view class="rule-row">
|
||||
<text class="rule-label">手续费</text>
|
||||
<text class="rule-value">每笔收取 {{ ruleInfo.service_fee }}%(从提现金额中扣除)</text>
|
||||
</view>
|
||||
</view>
|
||||
<button class="u-reset-button save-btn" @tap="withdraw">确认提现</button>
|
||||
</view>
|
||||
<view class="draw-notice" v-if="ruleInfo">
|
||||
<view class="title">温馨提示</view>
|
||||
<view class="draw-list">1. 请确保提现账户信息真实有效,姓名需与实名信息一致;</view>
|
||||
<view class="draw-list">2. 提现审核结果将通过小程序消息或提现记录通知;</view>
|
||||
<view class="draw-list">3. 如有疑问请及时联系在线客服。</view>
|
||||
</view>
|
||||
<!-- modal -->
|
||||
<u-modal ref="uModal" v-model="showModal" :show-cancel-button="true" confirm-color="#1677FF"
|
||||
cancel-color="#666666" @confirm="$Router.push('/pages/user/wallet/withdraw-log')" confirm-text="查看记录"
|
||||
cancel-text="继续提现" content="您的申请提现已提交" title="申请成功"></u-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState,
|
||||
mapActions,
|
||||
mapGetters
|
||||
} from 'vuex';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showModal: false,
|
||||
money: '', //提现金额
|
||||
ruleInfo: '', //提现规则
|
||||
showOnboardBind: false,
|
||||
huifuStatus: {},
|
||||
canSubmitOnboard: false,
|
||||
withdrawType: '',
|
||||
withdrawInfo: null, //提现信息
|
||||
withdrawList: {
|
||||
bank: {
|
||||
icon: this.$IMG_URL + '/imgs/wallet/bank_type.png',
|
||||
title: '银行卡转账',
|
||||
value: 'bank'
|
||||
},
|
||||
wechat: {
|
||||
icon: this.$IMG_URL + '/imgs/wallet/wx_type.png',
|
||||
title: '微信零钱',
|
||||
value: 'wechat'
|
||||
},
|
||||
alipay: {
|
||||
icon: this.$IMG_URL + '/imgs/wallet/ali_type.png',
|
||||
title: '支付宝账户',
|
||||
value: 'alipay'
|
||||
}
|
||||
},
|
||||
placeholderStyle: 'font-size: 30rpx; font-weight: 500;color:#C2C7CF;'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo', 'initRecharge']),
|
||||
perdayNumText() {
|
||||
if (!this.ruleInfo) return '-';
|
||||
const num = Number(this.ruleInfo.perday_num);
|
||||
return num > 0 ? `每日最多 ${num} 次` : '不限次数';
|
||||
},
|
||||
perdayAmountText() {
|
||||
if (!this.ruleInfo) return '-';
|
||||
const amount = Number(this.ruleInfo.perday_amount);
|
||||
return amount > 0 ? `每日最多 ${amount} 元` : '不限金额';
|
||||
},
|
||||
arrivalTimeText() {
|
||||
if (!this.ruleInfo) return '-';
|
||||
const type = this.withdrawType;
|
||||
const auto = !!this.ruleInfo.wechat_alipay_auto;
|
||||
if (type === 'bank') {
|
||||
return '人工审核通过后 1~3 个工作日到账(以银行处理为准)';
|
||||
}
|
||||
if ((type === 'wechat' || type === 'alipay') && auto) {
|
||||
return '审核通过后自动打款,一般 1 小时内到账(以微信/支付宝处理为准)';
|
||||
}
|
||||
if (type === 'wechat' || type === 'alipay') {
|
||||
return '人工审核通过后 1~3 个工作日到账(以微信/支付宝处理为准)';
|
||||
}
|
||||
return '审核通过后 1~3 个工作日到账(以实际渠道处理为准)';
|
||||
},
|
||||
onboardEntryDesc() {
|
||||
if (this.canSubmitOnboard) return '请完善实名与银行卡信息';
|
||||
const h = this.huifuStatus || {};
|
||||
if (h.await_admin) return '资料已提交,等待平台审核';
|
||||
if (h.status === 'busi_pending' || h.status === 'submitting' || h.status === 'basic_ok') {
|
||||
return '汇付进件审核中';
|
||||
}
|
||||
if (h.status === 'rejected' || h.status === 'failed' || h.can_submit) {
|
||||
return '进件被驳回,请修改后重新提交';
|
||||
}
|
||||
return '提现前请先完成分账进件绑定';
|
||||
},
|
||||
onboardStatusText() {
|
||||
const h = this.huifuStatus || {};
|
||||
const map = {
|
||||
draft: '待审核',
|
||||
submitting: '提交中',
|
||||
basic_ok: '开户成功',
|
||||
busi_pending: '审核中',
|
||||
rejected: '已驳回',
|
||||
failed: '失败'
|
||||
};
|
||||
if (h.can_submit) return '待修改';
|
||||
if (h.await_admin) return '待审核';
|
||||
if (h.status && map[h.status]) return map[h.status];
|
||||
if (this.canSubmitOnboard) return '待填写';
|
||||
return '';
|
||||
},
|
||||
onboardStatusClass() {
|
||||
const h = this.huifuStatus || {};
|
||||
if (h.can_submit || h.status === 'rejected' || h.status === 'failed') return 'is-warn';
|
||||
if (h.await_admin || h.status === 'draft') return 'is-pending';
|
||||
if (h.status === 'busi_pending' || h.status === 'submitting' || h.status === 'basic_ok') {
|
||||
return 'is-pending';
|
||||
}
|
||||
if (this.canSubmitOnboard) return 'is-warn';
|
||||
return '';
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getWithdrawRules();
|
||||
this.loadOnboardBind();
|
||||
uni.$on('SELECT_WITHDRAW_TYPE', this.onSelectWithdrawType);
|
||||
uni.$on('WITHDRAW_BIND_SUCCESS', this.onBindSuccess);
|
||||
},
|
||||
onShow() {
|
||||
this.loadOnboardBind();
|
||||
},
|
||||
onUnload() {
|
||||
uni.$off('SELECT_WITHDRAW_TYPE', this.onSelectWithdrawType);
|
||||
uni.$off('WITHDRAW_BIND_SUCCESS', this.onBindSuccess);
|
||||
},
|
||||
methods: {
|
||||
onSelectWithdrawType({ type }) {
|
||||
if (!type) return;
|
||||
this.withdrawType = type;
|
||||
this.getWithdrawInfo();
|
||||
},
|
||||
onBindSuccess() {
|
||||
if (this.withdrawType) {
|
||||
this.getWithdrawInfo();
|
||||
}
|
||||
},
|
||||
openWithdrawMethod() {
|
||||
if (!this.ruleInfo) {
|
||||
this.$u.toast('提现规则加载中,请稍候');
|
||||
return;
|
||||
}
|
||||
const methods = Array.isArray(this.ruleInfo.methods) ? this.ruleInfo.methods : [];
|
||||
if (!methods.length) {
|
||||
this.$u.toast('暂无可用的提现方式,请联系客服');
|
||||
return;
|
||||
}
|
||||
this.$Router.push({
|
||||
path: '/pages/user/wallet/withdraw-method',
|
||||
query: { current: this.withdrawType || '' }
|
||||
});
|
||||
},
|
||||
goToBind() {
|
||||
if (!this.withdrawType) {
|
||||
this.$u.toast('请先选择提现方式');
|
||||
return;
|
||||
}
|
||||
this.$Router.push({
|
||||
path: '/pages/user/wallet/bank-bind',
|
||||
query: { type: this.withdrawType }
|
||||
});
|
||||
},
|
||||
goToOnboardBind() {
|
||||
this.$Router.push({ path: '/pages/user/wallet/onboard-bind' });
|
||||
},
|
||||
// 提现检验
|
||||
onWithdrawInput(e) {
|
||||
let sVal = String(e.detail.value);
|
||||
sVal = sVal.replace(/\b(0+)/gi, '');
|
||||
sVal = sVal.replace(/[^\d]/g, '');
|
||||
this.money = sVal;
|
||||
},
|
||||
// 提现
|
||||
withdraw() {
|
||||
const that = this;
|
||||
if (!this.withdrawType) {
|
||||
this.$u.toast('请选择提现方式');
|
||||
return;
|
||||
}
|
||||
if (this.money <= 0) {
|
||||
this.$u.toast('请输入提现金额');
|
||||
return;
|
||||
}
|
||||
that.$http(
|
||||
'money.walletApply', {
|
||||
type: that.withdrawType,
|
||||
money: that.money
|
||||
},
|
||||
'申请中...',
|
||||
false
|
||||
).then(res => {
|
||||
if (res.code === 1) {
|
||||
that.money = '';
|
||||
that.showModal = true;
|
||||
// #ifdef MP-WEIXIN
|
||||
this.$store.commit('subscribeMessage', 'wallet');
|
||||
// #endif
|
||||
that.$store.dispatch('getUserInfo');
|
||||
} else {
|
||||
that.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
loadOnboardBind() {
|
||||
this.$http('money.walletOnboard', {}, '', false).then(res => {
|
||||
if (res.code !== 1) return;
|
||||
const data = res.data || {};
|
||||
this.showOnboardBind = !!data.show;
|
||||
this.huifuStatus = data.huifu_onboard || {};
|
||||
this.canSubmitOnboard = !!data.can_submit_bind;
|
||||
});
|
||||
},
|
||||
// 提现规则
|
||||
getWithdrawRules() {
|
||||
let that = this;
|
||||
that.$http('money.walletRule').then(res => {
|
||||
if (res.code === 1) {
|
||||
that.ruleInfo = res.data;
|
||||
const methods = Array.isArray(that.ruleInfo.methods) ? that.ruleInfo.methods : [];
|
||||
if (!that.withdrawType && methods.length) {
|
||||
that.withdrawType = methods[0];
|
||||
that.getWithdrawInfo();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取提现信息
|
||||
getWithdrawInfo() {
|
||||
let that = this;
|
||||
that.$http(
|
||||
'money.bankInfo', {
|
||||
type: that.withdrawType
|
||||
},
|
||||
'',
|
||||
false
|
||||
).then(res => {
|
||||
that.withdrawInfo = res.code === 1 ? res.data : null;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.head-box {
|
||||
// background: url($IMG_URL+'/imgs/user/draw_money_head_bg.png') no-repeat;
|
||||
background: $brand-primary-gradient;
|
||||
background-size: 100% auto;
|
||||
min-height: 400rpx;
|
||||
padding-bottom: var(--status-bar-height);
|
||||
|
||||
// 可提现
|
||||
.wallet-num-box {
|
||||
padding: 20rpx 40rpx 0;
|
||||
|
||||
.num-title {
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.wallet-num {
|
||||
font-size: 60rpx;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.log-btn {
|
||||
width: 170rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border: 1rpx solid #eeeeee;
|
||||
border-radius: 30rpx;
|
||||
padding: 0;
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 提现输入卡片
|
||||
.draw-card {
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
width: 690rpx;
|
||||
min-height: 530rpx;
|
||||
margin: -70rpx auto 0;
|
||||
padding: 30rpx;
|
||||
|
||||
.onboard-entry {
|
||||
padding: 24rpx;
|
||||
margin-bottom: 30rpx;
|
||||
background: #F5F7FA;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.onboard-entry-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.onboard-entry-desc {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.onboard-status {
|
||||
font-size: 24rpx;
|
||||
margin-right: 8rpx;
|
||||
|
||||
&.is-warn {
|
||||
color: #ff6b00;
|
||||
}
|
||||
|
||||
&.is-pending {
|
||||
color: #1677FF;
|
||||
}
|
||||
}
|
||||
|
||||
.arrow-icon {
|
||||
font-size: 28rpx;
|
||||
color: #C4C4C4;
|
||||
}
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.input-box {
|
||||
width: 624rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
height: 100rpx;
|
||||
margin-bottom: 40rpx;
|
||||
|
||||
.unit {
|
||||
font-size: 48rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.bank-box {
|
||||
min-height: 88rpx;
|
||||
padding: 16rpx 0;
|
||||
|
||||
.name {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.bank-list {
|
||||
.empty-text {
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.sel-box {
|
||||
.item-img {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.arrow-icon {
|
||||
font-size: 28rpx;
|
||||
color: #C4C4C4;
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bank-info {
|
||||
.account-card {
|
||||
background: #F5F7FA;
|
||||
border-radius: 12rpx;
|
||||
padding: 24rpx;
|
||||
min-height: 88rpx;
|
||||
}
|
||||
|
||||
.bank-info-title {
|
||||
flex: 1;
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
line-height: 1.5;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
|
||||
.bind-link {
|
||||
flex-shrink: 0;
|
||||
font-size: 26rpx;
|
||||
color: #1677FF;
|
||||
font-weight: 500;
|
||||
|
||||
.uicon-arrow-right {
|
||||
font-size: 24rpx;
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
width: 616rpx;
|
||||
height: 86rpx;
|
||||
line-height: 86rpx;
|
||||
background: $brand-primary-gradient;
|
||||
box-shadow: 0px 7rpx 11rpx 2rpx rgba(124, 103, 214, 0.34);
|
||||
border-radius: 43rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
// 提现规则 / 温馨提示
|
||||
.draw-notice {
|
||||
width: 684rpx;
|
||||
min-height: 180rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
padding: 30rpx 35rpx;
|
||||
margin: 20rpx auto;
|
||||
|
||||
&.in-card {
|
||||
width: 100%;
|
||||
margin: 0 0 30rpx;
|
||||
padding: 24rpx 0 0;
|
||||
background: transparent;
|
||||
border-top: 1rpx solid #f0f0f0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.rule-row {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 18rpx;
|
||||
line-height: 1.6;
|
||||
|
||||
.rule-label {
|
||||
flex-shrink: 0;
|
||||
width: 168rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.rule-value {
|
||||
flex: 1;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.draw-list {
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
margin-bottom: 10rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
在新工单中引用
屏蔽一个用户