修改多语言显示问题
parent
b26a90c338
commit
701263e0dd
16
App.vue
16
App.vue
|
|
@ -239,6 +239,7 @@
|
|||
// 其他数据
|
||||
// 公共数是否已初始化成功
|
||||
common_data_loading_status: 0,
|
||||
common_data_init_config_back_list: [],
|
||||
common_data_init_status: 0,
|
||||
common_data_init_back_timer: null,
|
||||
// 网络状态检查
|
||||
|
|
@ -1498,6 +1499,9 @@
|
|||
*/
|
||||
init_config(num = 0, object, method, params) {
|
||||
var self = this;
|
||||
if (num == 0) {
|
||||
self.data.common_data_init_config_back_list.push({ object: object, method: method, params: params})
|
||||
}
|
||||
uni.getNetworkType({
|
||||
success: function (res) {
|
||||
if (res.networkType != 'none') {
|
||||
|
|
@ -1507,7 +1511,6 @@
|
|||
// 公共配置初始化返回处理
|
||||
self.init_config_result_handle(config, self);
|
||||
}
|
||||
|
||||
// 读取远程配置
|
||||
if(self.data.common_data_loading_status == 0) {
|
||||
// 赋值在加载状态
|
||||
|
|
@ -1529,10 +1532,14 @@
|
|||
|
||||
// 公共配置初始化返回处理
|
||||
self.init_config_result_handle(data, self);
|
||||
|
||||
// 回调
|
||||
if (typeof object === 'object' && (method || null) != null) {
|
||||
object[method](params);
|
||||
if (self.data.common_data_init_config_back_list.length > 0) {
|
||||
self.data.common_data_init_config_back_list.forEach(item => {
|
||||
if (typeof item.object === 'object' && (item.method || null) != null) {
|
||||
item.object[item.method](item.params);
|
||||
}
|
||||
})
|
||||
self.data.common_data_init_config_back_list = [];
|
||||
}
|
||||
} else {
|
||||
self.showToast(res.data.msg);
|
||||
|
|
@ -1540,7 +1547,6 @@
|
|||
if (res.data.code == -10000) {
|
||||
self.data.common_data_init_status = 1;
|
||||
}
|
||||
|
||||
// 首次则再次初始化配置、站点关闭状态则不处理
|
||||
if (parseInt(num || 0) <= 20 && self.data.common_data_init_status == 0) {
|
||||
self.init_config(num+1, object, method, params);
|
||||
|
|
|
|||
|
|
@ -250,6 +250,9 @@ button:before {
|
|||
.z-i-deep {
|
||||
z-index: 2 !important;
|
||||
}
|
||||
.z-i-deep-middle {
|
||||
z-index: 100 !important;
|
||||
}
|
||||
.z-i-deep-must {
|
||||
z-index: 999 !important;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@
|
|||
"verification_mobile_message": "Please enter the verification code or mobile number",
|
||||
"unique_message": "The unique identifier is empty",
|
||||
"not_supported_scan_tips": "H5 webpage does not support scanning codes",
|
||||
"copy_link": "Copy link"
|
||||
"copy_link": "Copy link",
|
||||
"multilingual": "multilingual"
|
||||
},
|
||||
"client": {
|
||||
"weixin": "WeChat",
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@
|
|||
"verification_mobile_message": "请输入核销码或手机",
|
||||
"unique_message": "唯一标识为空",
|
||||
"not_supported_scan_tips": "H5网页不支持扫码",
|
||||
"copy_link": "复制链接"
|
||||
"copy_link": "复制链接",
|
||||
"multilingual": "多语言"
|
||||
},
|
||||
"client": {
|
||||
"weixin": "微信",
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
<component-diy-activity v-else-if="item.key == 'activity'" :ref="'diy_goods_buy' + index" :propDiyIndex="index" :propIndex="get_prop_index(item)" :propKey="item.id + index" :propValue="item.com_data" @goods_buy_event="goods_buy_event"></component-diy-activity>
|
||||
<component-diy-salerecords v-else-if="item.key == 'salerecords'" :propIndex="get_prop_index(item)" :propKey="item.id + index" :propValue="item.com_data"></component-diy-salerecords>
|
||||
<!-- 工具组件 -->
|
||||
<component-diy-float-window v-else-if="item.key == 'float-window'" :propKey="item.id + index" :propValue="item.com_data"></component-diy-float-window>
|
||||
<component-diy-float-window v-else-if="item.key == 'float-window'" :propKey="item.id + index" :propValue="item.com_data" @btn_event="btn_event"></component-diy-float-window>
|
||||
<component-diy-title v-else-if="item.key == 'title'" :propKey="item.id + index" :propIndex="get_prop_index(item)" :propValue="item.com_data"></component-diy-title>
|
||||
<component-diy-auxiliary-line v-else-if="item.key == 'row-line'" :propIndex="get_prop_index(item)" :propKey="item.id + index" :propValue="item.com_data"></component-diy-auxiliary-line>
|
||||
<component-diy-rich-text v-else-if="item.key == 'rich-text'" :propIndex="get_prop_index(item)" :propKey="item.id + index" :propValue="item.com_data"></component-diy-rich-text>
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
<slot name="diy-bottom-common"></slot>
|
||||
</template>
|
||||
|
||||
<view class="z-i-deep">
|
||||
<view class="z-i-deep-middle">
|
||||
<!-- 商品购买 -->
|
||||
<component-goods-buy ref="goods_buy" v-on:CartSuccessEvent="goods_cart_back_event"></component-goods-buy>
|
||||
<!-- 视频播放 -->
|
||||
|
|
@ -87,6 +87,10 @@
|
|||
<iconfont name="icon-qiandao-tancguanbi" size="56rpx" color="#ccc" propContainerDisplay="flex" @tap="video_close"></iconfont>
|
||||
</view>
|
||||
</uni-popup>
|
||||
<!-- 快捷导航 -->
|
||||
<component-quick-nav ref="quick_nav" :propIsBtn="false"></component-quick-nav>
|
||||
<!-- 语言选择 -->
|
||||
<component-lang-switch ref="lang_switch" @popup_sub_language_event="popup_sub_language_event"></component-lang-switch>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -95,7 +99,6 @@
|
|||
<component-diy-footer :propKey="footer_data.id" :propValue="footer_data.com_data" @onFooterHeight="footer_height_value_event"></component-diy-footer>
|
||||
<view v-if="footer_height_value > 0" :style="'height:' + footer_height_value + 'rpx;'"></view>
|
||||
</block>
|
||||
|
||||
<!-- 底部卡槽 -->
|
||||
<slot name="bottom"></slot>
|
||||
</scroll-view>
|
||||
|
|
@ -146,7 +149,8 @@
|
|||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
import componentGoodsBuy from '@/components/goods-buy/goods-buy';
|
||||
import componentSearch from '@/components/search/search';
|
||||
|
||||
import componentQuickNav from '@/components/quick-nav/quick-nav';
|
||||
import componentLangSwitch from '@/components/lang-switch/lang-switch';
|
||||
var system = app.globalData.get_system_info(null, null, true);
|
||||
var sys_width = app.globalData.window_width_handle(system.windowWidth);
|
||||
|
||||
|
|
@ -212,6 +216,8 @@
|
|||
componentBottomLine,
|
||||
componentGoodsBuy,
|
||||
componentSearch,
|
||||
componentLangSwitch,
|
||||
componentQuickNav
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -801,6 +807,26 @@
|
|||
this.tabs_click_event(this.tabs_id, this.is_tabs_type);
|
||||
}
|
||||
},
|
||||
btn_event(name) {
|
||||
switch(name) {
|
||||
case 'quick_nav' :
|
||||
if ((this.$refs.quick_nav || null) != null) {
|
||||
this.$refs.quick_nav.quick_open_event();
|
||||
}
|
||||
break;
|
||||
case 'lang' :
|
||||
if ((this.$refs.lang_switch || null) != null) {
|
||||
this.$refs.lang_switch.lang_open_event();
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
popup_sub_language_event(e) {
|
||||
// 重新设置当前页面导航标题
|
||||
app.globalData.set_pages_navigation_bar_title();
|
||||
// 重新读取数据配置
|
||||
app.globalData.init_config();
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -98,9 +98,10 @@
|
|||
break;
|
||||
// 快捷导航
|
||||
case 'quick_nav' :
|
||||
if ((this.$refs.quick_nav || null) != null) {
|
||||
this.$refs.quick_nav.quick_open_event();
|
||||
}
|
||||
this.$emit('btn_event', 'quick_nav');
|
||||
break;
|
||||
case 'lang' :
|
||||
this.$emit('btn_event', 'lang');
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -362,22 +362,7 @@
|
|||
</component-popup>
|
||||
|
||||
<!-- 打开语言选择弹层-->
|
||||
<component-popup :propShow="popup_language_status" propPosition="bottom" :propIsRadius="false" @onclose="popup_language_close_event">
|
||||
<view class="popup-language">
|
||||
<view class="flex-row align-c jc-sb padding-main">
|
||||
<view @tap="popup_language_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx"></iconfont>
|
||||
</view>
|
||||
<view class="text-size" @tap="popup_sub_language_event">{{ $t('common.confirm') }}</view>
|
||||
</view>
|
||||
<view class="br-t-f5 padding-main list">
|
||||
<view v-for="(value, key) in language_list" :key="key" class="spacing-mb flex-row jc-sb align-c" :class="language_key == key ? 'cr-main' : ''" :data-key="key" :data-value="value" @tap="checked_language_event">
|
||||
{{ value }}
|
||||
<iconfont v-if="language_key == key" name="icon-checked" size="32rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<component-lang-switch ref="lang_switch" @popup_sub_language_event="popup_sub_language_event"></component-lang-switch>
|
||||
<!-- 选择登录方式 -->
|
||||
<component-popup :propShow="popup_login_status" propMostClass="z-i-deep pr" propPosition="bottom" :propIsRadius="false" propStyle="background-color:transparent;" @onclose="popup_login_close_event">
|
||||
<view class="popup-login padding-sm">
|
||||
|
|
@ -414,18 +399,12 @@
|
|||
import base64 from '@/common/js/lib/base64.js';
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
import componentLangSwitch from '@/components/lang-switch/lang-switch';
|
||||
let login_static_url = app.globalData.get_static_url('thirdpartylogin', true) + 'icon/';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 多语言
|
||||
system_locale: '',
|
||||
application_locale: '',
|
||||
// 语言选择
|
||||
popup_language_status: false,
|
||||
language_list: '',
|
||||
language_key: '',
|
||||
// 实际提交的语言字段
|
||||
language: '',
|
||||
home_use_multilingual_status: 0,
|
||||
|
|
@ -484,6 +463,7 @@
|
|||
components: {
|
||||
componentCommon,
|
||||
componentPopup,
|
||||
componentLangSwitch
|
||||
},
|
||||
|
||||
// 页面加载初始化
|
||||
|
|
@ -500,18 +480,10 @@
|
|||
//#endif
|
||||
|
||||
// 多语言
|
||||
let system_info = uni.getSystemInfoSync();
|
||||
this.system_locale = system_info.language;
|
||||
this.application_locale = app.globalData.get_language_value();
|
||||
uni.onLocaleChange((e) => {
|
||||
this.application_locale = e.locale;
|
||||
});
|
||||
var language_key = app.globalData.get_language_value();
|
||||
var language_list = this.$t('language');
|
||||
this.setData({
|
||||
params: params,
|
||||
language_list: language_list,
|
||||
language_key: language_key,
|
||||
language: language_list[language_key],
|
||||
});
|
||||
|
||||
|
|
@ -1679,33 +1651,14 @@
|
|||
|
||||
// 打开语言选择弹窗
|
||||
open_language_event() {
|
||||
this.setData({
|
||||
popup_language_status: !this.popup_language_status,
|
||||
});
|
||||
if ((this.$refs.lang_switch || null) != null) {
|
||||
this.$refs.lang_switch.lang_open_event();
|
||||
}
|
||||
},
|
||||
|
||||
// 关闭语言弹窗
|
||||
popup_language_close_event() {
|
||||
this.setData({
|
||||
popup_language_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 选择语言
|
||||
checked_language_event(e) {
|
||||
this.setData({
|
||||
language_key: e.currentTarget.dataset.key,
|
||||
});
|
||||
},
|
||||
|
||||
// 提交语言选择
|
||||
popup_sub_language_event() {
|
||||
this.language_change(this.language_key);
|
||||
var language_list = this.$t('language');
|
||||
popup_sub_language_event(e) {
|
||||
this.setData({
|
||||
language_list: language_list,
|
||||
language: language_list[this.language_key],
|
||||
popup_language_status: false,
|
||||
language: e,
|
||||
});
|
||||
// 重新设置当前页面标题
|
||||
this.set_navigation_bar_title();
|
||||
|
|
@ -1713,12 +1666,6 @@
|
|||
app.globalData.init_config();
|
||||
},
|
||||
|
||||
// 多语言切换
|
||||
language_change(key) {
|
||||
uni.setLocale(key);
|
||||
this.$i18n.locale = key;
|
||||
},
|
||||
|
||||
// 打开登录方式弹层
|
||||
popup_login_open_event() {
|
||||
// 是否已同意协议
|
||||
|
|
|
|||
|
|
@ -89,24 +89,8 @@
|
|||
<text>{{ $t('setup.setup.tghrf2') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 打开语言选择弹层-->
|
||||
<component-popup :propShow="popup_language_status" propPosition="bottom" :propIsRadius="false" @onclose="popup_language_close_event">
|
||||
<view class="popup-language">
|
||||
<view class="flex-row align-c jc-sb padding-main">
|
||||
<view @tap="popup_language_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx"></iconfont>
|
||||
</view>
|
||||
<view class="text-size" @tap="popup_sub_language_event">{{ $t('common.confirm') }}</view>
|
||||
</view>
|
||||
<view class="br-t-f5 padding-main list">
|
||||
<view v-for="(value, key) in language_list" :key="key" class="spacing-mb flex-row jc-sb align-c" :class="language_key == key ? 'cr-main' : ''" :data-key="key" :data-value="value" @tap="checked_language_event">
|
||||
{{ value }}
|
||||
<iconfont v-if="language_key == key" name="icon-checked" size="32rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<component-lang-switch ref="lang_switch" @popup_sub_language_event="popup_sub_language_event"></component-lang-switch>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
|
|
@ -117,6 +101,7 @@
|
|||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
import componentLangSwitch from '@/components/lang-switch/lang-switch';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -128,14 +113,7 @@
|
|||
home_user_login_type: [],
|
||||
common_user_is_mandatory_bind_mobile: 0,
|
||||
|
||||
// 多语言
|
||||
system_locale: '',
|
||||
application_locale: '',
|
||||
home_use_multilingual_status: 0,
|
||||
// 语言选择
|
||||
popup_language_status: false,
|
||||
language_list: '',
|
||||
language_key: '',
|
||||
// 实际提交的语言字段
|
||||
language: '',
|
||||
|
||||
|
|
@ -146,24 +124,16 @@
|
|||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentPopup
|
||||
componentPopup,
|
||||
componentLangSwitch
|
||||
},
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 多语言
|
||||
let system_info = uni.getSystemInfoSync();
|
||||
this.system_locale = system_info.language;
|
||||
this.application_locale = app.globalData.get_language_value();
|
||||
uni.onLocaleChange((e) => {
|
||||
this.application_locale = e.locale;
|
||||
});
|
||||
var language_key = app.globalData.get_language_value();
|
||||
var language_list = this.$t('language');
|
||||
this.setData({
|
||||
language_list: language_list,
|
||||
language_key: language_key,
|
||||
language: language_list[language_key],
|
||||
});
|
||||
},
|
||||
|
|
@ -174,7 +144,7 @@
|
|||
|
||||
// 初始化配置
|
||||
app.globalData.init_config(0, this, 'init_config');
|
||||
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
|
|
@ -286,48 +256,21 @@
|
|||
remove_user_cache_event(e) {
|
||||
app.globalData.remove_user_cache_event(false);
|
||||
},
|
||||
|
||||
// 打开语言选择弹窗
|
||||
open_language_event() {
|
||||
this.setData({
|
||||
popup_language_status: !this.popup_language_status,
|
||||
});
|
||||
open_language_event () {
|
||||
if ((this.$refs.lang_switch || null) != null) {
|
||||
this.$refs.lang_switch.lang_open_event();
|
||||
}
|
||||
},
|
||||
|
||||
// 关闭语言弹窗
|
||||
popup_language_close_event() {
|
||||
this.setData({
|
||||
popup_language_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 选择语言
|
||||
checked_language_event(e) {
|
||||
this.setData({
|
||||
language_key: e.currentTarget.dataset.key,
|
||||
});
|
||||
},
|
||||
|
||||
// 提交语言选择
|
||||
popup_sub_language_event() {
|
||||
this.language_change(this.language_key);
|
||||
var language_list = this.$t('language');
|
||||
popup_sub_language_event(e) {
|
||||
this.setData({
|
||||
language_list: language_list,
|
||||
language: language_list[this.language_key],
|
||||
popup_language_status: false,
|
||||
language: e,
|
||||
});
|
||||
// 重新设置当前页面导航标题
|
||||
app.globalData.set_pages_navigation_bar_title();
|
||||
// 重新读取数据配置
|
||||
app.globalData.init_config();
|
||||
},
|
||||
|
||||
// 多语言切换
|
||||
language_change(key) {
|
||||
uni.setLocale(key);
|
||||
this.$i18n.locale = key;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue