1. 新增多语言资源文件,覆盖文章、预约日期、会员信息、优惠券、表单、购物车、积分商城、分销、AI聊天等多个模块 2. 优化底部导航组件,使用多语言配置替代硬编码文案 3. 重构工具函数,新增从后端数据提取多语言文案的工具方法 4. 修复邀请好友页面的保存提示文案,替换为多语言版本 5. 修复商品SKU组件的提示文案,使用多语言配置 6. 重构AI聊天页面的帮助文档和回复模板,使用多语言配置 7. 优化空状态组件,支持多语言默认文案 8. 修复跳转逻辑,补全参数传递 9. 新增本地开发环境配置
112 lines
2.2 KiB
Vue
112 lines
2.2 KiB
Vue
<template>
|
|
<view class="empty" :class="{ fixed: fixed }">
|
|
<view class="empty_img"><image :src="$util.img('public/uniapp/common/common-empty.png')" mode="aspectFit" show-menu-by-longpress></image></view>
|
|
<view class="color-tip margin-top title" :style="{ color: textColor + ' !important' }">{{ displayText }}</view>
|
|
<view class="color-tip margin-bottom font-size-sub">{{ displaySubText }}</view>
|
|
<button type="primary" size="mini" class="button mini" @click="goIndex()" v-if="isIndex">{{ displayBtnText }}</button>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {};
|
|
},
|
|
props: {
|
|
text: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
subText: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
isIndex: {
|
|
type: Boolean,
|
|
default: true
|
|
},
|
|
emptyBtn: {
|
|
type: Object,
|
|
default: () => {
|
|
return { text: '' };
|
|
}
|
|
},
|
|
fixed: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
textColor: {
|
|
type: String,
|
|
default: ''
|
|
}
|
|
},
|
|
computed: {
|
|
// 显示文案:优先用 prop 传入的,没有则用语言包默认值
|
|
displayText() {
|
|
return this.text || this.$lang('common.mescrollEmpty') || '暂无相关数据';
|
|
},
|
|
displaySubText() {
|
|
return this.subText || '';
|
|
},
|
|
displayBtnText() {
|
|
return (this.emptyBtn && this.emptyBtn.text) || this.$lang('toGoodsCategoryPage') || '去逛逛';
|
|
},
|
|
// 建立 componentRefresh 依赖,切语言时自动更新
|
|
_i18nRefresh() {
|
|
return this.componentRefresh;
|
|
}
|
|
},
|
|
methods: {
|
|
goIndex() {
|
|
if (this.emptyBtn.url) {
|
|
this.$util.redirectTo(this.emptyBtn.url, {}, 'redirectTo');
|
|
} else {
|
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
|
}
|
|
},
|
|
re(text) {
|
|
this.text = text;
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.empty {
|
|
width: 100%;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
padding: $padding;
|
|
box-sizing: border-box;
|
|
justify-content: center;
|
|
.title {
|
|
font-size: 30rpx;
|
|
}
|
|
.empty_img {
|
|
width: 50%;
|
|
height: 450rpx;
|
|
|
|
image {
|
|
width: 100%;
|
|
height: 100%;
|
|
padding-bottom: $padding;
|
|
}
|
|
}
|
|
button {
|
|
min-width: 300rpx;
|
|
margin-top: 100rpx;
|
|
height: 70rpx;
|
|
line-height: 70rpx !important;
|
|
font-size: $font-size-base;
|
|
font-weight: bold;
|
|
border-radius: 100rpx;
|
|
}
|
|
}
|
|
.fixed {
|
|
position: fixed;
|
|
left: 0;
|
|
top: 20vh;
|
|
}
|
|
</style>
|