## 删除的死代码脚本
- 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
110 lines
4.0 KiB
Vue
110 lines
4.0 KiB
Vue
<template>
|
||
<view :style="themeColor">
|
||
<common-payment :api="api" create-data-key="orderCreateData" ref="payment"></common-payment>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import commonPayment from './_components/common-payment/common-payment.vue';
|
||
|
||
export default {
|
||
components: {
|
||
commonPayment
|
||
},
|
||
data() {
|
||
return {
|
||
api: {
|
||
payment: '/api/ordercreate/payment',
|
||
calculate: '/api/ordercreate/calculate',
|
||
create: '/api/ordercreate/create',
|
||
}
|
||
}
|
||
},
|
||
provide() {
|
||
return {
|
||
promotion: this.promotion.bind(this)
|
||
}
|
||
},
|
||
onShow() {
|
||
if (this.$refs.payment) this.$refs.payment.pageShow();
|
||
},
|
||
methods: {
|
||
/**
|
||
* 处理活动信息 如不需要则定义为空方法
|
||
*/
|
||
promotion(data){
|
||
if (data.promotion && data.promotion.manjian && data.promotion.manjian.length) {
|
||
let promotionStr = {title: $lang(`order.payment.l37.t0`), content: ''}
|
||
data.promotion.manjian.forEach((mItem,mIndex)=>{
|
||
let promotion = '';
|
||
let content = {};
|
||
let limit = mItem.type == 0 ? '元' : $lang('common.ns-goods-sku.ns-goods-sku-index.l150.t0');
|
||
if(mItem.rule){
|
||
var item = mItem.discount_array.rule;
|
||
item.limit = mItem.type == 0 ? parseFloat(item.limit).toFixed(2) : parseInt(item.limit);
|
||
// 满减
|
||
if (item.discount_money != undefined) {
|
||
if (content.manjian == undefined) {
|
||
content.manjian = $lang('order.payment.l48') + item.limit + limit + $lang('common.register-reward.l60.t2') + item.discount_money + $lang('common.register-reward.l45.t0');
|
||
} else {
|
||
content.manjian += $lang('goods.public.js.detail.l379') + item.limit + limit + $lang('common.register-reward.l60.t2') + item.discount_money + $lang('common.register-reward.l45.t0');
|
||
}
|
||
}
|
||
// 满送优惠券
|
||
if (item.coupon && item.coupon_list) {
|
||
let text = '';
|
||
item.coupon_list.forEach((couponItem, couponIndex) => {
|
||
if (couponItem.type == 'discount') {
|
||
if (text == '') text = '送'+ couponItem.give_num +'张' + parseFloat(couponItem.discount) + '折优惠券';
|
||
else text += $lang('goods.public.js.detail.l392')+ couponItem.give_num +$lang('goods.public.js.detail.l392') + parseFloat(couponItem.discount) + $lang('goods.public.js.detail.l392');
|
||
} else {
|
||
if (text == '') text = '送'+ couponItem.give_num +'张' + parseFloat(couponItem.money) + '元优惠券';
|
||
else text += $lang('goods.public.js.detail.l392')+ couponItem.give_num +$lang('goods.public.js.detail.l392') + parseFloat(couponItem.money) + $lang('goods.public.js.detail.l395');
|
||
}
|
||
})
|
||
if (content.mansong == undefined) {
|
||
content.mansong = $lang('order.payment.l66') + item.limit + limit + text;
|
||
} else {
|
||
content.mansong += ';' + $lang('diy.diy-coupon.l32.t0') + item.limit + limit + text;
|
||
}
|
||
}
|
||
// 满送积分
|
||
if (item.point) {
|
||
let point_text = $lang('order.payment.l73') + item.point + $lang('common.register-reward.l19.t0');
|
||
if(content.point_text == undefined) {
|
||
content.point_text = $lang('order.payment.l66') + item.limit + limit + point_text
|
||
}else {
|
||
content.point_text += ';' + $lang('diy.diy-coupon.l32.t0') + item.limit + limit + point_text;
|
||
}
|
||
}
|
||
// 包邮
|
||
if (item.free_shipping != undefined) {
|
||
if (content.free_shipping == undefined) {
|
||
content.free_shipping = $lang('order.payment.l66') + item.limit + limit + $lang('goods.detail.l383');
|
||
}
|
||
}
|
||
}
|
||
promotion = Object.values(content).join('\n');
|
||
promotionStr.content = promotionStr.content + promotion + '\n';
|
||
})
|
||
return (promotionStr.content ? promotionStr : null);
|
||
}
|
||
}
|
||
}
|
||
};
|
||
</script>
|
||
|
||
<style scoped lang="scss">
|
||
::v-deep .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||
background: none;
|
||
max-height: unset !important;
|
||
overflow-y: hidden !important;
|
||
}
|
||
::v-deep .uni-popup__wrapper {
|
||
border-radius: 20rpx 20rpx 0 0;
|
||
}
|
||
::v-deep .uni-popup {
|
||
z-index: 8;
|
||
}
|
||
</style>
|