Files
lucky_shop/pages_tool/ai-chat/components/ai-chat-emoji-panel.vue
ZF sun 556ce9d132 refactor(ai-chat): 重构AI聊天国际化文件结构
- 将 ai-chat 语言文件从 ai/ 迁移至 ai-chat/ 目录
- 重构消息组件及多个子组件
2026-05-18 15:36:13 +08:00

161 lines
5.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view class="emoji-popup" v-if="visible">
<view class="emoji-mask" @click="hideEmojiPanel"></view>
<view class="emoji-panel">
<view class="emoji-header">
<text>{{ $lang('emojiTitle') }}</text>
<button class="close-btn" @click="hideEmojiPanel">
<text>×</text>
</button>
</view>
<view class="emoji-grid">
<view
v-for="(emoji, index) in emojiList"
:key="index"
class="emoji-item"
@click="insertEmoji(emoji)">
<text class="emoji-text">{{ emoji }}</text>
</view>
</view>
</view>
</view>
</template>
<script>
/**
* ai-chat-emoji-panel - Emoji 面板组件
*
* Props:
* visible: Boolean - 控制显示/隐藏
*
* Events:
* update:visible - 同步关闭状态
* emoji-selected - 选择表情,参数:emoji 字符串
*/
export default {
name: 'AiChatEmojiPanel',
props: {
visible: {
type: Boolean,
default: false
}
},
data() {
return {
emojiList: [
'😀','😃','😄','😁','😆','😅','🤣','😂','🙂','🙃','😉','😊','😇','🥰','😍','🤩','😘','😗','😚','😋','😛','😜','🤪','😝','🤑','🤗','🤭','🤫','🤔','🤐','🤨','😐','😑','😶','😏','😒','🙄','😬','🤥','😌','😔','😪','🤤','😴','😷','🤒','🤕','🤢','🤮','🤧','🥵','🥶','🥴','😵','🤯','🤠','🥳','😎','🤓','🧐','😕','😟','🙁','😮','😯','😲','😳','🥺','😦','😧','😨','😰','😥','😢','😭','😱','😖','😣','😞','😓','😩','😫','🥱','😤','😡','😠','🤬','😈','👿','💀','💩','👻','👽','🤖','🎃','😺','😸','😹','😻','😼','😽','🙀','😿','😾','👋','🤚','🖐','✋','🖖','👌','🤏','✌','🤞','🤟','🤘','🤙','👈','👉','👆','🖕','👇','☝','👍','👎','✊','👊','🤛','🤜','👏','🙌','👐','🤲','🤝','🙏','✍','💅','🤳','💪','💗','💓','💕','💖','💝','💞','💘','💌','💟','💛','💙','💜','🖤','💔','💢','💣','💥','💫','💦','💨','👁','👀','👅','👄','👂','👃','👶','👦','👧','👨','👩','👴','👵','👱','👲','👳','👴','👵','👶','👼','👸','🎅','🤶','🦸','🦹','🧙','🧚','🧛','🧜','🧝','🧞','🧟','🦄','🐶','🐱','🐭','🐹','🐰','🦊','🐻','🐼','🐨','🐯','🦁','🐮','🐷','🐸','🐵','🙈','🙉','🙊','🐒','🐔','🐧','🐦','🐤','🐣','🐥','🦆','🦅','🦉','🦇','🐺','🐗','🐴','🦄','🐝','🐛','🦋','🐌','🐞','🐜','🦟','🦗','🕷','🦂','🐢','🐍','🦎','🦖','🦕','🐙','🦑','🦐','🦞','🦀','🐡','🐠','🐟','🐬','🐳','🐋','🦈','🐊','🐅','🐆','🦓','🦍','🦧','🐘','🦛','🦏','🐪','🐫','🦒','🦘','🐃','🐂','🐄','🐎','🐖','🐏','🐑','🐐','🐓','🦃','🦚','🦜','🦢','🦩','🕊','🐕','🐩','🐈','🐓','🐇','🐁','🐀','🐿','🦔','🐾','🐉','🐲'
]
}
},
methods: {
hideEmojiPanel() {
this.$emit('update:visible', false)
},
insertEmoji(emoji) {
this.$emit('emoji-selected', emoji)
this.hideEmojiPanel()
}
}
}
</script>
<style lang="scss" scoped>
/* 引入图标字体 */
@import url('/common/css/iconfont.css');
/* 引入全局变量 */
@import '../styles/ai-chat-global.scss';
.emoji-popup {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 999;
.emoji-mask {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.4);
}
.emoji-panel {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: #fff;
border-radius: 24rpx 24rpx 0 0;
padding: 0;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
max-height: 55vh;
.emoji-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16rpx 20rpx;
border-bottom: 1rpx solid #e5e5e5;
background-color: #f7f7f7;
text {
font-size: 30rpx;
font-weight: 500;
color: #333;
}
.close-btn {
width: 48rpx;
height: 48rpx;
border-radius: 50%;
background-color: transparent;
display: flex;
align-items: center;
justify-content: center;
border: none;
text {
font-size: 36rpx;
color: #999;
}
}
}
.emoji-grid {
display: grid;
grid-template-columns: repeat(8, 1fr);
gap: 8rpx;
padding: 20rpx 16rpx;
overflow-y: auto;
max-height: 45vh;
.emoji-item {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 80rpx;
border-radius: 8rpx;
background-color: transparent;
&:active {
background-color: #e5e5e5;
}
.emoji-text {
font-size: 48rpx;
line-height: 1;
}
}
}
}
}
</style>