Merge branch 'dev-yxl' of gitee.com:zongzhige/shopxo-uniapp into dev

master
gongfuxiang 2025-04-28 14:00:06 +08:00
commit 7bc9d0ff98
2 changed files with 46 additions and 23 deletions

View File

@ -7,10 +7,10 @@
data: {
//
//
request_url:'https://d1.shopxo.vip/',
request_url:'http://shopxo.com/',
// publicpublichttps://d1.shopxo.vip/public/
static_url:'https://d1.shopxo.vip/',
static_url:'http://shopxo.com/',
// default
system_type: 'default',

View File

@ -34,7 +34,7 @@
<script>
const app = getApp();
import { isEmpty, common_styles_computer, common_img_computer, radius_computer, padding_computer, get_indicator_style, get_indicator_location_style } from '@/common/js/common/common.js';
import { isEmpty, common_styles_computer, common_img_computer, radius_computer, padding_computer, get_indicator_style, get_indicator_location_style, old_padding } from '@/common/js/common/common.js';
import imageEmpty from '@/pages/diy/components/diy/modules/image-empty.vue';
import subscriptIndex from '@/pages/diy/components/diy/modules/subscript/index.vue';
export default {
@ -68,7 +68,7 @@ export default {
img_style: '',
text_style: '',
indicator_style: '',
new_height: '',
new_height: '0rpx',
actived_index: 0,
group_width: '',
nav_content_list: [],
@ -125,39 +125,28 @@ export default {
init() {
const new_content = this.propValue.content;
const new_style = this.propValue.style;
let group = 1;
let single_line = parseInt(new_content.single_line || 4);
let group_width = `width: ${100 / single_line}%;`;
//
const single_line = new_content.single_line || 4;
let group_width = `width: ${100 / (single_line)}%;`;
//
if (new_content?.display_style == 'slide') {
if (new_content.row == 1 && new_style.rolling_fashion == 'translation') {
group = new_content.single_line || 4;
group = single_line;
group_width = 'width: 100%;';
} else {
group = 1;
group_width = `width: ${100 / single_line}%;`;
group_width = `width: ${100 / (single_line)}%;`;
}
}
//
let height = '126rpx';
let temp_nav_content = new_content.nav_content_list || [];
if(temp_nav_content.length > single_line*3) {
height = '496rpx';
} else if(temp_nav_content.length > single_line*2) {
height = '384rpx';
} else if(temp_nav_content.length > single_line) {
height = '272rpx';
}
this.setData({
form: new_content,
new_style: new_style,
style_container: common_styles_computer(new_style.common_style), //
style_img_container: common_img_computer(new_style.common_style, this.propIndex),
img_style: radius_computer(new_style), //
text_style: `font-size: ${new_style.title_size * 2 || 24}rpx; color: ${new_style.title_color || '#000'};`, //
text_style: `font-size: ${new_style.title_size * 2 || 24}rpx;line-height:${new_style.title_size * 2 || 24}rpx;height:${new_style.title_size * 2 || 24}rpx;color: ${new_style.title_color || '#000'};`, //
indicator_style: get_indicator_style(new_style), //
indicator_location_style: get_indicator_location_style(new_style), //
actived_color: new_style.actived_color || '#2A94FF', //
@ -168,7 +157,7 @@ export default {
img_size: 'width:' + (new_style.img_size || 0) * 2 + 'rpx;height:' + (new_style.img_size || 0) * 2 + 'rpx;', //
nav_style: new_content.nav_style || 'image_with_text', //
nav_content_list: this.get_nav_content_list(new_content, new_style),
new_height: height,
new_height: this.get_new_height(new_content, new_style),
});
setTimeout(() => {
const query = uni.createSelectorQuery().in(this);
@ -186,6 +175,40 @@ export default {
.exec(); //
}, 500);
},
get_new_height(new_content, new_style) {
const { nav_content_list = Array(4), single_line = 4, row = 1, nav_style = 'image_with_text' } = new_content;
const { img_size = 0, title_size = 0, title_space = 0, space = 0, data_padding = old_padding } = new_style;
const temp_nav_content = nav_content_list;
//
let total_num = 1;
//
const quantity_per_row = single_line;
//
if (new_content.display_style == 'slide') {
//
const num = quantity_per_row * row;
//
if (temp_nav_content.length > num) {
total_num = row;
} else {
total_num = Math.ceil(temp_nav_content.length / quantity_per_row);
}
} else {
//
total_num = Math.ceil(temp_nav_content.length / quantity_per_row);
}
//
let each_row_height = img_size + title_size + title_space;
//
if (nav_style == 'image') {
each_row_height = img_size;
} else if (nav_style == 'text') {
//
each_row_height = title_size;
}
//
return ((each_row_height * total_num) + ((total_num - 1) * space) + (data_padding.padding_top + data_padding.padding_bottom)) * 2 + 'rpx';
},
get_nav_content_list(data, new_style) {
//
const list = JSON.parse(JSON.stringify(data.nav_content_list || Array(4))).map(item => ({