feat: 新增多语言国际化页面配置,修复部分页面硬编码文案

1. 新增了zh-cn和en-us两套语言下的大量页面国际化配置文件,覆盖商品、订单、会员、营销活动等多个业务模块
2. 修复了分销页面、VR页面、支付页面、商品不存在页面的硬编码提示文案,替换为国际化调用
3. 删除了原有的i18n检查脚本文件
This commit is contained in:
2026-06-25 11:00:50 +08:00
parent 5f41febd70
commit 8e218bb663
509 changed files with 49155 additions and 55313 deletions

View File

@@ -3,15 +3,15 @@
const GlobalOption = {
down: {
// 其他down的配置参数也可以写,这里只展示了常用的配置:
textInOffset: $lang('common.mescroll.mescroll-uni-option.l6.t0'), // 下拉的距离在offset范围内的提示文本
textOutOffset: $lang('common.mescroll.mescroll-uni-option.l7.t0'), // 下拉的距离大于offset范围的提示文本
textLoading: $lang('common.mescroll.mescroll-uni-option.l8.t0'), // 加载中的提示文本
textInOffset: '下拉刷新', // 下拉的距离在offset范围内的提示文本
textOutOffset: '释放更新', // 下拉的距离大于offset范围的提示文本
textLoading: '加载中 ...', // 加载中的提示文本
offset: 80, // 在列表顶部,下拉大于80px,松手即可触发下拉刷新的回调
native: false // 是否使用系统自带的下拉刷新; 默认false; 仅在mescroll-body生效 (值为true时,还需在pages配置enablePullDownRefresh:true;详请参考mescroll-native的案例)
},
up: {
// 其他up的配置参数也可以写,这里只展示了常用的配置:
textLoading: $lang('common.mescroll.mescroll-uni-option.l8.t0'), // 加载中的提示文本
textLoading: '加载中 ...', // 加载中的提示文本
textNoMore: '', // 没有更多数据的提示文本
// textNoMore: '— 我是有底线的 —', // 没有更多数据的提示文本
offset: 80, // 距底部多远时,触发upCallback
@@ -27,7 +27,7 @@ const GlobalOption = {
empty: {
use: true, // 是否显示空布局
icon: "https://www.mescroll.com/img/mescroll-empty.png?v=1", // 图标路径 (建议放入static目录, 如 /static/img/mescroll-empty.png )
tip: $lang('common.mescroll.mescroll-uni-option.l30.t0') // 提示
tip: '~ 暂无相关数据 ~' // 提示
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,158 +1,158 @@
<template>
<!-- top="xxx"下拉布局往下偏移,防止被悬浮菜单遮住 -->
<!-- 鸿蒙下不要用 v-if="isInit",会导致内层 mescroll 创建被严重延迟,先 onReady 后 inner created -->
<mescroll
:top="top"
:down="downOption"
:fixed="fixed"
:topbar="topbar"
:background="background"
:paddingBoth="paddingBoth"
@down="downCallback"
:up="upOption"
@up="upCallback"
@emptyclick="emptyClick"
@init="mescrollInit"
>
<!-- 数据列表 - 鸿蒙下用 key 强制重建 slot DOM,绕过 ArkUI slot 响应式失效问题 -->
<view :key="listSlotKey">
<slot name="list"></slot>
</view>
</mescroll>
</template>
<script>
import Mescroll from './mescroll-uni.vue';
export default {
components: {
Mescroll
},
data() {
return {
mescroll: null, //mescroll实例对象
downOption: {
auto: false // 不自动加载
},
upOption: {
auto: false, // 不自动加载
page: {
num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
size: 10 // 每页数据的数量
},
noMoreSize: 2, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
empty: {
tip: $lang('common.mescroll.my-list-mescroll.l44.t0'), // 提示
btnText: $lang('common.mescroll.my-list-mescroll.l45.t0')
},
onScroll: true
},
scrollY: 0,
// 鸿蒙下直接初始化为 true,避免 v-if 阻塞子组件创建导致 onReady 先于 inner mounted
isInit: true,
// 鸿蒙下用来强制重建 slot DOM 的 key
listSlotKey: 0
};
},
props: {
top: [String, Number],
size: [String, Number],
fixed: {
// 是否通过fixed固定mescroll的高度, 默认true
type: Boolean,
default() {
return true;
}
},
background: String,
topbar: Boolean,
paddingBoth: {
type: [String, Number],
default() {
return 0;
}
}
},
created() {
if (this.size) this.upOption.page.size = this.size;
// 鸿蒙下 ArkUI 对 slot 内 Vue 响应式更新失效,数据加载后强制重建 slot DOM
// 通过把 listSlotKey 自增,使 :key 变化,触发整个 slot 子树销毁重建
const oldUpCallback = this.upCallback;
this.upCallback = function() {
const ret = oldUpCallback.apply(this, arguments);
// 数据回来后 200ms 自增 key,强制 slot DOM 重建
setTimeout(() => {
this.listSlotKey = (this.listSlotKey || 0) + 1;
}, 200);
return ret;
};
},
mounted() {
// 统一在 watcher 里触发首屏 resetUpScroll,这里不做任何事情
// (H5/微信下 mescroll 已在 mounted 前就绪;鸿蒙下 mounted 时机不可靠,所以都不在这里调)
},
watch: {
// 统一在 mescroll 实例就绪时触发首屏 resetUpScroll
// H5/微信下 inner 的 $emit('init') 同步触发,watcher 在 mounted 之前就 fire,正常加载
// 鸿蒙下 $emit 被延迟到 onReady 之后,watcher 在那时 fire,也能加载
mescroll: {
immediate: false,
handler(newVal) {
if (newVal && typeof newVal.resetUpScroll === 'function') {
// 避免重复触发
if (this._autoLoadTriggered) return;
this._autoLoadTriggered = true;
// 等下一个 tick,确保 outer 已挂载、meScroll 内部 setBodyHeight 等已执行
setTimeout(() => {
if (this.mescroll && typeof this.mescroll.resetUpScroll === 'function') {
this.mescroll.resetUpScroll();
this.listenRefresh();
}
}, 0);
}
}
}
},
methods: {
// mescroll组件初始化的回调,可获取到mescroll对象
mescrollInit(mescroll) {
this.mescroll = mescroll;
},
/*下拉刷新的回调 */
downCallback() {
// 这里加载你想下拉刷新的数据, 比如刷新轮播数据
// loadSwiper();
// 下拉刷新的回调,默认重置上拉加载列表为第一页 (自动执行 mescroll.num=1, 再触发upCallback方法 )
this.mescroll.resetUpScroll();
this.listenRefresh();
},
/*上拉加载的回调: mescroll携带page的参数, 其中num:当前页 从1开始, size:每页数据条数,默认10 */
upCallback() {
//联网加载数据
this.$emit('getData', this.mescroll);
},
//点击空布局按钮的回调
emptyClick() {
this.$emit('emptytap', this.mescroll);
},
//刷新
refresh() {
this.mescroll.resetUpScroll();
this.listenRefresh();
},
myScrollTo(y, t) {
this.mescroll.myScrollTo(y, t);
},
listenRefresh() {
this.$emit('listenRefresh', true);
},
/**
* 主动重建 slot DOM。
* 鸿蒙下通过 :key 变化重建的 .goods-item 元素 @click 事件绑定会丢失,
* 通过自增 listSlotKey 走 slot 重建路径可恢复事件绑定。
*/
forceSlotRebuild() {
this.listSlotKey = (this.listSlotKey || 0) + 1;
}
}
};
</script>
<template>
<!-- top="xxx"下拉布局往下偏移,防止被悬浮菜单遮住 -->
<!-- 鸿蒙下不要用 v-if="isInit",会导致内层 mescroll 创建被严重延迟,先 onReady 后 inner created -->
<mescroll
:top="top"
:down="downOption"
:fixed="fixed"
:topbar="topbar"
:background="background"
:paddingBoth="paddingBoth"
@down="downCallback"
:up="upOption"
@up="upCallback"
@emptyclick="emptyClick"
@init="mescrollInit"
>
<!-- 数据列表 - 鸿蒙下用 key 强制重建 slot DOM,绕过 ArkUI slot 响应式失效问题 -->
<view :key="listSlotKey">
<slot name="list"></slot>
</view>
</mescroll>
</template>
<script>
import Mescroll from './mescroll-uni.vue';
export default {
components: {
Mescroll
},
data() {
return {
mescroll: null, //mescroll实例对象
downOption: {
auto: false // 不自动加载
},
upOption: {
auto: false, // 不自动加载
page: {
num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
size: 10 // 每页数据的数量
},
noMoreSize: 2, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
empty: {
tip: '~ 空空如也 ~', // 提示
btnText: '去看看'
},
onScroll: true
},
scrollY: 0,
// 鸿蒙下直接初始化为 true,避免 v-if 阻塞子组件创建导致 onReady 先于 inner mounted
isInit: true,
// 鸿蒙下用来强制重建 slot DOM 的 key
listSlotKey: 0
};
},
props: {
top: [String, Number],
size: [String, Number],
fixed: {
// 是否通过fixed固定mescroll的高度, 默认true
type: Boolean,
default() {
return true;
}
},
background: String,
topbar: Boolean,
paddingBoth: {
type: [String, Number],
default() {
return 0;
}
}
},
created() {
if (this.size) this.upOption.page.size = this.size;
// 鸿蒙下 ArkUI 对 slot 内 Vue 响应式更新失效,数据加载后强制重建 slot DOM
// 通过把 listSlotKey 自增,使 :key 变化,触发整个 slot 子树销毁重建
const oldUpCallback = this.upCallback;
this.upCallback = function() {
const ret = oldUpCallback.apply(this, arguments);
// 数据回来后 200ms 自增 key,强制 slot DOM 重建
setTimeout(() => {
this.listSlotKey = (this.listSlotKey || 0) + 1;
}, 200);
return ret;
};
},
mounted() {
// 统一在 watcher 里触发首屏 resetUpScroll,这里不做任何事情
// (H5/微信下 mescroll 已在 mounted 前就绪;鸿蒙下 mounted 时机不可靠,所以都不在这里调)
},
watch: {
// 统一在 mescroll 实例就绪时触发首屏 resetUpScroll
// H5/微信下 inner 的 $emit('init') 同步触发,watcher 在 mounted 之前就 fire,正常加载
// 鸿蒙下 $emit 被延迟到 onReady 之后,watcher 在那时 fire,也能加载
mescroll: {
immediate: false,
handler(newVal) {
if (newVal && typeof newVal.resetUpScroll === 'function') {
// 避免重复触发
if (this._autoLoadTriggered) return;
this._autoLoadTriggered = true;
// 等下一个 tick,确保 outer 已挂载、meScroll 内部 setBodyHeight 等已执行
setTimeout(() => {
if (this.mescroll && typeof this.mescroll.resetUpScroll === 'function') {
this.mescroll.resetUpScroll();
this.listenRefresh();
}
}, 0);
}
}
}
},
methods: {
// mescroll组件初始化的回调,可获取到mescroll对象
mescrollInit(mescroll) {
this.mescroll = mescroll;
},
/*下拉刷新的回调 */
downCallback() {
// 这里加载你想下拉刷新的数据, 比如刷新轮播数据
// loadSwiper();
// 下拉刷新的回调,默认重置上拉加载列表为第一页 (自动执行 mescroll.num=1, 再触发upCallback方法 )
this.mescroll.resetUpScroll();
this.listenRefresh();
},
/*上拉加载的回调: mescroll携带page的参数, 其中num:当前页 从1开始, size:每页数据条数,默认10 */
upCallback() {
//联网加载数据
this.$emit('getData', this.mescroll);
},
//点击空布局按钮的回调
emptyClick() {
this.$emit('emptytap', this.mescroll);
},
//刷新
refresh() {
this.mescroll.resetUpScroll();
this.listenRefresh();
},
myScrollTo(y, t) {
this.mescroll.myScrollTo(y, t);
},
listenRefresh() {
this.$emit('listenRefresh', true);
},
/**
* 主动重建 slot DOM。
* 鸿蒙下通过 :key 变化重建的 .goods-item 元素 @click 事件绑定会丢失,
* 通过自增 listSlotKey 走 slot 重建路径可恢复事件绑定。
*/
forceSlotRebuild() {
this.listSlotKey = (this.listSlotKey || 0) + 1;
}
}
};
</script>