新增自定义的显示

v1.0.0
于肖磊 2024-08-19 18:19:42 +08:00
parent e477c59dde
commit 1bae42ea2c
4 changed files with 28 additions and 24 deletions

View File

@ -39,6 +39,9 @@
import Dialog from './components/dialog.vue';
import DragIndex from './components/index.vue';
import { cloneDeep } from 'lodash';
import { DataSourceStore } from '@/store';
const data_source = DataSourceStore();
const props = defineProps({
value: {
type: Object,

View File

@ -58,7 +58,7 @@
</div>
</div>
<div v-else class="flex-row align-c jc-sb">
<div class="flex-row align-c nowrap text-line-1">
<div class="flex-row align-c nowrap">
<div v-if="is_show('2')" class="num" :style="`color: ${ new_style.shop_price_color }`"><span class="identifying">{{ item.show_price_symbol }}</span><span :style="trends_config('price')">{{ item.min_price }}</span><span class="identifying">{{ item.show_price_unit }}</span></div>
<div v-if="show_content && is_show('5')" class="size-10 flex"><span class="original-price-left"></span><span class="original-price flex-1 text-line-1">{{ item.show_original_price_symbol }}{{ item.min_original_price }}{{ item.show_original_price_unit }}</span></div>
</div>
@ -133,17 +133,6 @@ const default_list = {
new_src: []
}
const list = ref<product_list[]>([]);
watchEffect(() => {
if (form.value.product_check == '0') {
if (!isEmpty(form.value.product_list)) {
list.value = form.value.product_list;
} else {
list.value = Array(4).fill(default_list);
}
} else {
get_products();
}
});
const get_products = () => {
const { goods_category_ids, goods_brand_ids, number, sort, sort_rules } = form.value;
const params = {
@ -163,6 +152,17 @@ const get_products = () => {
}
});
};
watchEffect(() => {
if (form.value.product_check == '0') {
if (!isEmpty(form.value.product_list)) {
list.value = form.value.product_list;
} else {
list.value = Array(4).fill(default_list);
}
} else {
get_products();
}
});
//
const content_radius = computed(() => radius_computer(new_style.value.shop_radius));
@ -376,7 +376,7 @@ const style_container = computed(() => {
height: 11.4rem;
}
.flex-img4 {
width: 100%;
width: 7rem;
height: 7rem;
}
.flex-img5 {

View File

@ -91,7 +91,7 @@ const state = reactive({
// 使toRefs
const { form } = toRefs(state);
const base_list = {
const base_list = reactive({
product_style_list: [
{ name: '单列展示', value: '0' },
{ name: '大图展示', value: '2' },
@ -117,16 +117,6 @@ const base_list = {
{ name: '降序(desc)', value: '0' },
{ name: '升序(asc)', value: '1' },
]
};
onBeforeMount(() => {
if (!shop_store.is_shop_api) {
shop_store.set_is_shop_api(true);
init();
} else {
base_list.product_category_list = shop_store.category_list;
base_list.product_brand_list = shop_store.brand_list;
}
});
const init = () => {
@ -138,6 +128,16 @@ const init = () => {
});
};
onMounted(() => {
if (!shop_store.is_shop_api) {
shop_store.set_is_shop_api(true);
init();
} else {
base_list.product_category_list = shop_store.category_list;
base_list.product_brand_list = shop_store.brand_list;
}
});
const product_list_remove = (index: number) => {
form.value.product_list.splice(index, 1);
};

View File

@ -11,4 +11,5 @@ export * from './modules/footer-nav-content';
export * from './modules/upload';
export * from './modules/shop';
export * from './modules/url-value';
export * from './modules/custom';
export { store };