添加描述信息
parent
c873061aec
commit
cfdc0ca5c9
|
|
@ -1,13 +1,15 @@
|
|||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 弹窗 -->
|
||||
<component-popup :propShow="popup_status" :propIsBar="propIsBar" propPosition="bottom" @onclose="lang_close_event">
|
||||
<component-popup :propShow="popup_status" propPosition="bottom" @onclose="lang_close_event">
|
||||
<view class="lang-popup-container">
|
||||
<!--弹出框关闭按钮 -->
|
||||
<view class="close oh flex-row">
|
||||
<view class="fr" @tap="lang_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<!--弹出框标题 -->
|
||||
<div class="lang-popup-title">{{ $t('common.multilingual') }}</div>
|
||||
<view class="lang-popup-content">
|
||||
<view v-if="!isEmpty(language_list)" class="nav-data-list">
|
||||
|
|
@ -15,6 +17,7 @@
|
|||
{{ value }}
|
||||
<iconfont v-if="language_key == key" name="icon-checked" size="32rpx"></iconfont>
|
||||
</view>
|
||||
<!-- 确认按钮 -->
|
||||
<view class="margin-top-xxxl">
|
||||
<view class="bottom-line-exclude oh">
|
||||
<button type="default" class="bg-main br-main cr-white round text-size " @tap="popup_sub_language_event">{{ $t('common.confirm') }}</button>
|
||||
|
|
@ -43,17 +46,18 @@
|
|||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
popup_status: false,
|
||||
propIsBar: false,
|
||||
language_list: [],
|
||||
language_key: '',
|
||||
popup_status: false, // 弹出框的开关
|
||||
language_list: [], // 多语言数组
|
||||
language_key: '', // 选中的多语言
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
isEmpty,
|
||||
// 打开弹出框
|
||||
lang_open_event() {
|
||||
// 获取当前的多语言
|
||||
var language_key = app.globalData.get_language_value();
|
||||
console.log(language_key)
|
||||
// 获取多语言数组
|
||||
var language_list = this.$t('language');
|
||||
this.setData({
|
||||
language_list: language_list,
|
||||
|
|
@ -61,21 +65,27 @@
|
|||
popup_status: true,
|
||||
});
|
||||
},
|
||||
// 关闭弹出框
|
||||
lang_close_event() {
|
||||
this.setData({
|
||||
popup_status: false,
|
||||
});
|
||||
},
|
||||
// 弹出框选中数据更新
|
||||
checked_language_event(e) {
|
||||
this.setData({
|
||||
language_key: e.currentTarget.dataset.key,
|
||||
});
|
||||
},
|
||||
// 点击确定按钮执行的操作
|
||||
popup_sub_language_event() {
|
||||
// 多语言切换
|
||||
this.language_change(this.language_key);
|
||||
// 关闭弹出框
|
||||
this.setData({
|
||||
popup_status: false,
|
||||
});
|
||||
// 将当前选中的多语言返回给父级使用
|
||||
var language_list = this.$t('language');
|
||||
this.$emit('popup_sub_language_event', language_list[this.language_key]);
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue