diff --git a/App.vue b/App.vue index 4a14c86f..7854bc71 100644 --- a/App.vue +++ b/App.vue @@ -7,10 +7,10 @@ data: { // 基础配置 // 数据接口请求地址 - request_url: 'http://shopxo.com/', + request_url: 'https://d1.shopxo.vip/', // 静态资源地址(如系统根目录不在public目录下面请在静态地址后面加public目录、如:https://d1.shopxo.vip/public/) - static_url: 'http://shopxo.com/', + static_url: 'https://d1.shopxo.vip/', // 系统类型(默认default、如额外独立小程序、可与程序分身插件实现不同主体小程序及支付独立) system_type: 'default', @@ -2087,6 +2087,13 @@ } // 未登录提示缓存记录 uni.removeStorageSync(this.data.cache_user_no_login_page_status_data_key); + // 用户基础资料提示间隔key + uni.removeStorageSync(this.data.cache_user_base_personal_interval_time_key); + // app更新提示缓存记录key + uni.removeStorageSync(this.data.cache_app_update_tips_interval_time_key); + // app评分提示缓存记录key + uni.removeStorageSync(this.data.cache_app_star_tips_interval_time_key); + // 非小程序则两秒后回到首页 this.showToast(i18n.t('shopxo-uniapp.app.'+((client_value == 'mp' || !is_remove_user) ? '0gwt7z' : '87yghj')), 'success'); }, diff --git a/components/app-admin/app-admin.vue b/components/app-admin/app-admin.vue index c03feee0..5e4e5e24 100644 --- a/components/app-admin/app-admin.vue +++ b/components/app-admin/app-admin.vue @@ -13,19 +13,19 @@ - - + + - + - - + + - + @@ -47,6 +47,7 @@ update_alert_bg_images: null, // 评分提示 is_star_status: false, + star_tips_await_time: 0, star_tips_interval_time: 0, star_alert_images: null, star_url: null @@ -61,14 +62,7 @@ methods: { // 初始化、获取数据 - init(is_init = 0) { - // 记录缓存 - var star_tips_cache_time = parseInt(uni.getStorageSync(this.star_tips_cache_key) || 0); - if(star_tips_cache_time == 0) { - uni.setStorageSync(this.star_tips_cache_key, Date.parse(new Date()) / 1000); - } - - // 获取版本数据 + init(is_init = 0) { uni.request({ url: app.globalData.get_request_url('index', 'version', 'appadmin'), method: 'POST', @@ -82,30 +76,40 @@ // 更新提示 update_alert_bg_images: data.update_alert_bg_images || null, is_update_status: parseInt(data.is_update_status || 0) == 1, - update_tips_interval_time: parseInt(data.update_tips_interval_time || 10), + update_tips_interval_time: parseInt(data.update_tips_interval_time || 600), // 评分提示 is_star_status: parseInt(data.is_star_status || 0) == 1, - star_tips_interval_time: parseInt(data.star_tips_interval_time || 10), + star_tips_await_time: parseInt(data.star_tips_await_time || 600), + star_tips_interval_time: parseInt(data.star_tips_interval_time || 1800), star_alert_images: data.star_alert_images || null, star_url: data.star_url || null, }; + // 当前时间 + var current_time = Date.parse(new Date()) / 1000; + // 更新提示间隔时间 var update_tips_cache_time = parseInt(uni.getStorageSync(this.update_tips_cache_key) || 0); - var current_time = Date.parse(new Date()) / 1000; if(update_tips_cache_time > 0 && current_time < update_tips_cache_time + upd_data.update_tips_interval_time) { upd_data.is_update_status = false; } - // 评分提示间隔时间、如果已经展示更新弹窗则不展示评分弹窗 + // 评分是否可以展示评分 + var star_tips_cache_time = parseInt(uni.getStorageSync(this.star_tips_cache_key) || 0); + if(star_tips_cache_time > 0) { + upd_data.is_star_status = current_time > star_tips_cache_time; + } + // 首次则记录评分缓存 + if(star_tips_cache_time == 0) { + uni.setStorageSync(this.star_tips_cache_key, (Date.parse(new Date()) / 1000)+upd_data.star_tips_await_time); + // 如果等待时间为0则不需要等待就提示评分 + if(upd_data.star_tips_await_time == 0) { + upd_data.is_star_status = true; + } + } + // 如果已经展示更新弹窗则不展示评分弹窗 if(upd_data.is_update_status) { upd_data.is_star_status = false; - } else { - var star_tips_cache_time = parseInt(uni.getStorageSync(this.star_tips_cache_key) || 0); - var current_time = Date.parse(new Date()) / 1000; - if(star_tips_cache_time > 0) { - upd_data.is_star_status = current_time > star_tips_cache_time + upd_data.star_tips_interval_time; - } } this.setData(upd_data); @@ -138,16 +142,16 @@ this.setData({ is_star_status: false }); - // 增加24小时,后才会再提示 - uni.setStorageSync(this.star_tips_cache_key, (Date.parse(new Date()) / 1000)+86400); + // 增加间隔时间,到时间后才会再提示 + uni.setStorageSync(this.star_tips_cache_key, (Date.parse(new Date()) / 1000)+this.star_tips_interval_time); // 打开地址 - var value = e.currentTarget.dataset.type || null; + var value = e.currentTarget.dataset.value || null; if(value == null) { plus.runtime.openURL(this.star_url); } } - }, + } }; \ No newline at end of file diff --git a/components/cart/cart.vue b/components/cart/cart.vue index 1d02f62c..50cb3357 100644 --- a/components/cart/cart.vue +++ b/components/cart/cart.vue @@ -1373,7 +1373,7 @@ * 空购物车 */ .cart-no-data-box { - padding: 100rpx 0 80rpx 0; + padding: 140rpx 0 80rpx 0; } .cart-no-data-box image { width: 160rpx; diff --git a/pages/cart/cart.vue b/pages/cart/cart.vue index adf8c7c6..f9b3674e 100644 --- a/pages/cart/cart.vue +++ b/pages/cart/cart.vue @@ -39,10 +39,8 @@ export default { // 数据加载 if ((this.$refs.cart || null) != null) { this.$refs.cart.init(); - } - }, - - onReady() { + } + // app管理 if ((this.$refs.app_admin || null) != null) { this.$refs.app_admin.init(); @@ -51,7 +49,7 @@ export default { // 用户头像和昵称设置提示 if ((this.$refs.user_base || null) != null) { this.$refs.user_base.init('cart'); - } + } }, methods: {}, diff --git a/pages/goods-category/goods-category.vue b/pages/goods-category/goods-category.vue index a45e91a3..30b08a1d 100644 --- a/pages/goods-category/goods-category.vue +++ b/pages/goods-category/goods-category.vue @@ -497,10 +497,8 @@ this.init_config(); // 清除tab参数 - app.globalData.remove_page_tabbar_switch_params(); - }, + app.globalData.remove_page_tabbar_switch_params(); - onReady() { // app管理 if ((this.$refs.app_admin || null) != null) { this.$refs.app_admin.init(); @@ -509,7 +507,7 @@ // 用户头像和昵称设置提示 if ((this.$refs.user_base || null) != null) { this.$refs.user_base.init('goods-category'); - } + } }, methods: { diff --git a/pages/index/index.vue b/pages/index/index.vue index a20c5165..c6d31084 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -455,14 +455,12 @@ // 初始化配置 this.init_config(); - }, - onReady() { // app管理 if ((this.$refs.app_admin || null) != null) { this.$refs.app_admin.init(); } - + // 用户头像和昵称设置提示 if ((this.$refs.user_base || null) != null) { this.$refs.user_base.init('index'); diff --git a/pages/user/user.vue b/pages/user/user.vue index 2b81d50b..721db3c8 100644 --- a/pages/user/user.vue +++ b/pages/user/user.vue @@ -238,9 +238,7 @@ // 数据加载 this.init(); - }, - onReady() { // app管理 if ((this.$refs.app_admin || null) != null) { this.$refs.app_admin.init();