1
This commit is contained in:
@@ -310,6 +310,7 @@ const props = defineProps({
|
||||
default: () => ({})
|
||||
}
|
||||
});
|
||||
const { feature } = toRefs(props);
|
||||
|
||||
// Emits
|
||||
const emit = defineEmits(['submit-success']);
|
||||
@@ -337,6 +338,7 @@ const loadProductBackground = async (productType) => {
|
||||
console.warn(`Failed to load background image for ${productType}:`, error);
|
||||
return null;
|
||||
}
|
||||
console.log('Loaded background21:', background);
|
||||
};
|
||||
|
||||
const route = useRoute();
|
||||
@@ -384,6 +386,7 @@ const getProductBackground = computed(() => productBackground.value);
|
||||
|
||||
// 背景图片样式
|
||||
const backgroundStyle = computed(() => {
|
||||
console.log('getProductBackground', getProductBackground.value);
|
||||
if (getProductBackground.value) {
|
||||
return {
|
||||
backgroundImage: `url(${getProductBackground.value})`,
|
||||
@@ -670,12 +673,12 @@ const toHistory = () => {
|
||||
|
||||
// 生命周期
|
||||
onMounted(async () => {
|
||||
await loadBackgroundImage();
|
||||
await loadTrapezoidBackground();
|
||||
|
||||
});
|
||||
|
||||
// 加载背景图片
|
||||
const loadBackgroundImage = async () => {
|
||||
console.log('加载背景图片:s111s', props.feature);
|
||||
const background = await loadProductBackground(props.feature);
|
||||
productBackground.value = background || '';
|
||||
};
|
||||
@@ -685,6 +688,10 @@ onUnmounted(() => {
|
||||
clearInterval(timer);
|
||||
}
|
||||
});
|
||||
watch(feature, async () => {
|
||||
await loadBackgroundImage();
|
||||
await loadTrapezoidBackground();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user