refactor: 替换多页面国际化文本为硬编码中文内容
移除项目内大部分$lang()国际化调用,替换为直接中文文本,统一前端展示文案
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
// 文件分享工具函数
|
||||
import lang from './lang.js';
|
||||
|
||||
export default {
|
||||
/**
|
||||
* 生成文件预览链接
|
||||
@@ -32,7 +30,7 @@ export default {
|
||||
* @param {string} title - 分享标题,默认使用文件名
|
||||
* @param {string} desc - 分享描述,默认使用固定文案
|
||||
*/
|
||||
shareFile(file, title = file.name, desc = lang('share.filePreview') + file.name) {
|
||||
shareFile(file, title = file.name, desc = '查看企业文件:' + file.name) {
|
||||
// 生成文件预览链接
|
||||
const filePreviewUrl = this.generateFilePreviewUrl(file);
|
||||
|
||||
@@ -46,17 +44,17 @@ export default {
|
||||
url: filePreviewUrl
|
||||
}).catch(err => {
|
||||
console.error('分享失败:', err);
|
||||
uni.showToast({ title: lang('share.failed'), icon: 'none' });
|
||||
uni.showToast({ title: '分享失败', icon: 'none' });
|
||||
});
|
||||
} else {
|
||||
// 不支持 Web Share API 的浏览器
|
||||
uni.setClipboardData({
|
||||
data: filePreviewUrl,
|
||||
success: () => {
|
||||
uni.showToast({ title: lang('share.linkCopied'), icon: 'success' });
|
||||
uni.showToast({ title: '链接已复制,请粘贴分享', icon: 'success' });
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({ title: lang('common.copyFailed'), icon: 'none' });
|
||||
uni.showToast({ title: '复制失败', icon: 'none' });
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -65,7 +63,7 @@ export default {
|
||||
// #ifdef MP-WEIXIN
|
||||
// 微信小程序分享
|
||||
uni.showActionSheet({
|
||||
itemList: [lang('share.sendToFriend'), lang('share.sendToMoments')],
|
||||
itemList: ['发送给朋友', '分享到朋友圈'],
|
||||
success: (res) => {
|
||||
if (res.tapIndex === 0) {
|
||||
// 发送给朋友
|
||||
@@ -73,10 +71,10 @@ export default {
|
||||
title: title,
|
||||
path: filePreviewUrl,
|
||||
success: () => {
|
||||
uni.showToast({ title: lang('share.success'), icon: 'success' });
|
||||
uni.showToast({ title: '分享成功', icon: 'success' });
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({ title: lang('share.failed'), icon: 'none' });
|
||||
uni.showToast({ title: '分享失败', icon: 'none' });
|
||||
}
|
||||
});
|
||||
} else if (res.tapIndex === 1) {
|
||||
@@ -85,10 +83,10 @@ export default {
|
||||
title: desc,
|
||||
path: filePreviewUrl,
|
||||
success: () => {
|
||||
uni.showToast({ title: lang('share.success'), icon: 'success' });
|
||||
uni.showToast({ title: '分享成功', icon: 'success' });
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({ title: lang('share.failed'), icon: 'none' });
|
||||
uni.showToast({ title: '分享失败', icon: 'none' });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user