## 删除的死代码脚本
- 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
345 lines
9.8 KiB
Vue
345 lines
9.8 KiB
Vue
<template>
|
|
<view class="container" :style="themeColor">
|
|
<template v-if="payInfo.pay_status != undefined">
|
|
<view class="result-box">
|
|
<template v-if="payInfo.pay_status">
|
|
<image :src="$util.img('public/uniapp/pay/pay_success.png')" mode="widthFix" lazy-load="true" class="result-image" show-menu-by-longpress/>
|
|
<view class="msg success">{{ $lang('order.list.payment_success') }}</view>
|
|
<view class="pay-amount">
|
|
<text class="unit price-style small">{{ $lang('common.currency_symbol') }}</text>
|
|
<text class="price-style large">{{ parseFloat(payInfo.pay_money).toFixed(2).split(".")[0] }}</text>
|
|
<text class="price-style small">.{{ parseFloat(payInfo.pay_money).toFixed(2).split(".")[1] }}</text>
|
|
</view>
|
|
</template>
|
|
<template v-else>
|
|
<image :src="$util.img('public/uniapp/pay/pay_fail.png')" mode="widthFix" class="result-image" show-menu-by-longpress/>
|
|
<view class="msg fail">{{ $lang('order.list.payment_fail') }}</view>
|
|
</template>
|
|
|
|
<view class="consume-box" v-if="addonIsExist.memberconsume && consumeStatus == 1 && payInfo.pay_status">
|
|
<view class="consume-head">
|
|
<view class="consume-head-text">{{ $lang("tool.pay.result.l21.t0") }}</view>
|
|
</view>
|
|
<view class="consume-list">
|
|
<view class="consume-item" v-if="consumeInfo.point_num > 0">
|
|
<image :src="$util.img('public/uniapp/pay/point.png')" mode="widthFix" show-menu-by-longpress></image>
|
|
<view class="consume-value color-base-text">{{ consumeInfo.point_num }}</view>
|
|
<view class="consume-type">{{ $lang("common.register-reward.l19.t0") }}</view>
|
|
</view>
|
|
<view class="consume-item" v-if="consumeInfo.growth_num > 0">
|
|
<image :src="$util.img('public/uniapp/pay/growth.png')" mode="widthFix" show-menu-by-longpress></image>
|
|
<view class="consume-value color-base-text">{{ consumeInfo.growth_num }}</view>
|
|
<view class="consume-type">{{ $lang("common.register-reward.l27.t0") }}</view>
|
|
</view>
|
|
<view class="consume-item" v-if="consumeInfo.coupon_list.length > 0">
|
|
<image :src="$util.img('public/uniapp/pay/coupon.png')" mode="widthFix" show-menu-by-longpress></image>
|
|
<view class="consume-value color-base-text">{{ consumeInfo.coupon_list.length }}</view>
|
|
<view class="consume-type">{{ $lang("tool.pay.result.l37.t0") }}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="action">
|
|
<template v-if="storeToken">
|
|
<view v-if="paySource == 'recharge'" class="btn" @click="toRecharge()">{{ $lang("member.balance.l56") }}</view>
|
|
<view v-else-if="paySource == 'membercard'" class="btn" @click="toCard()">{{ $lang("order._components.common-payment.l393.t0") }}</view>
|
|
<view v-else-if="paySource == 'presale'" class="btn" @click="toPresaleOrder()">{{ $lang("tool.pay.result.l46.t0") }}</view>
|
|
<view v-else-if="paySource == 'giftcard'" class="btn" @click="toOrder()">{{ $lang("tool.pay.result.l46.t0") }}</view>
|
|
<view v-else-if="paySource == 'pointexchange'" class="btn" @click="toExchangeOrder()">查看订单
|
|
</view>
|
|
<view v-else class="btn" @click="toOrderDetail(payInfo.order_id)">{{ $lang("tool.pay.result.l46.t0") }}</view>
|
|
</template>
|
|
<view class="btn go-home" @click="goHome()">{{ $lang('common.empty.goHome') }}</view>
|
|
</view>
|
|
</view>
|
|
|
|
<ns-goods-recommend route="pay"></ns-goods-recommend>
|
|
</template>
|
|
<loading-cover ref="loadingCover"></loading-cover>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
payInfo: {},
|
|
outTradeNo: '',
|
|
paySource: '',
|
|
consumeInfo: {},
|
|
consumeStatus: 0,
|
|
};
|
|
},
|
|
onLoad(option) {
|
|
if (option.code) this.outTradeNo = option.code;
|
|
this.paySource = uni.getStorageSync('paySource');
|
|
},
|
|
onShow() {
|
|
this.getPayInfo();
|
|
this.getConsume();
|
|
},
|
|
methods: {
|
|
consume(type) {
|
|
switch (type) {
|
|
case 'point':
|
|
this.$util.redirectTo('/pages_tool/member/point_detail', {});
|
|
break;
|
|
case 'growth':
|
|
this.$util.redirectTo('/pages_tool/member/level', {});
|
|
break;
|
|
case 'coupon':
|
|
this.$util.redirectTo('/pages_tool/member/coupon', {});
|
|
break;
|
|
default:
|
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, 'reLaunch');
|
|
break;
|
|
}
|
|
},
|
|
getConsume() {
|
|
this.$api.sendRequest({
|
|
url: '/memberconsume/api/config/info',
|
|
data: {
|
|
out_trade_no: this.outTradeNo
|
|
},
|
|
success: res => {
|
|
if (res.code >= 0 && res.data) {
|
|
let reward = res.data.value;
|
|
if (res.data.is_use && (reward.point_num > 0 || reward.growth_num > 0 || reward.coupon_list.length)) {
|
|
this.consumeStatus = res.data.is_use;
|
|
this.consumeInfo = res.data.value;
|
|
}
|
|
}
|
|
},
|
|
fail: res => {
|
|
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
|
}
|
|
});
|
|
},
|
|
getPayInfo() {
|
|
this.$api.sendRequest({
|
|
url: '/api/pay/info',
|
|
data: {
|
|
out_trade_no: this.outTradeNo
|
|
},
|
|
success: res => {
|
|
if (res.code >= 0 && res.data) {
|
|
this.payInfo = res.data;
|
|
this.payInfo.pay_money = parseFloat(res.data.pay_money);
|
|
this.payInfo.pay_money += parseFloat(res.data.balance);
|
|
this.payInfo.pay_money += parseFloat(res.data.balance_money);
|
|
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
|
} else {
|
|
this.$util.showToast({
|
|
title: $lang('common.ns-payment.l185.t0')
|
|
});
|
|
setTimeout(() => {
|
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL, {}, 'reLaunch');
|
|
}, 1500);
|
|
}
|
|
},
|
|
fail: res => {
|
|
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
|
}
|
|
});
|
|
},
|
|
goHome() {
|
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL, {}, 'reLaunch');
|
|
},
|
|
toOrderDetail(id) {
|
|
if (this.payInfo.order_type == 2) {
|
|
this.$util.redirectTo('/pages_order/detail_pickup', {
|
|
order_id: id
|
|
}, 'redirectTo');
|
|
} else if (this.payInfo.order_type == 3) {
|
|
this.$util.redirectTo('/pages_order/detail_local_delivery', {
|
|
order_id: id
|
|
}, 'redirectTo');
|
|
} else if (this.payInfo.order_type == 4) {
|
|
this.$util.redirectTo('/pages_tool/order/detail_virtual', {
|
|
order_id: id
|
|
}, 'redirectTo');
|
|
} else {
|
|
this.$util.redirectTo('/pages_order/detail', {
|
|
order_id: id
|
|
}, 'redirectTo');
|
|
}
|
|
},
|
|
toOrder(id) {
|
|
this.$util.redirectTo('/pages_promotion/giftcard/order_list', {}, 'redirectTo');
|
|
uni.setStorageSync('paySource', '');
|
|
},
|
|
toRecharge() {
|
|
this.$util.redirectTo('/pages_tool/recharge/order_list', {}, 'redirectTo');
|
|
uni.setStorageSync('paySource', '');
|
|
},
|
|
toCard() {
|
|
this.$util.redirectTo('/pages_tool/member/card', {}, 'redirectTo');
|
|
uni.setStorageSync('paySource', '');
|
|
},
|
|
toPresaleOrder() {
|
|
this.$util.redirectTo('/pages_promotion/presale/order_list', {}, 'redirectTo');
|
|
uni.setStorageSync('paySource', '');
|
|
},
|
|
toExchangeOrder() {
|
|
this.$util.redirectTo('/pages_promotion/point/order_list', {}, 'redirectTo');
|
|
uni.setStorageSync('paySource', '');
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.consume-box {
|
|
padding: $padding;
|
|
background: #F8F8F8;
|
|
width: calc(100% - 48rpx);
|
|
margin: 0 24rpx 0 24rpx;
|
|
box-sizing: border-box;
|
|
border-radius: 20rpx;
|
|
|
|
.consume-head {
|
|
display: flex;
|
|
justify-content: center;
|
|
font-weight: 500;
|
|
font-size: 26rpx;
|
|
|
|
.consume-head-text {
|
|
line-height: 1;
|
|
}
|
|
}
|
|
|
|
.consume-list {
|
|
display: flex;
|
|
}
|
|
|
|
.consume-item {
|
|
flex: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: $color-title;
|
|
font-size: $font-size-base;
|
|
margin-top: 10rpx;
|
|
|
|
image {
|
|
width: 24rpx;
|
|
margin-right: 4rpx;
|
|
}
|
|
|
|
.consume-value {
|
|
font-size: 26rpx;
|
|
}
|
|
}
|
|
|
|
.consume-remark {
|
|
color: $color-tip;
|
|
font-size: $font-size-tag;
|
|
padding: 10rpx 20rpx;
|
|
}
|
|
}
|
|
|
|
.clear {
|
|
clear: both;
|
|
}
|
|
|
|
.container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
|
|
.result-box {
|
|
padding-top: 94rpx;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
background-color: #FFFFFF;
|
|
width: 100%;
|
|
padding-bottom: 40rpx;
|
|
}
|
|
|
|
.result-image {
|
|
width: 80rpx;
|
|
height: auto;
|
|
will-change: transform;
|
|
}
|
|
|
|
.msg {
|
|
font-size: 32rpx;
|
|
margin-top: 25rpx;
|
|
|
|
&.success {
|
|
color: #09BB07;
|
|
}
|
|
|
|
&.fail {
|
|
// P0: 失败提示色 → var(--base-color)
|
|
// 兼容: 微信小程序 / 鸿蒙元服务 — color 接受 var() 无问题
|
|
color: var(--base-color, #FF4646);
|
|
}
|
|
}
|
|
|
|
.pay-amount {
|
|
font-size: 30rpx;
|
|
margin: 40rpx 0 24rpx 0;
|
|
font-weight: 600;
|
|
line-height: 50rpx;
|
|
|
|
text {
|
|
color: #333333 !important;
|
|
font-weight: bold !important;
|
|
}
|
|
|
|
.unit {
|
|
margin-right: 4rpx;
|
|
}
|
|
|
|
.large {
|
|
font-size: 60rpx !important;
|
|
}
|
|
|
|
.small {
|
|
font-size: 36rpx !important;
|
|
}
|
|
}
|
|
|
|
.action {
|
|
width: 100%;
|
|
height: 80rpx;
|
|
display: flex;
|
|
justify-content: center;
|
|
box-sizing: border-box;
|
|
margin-top: 24rpx;
|
|
|
|
.btn {
|
|
font-size: 30rpx;
|
|
width: 200rpx;
|
|
height: 66rpx;
|
|
line-height: 66rpx;
|
|
text-align: center;
|
|
border-radius: 66rpx;
|
|
border: 1px solid $color-tip;
|
|
box-sizing: border-box;
|
|
|
|
&:last-child {
|
|
margin-left: 40rpx;
|
|
}
|
|
}
|
|
|
|
.go-home {
|
|
background-color: $base-color;
|
|
color: #fff;
|
|
border-color: $base-color;
|
|
}
|
|
}
|
|
}
|
|
|
|
::v-deep .goods-recommend {
|
|
margin-top: 30rpx;
|
|
}
|
|
</style>
|
|
|
|
<style scoped>
|
|
::v-deep .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
|
max-height: unset !important;
|
|
}
|
|
</style> |