|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="H5Editor">
|
|
|
- <div class="H5Editor_left"></div>
|
|
|
+ <div class="H5Editor_left">1</div>
|
|
|
<div class="H5Editor_center">
|
|
|
<div class="pageClient">
|
|
|
<div class="page">
|
|
@@ -8,7 +8,7 @@
|
|
|
class="pageMain"
|
|
|
:style="{
|
|
|
width: page.width + 'px',
|
|
|
- 'min-height': page.height + 'px',
|
|
|
+ 'height': page.height ? page.height + 'px' : undefined,
|
|
|
...backgroundStyle(),
|
|
|
}"
|
|
|
>
|
|
@@ -16,7 +16,26 @@
|
|
|
v-for="(item, index) in hoversList[selectPage].components || []"
|
|
|
:key="index"
|
|
|
>
|
|
|
- <component :is="components[item.type]" :item="item"></component>
|
|
|
+ <h5-image v-if="item.type === 'image'" :item="item"></h5-image>
|
|
|
+ <h5-paragraph
|
|
|
+ v-if="item.type === 'paragraph'"
|
|
|
+ :item="item"
|
|
|
+ @saveParagraph="text => saveParagraph(text, index)"
|
|
|
+ ></h5-paragraph>
|
|
|
+ <h5-from-component
|
|
|
+ v-if="item.type === 'fromComponent'"
|
|
|
+ :item="item"
|
|
|
+ >
|
|
|
+ <!-- <div style="padding: 5px">
|
|
|
+ <van-button block type="danger" native-type="submit" disabled>
|
|
|
+ 我要报名
|
|
|
+ </van-button>
|
|
|
+ </div> -->
|
|
|
+ <template v-for="(v, i) in (item.child_list || [])" :key="i">
|
|
|
+ <h5-van-field v-if="v.type === 'van-field'" :item="v"></h5-van-field>
|
|
|
+ <h5-van-buttom v-if="v.type === 'van-buttom'" :item="v"></h5-van-buttom>
|
|
|
+ </template>
|
|
|
+ </h5-from-component>
|
|
|
</template>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -40,28 +59,21 @@
|
|
|
import { ref } from 'vue';
|
|
|
import { useRoute } from 'vue-router';
|
|
|
|
|
|
-import image from './components/H5Editor/img.vue';
|
|
|
-import paragraph from './components/H5Editor/paragraph.vue';
|
|
|
-import fromComponent from './components/H5Editor/from.vue';
|
|
|
-
|
|
|
-const components = {
|
|
|
- image,
|
|
|
- paragraph,
|
|
|
- fromComponent,
|
|
|
-};
|
|
|
+import H5Image from './components/H5Editor/img.vue';
|
|
|
+import H5Paragraph from './components/H5Editor/paragraph.vue';
|
|
|
+import H5FromComponent from './components/H5Editor/from.vue';
|
|
|
+import H5VanField from './components/H5Editor/van_field.vue';
|
|
|
+import H5VanButtom from './components/H5Editor/van_buttom.vue';
|
|
|
|
|
|
const route = useRoute();
|
|
|
const item = JSON.parse(route.query.item || '{}');
|
|
|
const selectPage = ref(0);
|
|
|
const hoversList = ref(item.hoversList || []);
|
|
|
const page = ref({ width: 375, height: 0 });
|
|
|
-
|
|
|
const selectPageFunc = (index = 0) => {
|
|
|
selectPage.value = index;
|
|
|
};
|
|
|
|
|
|
-console.log(item);
|
|
|
-
|
|
|
// 查看页面大小,
|
|
|
const img = new Image();
|
|
|
img.src = hoversList.value[selectPage.value].background_url || '';
|
|
@@ -81,6 +93,10 @@ const backgroundStyle = () => {
|
|
|
'background-image': 'url(' + back + ')',
|
|
|
};
|
|
|
};
|
|
|
+
|
|
|
+const saveParagraph = (paragraph, index) => {
|
|
|
+ console.log(paragraph, index);
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
@@ -108,13 +124,13 @@ const backgroundStyle = () => {
|
|
|
position: relative;
|
|
|
}
|
|
|
|
|
|
-.H5Editor_center .pageClient{
|
|
|
+.H5Editor_center .pageClient {
|
|
|
position: absolute;
|
|
|
top: 50%;
|
|
|
left: 50%;
|
|
|
transform: translate(-50%, -50%);
|
|
|
padding: 15px 5px;
|
|
|
- background-color: #000;
|
|
|
+ /* background-color: #000; */
|
|
|
border-radius: 1em;
|
|
|
}
|
|
|
|