chore(i18n): 清理死代码 + 遗留 lang 文件 + 旧工具
## 删除的死代码脚本
- 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
This commit is contained in:
@@ -1,233 +1,233 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderId: null,
|
||||
orderNo: "",
|
||||
isAnonymous: 1, //是否匿名发布 1.匿名,0.公开
|
||||
|
||||
goodsList: [], //订单列表
|
||||
goodsEvalList: [], //评价列表
|
||||
|
||||
imgList: [],
|
||||
isEvaluate: 0, //判断是否为追评
|
||||
|
||||
flag: false, //防止重复点击 ,
|
||||
evaluateConfig: {
|
||||
evaluate_audit: 1,
|
||||
evaluate_show: 0,
|
||||
evaluate_status: 1
|
||||
},
|
||||
|
||||
isIphoneX: false //判断手机是否是iphoneX以上
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
//接收订单号,订单是否是追评等信息
|
||||
options.order_id ? (this.orderId = options.order_id) : this.$util.redirectTo('/pages_order/list');
|
||||
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||
back: '/pages_tool/order/evaluate?order_id=' + this.orderId
|
||||
}, 'redirectTo');
|
||||
}
|
||||
this.getEvaluateConfig();
|
||||
this.getOrderInfo();
|
||||
},
|
||||
onShow() {
|
||||
//初始化重复点击
|
||||
this.flag = false;
|
||||
},
|
||||
methods: {
|
||||
//获取订单信息
|
||||
getOrderInfo() {
|
||||
//获取订单信息
|
||||
let data = {
|
||||
order_id: this.orderId
|
||||
};
|
||||
this.$api.sendRequest({
|
||||
url: '/api/order/evluateinfo',
|
||||
data: data,
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.isEvaluate = res.data.evaluate_status
|
||||
this.goodsList = res.data.list;
|
||||
if (this.goodsList.length) {
|
||||
this.orderNo = res.data.list[0].order_no;
|
||||
}
|
||||
if (this.isEvaluate) {
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let array = [];
|
||||
this.imgList.push(array)
|
||||
this.goodsEvalList.push({
|
||||
order_goods_id: res.data.list[i].order_goods_id,
|
||||
goods_id: res.data.list[i].goods_id,
|
||||
sku_id: res.data.list[i].sku_id,
|
||||
again_content: "",
|
||||
again_images: ""
|
||||
});
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let array = [];
|
||||
this.imgList.push(array)
|
||||
this.goodsEvalList.push({
|
||||
content: '', // 评价内容
|
||||
images: "", //图片数组
|
||||
scores: 5, // 评分
|
||||
explain_type: 1, // 评价类型
|
||||
order_goods_id: res.data.list[i].order_goods_id,
|
||||
goods_id: res.data.list[i].goods_id,
|
||||
sku_id: res.data.list[i].sku_id,
|
||||
sku_name: res.data.list[i].sku_name,
|
||||
sku_price: res.data.list[i].price,
|
||||
sku_image: res.data.list[i].sku_image
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: "未获取到订单数据"
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list', {}, "redirectTo");
|
||||
}, 1000)
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail() {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
//监听评分变化
|
||||
setStar(e) {
|
||||
this.goodsEvalList[e.index].scores = e.value;
|
||||
if (e.value >= 4) {
|
||||
this.goodsEvalList[e.index].explain_type = 1;
|
||||
} else if (1 < e.value && e.value < 4) {
|
||||
this.goodsEvalList[e.index].explain_type = 2
|
||||
} else {
|
||||
this.goodsEvalList[e.index].explain_type = 3
|
||||
}
|
||||
},
|
||||
//切换,是否匿名
|
||||
isAll() {
|
||||
this.isAnonymous ? this.isAnonymous = 0 : this.isAnonymous = 1
|
||||
},
|
||||
//添加图片
|
||||
addImg(e) {
|
||||
let size = this.imgList[e].length ? this.imgList[e].length : 0
|
||||
this.$util.upload(6 - size, {
|
||||
path: 'evaluateimg'
|
||||
}, res => {
|
||||
let arr = this.imgList[e]
|
||||
arr = arr.concat(res);
|
||||
this.imgList[e] = [];
|
||||
this.$set(this.imgList, e, arr)
|
||||
if (this.isEvaluate) {
|
||||
this.goodsEvalList[e].again_images = this.imgList[e].toString()
|
||||
} else {
|
||||
this.goodsEvalList[e].images = this.imgList[e].toString()
|
||||
}
|
||||
});
|
||||
},
|
||||
//删除图片
|
||||
deleteImg(i, index, j) {
|
||||
this.imgList[index].splice(j, 1);
|
||||
if (this.isEvaluate) {
|
||||
this.goodsEvalList[index].again_images = this.imgList[index].toString()
|
||||
} else {
|
||||
this.goodsEvalList[index].images = this.imgList[index].toString()
|
||||
}
|
||||
},
|
||||
// 图片预览
|
||||
preview(i, j) {
|
||||
let urls = this.imgList[j];
|
||||
for (let k = 0; k < urls.length; k++) {
|
||||
urls[k] = this.$util.img(urls[k])
|
||||
}
|
||||
uni.previewImage({
|
||||
urls: urls,
|
||||
current: i
|
||||
});
|
||||
},
|
||||
|
||||
//提交评价
|
||||
save() {
|
||||
if (this.evaluateConfig.evaluate_status == 0) {
|
||||
this.$util.showToast({
|
||||
title: "商家未开启商品评价功能"
|
||||
});
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < this.goodsEvalList.length; i++) {
|
||||
if (this.isEvaluate) {
|
||||
if (!this.goodsEvalList[i].again_content.trim().length) {
|
||||
this.$util.showToast({
|
||||
title: "商品的评价不能为空哦"
|
||||
});
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!this.goodsEvalList[i].content.trim().length) {
|
||||
this.$util.showToast({
|
||||
title: "商品的评价不能为空哦"
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
let goodsEvaluate = JSON.stringify(this.goodsEvalList)
|
||||
let data = {
|
||||
order_id: this.orderId,
|
||||
goods_evaluate: goodsEvaluate,
|
||||
};
|
||||
if (!this.isEvaluate) {
|
||||
data.order_no = this.orderNo;
|
||||
data.member_name = this.memberInfo.nickname;
|
||||
data.member_headimg = this.memberInfo.headimg;
|
||||
data.is_anonymous = this.isAnonymous;
|
||||
}
|
||||
if (this.flag) return;
|
||||
this.flag = true;
|
||||
this.$api.sendRequest({
|
||||
url: this.isEvaluate ? '/api/goodsevaluate/again' : '/api/goodsevaluate/add',
|
||||
data: data,
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.$util.showToast({
|
||||
title: "评价成功"
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list', {}, "redirectTo");
|
||||
}, 1000);
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
this.flag = false;
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.flag = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
imageError(index) {
|
||||
this.goodsList[index].sku_image = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
getEvaluateConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodsevaluate/config',
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
var data = res.data;
|
||||
this.evaluateConfig = data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderId: null,
|
||||
orderNo: "",
|
||||
isAnonymous: 1, //是否匿名发布 1.匿名,0.公开
|
||||
|
||||
goodsList: [], //订单列表
|
||||
goodsEvalList: [], //评价列表
|
||||
|
||||
imgList: [],
|
||||
isEvaluate: 0, //判断是否为追评
|
||||
|
||||
flag: false, //防止重复点击 ,
|
||||
evaluateConfig: {
|
||||
evaluate_audit: 1,
|
||||
evaluate_show: 0,
|
||||
evaluate_status: 1
|
||||
},
|
||||
|
||||
isIphoneX: false //判断手机是否是iphoneX以上
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
//接收订单号,订单是否是追评等信息
|
||||
options.order_id ? (this.orderId = options.order_id) : this.$util.redirectTo('/pages_order/list');
|
||||
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||
back: '/pages_tool/order/evaluate?order_id=' + this.orderId
|
||||
}, 'redirectTo');
|
||||
}
|
||||
this.getEvaluateConfig();
|
||||
this.getOrderInfo();
|
||||
},
|
||||
onShow() {
|
||||
//初始化重复点击
|
||||
this.flag = false;
|
||||
},
|
||||
methods: {
|
||||
//获取订单信息
|
||||
getOrderInfo() {
|
||||
//获取订单信息
|
||||
let data = {
|
||||
order_id: this.orderId
|
||||
};
|
||||
this.$api.sendRequest({
|
||||
url: '/api/order/evluateinfo',
|
||||
data: data,
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.isEvaluate = res.data.evaluate_status
|
||||
this.goodsList = res.data.list;
|
||||
if (this.goodsList.length) {
|
||||
this.orderNo = res.data.list[0].order_no;
|
||||
}
|
||||
if (this.isEvaluate) {
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let array = [];
|
||||
this.imgList.push(array)
|
||||
this.goodsEvalList.push({
|
||||
order_goods_id: res.data.list[i].order_goods_id,
|
||||
goods_id: res.data.list[i].goods_id,
|
||||
sku_id: res.data.list[i].sku_id,
|
||||
again_content: "",
|
||||
again_images: ""
|
||||
});
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let array = [];
|
||||
this.imgList.push(array)
|
||||
this.goodsEvalList.push({
|
||||
content: '', // 评价内容
|
||||
images: "", //图片数组
|
||||
scores: 5, // 评分
|
||||
explain_type: 1, // 评价类型
|
||||
order_goods_id: res.data.list[i].order_goods_id,
|
||||
goods_id: res.data.list[i].goods_id,
|
||||
sku_id: res.data.list[i].sku_id,
|
||||
sku_name: res.data.list[i].sku_name,
|
||||
sku_price: res.data.list[i].price,
|
||||
sku_image: res.data.list[i].sku_image
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: $lang("tool.order.public.js.evaluate.l90.t0")
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list', {}, "redirectTo");
|
||||
}, 1000)
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail() {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
//监听评分变化
|
||||
setStar(e) {
|
||||
this.goodsEvalList[e.index].scores = e.value;
|
||||
if (e.value >= 4) {
|
||||
this.goodsEvalList[e.index].explain_type = 1;
|
||||
} else if (1 < e.value && e.value < 4) {
|
||||
this.goodsEvalList[e.index].explain_type = 2
|
||||
} else {
|
||||
this.goodsEvalList[e.index].explain_type = 3
|
||||
}
|
||||
},
|
||||
//切换,是否匿名
|
||||
isAll() {
|
||||
this.isAnonymous ? this.isAnonymous = 0 : this.isAnonymous = 1
|
||||
},
|
||||
//添加图片
|
||||
addImg(e) {
|
||||
let size = this.imgList[e].length ? this.imgList[e].length : 0
|
||||
this.$util.upload(6 - size, {
|
||||
path: 'evaluateimg'
|
||||
}, res => {
|
||||
let arr = this.imgList[e]
|
||||
arr = arr.concat(res);
|
||||
this.imgList[e] = [];
|
||||
this.$set(this.imgList, e, arr)
|
||||
if (this.isEvaluate) {
|
||||
this.goodsEvalList[e].again_images = this.imgList[e].toString()
|
||||
} else {
|
||||
this.goodsEvalList[e].images = this.imgList[e].toString()
|
||||
}
|
||||
});
|
||||
},
|
||||
//删除图片
|
||||
deleteImg(i, index, j) {
|
||||
this.imgList[index].splice(j, 1);
|
||||
if (this.isEvaluate) {
|
||||
this.goodsEvalList[index].again_images = this.imgList[index].toString()
|
||||
} else {
|
||||
this.goodsEvalList[index].images = this.imgList[index].toString()
|
||||
}
|
||||
},
|
||||
// 图片预览
|
||||
preview(i, j) {
|
||||
let urls = this.imgList[j];
|
||||
for (let k = 0; k < urls.length; k++) {
|
||||
urls[k] = this.$util.img(urls[k])
|
||||
}
|
||||
uni.previewImage({
|
||||
urls: urls,
|
||||
current: i
|
||||
});
|
||||
},
|
||||
|
||||
//提交评价
|
||||
save() {
|
||||
if (this.evaluateConfig.evaluate_status == 0) {
|
||||
this.$util.showToast({
|
||||
title: $lang("tool.order.public.js.evaluate.l160.t0")
|
||||
});
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < this.goodsEvalList.length; i++) {
|
||||
if (this.isEvaluate) {
|
||||
if (!this.goodsEvalList[i].again_content.trim().length) {
|
||||
this.$util.showToast({
|
||||
title: $lang("tool.order.public.js.evaluate.l168.t0")
|
||||
});
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!this.goodsEvalList[i].content.trim().length) {
|
||||
this.$util.showToast({
|
||||
title: $lang("tool.order.public.js.evaluate.l168.t0")
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
let goodsEvaluate = JSON.stringify(this.goodsEvalList)
|
||||
let data = {
|
||||
order_id: this.orderId,
|
||||
goods_evaluate: goodsEvaluate,
|
||||
};
|
||||
if (!this.isEvaluate) {
|
||||
data.order_no = this.orderNo;
|
||||
data.member_name = this.memberInfo.nickname;
|
||||
data.member_headimg = this.memberInfo.headimg;
|
||||
data.is_anonymous = this.isAnonymous;
|
||||
}
|
||||
if (this.flag) return;
|
||||
this.flag = true;
|
||||
this.$api.sendRequest({
|
||||
url: this.isEvaluate ? '/api/goodsevaluate/again' : '/api/goodsevaluate/add',
|
||||
data: data,
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.$util.showToast({
|
||||
title: $lang("tool.order.public.js.evaluate.l200.t0")
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list', {}, "redirectTo");
|
||||
}, 1000);
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
this.flag = false;
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.flag = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
imageError(index) {
|
||||
this.goodsList[index].sku_image = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
getEvaluateConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodsevaluate/config',
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
var data = res.data;
|
||||
this.evaluateConfig = data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,30 +1,30 @@
|
||||
export default {
|
||||
methods: {
|
||||
/**
|
||||
* 撤销退款申请
|
||||
* @param {Object} order_goods_id
|
||||
* @param {Object} callback
|
||||
*/
|
||||
cancleRefund(order_goods_id, callback) {
|
||||
uni.showModal({
|
||||
content: '撤销之后本次申请将会关闭,如后续仍有问题可再次发起申请。',
|
||||
cancelText: '暂不撤销',
|
||||
cancelColor: '#898989',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/cancel',
|
||||
data: {
|
||||
order_goods_id
|
||||
},
|
||||
success: res => {
|
||||
typeof callback == 'function' && callback(res);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
export default {
|
||||
methods: {
|
||||
/**
|
||||
* 撤销退款申请
|
||||
* @param {Object} order_goods_id
|
||||
* @param {Object} callback
|
||||
*/
|
||||
cancleRefund(order_goods_id, callback) {
|
||||
uni.showModal({
|
||||
content: $lang('order.public.js.refund_method.l10'),
|
||||
cancelText: $lang('order.public.js.refund_method.l11'),
|
||||
cancelColor: '#898989',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/cancel',
|
||||
data: {
|
||||
order_goods_id
|
||||
},
|
||||
success: res => {
|
||||
typeof callback == 'function' && callback(res);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user