Files
lucky_shop/pages_tool/seal/structure.vue
ZF sun c7810f16f7 feat: 新增多语言文案并修复动态国际化调用问题
1. 新增多语言文件覆盖组件、页面、公共模块的翻译文案
2. 修复多处动态拼接lang key的调用,增加兜底逻辑避免空值或原始key暴露
3. 补全DIY组件、业务页面的国际化适配
4. 新增P2动态key国际化处理方案文档
2026-06-29 15:29:24 +08:00

114 lines
2.7 KiB
Vue

<template>
<view>
<view class="picker-container">
<view v-for="(item, idx) in pickerList" :key="item.id" class="single-picker">
<picker mode="selector" :value="item.value" :range="item.range" range-key="name" @change="bindPickerChange($event, idx, item)">
<view class="picker">{{ $lang('seal.structure.currentChoicePrefix') }}{{item.range[item.value].name || $lang('seal.structure.pleaseSelect')}}</view>
</picker>
</view>
</view>
<block v-if="answerName">
<view style="font-size:32rpx;color:#ff0000;text-align:center;">
<view style="color:#ff0000;">{{ $lang('seal.structure.resultPrefix') }}</view>{{answerName}}
</view>
</block>
<block v-if="files_url">
<view class="pdfcss" style="text-align:center;">
<view @tap="onTapDoc" class="graphic-nav-item">
<view style="display:flex;margin:10rpx;">
<view style="flex:1;">
<image style="width:50rpx;height:50rpx;" :src="g0" mode="widthFix" show-menu-by-longpress></image>
</view>
</view>
<view class="file_title">{{ $lang('seal.structure.resultFile') }}</view>
</view>
</view>
</block>
</view>
</template>
<script>
export default {
data() {
return {
pickerList: [],
answerName: '',
files_url: '',
g0: ''
};
},
computed: {
themeColor() {
return '#ffffff';
}
},
onLoad() {
// 初始化数据
this.files_url = '';
this.g0 = this.files_url ? this.$util.img('addon/personnel/shop/view/enterprise/fileicon.png') : null;
},
methods: {
bindPickerChange(e, idx, item) {
// 处理选择器变化
item.value = e.detail.value;
this.$set(this.pickerList, idx, item);
// 可以在这里添加逻辑,根据选择结果更新 answerName
},
onTapDoc() {
// 处理文档点击事件
if (this.files_url) {
uni.downloadFile({
url: this.files_url,
success: (res) => {
if (res.statusCode === 200) {
uni.openDocument({
filePath: res.tempFilePath,
success: (res) => {
}
});
}
}
});
}
}
}
};
</script>
<style scoped>
.picker-container {
padding: 20rpx;
display: flex;
flex-direction: column;
gap: 30rpx;
}
.single-picker {
display: flex;
align-items: center;
gap: 20rpx;
border: solid 2rpx red;
border-radius: 16rpx;
justify-content: center;
width: 100%;
}
.picker {
flex: 1;
padding: 20rpx;
border-radius: 10rpx;
font-size: 32rpx;
width: 100%;
font-weight: 600;
}
.file_title {
font-size: 28rpx;
color: #666;
}
.graphic-nav-item {
padding: 20rpx;
text-align: center;
}
</style>