本次提交对全项目的国际化调用进行了规范化重构:
1. 为中文/英文语言包新增了avatar和gender的别名映射,兼容旧有headImg/sex写法
2. 修正了lang.js中的注释路径错误
3. 将所有页面和组件内的$lang调用从短路径改为带业务模块前缀的完整命名空间路径,例如将$lang('title')改为$lang('article.list.title')
4. 优化了i18n-lazy.js的注释说明,补充了正确的key命名格式示例
5. 统一了分销、订单、会员等模块的国际化key层级,确保所有语言调用路径一致
518 lines
14 KiB
Vue
518 lines
14 KiB
Vue
<template>
|
|
<view class="container" :style="themeColor">
|
|
<view class="bank-account-wrap" @click="goAccount()">
|
|
<view class="tx-wrap" v-if="bankAccountInfo.withdraw_type && !isBalance">
|
|
<text class="tx-to">{{ $lang('fenxiao.withdraw_apply.withdrawTo') }}</text>
|
|
<view class="tx-bank" v-if="bankAccountInfo.withdraw_type == 'wechatpay'">{{ $lang('fenxiao.withdraw_apply.wechatDefaultWallet') }}</view>
|
|
<view class="tx-bank" v-else>{{ bankAccountInfo.bank_account }} </view>
|
|
<view class="tx-img" v-if="bankAccountInfo.withdraw_type == 'alipay'">
|
|
<image :src="$util.img('public/uniapp/member/apply_withdrawal/alipay.png')" mode="widthFix" show-menu-by-longpress></image>
|
|
</view>
|
|
<view class="tx-img" v-else-if="bankAccountInfo.withdraw_type == 'bank'">
|
|
<image :src="$util.img('public/uniapp/member/apply_withdrawal/bank.png')" mode="widthFix" show-menu-by-longpress></image>
|
|
</view>
|
|
<view class="tx-img" v-else-if="bankAccountInfo.withdraw_type == 'wechatpay'">
|
|
<image :src="$util.img('public/uniapp/member/apply_withdrawal/wechatpay.png')" mode="widthFix" show-menu-by-longpress>
|
|
</image>
|
|
</view>
|
|
</view>
|
|
<text class="tx-to" v-else-if="!isBalance">{{ $lang('fenxiao.withdraw_apply.pleaseAddWithdrawAccount') }}</text>
|
|
<view class="tx-wrap" v-else="isBalance">
|
|
<text class="tx-to">{{ $lang('fenxiao.withdraw_apply.withdrawTo') }}</text>
|
|
<view class="tx-bank">{{ $lang('fenxiao.withdraw_apply.balance') }}</view>
|
|
<view class="tx-img">
|
|
<image :src="$util.img('public/uniapp/member/apply_withdrawal/tixian.png')" mode="widthFix" show-menu-by-longpress></image>
|
|
</view>
|
|
</view>
|
|
<view class="iconfont icon-right"></view>
|
|
</view>
|
|
<view class="empty-box"></view>
|
|
<view class="withdraw-wrap">
|
|
<view class="withdraw-wrap-title">{{ $lang('fenxiao.withdraw_apply.withdrawAmountLabel') }}</view>
|
|
<view class="money-wrap">
|
|
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
|
|
<input type="digit" class="withdraw-money" v-model="withdrawMoney" />
|
|
<view class="delete" @click="remove" v-if="withdrawMoney">
|
|
<image :src="$util.img('public/uniapp/member/apply_withdrawal/close.png')" mode="widthFix" show-menu-by-longpress></image>
|
|
</view>
|
|
</view>
|
|
<view class="bottom">
|
|
<view>
|
|
<text class="color-tip">{{ $lang('fenxiao.withdraw_apply.withdrawableAmountLabel') }}{{ $lang('common.currencySymbol') }}{{ withdrawInfo.account | moneyFormat }}</text>
|
|
<text class="all-tx color-base-text" @click="allTx">{{ $lang('fenxiao.withdraw_apply.withdrawAll') }}</text>
|
|
</view>
|
|
</view>
|
|
<view class="desc">
|
|
<text v-if="withdrawConfigInfo.withdraw > 0">{{ $lang('fenxiao.withdraw_apply.minWithdrawAmountTip', { symbol: $lang('common.currencySymbol'), min: withdrawConfigInfo.withdraw | moneyFormat }) }}</text>
|
|
<text v-if="withdrawConfigInfo.max > 0">{{ $lang('fenxiao.withdraw_apply.maxWithdrawAmountTip', { symbol: $lang('common.currencySymbol'), max: (withdrawConfigInfo.max > withdrawInfo.account ? withdrawInfo.account : withdrawConfigInfo.max) | moneyFormat }) }}</text>
|
|
<text>{{ $lang('fenxiao.withdraw_apply.serviceFeeTip', { rate: withdrawConfigInfo.withdraw_rate + '%' }) }}</text>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- <view class="btn color-base-border ns-gradient-otherpages-member-widthdrawal-withdrawal" :class="{ disabled: withdrawMoney == '' || withdrawMoney == 0 }" @click="withdraw">
|
|
提现
|
|
</view> -->
|
|
|
|
|
|
<view class="grace-page-footer page-btm" style="z-index: 999999; background: rgb(255, 255, 255); padding-bottom: 0px;" @click="withdraw">
|
|
<view data-v-800ec5da="" class="collectionBorder">
|
|
<button data-v-800ec5da="" class="renren-btn do false middle">{{ $lang('fenxiao.withdraw_apply.withdrawBtn') }}</button>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- <view class="recoend" @click="toWithdrawal">
|
|
<view class="recoend-con">提现记录</view>
|
|
</view> -->
|
|
<loading-cover ref="loadingCover"></loading-cover>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
withdrawInfo: {},
|
|
withdrawConfigInfo: {},
|
|
bankAccountInfo: {},
|
|
withdrawMoney: '',
|
|
isSub: false,
|
|
isBalance: 0,
|
|
payList: null
|
|
};
|
|
},
|
|
onLoad(option) {
|
|
if (option.is_balance) this.isBalance = option.is_balance;
|
|
},
|
|
onShow() {
|
|
if (this.storeToken) {
|
|
this.getTransferType();
|
|
this.getWithdrawConfigInfo();
|
|
this.getBankAccountInfo();
|
|
this.getWithdrawInfo();
|
|
} else {
|
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
|
back: '/pages_promotion/fenxiao/withdraw_apply'
|
|
});
|
|
}
|
|
},
|
|
methods: {
|
|
toWithdrawal() {
|
|
this.$util.redirectTo('/pages_promotion/fenxiao/withdraw_list');
|
|
},
|
|
//全部提现
|
|
allTx() {
|
|
this.withdrawMoney = this.withdrawInfo.account;
|
|
},
|
|
// 删除提现金额
|
|
remove() {
|
|
this.withdrawMoney = '';
|
|
},
|
|
/**
|
|
* 获取提现信息
|
|
*/
|
|
getWithdrawInfo() {
|
|
this.$api.sendRequest({
|
|
url: '/fenxiao/api/fenxiao/detail',
|
|
success: res => {
|
|
if (res.code >= 0 && res.data) {
|
|
this.withdrawInfo = res.data;
|
|
}
|
|
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
|
},
|
|
fail: res => {
|
|
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
|
}
|
|
});
|
|
},
|
|
|
|
/**
|
|
* 获取提现配置信息
|
|
*/
|
|
getWithdrawConfigInfo() {
|
|
this.$api.sendRequest({
|
|
url: '/fenxiao/api/config/withdraw',
|
|
success: res => {
|
|
if (res.code >= 0 && res.data) {
|
|
this.withdrawConfigInfo = res.data;
|
|
}
|
|
},
|
|
fail: res => {
|
|
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
|
}
|
|
});
|
|
},
|
|
/**
|
|
* 银行账号信息
|
|
*/
|
|
getBankAccountInfo() {
|
|
this.$api.sendRequest({
|
|
url: '/api/memberbankaccount/defaultinfo',
|
|
success: res => {
|
|
|
|
if (res.code >= 0) {
|
|
if (res.data)
|
|
this.bankAccountInfo = res.data;
|
|
else if (this.payList && this.payList.balance) {
|
|
// 如果信息为空,将默认为余额
|
|
this.isBalance = 1;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
},
|
|
// 获取提现方式
|
|
getTransferType() {
|
|
this.payList = null;
|
|
this.$api.sendRequest({
|
|
url: "/fenxiao/api/withdraw/transferType",
|
|
success: res => {
|
|
if (res.code >= 0 && res.data) {
|
|
this.payList = res.data;
|
|
}
|
|
}
|
|
});
|
|
},
|
|
verify() {
|
|
if (this.withdrawMoney == '' || this.withdrawMoney < 0 || isNaN(parseFloat(this.withdrawMoney))) {
|
|
this.$util.showToast({
|
|
title: this.$lang('fenxiao.withdraw_apply.pleaseEnterWithdrawAmount')
|
|
});
|
|
return false;
|
|
}
|
|
|
|
let money = this.withdrawInfo.account;
|
|
if (this.withdrawConfigInfo.max > 0 && this.withdrawInfo.account > this.withdrawConfigInfo.max) {
|
|
money = this.withdrawConfigInfo.max;
|
|
}
|
|
if (parseFloat(this.withdrawMoney) > 0 && (parseFloat(this.withdrawMoney) > parseFloat(money))) {
|
|
this.$util.showToast({
|
|
title: this.$lang('fenxiao.withdraw_apply.withdrawAmountExceeds')
|
|
});
|
|
return false;
|
|
}
|
|
if (parseFloat(this.withdrawMoney) > 0 && (parseFloat(this.withdrawMoney) < parseFloat(this
|
|
.withdrawConfigInfo.withdraw))) {
|
|
this.$util.showToast({
|
|
title: this.$lang('fenxiao.withdraw_apply.withdrawAmountBelowMin')
|
|
});
|
|
return false;
|
|
}
|
|
return true;
|
|
},
|
|
withdraw() {
|
|
if (!this.bankAccountInfo.withdraw_type && !this.isBalance) {
|
|
this.$util.showToast({
|
|
title: this.$lang('fenxiao.withdraw_apply.pleaseAddWithdrawMethod')
|
|
});
|
|
return;
|
|
}
|
|
if (this.verify()) {
|
|
if (this.isSub) return;
|
|
this.isSub = true;
|
|
|
|
var applet_type = 0;
|
|
if (this.bankAccountInfo.withdraw_type == 'wechatpay') {
|
|
// #ifdef MP
|
|
applet_type = 1;
|
|
// #endif
|
|
}
|
|
|
|
let withdrawType = this.isBalance ? 'balance' : this.bankAccountInfo.withdraw_type;
|
|
let branchBankName = this.isBalance ? "余额" : this.bankAccountInfo.branch_bank_name;
|
|
// #ifdef MP-WEIXIN
|
|
// this.subscribeMessage(() => {
|
|
this.$api.sendRequest({
|
|
url: '/fenxiao/api/withdraw/apply',
|
|
data: {
|
|
apply_money: this.withdrawMoney,
|
|
transfer_type: withdrawType, //转账提现类型
|
|
realname: this.bankAccountInfo.realname,
|
|
mobile: this.bankAccountInfo.mobile,
|
|
bank_name: branchBankName,
|
|
account_number: this.bankAccountInfo.bank_account,
|
|
applet_type: applet_type
|
|
},
|
|
success: res => {
|
|
if (res.code >= 0) {
|
|
this.$util.showToast({
|
|
title: this.$lang('fenxiao.withdraw_apply.withdrawApplySuccess')
|
|
});
|
|
setTimeout(() => {
|
|
this.$util.redirectTo('/pages_promotion/fenxiao/withdraw_list', {},
|
|
'redirectTo');
|
|
}, 1500);
|
|
} else {
|
|
this.isSub = false;
|
|
this.$util.showToast({
|
|
title: res.message
|
|
});
|
|
}
|
|
},
|
|
fail: res => {
|
|
this.isSub = false;
|
|
}
|
|
});
|
|
// });
|
|
// #endif
|
|
|
|
// #ifndef MP-WEIXIN
|
|
this.$api.sendRequest({
|
|
url: '/fenxiao/api/withdraw/apply',
|
|
data: {
|
|
apply_money: this.withdrawMoney,
|
|
transfer_type: withdrawType, //转账提现类型
|
|
realname: this.bankAccountInfo.realname,
|
|
mobile: this.bankAccountInfo.mobile,
|
|
bank_name: branchBankName,
|
|
account_number: this.bankAccountInfo.bank_account,
|
|
applet_type: applet_type
|
|
},
|
|
success: res => {
|
|
if (res.code >= 0) {
|
|
this.$util.showToast({
|
|
title: this.$lang('fenxiao.withdraw_apply.withdrawApplySuccess')
|
|
});
|
|
setTimeout(() => {
|
|
this.$util.redirectTo('/pages_promotion/fenxiao/withdraw_list', {},
|
|
'redirectTo');
|
|
}, 1500);
|
|
} else {
|
|
this.isSub = false;
|
|
this.$util.showToast({
|
|
title: res.message
|
|
});
|
|
}
|
|
},
|
|
fail: res => {
|
|
this.isSub = false;
|
|
}
|
|
});
|
|
// #endif
|
|
}
|
|
},
|
|
goAccount() {
|
|
this.$util.redirectTo(
|
|
'/pages_tool/member/account', {
|
|
back: '/pages_promotion/fenxiao/withdraw_apply',
|
|
type: 'fenxiao'
|
|
},
|
|
'redirectTo'
|
|
);
|
|
},
|
|
/**
|
|
* 微信订阅消息
|
|
*/
|
|
subscribeMessage(callback) {
|
|
this.$api.sendRequest({
|
|
url: '/weapp/api/weapp/messagetmplids',
|
|
data: {
|
|
keywords: 'USER_WITHDRAWAL_SUCCESS'
|
|
},
|
|
success: res => {
|
|
if (res.code == 0 && res.data.length) {
|
|
uni.requestSubscribeMessage({
|
|
tmplIds: res.data,
|
|
fail: res => {
|
|
},
|
|
complete: () => {
|
|
callback();
|
|
}
|
|
});
|
|
} else {
|
|
callback();
|
|
}
|
|
},
|
|
fail: res => {
|
|
callback();
|
|
}
|
|
});
|
|
}
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.grace-page-footer{
|
|
width: 100%;
|
|
position: fixed;
|
|
left: 0;
|
|
bottom: 0;
|
|
z-index: 99 !important;
|
|
}
|
|
.collectionBorder{
|
|
border-top: 2rpx solid #e6e7eb;
|
|
padding: 14rpx 24rpx;
|
|
background: #fff;
|
|
position: relative;
|
|
}
|
|
.renren-btn {
|
|
height: 68px;
|
|
line-height: 68px;
|
|
line-height: 62px;
|
|
border-radius: 34px !important;
|
|
border-radius: 128px;
|
|
// P0: 提现按钮默认底色 → var(--fenxiao-withdraw-start)
|
|
// 兼容: 微信小程序 / 鸿蒙元服务 — background 接受 var() 无问题
|
|
background: var(--fenxiao-withdraw-start, #ff3c29);
|
|
color: #fff;
|
|
font-size: 32px;
|
|
font-weight: 400;
|
|
width: 100%;
|
|
border: 0;
|
|
}
|
|
.renren-btn.do {
|
|
// P0: 分销提现按钮渐变 → var(--fenxiao-withdraw-start/end)
|
|
// 兼容: 微信小程序 / 鸿蒙元服务 — -webkit-linear-gradient 嵌套 var() 现代 runtime 支持
|
|
background: #ff3c29; // 兜底
|
|
background: -webkit-linear-gradient(317.43deg, var(--fenxiao-withdraw-start, #ff3c29), var(--fenxiao-withdraw-end, #ff6f29) 94.38%);
|
|
background: linear-gradient(132.57deg, var(--fenxiao-withdraw-start, #ff3c29), var(--fenxiao-withdraw-end, #ff6f29) 94.38%);
|
|
font-size: 28rpx;
|
|
font-weight: 500;
|
|
}
|
|
.renren-btn.middle {
|
|
height: 76rpx;
|
|
line-height: 76rpx;
|
|
border-radius: 38rpx !important;
|
|
font-size: 28rpx !important;
|
|
font-weight: 500 !important;
|
|
margin: 0;
|
|
}
|
|
|
|
|
|
.container {
|
|
width: 100vw;
|
|
height: 100vh;
|
|
background: #fff;
|
|
}
|
|
|
|
.empty-box {
|
|
height: 20rpx;
|
|
}
|
|
|
|
.bank-account-wrap {
|
|
margin: 0 20rpx;
|
|
padding: 20rpx 30rpx;
|
|
border-bottom: 2rpx solid #f7f7f7;
|
|
position: relative;
|
|
|
|
.tx-wrap {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
margin-right: 60rpx;
|
|
|
|
.tx-bank {
|
|
margin-right: 60rpx;
|
|
flex: 1;
|
|
margin-left: 10rpx;
|
|
text-align: right;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.tx-img {
|
|
position: absolute;
|
|
right: 100rpx;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
width: 40rpx;
|
|
height: 40rpx;
|
|
|
|
image {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
}
|
|
|
|
.iconfont {
|
|
position: absolute;
|
|
right: 40rpx;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
}
|
|
}
|
|
|
|
.withdraw-wrap {
|
|
margin: 0 20rpx;
|
|
padding: 30rpx;
|
|
border-radius: 16rpx;
|
|
box-shadow: rgba(110, 110, 110, 0.09) 0 0 20rpx 0;
|
|
|
|
.money-wrap {
|
|
padding: 20rpx 0;
|
|
border-bottom: 2rpx solid #eee;
|
|
display: flex;
|
|
align-items: baseline;
|
|
|
|
.unit {
|
|
font-size: 60rpx;
|
|
line-height: 1.3;
|
|
}
|
|
|
|
.withdraw-money {
|
|
height: 70rpx;
|
|
line-height: 70rpx;
|
|
min-height: 70rpx;
|
|
padding-left: 20rpx;
|
|
font-size: 60rpx;
|
|
flex: 1;
|
|
font-weight: bolder;
|
|
}
|
|
|
|
.delete {
|
|
width: 40rpx;
|
|
height: 40rpx;
|
|
|
|
image {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
}
|
|
|
|
.bottom {
|
|
display: flex;
|
|
padding-top: 20rpx;
|
|
|
|
text {
|
|
line-height: 1;
|
|
flex: 2;
|
|
}
|
|
|
|
.all-tx {
|
|
padding-left: 10rpx;
|
|
}
|
|
}
|
|
}
|
|
|
|
.btn {
|
|
margin: 0 30rpx;
|
|
margin-top: 60rpx;
|
|
height: 80rpx;
|
|
line-height: 80rpx;
|
|
border-radius: $border-radius;
|
|
color: #fff;
|
|
text-align: center;
|
|
background-color: var(--main-color);
|
|
|
|
&.disabled {
|
|
background: #ccc;
|
|
border-color: #ccc;
|
|
color: #fff;
|
|
}
|
|
}
|
|
|
|
.recoend {
|
|
margin-top: 40rpx;
|
|
|
|
.recoend-con {
|
|
text-align: center;
|
|
}
|
|
}
|
|
|
|
.desc {
|
|
font-size: $font-size-tag;
|
|
color: #999;
|
|
}
|
|
</style> |