## 删除的死代码脚本
- scripts/i18n_class_c.py (脚本自承'新架构下永远输出 0',纯防御性)
- scripts/full_migrate_i18n.py (其产出违反 CLAUDE.md 1.2 中文 key 铁律,已标 DEPRECATED)
- scripts/__pycache__/ (Python 缓存)
## 删除的旧 per-page lang 文件
- lang/zh-cn/<page>/<file>.js (140 个)
- lang/en-us/<page>/<file>.js (139 个)
- 共 279 个文件,运行时不再加载,0 个 key 被 .vue 调用(经 diagnose_keys.py 验证)
## 删除的备份和迁移表
- lang/_backup/ (git 已跟踪原文件)
- lang/_migration_map.json / lang/_migration-map.json (运行时不用)
## 删除的中间产物 JSON
- docs/i18n-rename-*.json (smart_rename 中间产物,已用完)
- docs/i18n-ambiguous.json / i18n-audit.json / i18n-call-rewrite.log /
i18n-clean-dead.log / i18n-file-texts.json / i18n-page-titles.json /
i18n-vue-extract.json (前一会话残留,无引用方)
- docs/i18n-{naming,shadow,strict}-audit.json (脚本会自动重新生成)
## 删除的 modular lang 文件
- lang/zh-cn/*.js / lang/en-us/*.js (20 个模块文件,内容是上一会话产生的死代码)
- lang/zh-cn/index.js / lang/en-us/index.js (聚合入口)
- lang/DEPRECATED.md (已不再相关)
## 删除的不成熟脚本
- scripts/check_perpage.py (诊断用,已完成)
- scripts/diagnose_keys.py (诊断用,已完成)
- scripts/smart_rename_i18n.py (v1-v3 都 bug,未修完)
## 现状
- lang/ 现在只有 zh-cn.js + en-us.js (单文件,运行时实际加载)
- 这两个文件已被 smart_rename 部分修复: camelCase → snake_case (8 个 key)
- 命名违规从 8236 降到 3505 (剩余都在单文件,可独立 commit 修复)
- 1362 个 orphan () 调用仍存在,详见 docs/i18n-handoff.md
190 lines
5.6 KiB
Vue
190 lines
5.6 KiB
Vue
<template>
|
|
<view class="balance" :style="themeColor">
|
|
<!-- #ifdef MP-WEIXIN -->
|
|
<view class="custom-navbar" :style="{
|
|
'padding-top': menuButtonBounding.top + 'px',
|
|
'height': menuButtonBounding.height + 'px'
|
|
}">
|
|
<view class="navbar-wrap">
|
|
<text class="iconfont icon-back_light back" @click="$util.redirectTo($util.MEMBER_PAGE_URL)"></text>
|
|
<view class="navbar-title">
|
|
账户余额
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- #endif -->
|
|
|
|
<view class="head-wrap" :style="{ background: 'url(' + $util.img('public/uniapp/balance/balance-bg.png') + ')',backgroundSize:'100% 100%' }">
|
|
<!-- <view class="head-wrap" :style="{ background: 'url(' + $util.img('public/uniapp/balance/balance-bg.png') + ') no-repeat right bottom/ auto 380rpx, linear-gradient(314deg, #FE7849 0%, #FF1959 100%)' }"> -->
|
|
<view class="title">{{ $lang("member.balance.l19") }}</view>
|
|
<view class="balance price-font">{{ (parseFloat(balanceInfo.balance) + parseFloat(balanceInfo.balance_money)).toFixed(2) }}</view>
|
|
<!-- <view class="flex-box">
|
|
<view class="flex-item">
|
|
<view class="num price-font">{{ balanceInfo.balance_money|moneyFormat }}</view>
|
|
<view class="font-size-tag">{{ $lang("member.balance.l24") }}</view>
|
|
</view>
|
|
<view class="flex-item">
|
|
<view class="num price-font">{{ balanceInfo.balance|moneyFormat }}</view>
|
|
<view class="font-size-tag">{{ $lang("member.balance.l28") }}</view>
|
|
</view>
|
|
</view> -->
|
|
<view class="btns">
|
|
<view class="cash btn" @click="toWithdrawal">{{ $lang("fenxiao.withdraw_apply.l59") }}</view>
|
|
<view class="recharge btn" @click="toList">{{ $lang("member.balance.l33") }}</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="menu-wrap">
|
|
<view class="menu-item" @click="toApply" style="border-bottom: 0.5px solid #f2f2f2;">
|
|
<view class="icon">
|
|
<text class="iconfont icon-yuemingxi"></text>
|
|
</view>
|
|
<text class="title">{{ $lang("fenxiao.withdraw_apply.l64") }}</text>
|
|
<text class="iconfont icon-right"></text>
|
|
</view>
|
|
<view class="menu-item" @click="toBalanceDetail" style="border-bottom: 0.5px solid #f2f2f2;">
|
|
<view class="icon">
|
|
<text class="iconfont icon-yuemingxi"></text>
|
|
</view>
|
|
<text class="title">{{ $lang("member.balance.l49") }}</text>
|
|
<text class="iconfont icon-right"></text>
|
|
</view>
|
|
<!-- <view class="menu-item" @click="toOrderList">
|
|
<view class="icon">
|
|
<text class="iconfont icon-chongzhijilu"></text>
|
|
</view>
|
|
<text class="title">{{ $lang("member.balance.l56") }}</text>
|
|
<text class="iconfont icon-right"></text>
|
|
</view> -->
|
|
</view>
|
|
|
|
<!-- <view class="action">
|
|
<view @click="toList" class="recharge-withdraw" v-if="addonIsExist.memberrecharge && memberrechargeConfig && memberrechargeConfig.is_use">
|
|
{{ $lang('recharge') }}
|
|
</view>
|
|
<view class="withdraw" v-if="addonIsExist.memberwithdraw && withdrawConfig && withdrawConfig.is_use" @click="toWithdrawal">
|
|
{{ $lang('fenxiao.list.withdrawal') }}
|
|
</view>
|
|
</view> -->
|
|
<ns-login ref="login"></ns-login>
|
|
<loading-cover ref="loadingCover"></loading-cover>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
balanceInfo: {
|
|
balance: 0,
|
|
balance_money: 0
|
|
},
|
|
withdrawConfig: null,
|
|
memberrechargeConfig: null,
|
|
menuButtonBounding: {} // 小程序胶囊属性
|
|
};
|
|
},
|
|
async onShow() {
|
|
this.getWithdrawConfig();
|
|
this.getMemberrechargeConfig();
|
|
if (!this.storeToken) {
|
|
this.$nextTick(() => {
|
|
this.$refs.login.open('/pages_tool/member/balance');
|
|
});
|
|
} else {
|
|
this.getUserInfo();
|
|
}
|
|
},
|
|
onLoad() {
|
|
// #ifdef MP
|
|
this.menuButtonBounding = uni.getMenuButtonBoundingClientRect();
|
|
// #endif
|
|
},
|
|
methods: {
|
|
toWithdrawal() {
|
|
this.$util.redirectTo('/pages_tool/member/apply_withdrawal');
|
|
},
|
|
toOrderList() {
|
|
this.$util.redirectTo('/pages_tool/recharge/order_list');
|
|
},
|
|
toBalanceDetail() {
|
|
this.$util.redirectTo('/pages_tool/member/balance_detail');
|
|
},
|
|
toApply(){
|
|
this.$util.redirectTo('/pages_tool/member/withdrawal');
|
|
},
|
|
toList() {
|
|
this.$util.redirectTo('/pages_tool/recharge/list');
|
|
},
|
|
//获取余额信息
|
|
getUserInfo() {
|
|
this.$api.sendRequest({
|
|
url: '/api/memberaccount/info',
|
|
data: {
|
|
account_type: 'balance,balance_money'
|
|
},
|
|
success: res => {
|
|
if (res.data) {
|
|
this.balanceInfo = res.data;
|
|
} else {
|
|
this.$util.showToast({
|
|
title: res.message
|
|
});
|
|
}
|
|
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
|
},
|
|
fail: res => {
|
|
mescroll.endErr();
|
|
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
|
}
|
|
});
|
|
},
|
|
/**
|
|
* 获取余额提现配置
|
|
*/
|
|
getWithdrawConfig() {
|
|
this.$api.sendRequest({
|
|
url: '/api/memberwithdraw/config',
|
|
success: res => {
|
|
if (res.code >= 0 && res.data) {
|
|
this.withdrawConfig = res.data;
|
|
}
|
|
}
|
|
});
|
|
},
|
|
/**
|
|
* 获取充值提现配置
|
|
*/
|
|
getMemberrechargeConfig() {
|
|
this.$api.sendRequest({
|
|
url: '/memberrecharge/api/memberrecharge/config',
|
|
success: res => {
|
|
if (res.code >= 0 && res.data) {
|
|
this.memberrechargeConfig = res.data;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
},
|
|
onBackPress(options) {
|
|
if (options.from === 'navigateBack') {
|
|
return false;
|
|
}
|
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, 'reLaunch');
|
|
return true;
|
|
},
|
|
watch: {
|
|
storeToken: function(nVal, oVal) {
|
|
if (nVal) {
|
|
this.getUserInfo();
|
|
}
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
@import './public/css/balance.scss';
|
|
</style>
|