营销:完善装修编辑器预览功能

(cherry picked from commit cd89f75b07)
This commit is contained in:
owen 2023-12-07 19:59:32 +08:00 committed by shizhong
parent 59ebc1ea8f
commit 57fcddd6c7

View File

@ -7,6 +7,7 @@
:show-page-config="selectedTemplateItem !== 0"
:show-tab-bar="selectedTemplateItem === 0"
:show-navigation-bar="selectedTemplateItem !== 0"
:preview-url="previewUrl"
@save="submitForm"
@reset="handleEditorReset"
>
@ -50,6 +51,8 @@ const formData = ref<DiyTemplateApi.DiyTemplatePropertyVO>()
const formRef = ref() // Ref
//
const currentFormData = ref<DiyTemplateApi.DiyTemplatePropertyVO | DiyPageApi.DiyPageVO>()
// H5
const previewUrl = ref('')
//
const getPageDetail = async (id: any) => {
@ -57,6 +60,10 @@ const getPageDetail = async (id: any) => {
try {
formData.value = await DiyTemplateApi.getDiyTemplateProperty(id)
currentFormData.value = formData.value
//
const domain = import.meta.env.VITE_MALL_H5_DOMAIN
previewUrl.value = `${domain}/#/pages/index/index?templateId=${formData.value.id}`
} finally {
formLoading.value = false
}