tab页面自动更新缓存
parent
e8bf4a89fc
commit
26c23a7278
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<view :class="theme_view">
|
||||
<block v-if="is_first == 0">
|
||||
<block v-if="load_status == 1">
|
||||
<block v-if="(plugins_realstore_info || null) != null">
|
||||
<!-- 顶部导航 -->
|
||||
<component-nav-back propClass="bg-white" propColor="#333" :propFixed="false" :propIsShowBack="propSourceType == 'page'">
|
||||
|
|
@ -363,7 +363,7 @@
|
|||
common_static_url: common_static_url,
|
||||
user: null,
|
||||
no_cart_data_btn_text: this.$t('login.login.6yfr9g'),
|
||||
is_first: 1,
|
||||
load_status: 0,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_is_loading: 0,
|
||||
|
|
@ -476,26 +476,19 @@
|
|||
created: function () {
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if ((status || false) == true) {
|
||||
this.setData({
|
||||
currency_symbol: app.globalData.get_config('currency_symbol'),
|
||||
common_site_type: app.globalData.get_config('config.common_site_type'),
|
||||
common_is_exhibition_mode_btn_text: app.globalData.get_config('config.common_is_exhibition_mode_btn_text') || this.$t('cart.cart.31h34v'),
|
||||
common_is_cart_show_guess_you_like: parseInt(app.globalData.get_config('config.common_is_cart_show_guess_you_like', 0)),
|
||||
common_app_customer_service_tel: app.globalData.get_config('config.common_app_customer_service_tel'),
|
||||
is_cart_show_discount: parseInt(app.globalData.get_config('plugins_base.intellectstools.data.is_cart_show_discount', 0)),
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
init_config() {
|
||||
this.setData({
|
||||
currency_symbol: app.globalData.get_config('currency_symbol'),
|
||||
common_site_type: app.globalData.get_config('config.common_site_type'),
|
||||
common_is_exhibition_mode_btn_text: app.globalData.get_config('config.common_is_exhibition_mode_btn_text') || this.$t('cart.cart.31h34v'),
|
||||
common_is_cart_show_guess_you_like: parseInt(app.globalData.get_config('config.common_is_cart_show_guess_you_like', 0)),
|
||||
common_app_customer_service_tel: app.globalData.get_config('config.common_app_customer_service_tel'),
|
||||
is_cart_show_discount: parseInt(app.globalData.get_config('plugins_base.intellectstools.data.is_cart_show_discount', 0)),
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
|
|
@ -505,6 +498,11 @@
|
|||
app.globalData.network_type_handle(this, 'init');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 用户信息
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.setData({
|
||||
|
|
@ -516,12 +514,12 @@
|
|||
this.get_data();
|
||||
|
||||
// 猜你喜欢、仅首次读取、还未加载过
|
||||
if (this.is_first == 1 && this.goods_is_loading == 0) {
|
||||
if (this.load_status == 0 && this.goods_is_loading == 0) {
|
||||
this.get_data_list(1);
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
is_first: 0,
|
||||
load_status: 1,
|
||||
user: null,
|
||||
data_list: [],
|
||||
plugins_realstore_info: null,
|
||||
|
|
@ -603,7 +601,7 @@
|
|||
|
||||
// 设置数据
|
||||
this.setData({
|
||||
is_first: 0,
|
||||
load_status: 1,
|
||||
data_is_loading: 0,
|
||||
data_list: data_list,
|
||||
data_list_loding_status: data_list.length == 0 ? 0 : 3,
|
||||
|
|
@ -641,7 +639,7 @@
|
|||
app.globalData.set_tab_bar_badge('cart', data.buy_number);
|
||||
} else {
|
||||
this.setData({
|
||||
is_first: 0,
|
||||
load_status: 1,
|
||||
data_is_loading: 0,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
|
|
@ -661,7 +659,7 @@
|
|||
},
|
||||
fail: () => {
|
||||
this.setData({
|
||||
is_first: 0,
|
||||
load_status: 1,
|
||||
data_is_loading: 0,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
|
|
@ -1439,7 +1437,7 @@
|
|||
}
|
||||
this.setData({
|
||||
bottom_fixed_style: 'bottom:'+value+value_unit,
|
||||
scroll_style: 'height: calc(100vh - ' + (value+(this.cart_type_value == 'realstore' ? 200 : 70)-(this.is_first == 1 ? 100 : 0))+'rpx)',
|
||||
scroll_style: 'height: calc(100vh - ' + (value+(this.cart_type_value == 'realstore' ? 200 : 70)-(this.load_status == 0 ? 100 : 0))+'rpx)',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
load_status: 0,
|
||||
footer_height_value: 0
|
||||
};
|
||||
},
|
||||
|
|
@ -39,9 +40,11 @@
|
|||
methods: {
|
||||
// 初始化
|
||||
init() {
|
||||
// 数据加载
|
||||
if ((this.$refs.cart || null) != null) {
|
||||
this.$refs.cart.init();
|
||||
// 调用购物车
|
||||
if(app.globalData.get_config('status') == 1) {
|
||||
app.globalData.init_config(0, this, 'init_config', true);
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
|
||||
// 公共onshow事件
|
||||
|
|
@ -50,6 +53,19 @@
|
|||
}
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if ((status || false) == true) {
|
||||
this.setData({
|
||||
load_status: 1
|
||||
});
|
||||
// 数据加载
|
||||
if ((this.$refs.cart || null) != null) {
|
||||
this.$refs.cart.init();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 底部菜单高度
|
||||
footer_height_value_event(value) {
|
||||
this.setData({
|
||||
|
|
|
|||
|
|
@ -398,6 +398,7 @@
|
|||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_is_loading: 0,
|
||||
load_status: 0,
|
||||
user: null,
|
||||
params: null,
|
||||
tabbar_params: null,
|
||||
|
|
@ -497,7 +498,11 @@
|
|||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
if(app.globalData.get_config('status') == 1) {
|
||||
app.globalData.init_config(0, this, 'init_config', true);
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
|
||||
// 清除tab参数
|
||||
app.globalData.remove_page_tabbar_switch_params();
|
||||
|
|
@ -555,8 +560,6 @@
|
|||
currency_symbol: app.globalData.get_config('currency_symbol'),
|
||||
category_show_level: app.globalData.get_config('config.category_show_level'),
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -602,6 +605,7 @@
|
|||
}
|
||||
// 设置分类及右侧数据和及基础数据
|
||||
var upd_data = {
|
||||
load_status: 1,
|
||||
category_list: temp_category,
|
||||
data_content: temp_category[active_index] || null,
|
||||
nav_active_index: active_index,
|
||||
|
|
|
|||
|
|
@ -436,7 +436,11 @@
|
|||
this.init();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
if(app.globalData.get_config('status') == 1) {
|
||||
app.globalData.init_config(0, this, 'init_config', true);
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
|
|
@ -469,8 +473,6 @@
|
|||
application_title: app.globalData.get_application_title(),
|
||||
application_logo: app.globalData.get_application_logo(),
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -180,6 +180,7 @@
|
|||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
common_static_url: common_static_url,
|
||||
load_status: 0,
|
||||
static_url: static_url,
|
||||
avatar: app.globalData.data.default_user_head_src,
|
||||
user: null,
|
||||
|
|
@ -227,7 +228,11 @@
|
|||
this.set_resources_data();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
if(app.globalData.get_config('status') == 1) {
|
||||
app.globalData.init_config(0, this, 'init_config', true);
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
|
@ -305,8 +310,6 @@
|
|||
membership_page_url: membership_page_url,
|
||||
payment_page_url: payment_page_url,
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -440,6 +443,7 @@
|
|||
|
||||
// 数据设置
|
||||
var upd_data = {
|
||||
load_status: 1,
|
||||
message_total: parseInt(data.message_total || 0),
|
||||
head_nav_list: temp_head_nav_list,
|
||||
navigation: temp_navigation,
|
||||
|
|
|
|||
Loading…
Reference in New Issue