Skip to content

Commit 1d40a74

Browse files
committed
refactor: 调整表情显示方式
1 parent f42a2fb commit 1d40a74

File tree

1 file changed

+41
-55
lines changed

1 file changed

+41
-55
lines changed

src/client/view/submit.vue

Lines changed: 41 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
</div>
2020
<div class="D-actions D-select-none">
2121
<div class="D-actions-left">
22-
<div class="D-emot-btn" v-html="iconEmotion"></div>
22+
<div
23+
class="D-emot-btn"
24+
@click="isEmot = !isEmot"
25+
v-html="iconEmotion"
26+
></div>
2327
<div
2428
v-if="!isCancel"
2529
class="D-setting-btn"
@@ -32,44 +36,6 @@
3236
@click="onRefresh"
3337
v-html="iconRefresh"
3438
></div>
35-
<div class="D-emot">
36-
<ul
37-
class="D-emot-items"
38-
:class="{ 'D-emot-items-active': index === emotIndex }"
39-
v-for="(emots, keys, index) in emotMaps"
40-
:key="index"
41-
>
42-
<li
43-
class="D-emot-item"
44-
v-for="(items, key, index) in emots.items"
45-
@click="onClickEmot(key, items, emots.type)"
46-
:key="index"
47-
>
48-
<span
49-
v-if="emots.type == 'text'"
50-
:title="key"
51-
v-text="items"
52-
></span>
53-
<img
54-
v-else
55-
:src="$D.imgLoading"
56-
:d-src="items"
57-
:alt="key"
58-
:title="key"
59-
/>
60-
</li>
61-
</ul>
62-
63-
<div class="D-emot-packages">
64-
<span
65-
:class="{ 'D-emot-package-active': index === emotIndex }"
66-
v-for="(emots, key, index) in emotMaps"
67-
@click="onClickEmotPackage(index)"
68-
:key="index"
69-
v-html="key"
70-
></span>
71-
</div>
72-
</div>
7339
</div>
7440
<div class="D-actions-right">
7541
<div class="D-text-number" v-if="wordNumber.content">
@@ -105,6 +71,40 @@
10571
</div>
10672
</div>
10773
<div class="D-preview" v-if="isPreview" v-html="contentHTML"></div>
74+
<div class="D-emot" v-show="isEmot">
75+
<ul
76+
class="D-emot-items"
77+
:class="{ 'D-emot-items-active': index === emotIndex }"
78+
v-for="(emots, keys, index) in emotMaps"
79+
:key="index"
80+
>
81+
<li
82+
class="D-emot-item"
83+
v-for="(items, key, index) in emots.items"
84+
@click="onClickEmot(key, items, emots.type)"
85+
:key="index"
86+
>
87+
<span v-if="emots.type == 'text'" :title="key" v-text="items"></span>
88+
<img
89+
v-else
90+
:src="$D.imgLoading"
91+
:d-src="items"
92+
:alt="key"
93+
:title="key"
94+
/>
95+
</li>
96+
</ul>
97+
98+
<div class="D-emot-packages">
99+
<span
100+
:class="{ 'D-emot-package-active': index === emotIndex }"
101+
v-for="(emots, key, index) in emotMaps"
102+
@click="onClickEmotPackage(index)"
103+
:key="index"
104+
v-html="key"
105+
></span>
106+
</div>
107+
</div>
108108
</div>
109109
</template>
110110

@@ -172,6 +172,7 @@ export default {
172172
sending: false,
173173
174174
// emot
175+
isEmot: false,
175176
emotIndex: 0,
176177
emotMaps: this.$D.emotMaps,
177178
emotAll: {},
@@ -567,10 +568,9 @@ export default {
567568
/* emot */
568569
.D-emot {
569570
top: 30px;
570-
display: none;
571571
width: 100%;
572+
margin-top: 10px;
572573
border: 1px solid var(--D-Low-Color);
573-
z-index: 1;
574574
border-radius: 4px;
575575
background: #fff;
576576
}
@@ -585,20 +585,6 @@ export default {
585585
}
586586
}
587587
588-
.D-emot-btn::after {
589-
content: '';
590-
position: absolute;
591-
left: -6px;
592-
top: 0;
593-
right: -6px;
594-
bottom: -10px;
595-
}
596-
.D-emot-btn:hover ~ .D-emot,
597-
.D-emot:hover {
598-
display: block;
599-
position: absolute;
600-
}
601-
602588
.D-emot-items {
603589
display: none;
604590
height: 180px;

0 commit comments

Comments
 (0)