修改页面显示内容
parent
b595131809
commit
021cd90021
|
|
@ -92,6 +92,15 @@ class UrlValueAPI {
|
|||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/** 多门店指定数据 */
|
||||
static getAskList(data: any) {
|
||||
return api_request({
|
||||
url: `?s=plugins/index/pluginsname/ask/pluginscontrol/diyask/pluginsaction/index.html`,
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default UrlValueAPI;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<div v-show="form.data_type === '0'" class="nav-list">
|
||||
<drag-group :list="drag_list" :img-params="img_params" :title-params="title_params" @onsort="data_list_sort" @remove="data_list_remove" @replace="data_list_replace"></drag-group>
|
||||
<drag-group :list="drag_list" :img-params="img_params" :title-params="title_params" :type="type_params" @onsort="data_list_sort" @remove="data_list_remove" @replace="data_list_replace"></drag-group>
|
||||
<el-button class="mt-20 w" @click="add">+添加</el-button>
|
||||
</div>
|
||||
<!-- 商品 -->
|
||||
|
|
@ -93,7 +93,7 @@
|
|||
<el-input v-model="keywords" placeholder="请输入组合搭配关键字" clearable @blur="keyword_blur"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型">
|
||||
<el-select v-model="form.binding_type" multiple collapse-tags filterable placeholder="请选择类型">
|
||||
<el-select v-model="form.category_ids" multiple collapse-tags filterable placeholder="请选择类型">
|
||||
<el-option v-for="item in get_data_list(common_store.common.plugins, 'binding.type_list')" :key="item.value" :label="item.name" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -157,6 +157,37 @@
|
|||
</el-form-item>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 问答 -->
|
||||
<template v-else-if="['ask'].includes(type)">
|
||||
<div v-show="form.data_type === '1'" class="w h">
|
||||
<el-form-item label="关键字">
|
||||
<el-input v-model="keywords" placeholder="请输入问答关键字" clearable @blur="keyword_blur"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="问答分类">
|
||||
<el-select v-model="form.category_ids" multiple collapse-tags filterable placeholder="请选择类型">
|
||||
<el-option v-for="item in get_data_list(common_store.common.plugins, 'ask.category_list')" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="显示数量">
|
||||
<el-input-number v-model="form.number" :min="1" :max="50" type="number" placeholder="请输入显示数量" value-on-clear="min" class="w number-show" controls-position="right"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序类型">
|
||||
<el-radio-group v-model="form.order_by_type">
|
||||
<el-radio v-for="item in get_data_list(common_store.common.plugins, 'ask.order_by_type_list')" :key="item.index" :value="item.index">{{ item.name }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序规则">
|
||||
<el-radio-group v-model="form.order_by_rule">
|
||||
<el-radio v-for="item in common_store.common.data_order_by_rule_list" :key="item.index" :value="item.index">{{ item.name }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="回复状态">
|
||||
<el-radio-group v-model="form.is_reply">
|
||||
<el-radio v-for="item in baseList.filter_list" :key="item.value" :value="item.value">{{ item.name }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div v-show="form.data_type === '1'" class="w h">
|
||||
<el-form-item label="关键字">
|
||||
|
|
@ -217,8 +248,10 @@
|
|||
const option_list = ref<option[]>([]);
|
||||
const img_params = ref('logo');
|
||||
const title_params = ref('title');
|
||||
const type_params = ref('other');
|
||||
// 更新数据,避免子组件数据不刷新
|
||||
watchEffect(() => {
|
||||
type_params.value = 'other';
|
||||
// 商品
|
||||
if (props.type === 'goods') {
|
||||
option_list.value = props.baseList.product_list;
|
||||
|
|
@ -239,6 +272,12 @@
|
|||
option_list.value = props.baseList.data_type_list;
|
||||
img_params.value = 'logo';
|
||||
title_params.value = 'name';
|
||||
} else if (['ask'].includes(props.type)) {
|
||||
// 问答
|
||||
option_list.value = props.baseList.data_type_list;
|
||||
img_params.value = '';
|
||||
title_params.value = 'title';
|
||||
type_params.value = 'custom';
|
||||
} else {
|
||||
option_list.value = props.baseList.brand_data_type_list;
|
||||
img_params.value = 'logo';
|
||||
|
|
|
|||
|
|
@ -66,6 +66,10 @@
|
|||
<template v-else-if="link_select == 'realstore'">
|
||||
<link-realstore v-model="link_value" :multiple="multiple" :reset="reset_compontent"></link-realstore>
|
||||
</template>
|
||||
<!-- 问答 -->
|
||||
<template v-else-if="link_select == 'ask'">
|
||||
<link-ask v-model="link_value" :multiple="multiple" :reset="reset_compontent"></link-ask>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
|
|
@ -180,6 +184,8 @@ const dialog_title = computed(() => {
|
|||
name = '多商户';
|
||||
} else if (props.type[0] == 'realstore') {
|
||||
name = '多门店';
|
||||
} else if (props.type[0] == 'ask') {
|
||||
name = '问答';
|
||||
}
|
||||
return name + '选择';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -2,37 +2,63 @@
|
|||
<div class="oh" :style="style_container">
|
||||
<div :style="style_img_container">
|
||||
<div :class="outer_class" :style="onter_style">
|
||||
<template v-if="!['3'].includes(theme)">
|
||||
<template v-if="!['2'].includes(theme)">
|
||||
<div v-for="(item, index) in list" :key="index" class="re oh" :class="layout_type" :style="layout_style">
|
||||
<div :class="['oh w h', ['0'].includes(theme) ? 'flex-row' : 'flex-col' ]" :style="layout_img_style">
|
||||
<div class="flex-row jc-sb gap-10" :style="content_style">
|
||||
<template v-if="theme == '0'">
|
||||
|
||||
</template>
|
||||
<div class="flex-col jc-sb gap-10">
|
||||
<div class="text-line-2" :style="trends_config('title')">{{ item.name }}</div>
|
||||
<div class="flex-row gap-10">
|
||||
<span v-if="form.ask_desc == '1'" :style="trends_config('desc', 'desc')">{{ item.describe }}</span>
|
||||
<span></span>
|
||||
<span>浏览</span>
|
||||
<template v-if="theme == 0">
|
||||
<div class="oh w h flex-col jc-sb gap-10" :style="layout_img_style">
|
||||
<div class="flex-row gap-10 align-b">
|
||||
<div v-if="is_show('ranking')" :class="`top-style one${ index + 1 }`">{{ index + 1 }}</div>
|
||||
<div :style="trends_config('title') + 'word-break: break-all;'">{{ item.title }}</div>
|
||||
</div>
|
||||
<div v-if="is_show('reply_status') || is_show('time') || is_show('page_view')" class="flex-row gap-10 align-c" :style="is_show('ranking') ? 'margin-left: 2.7rem;' : ''">
|
||||
<div class="flex-row">
|
||||
<div v-if="is_show('reply_status')" :style="button_style(item.is_reply == 0)">
|
||||
<div :style="button_img_style(item.is_reply == 0)">
|
||||
{{ item.is_reply == 0 ? '未回' : '已回'}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span v-if="is_show('time')" :style="trends_config('time')">{{ item.add_time_date }}</span>
|
||||
<span v-if="is_show('page_view')" :style="trends_config('page_view')">共有{{ item.access_count }}浏览</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="oh flex-col gap-10 jc-sb" :style="layout_img_style">
|
||||
<div class="flex-row gap-10 align-b">
|
||||
<div :style="trends_config('title') + 'word-break: break-all;'">{{ item.title }}</div>
|
||||
</div>
|
||||
<div v-if="is_show('reply_status') || is_show('time')" class="flex-col gap-10">
|
||||
<span v-if="is_show('time')" :style="trends_config('time')">{{ item.add_time_date }}</span>
|
||||
<div class="flex-row">
|
||||
<div v-if="is_show('reply_status')" class="flex-row" :style="button_style(item.is_reply == 0)">
|
||||
<div :style="button_img_style(item.is_reply == 0)">
|
||||
{{ item.is_reply == 0 ? '未回' : '已回'}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<swiper :key="carouselKey" class="w flex" direction="horizontal" :loop="true" :autoplay="autoplay" :slides-per-view="form.carousel_col" :slides-per-group="slides_per_group" :allow-touch-move="false" :space-between="content_outer_spacing" :pause-on-mouse-enter="true" :modules="modules">
|
||||
<swiper-slide v-for="(item, index) in list" :key="index">
|
||||
<div :class="layout_type" :style="layout_style">
|
||||
<div :class="['oh w h', ['0', '4'].includes(theme) ? 'flex-row' : 'flex-col' ]" :style="layout_img_style">
|
||||
<div class="flex-col jc-sb gap-10" :style="content_style">
|
||||
<div class="text-line-2" :style="trends_config('title')">
|
||||
<template v-for="(item1, index1) in new_url_list(item.icon_list)" :key="index1">
|
||||
<img :src="item1.icon" class="title-img" :style="title_img_style(item.icon_list, index1) + 'vertical-align: middle;'" />
|
||||
</template>{{ item.name }}
|
||||
<div class="oh w h flex-col gap-10 jc-sb" :style="layout_img_style">
|
||||
<div class="flex-row gap-10 align-b">
|
||||
<div :style="trends_config('title')">{{ item.title }}</div>
|
||||
</div>
|
||||
<div v-if="is_show('reply_status') || is_show('time')" class="flex-col gap-10">
|
||||
<span v-if="is_show('time')" :style="trends_config('time')">{{ item.add_time_date }}</span>
|
||||
<div class="flex-row">
|
||||
<div v-if="is_show('reply_status')" class="flex-row" :style="button_style(item.is_reply == 0)">
|
||||
<div :style="button_img_style(item.is_reply == 0)">
|
||||
{{ item.is_reply == 0 ? '未回' : '已回'}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span v-if="form.ask_desc == '1'" :style="trends_config('desc', 'desc')">{{ item.describe }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -40,14 +66,15 @@
|
|||
</swiper>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { common_styles_computer, common_img_computer, get_math, gradient_handle, margin_computer, border_computer, box_shadow_computer, radius_computer, background_computer, padding_computer } from '@/utils';
|
||||
import { common_styles_computer, common_img_computer, get_math, gradient_handle, margin_computer, border_computer, box_shadow_computer, radius_computer, background_computer, padding_computer, gradient_computer } from '@/utils';
|
||||
import { old_margin } from "@/utils/common";
|
||||
import { isEmpty, cloneDeep } from 'lodash';
|
||||
import ShopAPI from '@/api/shop';
|
||||
import AskAPI from '@/api/ask';
|
||||
import { Swiper, SwiperSlide } from 'swiper/vue';
|
||||
import { Autoplay } from 'swiper/modules';
|
||||
const modules = [Autoplay];
|
||||
|
|
@ -72,12 +99,12 @@ const new_style = computed(() => props.value?.style || {});
|
|||
const theme = computed(() => form.value.theme);
|
||||
// 最外层不同风格下的显示
|
||||
const outer_class = computed(() => {
|
||||
const flex = ['0', '2' ].includes(theme.value) ? 'flex-col ' : 'flex-row ';
|
||||
const wrap = theme.value == '3' ? '' : 'flex-wrap ';
|
||||
const flex = ['0', '2'].includes(theme.value) ? 'flex-col ' : 'container ';
|
||||
const wrap = theme.value == '2' ? '' : 'flex-wrap ';
|
||||
return flex + wrap + 'oh';
|
||||
});
|
||||
const onter_style = computed(() => {
|
||||
const radius = `gap: ${new_style.value.content_outer_spacing + 'px'};`;
|
||||
const radius = ['0', '2'].includes(theme.value) ? `gap: ${new_style.value.content_outer_spacing + 'px'};` : `column-gap: ${ new_style.value.content_outer_spacing + 'px' }`;
|
||||
return `${radius}`;
|
||||
});
|
||||
|
||||
|
|
@ -85,43 +112,19 @@ const onter_style = computed(() => {
|
|||
const style_container = computed(() => common_styles_computer(new_style.value.common_style));
|
||||
const style_img_container = computed(() => common_img_computer(new_style.value.common_style));
|
||||
//#region 列表数据
|
||||
type url = {
|
||||
icon: string;
|
||||
}
|
||||
type data_list = {
|
||||
name: string;
|
||||
icon_list: url[],
|
||||
logo: string;
|
||||
new_cover: string[];
|
||||
describe: string;
|
||||
title: string;
|
||||
add_time_date: string,
|
||||
is_reply: number;
|
||||
access_count: number;
|
||||
}
|
||||
const default_list = {
|
||||
name: '测试商户标题',
|
||||
describe: '测试商户描述',
|
||||
icon_list: [{ icon: 'http://shopxo.com/static/diy/images/layout/siderbar/data-magic.png'}, { icon: ''}],
|
||||
logo: '',
|
||||
new_cover: [],
|
||||
title: '测试商户标题',
|
||||
access_count: 0,
|
||||
add_time_date: '2023-01-01 10:00:00',
|
||||
is_reply: 0,
|
||||
};
|
||||
const list = ref<data_list[]>([]);
|
||||
const new_url_list = computed(() => {
|
||||
return (icon_list: url[]) => {
|
||||
return icon_list.filter(item1 => !isEmpty(item1.icon));
|
||||
}
|
||||
});
|
||||
// 标题图片样式
|
||||
const title_img_style = computed(() => {
|
||||
return (icon_list: url[], index: number) => {
|
||||
const { ask_title_img_width = 0, ask_title_img_height = 0, ask_title_img_radius, ask_title_img_inner_spacing, ask_title_img_outer_spacing} = new_style.value;
|
||||
let style = `width: ${ask_title_img_width || 0 }px;height: ${ ask_title_img_height || 0 }px;${ radius_computer(ask_title_img_radius) }`;
|
||||
const list = icon_list.filter(item1 => !isEmpty(item1.icon));
|
||||
if (index < list.length - 1) {
|
||||
style += `margin-right: ${ ask_title_img_inner_spacing || 0}px;`;
|
||||
} else {
|
||||
style += `margin-right: ${ ask_title_img_outer_spacing || 0}px;`;
|
||||
}
|
||||
return style;
|
||||
}
|
||||
});
|
||||
// 初始化的时候执行
|
||||
onMounted(() => {
|
||||
// 指定商品并且指定商品数组不为空
|
||||
|
|
@ -140,30 +143,28 @@ onMounted(() => {
|
|||
});
|
||||
|
||||
const get_shops = () => {
|
||||
const { category_ids, number, order_by_type, order_by_rule, keywords, is_goods_list } = form.value;
|
||||
const { category_ids, number, order_by_type, order_by_rule, keywords, is_reply } = form.value;
|
||||
const params = {
|
||||
ask_keywords: keywords,
|
||||
ask_category_ids: category_ids,
|
||||
ask_order_by_type: order_by_type,
|
||||
ask_order_by_rule: order_by_rule,
|
||||
ask_number: number,
|
||||
ask_is_goods_list: is_goods_list,
|
||||
ask_is_reply: is_reply,
|
||||
};
|
||||
// 获取商品列表
|
||||
ShopAPI.getShopList(params).then((res: any) => {
|
||||
AskAPI.getAutoList(params).then((res: any) => {
|
||||
if (!isEmpty(res.data)) {
|
||||
list.value = res.data;
|
||||
} else {
|
||||
list.value = Array(4).fill(default_list);
|
||||
}
|
||||
}).catch(() => {
|
||||
list.value = Array(4).fill(default_list);
|
||||
});
|
||||
})
|
||||
};
|
||||
// 取出监听的数据
|
||||
const watch_data = computed(() => {
|
||||
const { category_ids, number, order_by_type, order_by_rule, data_type, data_list, keywords } = form.value;
|
||||
return { category_ids, number, order_by_type, order_by_rule, data_type, data_list, keywords };
|
||||
const { category_ids, number, order_by_type, order_by_rule, data_type, data_list, keywords, is_reply } = form.value;
|
||||
return { category_ids, number, order_by_type, order_by_rule, data_type, data_list, keywords, is_reply };
|
||||
})
|
||||
// 初始化的时候不执行, 监听数据变化
|
||||
watch(() => watch_data.value, (val, oldVal) => {
|
||||
|
|
@ -189,8 +190,6 @@ watch(() => watch_data.value, (val, oldVal) => {
|
|||
const content_outer_spacing = computed(() => new_style.value.content_outer_spacing);
|
||||
// 圆角设置
|
||||
const content_radius = computed(() => radius_computer(new_style.value.ask_radius));
|
||||
// 图片圆角设置
|
||||
const content_img_radius = computed(() => radius_computer(new_style.value.ask_img_radius));
|
||||
// 内边距设置
|
||||
const content_padding = computed(() => padding_computer(new_style.value.ask_padding));
|
||||
const ask_left_right_width_margin = computed(() => {
|
||||
|
|
@ -199,6 +198,14 @@ const ask_left_right_width_margin = computed(() => {
|
|||
});
|
||||
// 两列风格
|
||||
const two_columns = computed(() => content_outer_spacing.value + ask_left_right_width_margin.value * 2 + 'px' );
|
||||
const button_style = (flag: boolean) => {
|
||||
const style = flag ? new_style.value.not_replied_yet_style : new_style.value.returned_style;
|
||||
return `${ gradient_computer(style)}; ${ border_computer(style) }`;
|
||||
}
|
||||
const button_img_style = (flag: boolean) => {
|
||||
const style = flag ? new_style.value.not_replied_yet_style : new_style.value.returned_style;
|
||||
return `${ padding_computer(style.font_padding) } ${ background_computer(style) }font-weight:${style.font_typeface}; font-size: ${style.font_size}px;color: ${style.font_color};`;
|
||||
}
|
||||
// 根据传递的参数,从对象中取值
|
||||
const trends_config = (key: string, type?: string) => {
|
||||
return style_config(new_style.value[`ask_${key}_typeface`], new_style.value[`ask_${key}_size`], new_style.value[`ask_${key}_color`], type);
|
||||
|
|
@ -216,12 +223,9 @@ const layout_type = computed(() => {
|
|||
class_type = `oh`;
|
||||
break;
|
||||
case '1':
|
||||
class_type = `two-columns oh`;
|
||||
break;
|
||||
case '2':
|
||||
class_type = `oh`;
|
||||
break;
|
||||
case '3':
|
||||
case '2':
|
||||
class_type = `multicolumn-columns oh`;
|
||||
break;
|
||||
default:
|
||||
|
|
@ -231,31 +235,28 @@ const layout_type = computed(() => {
|
|||
});
|
||||
// 容器样式
|
||||
const layout_style = computed(() => {
|
||||
const radius = theme.value == '6' ? '' : content_radius.value;
|
||||
const radius = content_radius.value;
|
||||
const width = theme.value == '0' ? `width: calc(100% - ${ ask_left_right_width_margin.value }px);` : '';
|
||||
const gradient = gradient_handle(new_style.value.ask_color_list, new_style.value.ask_direction) + margin_computer(new_style.value.ask_margin) + border_computer(new_style.value) + box_shadow_computer(new_style.value);
|
||||
const margin = theme.value == '1' ? {
|
||||
...new_style.value.ask_margin,
|
||||
margin_bottom: (new_style.value.ask_margin?.margin_bottom || 0) + new_style.value.content_outer_spacing,
|
||||
} : new_style.value.ask_margin;
|
||||
const gradient = gradient_handle(new_style.value.ask_color_list, new_style.value.ask_direction) + margin_computer(margin) + border_computer(new_style.value) + box_shadow_computer(new_style.value);
|
||||
return `${radius} ${ gradient } ${ width }`;
|
||||
});
|
||||
// 容器图片样式
|
||||
const layout_img_style = computed(() => {
|
||||
const padding = theme.value == '0' ? content_padding.value : '';
|
||||
const padding = content_padding.value;
|
||||
const data = {
|
||||
background_img_style: new_style.value.ask_background_img_style,
|
||||
background_img: new_style.value.ask_background_img,
|
||||
}
|
||||
return padding + background_computer(data);
|
||||
});
|
||||
// 内容区域的样式
|
||||
const content_style = computed(() => {
|
||||
const spacing_value = new_style.value.content_spacing;
|
||||
let spacing = '';
|
||||
if (['0'].includes(theme.value)) {
|
||||
spacing = `margin-left: ${spacing_value}px;`;
|
||||
} else {
|
||||
spacing = content_padding.value;
|
||||
}
|
||||
return `${spacing}`;
|
||||
});
|
||||
// 判断是否显示对应的内容
|
||||
const is_show = (index: string) => {
|
||||
return form.value.is_show.includes(index);
|
||||
};
|
||||
//#region 轮播设置
|
||||
// 轮播图key值
|
||||
const carouselKey = ref('0');
|
||||
|
|
@ -345,4 +346,31 @@ const content_outer_height = computed(() => new_style.value.content_outer_height
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.one1 {
|
||||
color: #fff !important;
|
||||
background: #FF6565 !important;
|
||||
}
|
||||
.one2 {
|
||||
color: #fff !important;
|
||||
background: #FF9F2F !important;
|
||||
}
|
||||
.one3 {
|
||||
color: #fff !important;
|
||||
background: #FFC889 !important;
|
||||
}
|
||||
.top-style {
|
||||
color: #EBAB2A;
|
||||
background: #fff;
|
||||
padding: 0 0.5rem;
|
||||
width: 1.7rem;
|
||||
height: 1.7rem;
|
||||
font-weight: 400;
|
||||
font-size: 1.2rem;
|
||||
line-height: 1.7rem;
|
||||
text-align: right;
|
||||
font-style: normal;
|
||||
}
|
||||
.container {
|
||||
column-count: 2;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<el-radio v-for="item in base_list.theme_list" :key="item.value" :value="item.value">{{ item.name }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.theme == '3'" label="轮播列数">
|
||||
<el-form-item v-if="form.theme == '2'" label="轮播列数">
|
||||
<el-radio-group v-model="form.carousel_col">
|
||||
<el-radio :value="1">单列展示</el-radio>
|
||||
<el-radio :value="2">两列展示</el-radio>
|
||||
|
|
@ -25,15 +25,15 @@
|
|||
<!-- 数据筛选组件, 根据数据源类型显示不同的筛选组件 -->
|
||||
<data-filter type="ask" :value="form" :list="form.data_list" :base-list="base_list" @add="add" @data_list_replace="data_list_replace" @data_list_remove="data_list_remove" @data_list_sort="data_list_sort"></data-filter>
|
||||
</card-container>
|
||||
<template v-if="form.theme == '0'">
|
||||
<div class="divider-line"></div>
|
||||
<card-container>
|
||||
<div class="mb-12">列表设置</div>
|
||||
<div class="divider-line"></div>
|
||||
<card-container>
|
||||
<div class="mb-12">列表设置</div>
|
||||
<el-form-item label="是否显示">
|
||||
<el-checkbox-group v-model="form.is_show">
|
||||
<el-checkbox v-for="item in base_list.show_list.filter(item => item.show.includes(form.theme))" :key="item.value" :value="item.value">{{ item.name }}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</card-container>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</card-container>
|
||||
</el-form>
|
||||
<url-value-dialog v-model:dialog-visible="url_value_dialog_visible" :type="['ask']" :multiple="url_value_multiple_bool" @update:model-value="url_value_dialog_call_back"></url-value-dialog>
|
||||
</div>
|
||||
|
|
@ -82,11 +82,16 @@ const base_list = reactive({
|
|||
{ name: '筛选问答', value: '1' },
|
||||
],
|
||||
show_list: [
|
||||
{ name: '日期时间', value: 'time', show: ['0', '1' , '2'] },
|
||||
{ name: '浏览量', value: 'page_view', show: ['0', '1' , '2'] },
|
||||
{ name: '回复状态', value: 'reply_status', show: ['0', '1' , '2'] },
|
||||
{ name: '日期时间', value: 'time', show: ['0', '1' , '2'] },
|
||||
{ name: '浏览量', value: 'page_view', show: ['0', '1'] },
|
||||
{ name: 'TOP排名', value: 'ranking', show: ['0'] },
|
||||
]
|
||||
],
|
||||
filter_list: [
|
||||
{ name: '全部', value: '' },
|
||||
{ name: '未回', value: '0' },
|
||||
{ name: '已回', value: '1' },
|
||||
],
|
||||
});
|
||||
|
||||
// 移除
|
||||
|
|
|
|||
|
|
@ -245,10 +245,10 @@ onMounted(() => {
|
|||
});
|
||||
|
||||
const get_binding = () => {
|
||||
const { keywords, binding_type, number, order_by_type, order_by_rule, is_home_show } = form.value;
|
||||
const { keywords, category_ids, number, order_by_type, order_by_rule, is_home_show } = form.value;
|
||||
const params = {
|
||||
binding_keywords: keywords,
|
||||
binding_type: binding_type,
|
||||
binding_type: category_ids,
|
||||
binding_order_by_type: order_by_type,
|
||||
binding_order_by_rule: order_by_rule,
|
||||
binding_number: number,
|
||||
|
|
@ -261,14 +261,12 @@ const get_binding = () => {
|
|||
} else {
|
||||
list.value = Array(4).fill(default_list);
|
||||
}
|
||||
}).catch(() => {
|
||||
list.value = Array(4).fill(default_list);
|
||||
});
|
||||
})
|
||||
};
|
||||
// 取出监听的数据
|
||||
const watch_data = computed(() => {
|
||||
const { keywords, binding_type, number, order_by_type, order_by_rule, is_home_show, data_type, data_list } = form.value;
|
||||
return { keywords, binding_type, number, order_by_type, order_by_rule, is_home_show, data_type, data_list };
|
||||
const { keywords, category_ids, number, order_by_type, order_by_rule, is_home_show, data_type, data_list } = form.value;
|
||||
return { keywords, category_ids, number, order_by_type, order_by_rule, is_home_show, data_type, data_list };
|
||||
})
|
||||
// 初始化的时候不执行, 监听数据变化
|
||||
watch(() => watch_data.value, (val, oldVal) => {
|
||||
|
|
|
|||
|
|
@ -284,9 +284,7 @@ const get_products = () => {
|
|||
} else {
|
||||
list.value = Array(4).fill(default_list);
|
||||
}
|
||||
}).catch(() => {
|
||||
list.value = Array(4).fill(default_list);
|
||||
});
|
||||
})
|
||||
};
|
||||
// 取出监听的数据
|
||||
const watch_data = computed(() => {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
</div>
|
||||
<div class="flex-row gap-2 align-c">
|
||||
<img-or-icon-or-text :value="props.value" type="time" />
|
||||
<div class="flex-1 flex-row align-c">
|
||||
<div v-if="!isEmpty(item.status_info)" class="flex-1 flex-row align-c">
|
||||
<span class="text-line-1" :style="trends_config('state') + `color: ${ item.status_info.status == 1 ? new_style.realstore_state_color : new_style.realstore_default_state_color }`">{{ item.status_info.msg }}</span>
|
||||
<span v-if="!isEmpty(item.status_info.msg) || !isEmpty(item.status_info.time)" :style="'color: #ccc;' + margin_computer(new_style.realstore_business_distance)">|</span>
|
||||
<span class="text-line-1" :style="trends_config('business_hours')">{{ item.status_info.time }}</span>
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
<div class="flex-row jc-sb align-c">
|
||||
<div class="flex-1 flex-row gap-2 align-c">
|
||||
<img-or-icon-or-text :value="props.value" type="time" />
|
||||
<span class="text-line-1" :style="trends_config('state') + `color: ${ item.status_info.status == 1 ? new_style.realstore_state_color : new_style.realstore_default_state_color }`">{{ item.status_info.msg }}</span>
|
||||
<span v-if="!isEmpty(item.status_info)" class="text-line-1" :style="trends_config('state') + `color: ${ item.status_info.status == 1 ? new_style.realstore_state_color : new_style.realstore_default_state_color }`">{{ item.status_info.msg }}</span>
|
||||
</div>
|
||||
<img-or-icon-or-text :value="props.value" type="navigation" />
|
||||
</div>
|
||||
|
|
@ -231,9 +231,7 @@ const get_products = () => {
|
|||
} else {
|
||||
list.value = Array(4).fill(default_list);
|
||||
}
|
||||
}).catch(() => {
|
||||
list.value = Array(4).fill(default_list);
|
||||
});
|
||||
})
|
||||
};
|
||||
// 取出监听的数据
|
||||
const watch_data = computed(() => {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<image-empty v-model="item.goods_url" :style="goods_image_radius"></image-empty>
|
||||
</template>
|
||||
<span v-if="is_show('goods_title')" class="flex-1 text-line-1" :style="trends_config('goods_title')">{{ item.title }}</span>
|
||||
<span v-if="is_show('time')" class="nowarp" :style="trends_config('time')">{{ item.add_time }}</span>
|
||||
<span v-if="is_show('time')" class="nowrap" :style="trends_config('time')">{{ item.add_time }}</span>
|
||||
</div>
|
||||
</swiper-slide>
|
||||
</swiper>
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
<image-empty v-model="item1.goods_url" :style="goods_image_radius"></image-empty>
|
||||
</template>
|
||||
<span v-if="is_show('goods_title')" class="flex-1 text-line-1" :style="trends_config('goods_title') + `max-width: ${ max_title_width }px;`">{{ item1.title }}</span>
|
||||
<span v-if="is_show('time')" class="nowarp" :style="trends_config('time')">{{ item1.add_time }}</span>
|
||||
<span v-if="is_show('time')" class="nowrap" :style="trends_config('time')">{{ item1.add_time }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</swiper-slide>
|
||||
|
|
@ -147,7 +147,6 @@ const get_products = () => {
|
|||
keywords: keywords,
|
||||
number: number,
|
||||
};
|
||||
list.value = Array(50).fill(default_list);
|
||||
// 获取商品列表
|
||||
SalerecordsAPI.getAutoList(params).then((res: any) => {
|
||||
if (!isEmpty(res.data)) {
|
||||
|
|
|
|||
|
|
@ -176,14 +176,12 @@ const get_shops = () => {
|
|||
} else {
|
||||
list.value = Array(4).fill(default_list);
|
||||
}
|
||||
}).catch(() => {
|
||||
list.value = Array(4).fill(default_list);
|
||||
});
|
||||
})
|
||||
};
|
||||
// 取出监听的数据
|
||||
const watch_data = computed(() => {
|
||||
const { category_ids, number, order_by_type, order_by_rule, data_type, data_list, keywords } = form.value;
|
||||
return { category_ids, number, order_by_type, order_by_rule, data_type, data_list, keywords };
|
||||
const { category_ids, number, order_by_type, order_by_rule, data_type, data_list, keywords, is_goods_list } = form.value;
|
||||
return { category_ids, number, order_by_type, order_by_rule, data_type, data_list, keywords, is_goods_list };
|
||||
})
|
||||
// 初始化的时候不执行, 监听数据变化
|
||||
watch(() => watch_data.value, (val, oldVal) => {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ interface defaultRealstore {
|
|||
order_by_type: number,
|
||||
order_by_rule:number,
|
||||
keywords: string;
|
||||
is_reply: string;
|
||||
is_show: string[],
|
||||
};
|
||||
style: {
|
||||
|
|
@ -70,8 +71,9 @@ const defaultRealstore: defaultRealstore = {
|
|||
category_ids: [],
|
||||
number: 4,
|
||||
order_by_type: 0,
|
||||
order_by_rule: 0,
|
||||
order_by_rule: 0,
|
||||
keywords: '',
|
||||
is_reply: '',
|
||||
is_show: ['time', 'page_view', 'reply_status', 'ranking'],
|
||||
},
|
||||
style: {
|
||||
|
|
@ -108,12 +110,12 @@ const defaultRealstore: defaultRealstore = {
|
|||
ask_title_color: '#333',
|
||||
ask_title_typeface: 'bold',
|
||||
ask_title_size: 14,
|
||||
ask_time_color: '#666',
|
||||
ask_time_color: '#999',
|
||||
ask_time_typeface: '400',
|
||||
ask_time_size: 12,
|
||||
ask_page_view_color: '#666',
|
||||
ask_time_size: 11,
|
||||
ask_page_view_color: '#999',
|
||||
ask_page_view_typeface: '400',
|
||||
ask_page_view_size: 12,
|
||||
ask_page_view_size: 11,
|
||||
// 是否滚动
|
||||
is_roll: '1',
|
||||
interval_time: 3,
|
||||
|
|
@ -135,13 +137,20 @@ const defaultRealstore: defaultRealstore = {
|
|||
box_shadow_blur: 0,
|
||||
box_shadow_spread: 0,
|
||||
returned_style: {
|
||||
color_list: [{ color: '', color_percentage: undefined }],
|
||||
color_list: [{ color: '#10BB78', color_percentage: undefined }],
|
||||
direction: '90deg',
|
||||
background_img_style: '2',
|
||||
background_img: [],
|
||||
font_color: '#ccc',
|
||||
font_color: '#fff',
|
||||
font_size: 12,
|
||||
font_typeface: '400',
|
||||
font_padding: {
|
||||
padding: 0,
|
||||
padding_top: 0,
|
||||
padding_bottom: 0,
|
||||
padding_left: 7,
|
||||
padding_right: 7,
|
||||
},
|
||||
border_is_show: '0',
|
||||
border_color: '#eee',
|
||||
border_style: 'solid',
|
||||
|
|
@ -154,13 +163,20 @@ const defaultRealstore: defaultRealstore = {
|
|||
},
|
||||
},
|
||||
not_replied_yet_style: {
|
||||
color_list: [{ color: '', color_percentage: undefined }],
|
||||
color_list: [{ color: '#E3CD35', color_percentage: undefined }],
|
||||
direction: '90deg',
|
||||
background_img_style: '2',
|
||||
background_img: [],
|
||||
font_color: '#ccc',
|
||||
font_color: '#fff',
|
||||
font_size: 12,
|
||||
font_typeface: '400',
|
||||
font_padding: {
|
||||
padding: 0,
|
||||
padding_top: 0,
|
||||
padding_bottom: 0,
|
||||
padding_left: 7,
|
||||
padding_right: 7,
|
||||
},
|
||||
border_is_show: '0',
|
||||
border_color: '#eee',
|
||||
border_style: 'solid',
|
||||
|
|
|
|||
|
|
@ -59,10 +59,11 @@ interface defaultRealstore {
|
|||
goods_save_price: string;
|
||||
goods_save_price_row: string;
|
||||
data_type: string;
|
||||
data_ids: string;
|
||||
data_list: string[];
|
||||
data_auto_list: string[],
|
||||
keywords: string,
|
||||
binding_type: string[],
|
||||
category_ids: string[],
|
||||
number: number,
|
||||
order_by_type: number,
|
||||
order_by_rule: number,
|
||||
|
|
@ -178,10 +179,11 @@ const defaultRealstore: defaultRealstore = {
|
|||
goods_save_price: '1',
|
||||
goods_save_price_row: '1',
|
||||
data_type: '0',
|
||||
data_ids: '',
|
||||
data_list: [],
|
||||
data_auto_list: [],
|
||||
keywords: '',
|
||||
binding_type: [],
|
||||
category_ids: [],
|
||||
number: 4,
|
||||
order_by_type: 0,
|
||||
order_by_rule: 0,
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ interface defaultRealstore {
|
|||
content_top: object;
|
||||
theme: string;
|
||||
data_type: string,
|
||||
data_ids: string,
|
||||
data_list: string[],
|
||||
data_auto_list: string[],
|
||||
category_ids: string[],
|
||||
|
|
@ -62,6 +63,7 @@ interface defaultRealstore {
|
|||
order_by_type: number,
|
||||
order_by_rule: number,
|
||||
keywords: string,
|
||||
is_goods_list: string;
|
||||
carousel_col: number;
|
||||
is_navigation_show: string;
|
||||
navigation_type: string;
|
||||
|
|
@ -158,6 +160,7 @@ const defaultRealstore: defaultRealstore = {
|
|||
},
|
||||
theme: '0',
|
||||
data_type: '0',
|
||||
data_ids: '',
|
||||
data_list: [],
|
||||
data_auto_list: [],
|
||||
category_ids: [],
|
||||
|
|
@ -165,6 +168,7 @@ const defaultRealstore: defaultRealstore = {
|
|||
order_by_type: 0,
|
||||
order_by_rule: 0,
|
||||
keywords: '',
|
||||
is_goods_list: '0',
|
||||
carousel_col: 1,
|
||||
is_navigation_show: '1',
|
||||
navigation_type: 'img-icon',
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ interface defaultSalerecords {
|
|||
keywords: string,
|
||||
show_number: number,
|
||||
number: number;
|
||||
data_auto_list: string[];
|
||||
is_show: string[];
|
||||
};
|
||||
style: {
|
||||
|
|
@ -71,6 +72,7 @@ const defaultSalerecords: defaultSalerecords = {
|
|||
interval_time: 3,
|
||||
show_number: 2,
|
||||
keywords: '',
|
||||
data_auto_list: [],
|
||||
number: 4,
|
||||
is_show: ['head', 'nick_name', 'goods_image', 'goods_title', 'time'],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ interface defaultRealstore {
|
|||
shop_desc: string;
|
||||
shop_desc_row: string;
|
||||
data_type: string,
|
||||
data_ids: string;
|
||||
data_list: string[];
|
||||
data_auto_list: string[];
|
||||
category_ids: string[],
|
||||
|
|
@ -17,6 +18,7 @@ interface defaultRealstore {
|
|||
order_by_type: number,
|
||||
order_by_rule:number,
|
||||
keywords: string;
|
||||
is_goods_list: string,
|
||||
is_right_show: string;
|
||||
right_type: string;
|
||||
right_img: uploadList[];
|
||||
|
|
@ -75,6 +77,7 @@ const defaultRealstore: defaultRealstore = {
|
|||
shop_desc: '1',
|
||||
shop_desc_row: '1',
|
||||
data_type: '0',
|
||||
data_ids: '',
|
||||
data_list: [],
|
||||
data_auto_list: [],
|
||||
category_ids: [],
|
||||
|
|
@ -82,6 +85,7 @@ const defaultRealstore: defaultRealstore = {
|
|||
order_by_type: 0,
|
||||
order_by_rule: 0,
|
||||
keywords: '',
|
||||
is_goods_list: '0',
|
||||
is_right_show: '1',
|
||||
right_type: 'img-icon',
|
||||
right_img: [],
|
||||
|
|
|
|||
|
|
@ -251,9 +251,9 @@ const save_formmat_form_data = (data: diy_data_item, close: boolean = false, is_
|
|||
|
||||
clone_form.footer.show_tabs = '0';
|
||||
// 字段比coupon多
|
||||
const new_array_1 = ['goods-list', 'article-list'];
|
||||
const new_array_1 = ['goods-list', 'article-list', 'blog', 'shop', 'realstore', 'binding'];
|
||||
// 数据比正常list多一级
|
||||
const new_array_2 = ['goods-tabs', 'article-tabs'];
|
||||
const new_array_2 = ['goods-tabs', 'article-tabs', 'blog-tabs'];
|
||||
// 数据格式简单
|
||||
const new_array_3 = ['coupon'];
|
||||
// 层级更深
|
||||
|
|
@ -265,12 +265,12 @@ const save_formmat_form_data = (data: diy_data_item, close: boolean = false, is_
|
|||
clone_form.diy_data = clone_form.diy_data.map((item: any) => {
|
||||
if (new_array_1.includes(item.key)) {
|
||||
// 商品或文章的数据处理
|
||||
goods_or_article_data_processing(item.com_data.content, item.key == new_array_1[0]);
|
||||
goods_or_article_data_processing(item.com_data.content, item.key == new_array_1[0], item.key);
|
||||
} else if (new_array_2.includes(item.key)) {
|
||||
item.com_data.content.tabs_active_index = 0;
|
||||
item.com_data.content.tabs_list.forEach((item0: any) => {
|
||||
// 商品或文章的数据处理
|
||||
goods_or_article_data_processing(item0, item.key == new_array_1[0]);
|
||||
goods_or_article_data_processing(item0, item.key == new_array_1[0], item.key);
|
||||
});
|
||||
} else if (new_array_3.includes(item.key)) {
|
||||
item.com_data.content.data_ids = item.com_data.content.data_list.map((item: any) => item.id).join(',') || '';
|
||||
|
|
@ -365,6 +365,8 @@ const save_formmat_form_data = (data: diy_data_item, close: boolean = false, is_
|
|||
// item.article_config = cloneDeep(article_default_parameter);
|
||||
}
|
||||
});
|
||||
} else if (['salerecords'].includes(item.key)) {
|
||||
item.com_data.content.data_auto_list = [];
|
||||
}
|
||||
return {
|
||||
...item,
|
||||
|
|
@ -417,7 +419,7 @@ const save_formmat_form_data = (data: diy_data_item, close: boolean = false, is_
|
|||
* @param new_com_data_content 传入的新数据内容对象,包含需要处理的数据列表和其他相关信息
|
||||
* @param is_goods 是否为商品的标志,用于决定数据处理的具体方式
|
||||
*/
|
||||
const goods_or_article_data_processing = (new_com_data_content: any, is_goods: boolean) => {
|
||||
const goods_or_article_data_processing = (new_com_data_content: any, is_goods: boolean, type: string = '') => {
|
||||
// 判断数据类型,如果为'0',则进行详细的数据处理
|
||||
if (new_com_data_content.data_type == '0') {
|
||||
// 提取数据ID列表,用于后续的数据查询或处理
|
||||
|
|
@ -431,8 +433,9 @@ const save_formmat_form_data = (data: diy_data_item, close: boolean = false, is_
|
|||
data_id: item1.data.id,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// 设置分类ID、数量、排序规则等默认值,确保数据的一致性和完整性
|
||||
new_com_data_content.keywords = '';
|
||||
new_com_data_content.category_ids = defaultConfigSetting.category_ids;
|
||||
new_com_data_content.number = defaultConfigSetting.page_size;
|
||||
new_com_data_content.order_by_rule = defaultConfigSetting.order_by_rule;
|
||||
|
|
@ -442,7 +445,20 @@ const save_formmat_form_data = (data: diy_data_item, close: boolean = false, is_
|
|||
if (is_goods) {
|
||||
new_com_data_content.brand_ids = defaultConfigSetting.brand_ids;
|
||||
} else {
|
||||
new_com_data_content.is_cover = defaultConfigSetting.is_cover;
|
||||
// 文章博客的显示
|
||||
if (['article-list', 'article-tabs', 'blog', 'blog-tabs'].includes(type)) {
|
||||
new_com_data_content.is_cover = defaultConfigSetting.is_cover;
|
||||
if (['blog', 'blog-tabs'].includes(type)) {
|
||||
new_com_data_content.is_recommended = '0';
|
||||
new_com_data_content.is_hot = '0';
|
||||
}
|
||||
} else if (['realstore', 'shop'].includes(type)) {
|
||||
// 多商户多门店的显示
|
||||
new_com_data_content.is_goods_list = '0';
|
||||
} else if (type === 'binding') {
|
||||
// 组合搭配的显示
|
||||
new_com_data_content.is_home_show = '0';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 如果数据类型不是'0',清空数据ID列表和数据列表,确保数据处理的一致性
|
||||
|
|
|
|||
Loading…
Reference in New Issue