博客上传图片错误,首页顶部背景色,分享地址优化

master
gongfuxiang 2024-01-23 19:38:06 +08:00
parent f1cfd89dd5
commit c808167e33
3 changed files with 33 additions and 29 deletions

12
App.vue
View File

@ -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;
},

View File

@ -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 @@
</script>
<style>
@import './index.css';
</style>
</style>

View File

@ -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();