diff --git a/App.vue b/App.vue index 12dd3928..8d4c5da6 100644 --- a/App.vue +++ b/App.vue @@ -1698,11 +1698,8 @@ // url协议地址处理 page_url_protocol(url) { - if ((url || null) != null) { - var http_arr = ['https:', 'http:/']; - if (http_arr.indexOf(url.substr(0, 6)) == -1) { - url = this.get_config('config.common_app_h5_url') + url; - } + if ((url || null) != null && !this.is_url(url)) { + url = this.get_config('config.common_app_h5_url', '') + url; } return url; }, @@ -1822,7 +1819,10 @@ }; result['url'] = this.get_page_url(); // #ifdef H5 || APP - result['url'] = this.page_url_protocol(result.url.split('#')[0] + '#' + (result.path.substr(0, 1) == '/' ? '' : '/') + result.path + result.query); + // 是有效的url地址则通过#号分割处理参数 + if(this.is_url(result['url'])) { + result['url'] = this.page_url_protocol(result.url.split('#')[0] + '#' + (result.path.substr(0, 1) == '/' ? '' : '/') + result.path + result.query); + } // #endif return result; }, diff --git a/pages/index/index.vue b/pages/index/index.vue index f8002361..7c21f7ae 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -507,19 +507,14 @@ this.init_config(true); } + var data = res.data.data; + var theme_view = app.globalData.get_theme_value_view(); + var theme_color = app.globalData.get_theme_color(); + var common_static_url = app.globalData.get_static_url('common'); + var seckill_static_url = app.globalData.get_static_url('seckill', true) + 'app/'; + var static_url = app.globalData.get_static_url('home'); if (res.data.code == 0) { - var data = res.data.data; - var theme_view = app.globalData.get_theme_value_view(); - var theme_color = app.globalData.get_theme_color(); - var common_static_url = app.globalData.get_static_url('common'); - var seckill_static_url = app.globalData.get_static_url('seckill', true) + 'app/'; - var static_url = app.globalData.get_static_url('home'); this.setData({ - theme_view: theme_view, - theme_color: theme_color, - common_static_url: common_static_url, - seckill_static_url: seckill_static_url, - static_url: static_url, top_content_search_content_style: 'background-image: url("' + static_url + 'nav-top.png");', data_bottom_line_status: true, banner_list: data.banner_list || [], @@ -545,12 +540,6 @@ plugins_magic_data: data.plugins_magic_data || null, }); - // 轮播数据处理 - if (this.load_status == 0) { - var color = (data.banner_list && data.banner_list.length > 0 && (data.banner_list[0]['bg_color'] || null) != null) ? data.banner_list[0].bg_color : theme_color; - this.change_banner(color); - } - // 弹屏广告插件处理 this.plugins_popupscreen_handle(); @@ -569,8 +558,19 @@ app.globalData.showToast(res.data.msg); } - // 设置首次加载状态 + // 轮播数据处理 + if (this.load_status == 0 || (this.top_content_search_bg_color || null) == null) { + var color = (this.banner_list && this.banner_list.length > 0 && (this.banner_list[0]['bg_color'] || null) != null) ? this.banner_list[0]['bg_color'] : theme_color; + this.change_banner(color); + } + + // 公共数据 this.setData({ + theme_view: theme_view, + theme_color: theme_color, + common_static_url: common_static_url, + seckill_static_url: seckill_static_url, + static_url: static_url, load_status: 1, }); @@ -580,6 +580,11 @@ }, 3000); }, fail: () => { + // 轮播数据处理 + if (this.load_status == 0 || (this.top_content_search_bg_color || null) == null) { + this.change_banner(app.globalData.get_theme_color()); + } + uni.stopPullDownRefresh(); this.setData({ data_list_loding_status: 2, @@ -683,4 +688,4 @@ + \ No newline at end of file diff --git a/pages/plugins/blog/form/form.vue b/pages/plugins/blog/form/form.vue index 951edeb7..43b5b7f3 100644 --- a/pages/plugins/blog/form/form.vue +++ b/pages/plugins/blog/form/form.vue @@ -305,7 +305,6 @@ // 回调富文本内容 rich_text_event(e) { - // console.log('==== input :', e); var new_data = this.data; new_data.content = e.html; this.setData({ @@ -321,10 +320,11 @@ // 上传图片 up_in_image_event(tempFiles, editorCtx) { + var self = this; // 使用 uniCloud.uploadFile 上传图片的示例方法(可适用多选上传) tempFiles.forEach(async (item) => { uni.showLoading({ - title: this.$t('form.form.2e5rv3'), + title: self.$t('form.form.2e5rv3'), mask: true, }); await uni.uploadFile({ @@ -341,14 +341,13 @@ path_type: 'common', // 路径类型,默认common }, success: function (res) { - console.log(res); let data = JSON.parse(res.data); if (res.statusCode == 200) { // 上传完成后处理 editorCtx.insertImage({ src: data.data.url, // 此处需要将图片地址切换成服务器返回的真实图片地址 // width: '50%', - alt: this.$t('form.form.3h58hv'), + alt: self.$t('form.form.3h58hv'), success: function (e) {}, }); uni.hideLoading();