refactor: 将项目内硬编码文本替换为多语言调用

统一替换所有页面和组件中的硬编码字符串为 $lang 多语言方法调用,提升项目国际化适配能力
This commit is contained in:
2026-06-22 14:04:13 +08:00
parent 46508c7d55
commit 2337e3cacf
38 changed files with 505 additions and 511 deletions

View File

@@ -19,7 +19,7 @@
<view style="padding:20rpx;">
<view style="font-size:36rpx;font-weight:600;">{{item.$orig.title}}</view>
<view>{{item.$orig.desc}}</view>
<view style="font-size:24rpx;color:#888;padding-top:20rpx;">{{"完成时间:" + item.g3}}</view>
<view style="font-size:24rpx;color:#888;padding-top:20rpx;">{{ $lang('cases.completionTime') }}:{{ item.g3 }}</view>
<block v-if="item.$orig.files_url">
<view @tap="toDetail(item.$orig)" class="item">
<view class="article-img">
@@ -28,7 +28,7 @@
<view class="info-wrap">
<view class="title">{{item.$orig.files_title}}</view>
<view class="read-wrap">
<text>查看PDF文件</text>
<text>{{ $lang('cases.viewPdfFile') }}</text>
</view>
</view>
</view>
@@ -44,35 +44,35 @@
<uni-popup ref="informationPopup" class="vue-ref" type="bottom" @change="change">
<view class="liuyan-popup-layer popup-layer">
<view @tap="closeinformationPopup" class="head-wrap">
<text>在线留言</text>
<text>{{ $lang('cases.onlineMessage') }}</text>
<text class="iconfont icon-close"></text>
</view>
<scroll-view class="liuyan-body" scroll-y="true">
<view style="padding:0 30rpx;">
<view class="fui-cell-group">
<view class="fui-cell">
<view class="fui-cell-label">姓名</view>
<view class="fui-cell-label">{{ $lang('form.name') }}</view>
<view class="fui-cell-info">
<input class="fui-input" placeholder="请输入您的姓名" v-model="Form.realname" />
<input class="fui-input" :placeholder="$lang('cases.inputName')" v-model="Form.realname" />
</view>
</view>
<view class="fui-cell">
<view class="fui-cell-label">联系方式</view>
<view class="fui-cell-label">{{ $lang('form.contactInfo') }}</view>
<view class="fui-cell-info">
<input class="fui-input" maxlength="11" placeholder="请输入您的手机号" type="number" v-model="Form.mobile" />
<input class="fui-input" maxlength="11" :placeholder="$lang('cases.inputMobile')" type="number" v-model="Form.mobile" />
</view>
</view>
<view class="fui-cell">
<view class="fui-cell-label" style="position:absolute;top:10px;">留言内容</view>
<view class="fui-cell-label" style="position:absolute;top:10px;">{{ $lang('cases.messageContent') }}</view>
<view class="fui-cell-info" style="margin-left:160rpx;border:solid 2rpx #eee;">
<textarea class="textarea" style="font-size:28rpx;padding:10rpx;" placeholder="请输入留言内容" v-model="Form.remark"></textarea>
<textarea class="textarea" style="font-size:28rpx;padding:10rpx;" :placeholder="$lang('cases.inputMessageContent')" v-model="Form.remark"></textarea>
</view>
</view>
</view>
</view>
</scroll-view>
<view class="button-box">
<button type="primary" @tap="save">提交</button>
<button type="primary" @tap="save">{{ $lang('form.submit') }}</button>
</view>
</view>
</uni-popup>
@@ -140,7 +140,7 @@ export default {
},
toDetail(item) {
const url = item.files_url;
uni.showLoading({ title: "正在加载" });
uni.showLoading({ title: this.$lang('cases.loading') });
try {
uni.downloadFile({
url: url,
@@ -164,7 +164,7 @@ export default {
},
complete: (res) => {
if (res.statusCode === 404) {
uni.showToast({ title: "文件不存在", icon: "none" });
uni.showToast({ title: this.$lang('cases.fileNotExist'), icon: "none" });
}
}
});
@@ -186,7 +186,7 @@ export default {
},
onTapDoc(item) {
const url = this.$util.img(item.files_url);
uni.showLoading({ title: "正在加载" });
uni.showLoading({ title: this.$lang('cases.loading') });
try {
uni.downloadFile({
url: url,
@@ -210,7 +210,7 @@ export default {
},
complete: (res) => {
if (res.statusCode === 404) {
uni.showToast({ title: "文件不存在", icon: "none" });
uni.showToast({ title: this.$lang('cases.fileNotExist'), icon: "none" });
}
}
});
@@ -220,7 +220,7 @@ export default {
},
share(item) {
const url = this.$util.img(item.files_url);
uni.showLoading({ title: "正在加载" });
uni.showLoading({ title: this.$lang('cases.loading') });
try {
uni.downloadFile({
url: url,
@@ -241,7 +241,7 @@ export default {
},
complete: (res) => {
if (res.statusCode === 404) {
uni.showToast({ title: "文件不存在", icon: "none" });
uni.showToast({ title: this.$lang('cases.fileNotExist'), icon: "none" });
}
}
});