feat: add and optimize multilingual text resources
- add new language packs for multiple pages and components including category, cart, order, member center, distribution, etc. - add Chinese and English translations for new features and UI text - fix navigation service error message to use multilingual text - update component templates to use dynamic language translation instead of hardcoded text - adjust code indentation and formatting for consistency
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
</view>
|
||||
<block v-if="g0>0">
|
||||
<view class="foot">
|
||||
<view @tap="generateImage" class="item" style="margin-right:30rpx;">导出图片</view>
|
||||
<view @tap="generatePdf" class="item">导出PDF</view>
|
||||
<view @tap="generateImage" class="item" style="margin-right:30rpx;">{{ $lang('exportImage') }}</view>
|
||||
<view @tap="generatePdf" class="item">{{ $lang('exportPdf') }}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
@@ -26,7 +26,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: "搜索结果",
|
||||
title: "",
|
||||
info: {},
|
||||
list: [],
|
||||
keyword: "",
|
||||
@@ -39,6 +39,7 @@ export default {
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.title = this.$lang('title');
|
||||
if (options.keyword) {
|
||||
this.keyword = options.keyword;
|
||||
}
|
||||
@@ -50,7 +51,7 @@ export default {
|
||||
methods: {
|
||||
generatePdf() {
|
||||
const url = this.$util.img(this.info.files_url);
|
||||
uni.showLoading({ title: '正在加载' });
|
||||
uni.showLoading({ title: this.$lang('loading') });
|
||||
try {
|
||||
uni.downloadFile({
|
||||
url: url,
|
||||
@@ -70,7 +71,7 @@ export default {
|
||||
},
|
||||
complete: (res) => {
|
||||
if (res.statusCode === 404) {
|
||||
uni.showToast({ title: '文件不存在', icon: 'none' });
|
||||
uni.showToast({ title: this.$lang('fileNotExist'), icon: 'none' });
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -80,7 +81,7 @@ export default {
|
||||
},
|
||||
generateImage() {
|
||||
const url = this.$util.img(this.info.img_url);
|
||||
uni.showLoading({ title: '正在加载' });
|
||||
uni.showLoading({ title: this.$lang('loading') });
|
||||
uni.downloadFile({
|
||||
url: url,
|
||||
success: (res) => {
|
||||
@@ -89,21 +90,21 @@ export default {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
this.$util.showToast({ title: '保存成功' });
|
||||
this.$util.showToast({ title: this.$lang('saveSuccess') });
|
||||
},
|
||||
fail: (err) => {
|
||||
if (err.errMsg !== 'saveImageToPhotosAlbum:fail auth deny' && err.errMsg !== 'saveImageToPhotosAlbum:fail:auth denied') {
|
||||
this.$util.showToast({ title: '保存失败,请稍后重试' });
|
||||
this.$util.showToast({ title: this.$lang('saveFailed') });
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({ title: '下载失败' });
|
||||
this.$util.showToast({ title: this.$lang('downloadFailed') });
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.hideLoading();
|
||||
this.$util.showToast({ title: '下载失败' });
|
||||
this.$util.showToast({ title: this.$lang('downloadFailed') });
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -196,4 +197,4 @@ export default {
|
||||
color: #fff;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user