|
@@ -7,7 +7,9 @@
|
7
|
7
|
<Image :src="backImg" :actions="actions" @load="onLoad"/>
|
8
|
8
|
<img :src="qrcode" alt="" class="qrcode" :style="qrStyle">
|
9
|
9
|
<div class="poem-author" :style="iiStyle">{{ author }}</div>
|
10
|
|
- <div class="poem-content" :style="ttStyle" v-html="contentHtml"></div>
|
|
10
|
+ <div class="poem-content" :style="ttStyle">
|
|
11
|
+ <VerticalText :text="content" :size="sizeRef" />
|
|
12
|
+ </div>
|
11
|
13
|
</div>
|
12
|
14
|
<TGradient :style="gdStyle" color="#0f2c37" />
|
13
|
15
|
<template v-if="creation">
|
|
@@ -24,6 +26,7 @@
|
24
|
26
|
import html2canvas from 'html2canvas';
|
25
|
27
|
import Image from '@/components/Image.vue';
|
26
|
28
|
import TGradient from '@/components/TGradient.vue';
|
|
29
|
+ import VerticalText from '../../components/VerticalText.vue';
|
27
|
30
|
import { getPageStyle } from '@/utils/page';
|
28
|
31
|
|
29
|
32
|
const backImg = './images/3.png';
|
|
@@ -54,19 +57,17 @@
|
54
|
57
|
const psStyle = ref({});
|
55
|
58
|
const qrStyle = ref({ width: '1px', height: '1px' });
|
56
|
59
|
const pgStyle = ref({});
|
|
60
|
+ const sizeRef = ref([26, 18]);
|
57
|
61
|
const creation = ref();
|
58
|
62
|
const [author, content] = useModel('poem');
|
59
|
63
|
const [qrcode] = useModel('qrcode');
|
60
|
64
|
|
61
|
|
- const contentHtml = computed(() => (content.value || '').replace(/[\r\n]/g, '<br>').replace(/[\n]/g, '<br>'));
|
62
|
|
-
|
63
|
65
|
const onNextClick = () => {
|
64
|
66
|
router.push('/creation');
|
65
|
67
|
};
|
66
|
68
|
|
67
|
69
|
const onLoad = (e) => {
|
68
|
|
- console.log('---------')
|
69
|
|
- const { width, height, naturalHeight, naturalWidth } = e.target;
|
|
70
|
+ const { clientWidth: width, clientHeight: height, naturalHeight, naturalWidth } = e.target;
|
70
|
71
|
const xRate = width / naturalWidth;
|
71
|
72
|
const yRate = height / naturalHeight;
|
72
|
73
|
|
|
@@ -101,6 +102,8 @@
|
101
|
102
|
lineHeight: `${50 * xRate}px`,
|
102
|
103
|
};
|
103
|
104
|
|
|
105
|
+ sizeRef.value = [50 * xRate, 36 * xRate];
|
|
106
|
+
|
104
|
107
|
iiStyle.value = {
|
105
|
108
|
top: `${authorHeight * yRate}px`,
|
106
|
109
|
};
|
|
@@ -145,7 +148,7 @@
|
145
|
148
|
// background: rgba(255, 0,0, .5);
|
146
|
149
|
position: absolute;
|
147
|
150
|
|
148
|
|
- writing-mode: vertical-rl;
|
|
151
|
+ // writing-mode: vertical-rl;
|
149
|
152
|
font-size: 18px;
|
150
|
153
|
color: #0F3341;
|
151
|
154
|
line-break: anywhere;
|