优化页面
This commit is contained in:
@@ -1,150 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../../common/vendor.js");
|
||||
require("../../../../adapter-vue.js");
|
||||
const common_assets = require("../../../../../common/assets.js");
|
||||
const TUIKit_constant = require("../../../../constant.js");
|
||||
const TUIKit_utils_env = require("../../../../utils/env.js");
|
||||
const TUIKit_components_TUIChat_utils_utils = require("../../utils/utils.js");
|
||||
const TUIKit_components_TUIChat_emojiConfig_index = require("../../emoji-config/index.js");
|
||||
const TUIKit_components_TUIChat_config = require("../../config.js");
|
||||
if (!Math) {
|
||||
Icon();
|
||||
}
|
||||
const Icon = () => "../../../common/Icon.js";
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "emoji-picker-dialog",
|
||||
emits: ["insertEmoji", "onClose", "sendMessage"],
|
||||
setup(__props, { emit: __emit }) {
|
||||
var _a;
|
||||
const faceIcon = TUIKit_components_TUIChat_config.ChatConfig.getTheme() === "dark" ? common_assets.faceIconDark : common_assets.faceIconLight;
|
||||
const emits = __emit;
|
||||
const currentTabIndex = common_vendor.ref(0);
|
||||
const currentConversation = common_vendor.ref();
|
||||
common_vendor.ref();
|
||||
const emojiPickerListRef = common_vendor.ref();
|
||||
const featureConfig = TUIKit_components_TUIChat_config.ChatConfig.getFeatureConfig();
|
||||
const list = common_vendor.ref(initEmojiList());
|
||||
const currentTabItem = common_vendor.ref(list == null ? void 0 : list.value[0]);
|
||||
const currentEmojiList = common_vendor.ref((_a = list == null ? void 0 : list.value[0]) == null ? void 0 : _a.list);
|
||||
common_vendor.onMounted(() => {
|
||||
common_vendor.Jt.watch(common_vendor.o.CONV, {
|
||||
currentConversation: onCurrentConversationUpdate
|
||||
});
|
||||
});
|
||||
common_vendor.onUnmounted(() => {
|
||||
common_vendor.Jt.unwatch(common_vendor.o.CONV, {
|
||||
currentConversation: onCurrentConversationUpdate
|
||||
});
|
||||
});
|
||||
const toggleEmojiTab = (index) => {
|
||||
var _a2;
|
||||
currentTabIndex.value = index;
|
||||
currentTabItem.value = list == null ? void 0 : list.value[index];
|
||||
currentEmojiList.value = (_a2 = list == null ? void 0 : list.value[index]) == null ? void 0 : _a2.list;
|
||||
if (!TUIKit_utils_env.isUniFrameWork) {
|
||||
(emojiPickerListRef == null ? void 0 : emojiPickerListRef.value) && (emojiPickerListRef.value.scrollTop = 0);
|
||||
}
|
||||
};
|
||||
const select = (item, index) => {
|
||||
var _a2, _b, _c;
|
||||
const options = {
|
||||
emoji: { key: item, name: TUIKit_components_TUIChat_emojiConfig_index.convertKeyToEmojiName(item) },
|
||||
type: (_a2 = currentTabItem == null ? void 0 : currentTabItem.value) == null ? void 0 : _a2.type
|
||||
};
|
||||
switch ((_b = currentTabItem == null ? void 0 : currentTabItem.value) == null ? void 0 : _b.type) {
|
||||
case TUIKit_constant.EMOJI_TYPE.BASIC:
|
||||
options.url = ((_c = currentTabItem == null ? void 0 : currentTabItem.value) == null ? void 0 : _c.url) + TUIKit_components_TUIChat_emojiConfig_index.BASIC_EMOJI_URL_MAPPING[item];
|
||||
if (TUIKit_utils_env.isUniFrameWork) {
|
||||
common_vendor.index.$emit("insert-emoji", options);
|
||||
} else {
|
||||
emits("insertEmoji", options);
|
||||
}
|
||||
break;
|
||||
case TUIKit_constant.EMOJI_TYPE.BIG:
|
||||
sendFaceMessage(index, currentTabItem.value);
|
||||
break;
|
||||
case TUIKit_constant.EMOJI_TYPE.CUSTOM:
|
||||
sendFaceMessage(index, currentTabItem.value);
|
||||
break;
|
||||
}
|
||||
TUIKit_utils_env.isPC && emits("onClose");
|
||||
};
|
||||
const sendFaceMessage = (index, listItem) => {
|
||||
var _a2, _b, _c, _d, _e;
|
||||
const options = {
|
||||
to: ((_b = (_a2 = currentConversation == null ? void 0 : currentConversation.value) == null ? void 0 : _a2.groupProfile) == null ? void 0 : _b.groupID) || ((_d = (_c = currentConversation == null ? void 0 : currentConversation.value) == null ? void 0 : _c.userProfile) == null ? void 0 : _d.userID),
|
||||
conversationType: (_e = currentConversation == null ? void 0 : currentConversation.value) == null ? void 0 : _e.type,
|
||||
payload: {
|
||||
index: listItem.emojiGroupID,
|
||||
data: listItem.list[index]
|
||||
},
|
||||
needReadReceipt: TUIKit_components_TUIChat_utils_utils.isEnabledMessageReadReceiptGlobal()
|
||||
};
|
||||
common_vendor.Qt.sendFaceMessage(options);
|
||||
};
|
||||
function sendMessage() {
|
||||
common_vendor.index.$emit("send-message-in-emoji-picker");
|
||||
}
|
||||
function onCurrentConversationUpdate(conversation) {
|
||||
currentConversation.value = conversation;
|
||||
}
|
||||
function initEmojiList() {
|
||||
return TUIKit_components_TUIChat_emojiConfig_index.EMOJI_GROUP_LIST.filter((item) => {
|
||||
if (item.type === TUIKit_constant.EMOJI_TYPE.BASIC) {
|
||||
return featureConfig.InputEmoji;
|
||||
}
|
||||
if (item.type === TUIKit_constant.EMOJI_TYPE.BIG) {
|
||||
return featureConfig.InputStickers;
|
||||
}
|
||||
if (item.type === TUIKit_constant.EMOJI_TYPE.CUSTOM) {
|
||||
return featureConfig.InputStickers;
|
||||
}
|
||||
});
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.f(common_vendor.unref(currentEmojiList), (childrenItem, childrenIndex, i0) => {
|
||||
return common_vendor.e(common_vendor.unref(currentTabItem).type === common_vendor.unref(TUIKit_constant.EMOJI_TYPE).BASIC ? {
|
||||
a: common_vendor.unref(currentTabItem).url + common_vendor.unref(TUIKit_components_TUIChat_emojiConfig_index.BASIC_EMOJI_URL_MAPPING)[childrenItem]
|
||||
} : common_vendor.unref(currentTabItem).type === common_vendor.unref(TUIKit_constant.EMOJI_TYPE).BIG ? {
|
||||
b: common_vendor.unref(currentTabItem).url + childrenItem + "@2x.png"
|
||||
} : {
|
||||
c: common_vendor.unref(currentTabItem).url + childrenItem
|
||||
}, {
|
||||
d: childrenIndex,
|
||||
e: common_vendor.o$1(($event) => select(childrenItem, childrenIndex), childrenIndex)
|
||||
});
|
||||
}),
|
||||
b: common_vendor.unref(currentTabItem).type === common_vendor.unref(TUIKit_constant.EMOJI_TYPE).BASIC,
|
||||
c: common_vendor.unref(currentTabItem).type === common_vendor.unref(TUIKit_constant.EMOJI_TYPE).BIG,
|
||||
d: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "emoji-picker-h5-list"),
|
||||
e: common_vendor.f(common_vendor.unref(list), (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: item.type === common_vendor.unref(TUIKit_constant.EMOJI_TYPE).BASIC
|
||||
}, item.type === common_vendor.unref(TUIKit_constant.EMOJI_TYPE).BASIC ? {
|
||||
b: "194fb307-0-" + i0,
|
||||
c: common_vendor.p({
|
||||
file: common_vendor.unref(faceIcon)
|
||||
})
|
||||
} : item.type === common_vendor.unref(TUIKit_constant.EMOJI_TYPE).BIG ? {
|
||||
e: item.url + item.list[0] + "@2x.png"
|
||||
} : {
|
||||
f: item.url + item.list[0]
|
||||
}, {
|
||||
d: item.type === common_vendor.unref(TUIKit_constant.EMOJI_TYPE).BIG,
|
||||
g: index,
|
||||
h: common_vendor.o$1(($event) => toggleEmojiTab(index), index)
|
||||
});
|
||||
}),
|
||||
f: common_vendor.unref(TUIKit_utils_env.isUniFrameWork)
|
||||
}, common_vendor.unref(TUIKit_utils_env.isUniFrameWork) ? {
|
||||
g: common_vendor.o$1(sendMessage)
|
||||
} : {}, {
|
||||
h: !common_vendor.unref(TUIKit_utils_env.isPC) ? 1 : ""
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-194fb307"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIChat/message-input-toolbar/emoji-picker/emoji-picker-dialog.js.map
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"icon": "../../../common/Icon"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view ref="emojiPickerDialog" class="{{['data-v-194fb307', 'emoji-picker', h && 'emoji-picker-h5']}}"><view ref="emojiPickerListRef" class="{{['data-v-194fb307', 'emoji-picker-list', d]}}"><view wx:for="{{a}}" wx:for-item="childrenItem" wx:key="d" class="emoji-picker-list-item data-v-194fb307" bindtap="{{childrenItem.e}}"><image wx:if="{{b}}" class="emoji data-v-194fb307" src="{{childrenItem.a}}"></image><image wx:elif="{{c}}" class="emoji-big data-v-194fb307" src="{{childrenItem.b}}"></image><image wx:else class="emoji-custom emoji-big data-v-194fb307" src="{{childrenItem.c}}"></image></view></view><view class="emoji-picker-tab data-v-194fb307"><view wx:for="{{e}}" wx:for-item="item" wx:key="g" class="emoji-picker-tab-item data-v-194fb307" bindtap="{{item.h}}"><icon wx:if="{{item.a}}" class="icon data-v-194fb307" u-i="{{item.b}}" bind:__l="__l" u-p="{{item.c}}"/><image wx:elif="{{item.d}}" class="icon-big data-v-194fb307" src="{{item.e}}"></image><image wx:else class="icon-custom icon-big data-v-194fb307" src="{{item.f}}"></image></view><view wx:if="{{f}}" class="send-btn data-v-194fb307" bindtap="{{g}}"> 发送 </view></view></view>
|
||||
@@ -1,143 +0,0 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
body.data-v-194fb307, div.data-v-194fb307, ul.data-v-194fb307, ol.data-v-194fb307, dt.data-v-194fb307, dd.data-v-194fb307, li.data-v-194fb307, dl.data-v-194fb307, h1.data-v-194fb307, h2.data-v-194fb307, h3.data-v-194fb307, h4.data-v-194fb307, p.data-v-194fb307 {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-style: normal;
|
||||
/* font:12px/22px"\5B8B\4F53",Arial,Helvetica,sans-serif; */
|
||||
}
|
||||
ol.data-v-194fb307, ul.data-v-194fb307, li.data-v-194fb307 {
|
||||
list-style: none;
|
||||
}
|
||||
img.data-v-194fb307 {
|
||||
border: 0;
|
||||
vertical-align: middle;
|
||||
pointer-events: none;
|
||||
}
|
||||
body.data-v-194fb307 {
|
||||
color: #000;
|
||||
background: #FFF;
|
||||
}
|
||||
.clear.data-v-194fb307 {
|
||||
clear: both;
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
margin-top: -1px;
|
||||
}
|
||||
a.data-v-194fb307 {
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
a.data-v-194fb307:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
input.data-v-194fb307, textarea.data-v-194fb307 {
|
||||
-webkit-user-select: auto;
|
||||
user-select: auto;
|
||||
}
|
||||
input.data-v-194fb307:focus, input.data-v-194fb307:active, textarea.data-v-194fb307:focus, textarea.data-v-194fb307:active {
|
||||
outline: none;
|
||||
}
|
||||
.chat-aside.data-v-194fb307 {
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
right: 0;
|
||||
box-sizing: border-box;
|
||||
width: 360px !important;
|
||||
border-radius: 8px 0 0 8px;
|
||||
z-index: 9999;
|
||||
max-height: calc(100% - 50px);
|
||||
}
|
||||
.emoji-picker.data-v-194fb307 {
|
||||
width: 405px;
|
||||
height: 300px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.emoji-picker-list.data-v-194fb307 {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
overflow-y: auto;
|
||||
margin: 2px;
|
||||
}
|
||||
.emoji-picker-list.data-v-194fb307::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.emoji-picker-list-item.data-v-194fb307 {
|
||||
cursor: pointer;
|
||||
padding: 5px;
|
||||
}
|
||||
.emoji-picker-list-item .emoji.data-v-194fb307 {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
.emoji-picker-list-item .emoji-big.data-v-194fb307 {
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
}
|
||||
.emoji-picker-tab.data-v-194fb307 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.emoji-picker-tab-item.data-v-194fb307 {
|
||||
padding: 0 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.emoji-picker-tab-item .icon.data-v-194fb307 {
|
||||
margin: 10px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
.emoji-picker-tab-item .icon-big.data-v-194fb307 {
|
||||
margin: 2px 0;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
.emoji-picker-h5.data-v-194fb307 {
|
||||
width: 100%;
|
||||
}
|
||||
.emoji-picker-h5-list.data-v-194fb307 {
|
||||
justify-content: space-between;
|
||||
}
|
||||
.emoji-picker-h5-list.data-v-194fb307::after {
|
||||
content: "";
|
||||
display: block;
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.emoji-picker-h5 .send-btn.data-v-194fb307 {
|
||||
width: 50px;
|
||||
height: 30px;
|
||||
background-color: #55C06A;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
font-size: 16px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 30px;
|
||||
}
|
||||
Reference in New Issue
Block a user