+
{{ item.show_price_symbol }}{{ item.min_price }}{{ item.show_price_unit }}
{{ item.show_original_price_symbol }}{{ item.min_original_price }}{{ item.show_original_price_unit }}
@@ -133,17 +133,6 @@ const default_list = {
new_src: []
}
const list = ref
([]);
-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 {
diff --git a/src/components/model-shop-list/model-shop-list-content.vue b/src/components/model-shop-list/model-shop-list-content.vue
index 800e7be0..1f28acef 100644
--- a/src/components/model-shop-list/model-shop-list-content.vue
+++ b/src/components/model-shop-list/model-shop-list-content.vue
@@ -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);
};
diff --git a/src/store/index.ts b/src/store/index.ts
index f34bf617..9b0b1f55 100644
--- a/src/store/index.ts
+++ b/src/store/index.ts
@@ -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 };