优化页面

This commit is contained in:
pengxiaolong
2025-06-11 22:16:44 +08:00
parent 3c2d7e5959
commit 931d867c09
806 changed files with 87462 additions and 331 deletions

View File

@@ -0,0 +1,176 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
require("../../../adapter-vue.js");
const common_assets = require("../../../../common/assets.js");
const TUIKit_utils_env = require("../../../utils/env.js");
const TUIKit_components_TUIChat_utils_sendMessage = require("../utils/sendMessage.js");
const TUIKit_components_TUIChat_config = require("../config.js");
if (!Math) {
(MessageInputAudio + MessageInputEditor + MessageInputAt + Icon + MessageQuote)();
}
const MessageInputEditor = () => "./message-input-editor.js";
const MessageInputAt = () => "./message-input-at/index.js";
const MessageInputAudio = () => "./message-input-audio.js";
const MessageQuote = () => "./message-input-quote/index.js";
const Icon = () => "../../common/Icon.js";
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "index",
props: {
placeholder: { default: "this is placeholder" },
isMuted: { type: Boolean, default: true },
muteText: { default: "" },
enableInput: { type: Boolean, default: true },
enableAt: { type: Boolean, default: true },
enableTyping: { type: Boolean, default: true },
replyOrReference: { default: () => ({}) },
inputToolbarDisplayType: { default: "none" }
},
emits: ["changeToolbarDisplayType"],
setup(__props, { expose: __expose, emit: __emit }) {
const emits = __emit;
const props = __props;
const editor = common_vendor.ref();
const messageInputAtRef = common_vendor.ref();
const currentConversation = common_vendor.ref();
const isGroup = common_vendor.ref(false);
const displayType = common_vendor.ref("editor");
const featureConfig = TUIKit_components_TUIChat_config.ChatConfig.getFeatureConfig();
const isRenderVoice = common_vendor.ref(featureConfig.InputVoice);
const isRenderEmojiPicker = common_vendor.ref(featureConfig.InputEmoji || featureConfig.InputStickers);
const isRenderMore = common_vendor.ref(featureConfig.InputImage || featureConfig.InputVideo || featureConfig.InputEvaluation || featureConfig.InputQuickReplies);
common_vendor.onMounted(() => {
common_vendor.Jt.watch(common_vendor.o.CONV, {
currentConversation: onCurrentConversationUpdated
});
common_vendor.Jt.watch(common_vendor.o.CHAT, {
quoteMessage: onQuoteMessageUpdated
});
});
common_vendor.onUnmounted(() => {
common_vendor.Jt.unwatch(common_vendor.o.CONV, {
currentConversation: onCurrentConversationUpdated
});
common_vendor.Jt.unwatch(common_vendor.o.CHAT, {
quoteMessage: onQuoteMessageUpdated
});
});
common_vendor.watch(() => props.inputToolbarDisplayType, (newVal) => {
if (newVal !== "none") {
changeDisplayType("editor");
}
});
function changeDisplayType(display) {
displayType.value = display;
if (display === "audio") {
emits("changeToolbarDisplayType", "none");
}
}
function changeToolbarDisplayType(displayType2) {
emits("changeToolbarDisplayType", displayType2);
}
const onTyping = (inputContentEmpty, inputBlur) => {
TUIKit_components_TUIChat_utils_sendMessage.sendTyping(inputContentEmpty, inputBlur);
};
const onAt = (show) => {
var _a;
(_a = messageInputAtRef == null ? void 0 : messageInputAtRef.value) == null ? void 0 : _a.toggleAtList(show);
};
const onFocus = () => {
if (TUIKit_utils_env.isH5) {
emits("changeToolbarDisplayType", "none");
}
};
const insertEmoji = (emoji) => {
var _a, _b;
((_a = editor == null ? void 0 : editor.value) == null ? void 0 : _a.addEmoji) && ((_b = editor == null ? void 0 : editor.value) == null ? void 0 : _b.addEmoji(emoji));
};
const insertAt = (atInfo) => {
var _a, _b;
((_a = editor == null ? void 0 : editor.value) == null ? void 0 : _a.insertAt) && ((_b = editor == null ? void 0 : editor.value) == null ? void 0 : _b.insertAt(atInfo));
};
const onAtListOpen = () => {
var _a, _b;
((_a = editor == null ? void 0 : editor.value) == null ? void 0 : _a.blur) && ((_b = editor == null ? void 0 : editor.value) == null ? void 0 : _b.blur());
};
const reEdit = (content) => {
var _a, _b;
(_a = editor == null ? void 0 : editor.value) == null ? void 0 : _a.resetEditor();
(_b = editor == null ? void 0 : editor.value) == null ? void 0 : _b.setEditorContent(content);
};
function onCurrentConversationUpdated(conversation) {
var _a;
currentConversation.value = conversation;
isGroup.value = ((_a = currentConversation.value) == null ? void 0 : _a.type) === common_vendor.qt.TYPES.CONV_GROUP;
}
function onQuoteMessageUpdated(options) {
if ((options == null ? void 0 : options.message) && (options == null ? void 0 : options.type) === "quote") {
changeDisplayType("editor");
}
}
__expose({
insertEmoji,
reEdit
});
return (_ctx, _cache) => {
return common_vendor.e({
a: (common_vendor.unref(TUIKit_utils_env.isWeChat) || common_vendor.unref(TUIKit_utils_env.isApp)) && common_vendor.unref(isRenderVoice)
}, (common_vendor.unref(TUIKit_utils_env.isWeChat) || common_vendor.unref(TUIKit_utils_env.isApp)) && common_vendor.unref(isRenderVoice) ? {
b: common_vendor.unref(displayType) === "audio" ? 1 : "",
c: common_vendor.o$1(changeDisplayType),
d: common_vendor.p({
isEnableAudio: common_vendor.unref(displayType) === "audio"
})
} : {}, {
e: common_vendor.sr(editor, "ceb9e230-1", {
"k": "editor"
}),
f: common_vendor.unref(displayType) === "editor",
g: common_vendor.o$1(onTyping),
h: common_vendor.o$1(onAt),
i: common_vendor.o$1(onFocus),
j: common_vendor.p({
placeholder: props.placeholder,
isMuted: props.isMuted,
muteText: props.muteText,
enableInput: props.enableInput,
enableAt: props.enableAt,
enableTyping: props.enableTyping,
isGroup: common_vendor.unref(isGroup)
}),
k: props.enableAt
}, props.enableAt ? {
l: common_vendor.sr(messageInputAtRef, "ceb9e230-2", {
"k": "messageInputAtRef"
}),
m: common_vendor.o$1(insertAt),
n: common_vendor.o$1(onAtListOpen)
} : {}, {
o: common_vendor.unref(isRenderEmojiPicker)
}, common_vendor.unref(isRenderEmojiPicker) ? {
p: common_vendor.o$1(($event) => changeToolbarDisplayType("emojiPicker")),
q: common_vendor.p({
file: common_vendor.unref(common_assets.faceIcon),
size: "23px",
hotAreaSize: "3px"
})
} : {}, {
r: common_vendor.unref(isRenderMore)
}, common_vendor.unref(isRenderMore) ? {
s: common_vendor.o$1(($event) => changeToolbarDisplayType("tools")),
t: common_vendor.p({
file: common_vendor.unref(common_assets.moreIcon),
size: "23px",
hotAreaSize: "3px"
})
} : {}, {
v: common_vendor.p({
displayType: common_vendor.unref(displayType)
}),
w: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "message-input-h5")
});
};
}
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-ceb9e230"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIChat/message-input/index.js.map

View File

@@ -0,0 +1,10 @@
{
"component": true,
"usingComponents": {
"message-input-editor": "./message-input-editor",
"message-input-at": "./message-input-at/index",
"message-input-audio": "./message-input-audio",
"message-quote": "./message-input-quote/index",
"icon": "../../common/Icon"
}
}

View File

@@ -0,0 +1 @@
<view class="{{['data-v-ceb9e230', 'message-input', w]}}"><view class="audio-main-content-line data-v-ceb9e230"><message-input-audio wx:if="{{a}}" class="{{['data-v-ceb9e230', b && 'message-input-wx-audio-open']}}" bindchangeDisplayType="{{c}}" u-i="ceb9e230-0" bind:__l="__l" u-p="{{d}}"/><message-input-editor wx:if="{{j}}" data-c-h="{{!f}}" u-r="editor" class="message-input-editor r data-v-ceb9e230" bindonTyping="{{g}}" bindonAt="{{h}}" bindonFocus="{{i}}" u-i="ceb9e230-1" bind:__l="__l" u-p="{{j}}"/><message-input-at wx:if="{{k}}" class="r data-v-ceb9e230" u-r="messageInputAtRef" bindinsertAt="{{m}}" bindonAtListOpen="{{n}}" u-i="ceb9e230-2" bind:__l="__l"/><icon wx:if="{{o}}" class="icon icon-face data-v-ceb9e230" bindonClick="{{p}}" u-i="ceb9e230-3" bind:__l="__l" u-p="{{q}}"/><icon wx:if="{{r}}" class="icon icon-more data-v-ceb9e230" bindonClick="{{s}}" u-i="ceb9e230-4" bind:__l="__l" u-p="{{t}}"/></view><view class="data-v-ceb9e230"><message-quote wx:if="{{v}}" class="data-v-ceb9e230" style="{{'min-width:' + 0}}" u-i="ceb9e230-5" bind:__l="__l" u-p="{{v}}"/></view></view>

View File

@@ -0,0 +1,107 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
body.data-v-ceb9e230, div.data-v-ceb9e230, ul.data-v-ceb9e230, ol.data-v-ceb9e230, dt.data-v-ceb9e230, dd.data-v-ceb9e230, li.data-v-ceb9e230, dl.data-v-ceb9e230, h1.data-v-ceb9e230, h2.data-v-ceb9e230, h3.data-v-ceb9e230, h4.data-v-ceb9e230, p.data-v-ceb9e230 {
margin: 0;
padding: 0;
font-style: normal;
/* font:12px/22px"\5B8B\4F53",Arial,Helvetica,sans-serif; */
}
ol.data-v-ceb9e230, ul.data-v-ceb9e230, li.data-v-ceb9e230 {
list-style: none;
}
img.data-v-ceb9e230 {
border: 0;
vertical-align: middle;
pointer-events: none;
}
body.data-v-ceb9e230 {
color: #000;
background: #FFF;
}
.clear.data-v-ceb9e230 {
clear: both;
height: 1px;
width: 100%;
overflow: hidden;
margin-top: -1px;
}
a.data-v-ceb9e230 {
color: #000;
text-decoration: none;
cursor: pointer;
}
a.data-v-ceb9e230:hover {
text-decoration: none;
}
input.data-v-ceb9e230, textarea.data-v-ceb9e230 {
-webkit-user-select: auto;
user-select: auto;
}
input.data-v-ceb9e230:focus, input.data-v-ceb9e230:active, textarea.data-v-ceb9e230:focus, textarea.data-v-ceb9e230:active {
outline: none;
}
.chat-aside.data-v-ceb9e230 {
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);
}
.data-v-ceb9e230:not(not) {
display: flex;
flex-direction: column;
min-width: 0;
box-sizing: border-box;
}
.message-input.data-v-ceb9e230 {
position: relative;
display: flex;
flex-direction: column;
border: none;
overflow: hidden;
background: #ebf0f6;
}
.message-input-h5.data-v-ceb9e230 {
padding: 10px 10px 15px;
}
.message-input-editor.data-v-ceb9e230 {
flex: 1;
display: flex;
}
.message-input .icon.data-v-ceb9e230 {
margin-left: 3px;
}
.message-input-wx-audio-open.data-v-ceb9e230 {
flex: 1;
}
.audio-main-content-line.data-v-ceb9e230 {
display: flex;
flex-direction: row;
align-items: center;
}

View File

@@ -0,0 +1,154 @@
"use strict";
const common_vendor = require("../../../../../common/vendor.js");
require("../../../../adapter-vue.js");
const TUIKit_utils_env = require("../../../../utils/env.js");
if (!Math) {
BottomPopup();
}
const BottomPopup = () => "../../../common/BottomPopup/index.js";
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "index",
emits: ["onAtListOpen", "insertAt"],
setup(__props, { expose: __expose, emit: __emit }) {
const emits = __emit;
const MessageInputAt = common_vendor.ref();
const memberListItems = common_vendor.ref();
const showAtList = common_vendor.ref(false);
const memberList = common_vendor.ref();
const allMemberList = common_vendor.ref();
const showMemberList = common_vendor.ref();
const isGroup = common_vendor.ref(false);
const position = common_vendor.ref({
left: 0,
top: 0
});
const selectedIndex = common_vendor.ref(0);
const currentConversationID = common_vendor.ref("");
const all = {
userID: common_vendor.qt.TYPES.MSG_AT_ALL,
nick: "所有人",
isAll: true,
avatar: "https://web.sdk.qcloud.com/im/assets/images/at.svg"
};
common_vendor.Jt.watch(common_vendor.o.CONV, {
currentConversationID: (id) => {
var _a, _b;
if (id !== currentConversationID.value) {
currentConversationID.value = id;
memberList.value = [];
allMemberList.value = [];
showMemberList.value = [];
isGroup.value = false;
common_vendor.Jt.update(common_vendor.o.CUSTOM, "memberList", memberList.value);
if ((_a = currentConversationID == null ? void 0 : currentConversationID.value) == null ? void 0 : _a.startsWith("GROUP")) {
isGroup.value = true;
const groupID = (_b = currentConversationID == null ? void 0 : currentConversationID.value) == null ? void 0 : _b.substring(5);
common_vendor.es.switchGroup(groupID);
} else {
common_vendor.es.switchGroup("");
}
}
}
});
common_vendor.Jt.watch(common_vendor.o.GRP, {
currentGroupMemberList: (list) => {
memberList.value = list;
allMemberList.value = [all, ...memberList.value];
showMemberList.value = allMemberList.value;
common_vendor.Jt.update(common_vendor.o.CUSTOM, "memberList", memberList.value);
}
});
const toggleAtList = (show) => {
if (!isGroup.value) {
return;
}
showAtList.value = show;
if (showAtList.value) {
emits("onAtListOpen");
}
};
const handleAtListPosition = (positionData) => {
position.value = positionData;
};
const setCurrentSelectIndex = (index) => {
var _a, _b;
selectedIndex.value = index;
(_b = (_a = memberListItems.value) == null ? void 0 : _a[selectedIndex.value]) == null ? void 0 : _b.scrollIntoView(false);
};
const setShowMemberList = (list) => {
showMemberList.value = list;
};
common_vendor.i.toggleAtList = toggleAtList;
common_vendor.i.handleAtListPosition = handleAtListPosition;
common_vendor.i.setCurrentSelectIndex = setCurrentSelectIndex;
common_vendor.i.setShowMemberList = setShowMemberList;
__expose({
toggleAtList
});
common_vendor.watch(
() => [position.value, MessageInputAt == null ? void 0 : MessageInputAt.value],
() => {
var _a;
if (TUIKit_utils_env.isH5 || !(MessageInputAt == null ? void 0 : MessageInputAt.value) || !((_a = MessageInputAt == null ? void 0 : MessageInputAt.value) == null ? void 0 : _a.style)) {
return;
}
MessageInputAt.value.style.left = position.value.left + "px";
MessageInputAt.value.style.top = position.value.top - MessageInputAt.value.clientHeight + "px";
}
);
const closeAt = () => {
showAtList.value = false;
showMemberList.value = allMemberList.value;
position.value = {
left: 0,
top: 0
};
};
const selectItem = (index) => {
var _a;
if (TUIKit_utils_env.isPC && common_vendor.i.selectItem) {
common_vendor.i.selectItem(index);
} else {
if ((_a = showMemberList == null ? void 0 : showMemberList.value) == null ? void 0 : _a.length) {
const item = showMemberList == null ? void 0 : showMemberList.value[index];
emits("insertAt", {
id: item == null ? void 0 : item.userID,
label: (item == null ? void 0 : item.nick) || (item == null ? void 0 : item.userID)
});
}
}
closeAt();
};
const handleMemberAvatar = (item) => {
return (item == null ? void 0 : item.avatar) || "https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png";
};
const handleMemberName = (item) => {
return (item == null ? void 0 : item.nick) ? item == null ? void 0 : item.nick : item == null ? void 0 : item.userID;
};
return (_ctx, _cache) => {
return common_vendor.e({
a: !common_vendor.unref(TUIKit_utils_env.isPC)
}, !common_vendor.unref(TUIKit_utils_env.isPC) ? {
b: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("TUIChat.选择提醒的人"))
} : {}, {
c: common_vendor.f(common_vendor.unref(showMemberList), (item, index, i0) => {
return {
a: handleMemberAvatar(item),
b: common_vendor.t(handleMemberName(item)),
c: index,
d: common_vendor.n(index === common_vendor.unref(selectedIndex) && "selected"),
e: common_vendor.o$1(($event) => selectItem(index), index)
};
}),
d: common_vendor.n(common_vendor.unref(TUIKit_utils_env.isPC) ? "message-input-at" : "message-input-at-h5"),
e: common_vendor.o$1(closeAt),
f: common_vendor.p({
show: common_vendor.unref(showAtList)
})
});
};
}
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-7a11d573"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIChat/message-input/message-input-at/index.js.map

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"bottom-popup": "../../../common/BottomPopup/index"
}
}

View File

@@ -0,0 +1 @@
<bottom-popup wx:if="{{f}}" class="data-v-7a11d573" u-s="{{['d']}}" bindonClose="{{e}}" u-i="7a11d573-0" bind:__l="__l" u-p="{{f}}"><view ref="MessageInputAt" class="{{['data-v-7a11d573', d]}}"><view ref="dialog" class="member-list data-v-7a11d573"><view wx:if="{{a}}" class="member-list-title data-v-7a11d573"><label class="title data-v-7a11d573">{{b}}</label></view><view class="member-list-box data-v-7a11d573"><view wx:for="{{c}}" wx:for-item="item" wx:key="c" ref="memberListItems" class="{{['member-list-box-body', 'data-v-7a11d573', item.d]}}" bindtap="{{item.e}}"><image class="member-list-box-body-avatar data-v-7a11d573" src="{{item.a}}"></image><label class="member-list-box-body-name data-v-7a11d573">{{item.b}}</label></view></view></view></view></bottom-popup>

View File

@@ -0,0 +1,168 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
body.data-v-7a11d573, div.data-v-7a11d573, ul.data-v-7a11d573, ol.data-v-7a11d573, dt.data-v-7a11d573, dd.data-v-7a11d573, li.data-v-7a11d573, dl.data-v-7a11d573, h1.data-v-7a11d573, h2.data-v-7a11d573, h3.data-v-7a11d573, h4.data-v-7a11d573, p.data-v-7a11d573 {
margin: 0;
padding: 0;
font-style: normal;
/* font:12px/22px"\5B8B\4F53",Arial,Helvetica,sans-serif; */
}
ol.data-v-7a11d573, ul.data-v-7a11d573, li.data-v-7a11d573 {
list-style: none;
}
img.data-v-7a11d573 {
border: 0;
vertical-align: middle;
pointer-events: none;
}
body.data-v-7a11d573 {
color: #000;
background: #FFF;
}
.clear.data-v-7a11d573 {
clear: both;
height: 1px;
width: 100%;
overflow: hidden;
margin-top: -1px;
}
a.data-v-7a11d573 {
color: #000;
text-decoration: none;
cursor: pointer;
}
a.data-v-7a11d573:hover {
text-decoration: none;
}
input.data-v-7a11d573, textarea.data-v-7a11d573 {
-webkit-user-select: auto;
user-select: auto;
}
input.data-v-7a11d573:focus, input.data-v-7a11d573:active, textarea.data-v-7a11d573:focus, textarea.data-v-7a11d573:active {
outline: none;
}
.chat-aside.data-v-7a11d573 {
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);
}
.message-input-at.data-v-7a11d573 {
position: fixed;
max-width: 15rem;
max-height: 10rem;
overflow: hidden auto;
background: #fff;
box-shadow: 0 0.06rem 0.63rem 0 rgba(2, 16, 43, 0.15);
border-radius: 0.13rem;
}
.member-list-box-header.data-v-7a11d573 {
height: 2.5rem;
padding-top: 5px;
cursor: pointer;
}
.member-list-box-header.data-v-7a11d573:hover {
background: rgba(0, 110, 255, 0.1);
}
.member-list-box span.data-v-7a11d573 {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 12px;
color: #000;
letter-spacing: 0;
padding: 5px;
}
.member-list-box-body.data-v-7a11d573 {
height: 30px;
cursor: pointer;
display: flex;
align-items: center;
}
.member-list-box-body .selected.data-v-7a11d573, .member-list-box-body.data-v-7a11d573:hover {
background: rgba(0, 110, 255, 0.1);
}
.member-list-box-body-name.data-v-7a11d573 {
overflow: hidden;
white-space: nowrap;
word-wrap: break-word;
word-break: break-all;
text-overflow: ellipsis;
}
.member-list-box-body-avatar.data-v-7a11d573 {
width: 20px;
height: 20px;
padding-left: 10px;
}
.member-list-box .selected.data-v-7a11d573 {
background: rgba(0, 110, 255, 0.1);
}
.message-input-at-h5 .member-list.data-v-7a11d573 {
height: auto;
max-height: 500px;
width: 100%;
max-width: 100%;
background: white;
border-radius: 12px 12px 0 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
.message-input-at-h5 .member-list-title.data-v-7a11d573 {
height: -webkit-fit-content;
height: fit-content;
width: calc(100% - 30px);
text-align: center;
vertical-align: middle;
padding: 15px;
}
.message-input-at-h5 .member-list-title .title.data-v-7a11d573 {
vertical-align: middle;
display: inline-block;
font-size: 16px;
}
.message-input-at-h5 .member-list-title .close.data-v-7a11d573 {
vertical-align: middle;
position: absolute;
right: 10px;
display: inline-block;
}
.message-input-at-h5 .member-list-box.data-v-7a11d573 {
flex: 1;
overflow-y: scroll;
}
.message-input-at-h5 .member-list-box-body.data-v-7a11d573 {
padding: 10px;
}
.message-input-at-h5 .member-list-box-body img.data-v-7a11d573 {
width: 26px;
height: 26px;
}
.message-input-at-h5 .member-list-box-body span.data-v-7a11d573 {
font-size: 14px;
}

View File

@@ -0,0 +1,199 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
require("../../../adapter-vue.js");
const common_assets = require("../../../../common/assets.js");
const TUIKit_components_common_Toast_index = require("../../common/Toast/index.js");
const TUIKit_utils_lodash = require("../../../utils/lodash.js");
const TUIKit_components_TUIChat_utils_utils = require("../utils/utils.js");
const TUIKit_components_common_Toast_type = require("../../common/Toast/type.js");
if (!Math) {
Icon();
}
const Icon = () => "../../common/Icon.js";
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "message-input-audio",
props: {
isEnableAudio: { type: Boolean, default: false }
},
emits: ["changeDisplayType"],
setup(__props, { emit: __emit }) {
var _a;
const emits = __emit;
const props = __props;
let recordTime = 0;
let isManualCancelBySlide = false;
let recordTimer;
let firstTouchPageY = -1;
let isFingerTouchingScreen = false;
let isFirstAuthrizedRecord = false;
const recorderManager = (_a = common_vendor.i) == null ? void 0 : _a.getRecorderManager();
const isRecording = common_vendor.ref(false);
const touchBarText = common_vendor.ref("按住说话");
const modalText = common_vendor.ref("正在录音");
const isAudioTouchBarShow = common_vendor.ref(false);
const currentConversation = common_vendor.ref();
const recordConfig = {
// Duration of the recording, in ms, with a maximum value of 600000 (10 minutes)
duration: 6e4,
// Sampling rate
sampleRate: 44100,
// Number of recording channels
numberOfChannels: 1,
// Encoding bit rate
encodeBitRate: 192e3,
// Audio format
// Select this format to create audio messages that can be interoperable across all chat platforms (Android, iOS, WeChat Mini Programs, and Web).
format: "mp3"
};
function switchAudio() {
emits("changeDisplayType", props.isEnableAudio ? "editor" : "audio");
}
common_vendor.onMounted(() => {
recorderManager.onStart(onRecorderStart);
recorderManager.onStop(onRecorderStop);
recorderManager.onError(onRecorderError);
common_vendor.Jt.watch(common_vendor.o.CONV, {
currentConversation: onCurrentConverstaionUpdated
});
});
common_vendor.onUnmounted(() => {
common_vendor.Jt.unwatch(common_vendor.o.CONV, {
currentConversation: onCurrentConverstaionUpdated
});
});
function onCurrentConverstaionUpdated(conversation) {
currentConversation.value = conversation;
}
function initRecorder() {
initRecorderData();
initRecorderView();
}
function initRecorderView() {
isRecording.value = false;
touchBarText.value = "按住说话";
modalText.value = "正在录音";
}
function initRecorderData(options) {
clearInterval(recordTimer);
recordTimer = void 0;
recordTime = 0;
firstTouchPageY = -1;
isManualCancelBySlide = false;
if (!(options == null ? void 0 : options.hasError)) {
recorderManager.stop();
}
}
function handleTouchStart() {
if (isFingerTouchingScreen) {
isFirstAuthrizedRecord = true;
}
}
function handleLongPress() {
isFingerTouchingScreen = true;
recorderManager.start(recordConfig);
}
const handleTouchMove = TUIKit_utils_lodash.throttle(function(e) {
if (isRecording.value) {
const pageY = e.changedTouches[e.changedTouches.length - 1].pageY;
if (firstTouchPageY < 0) {
firstTouchPageY = pageY;
}
const offset = firstTouchPageY - pageY;
if (offset > 150) {
touchBarText.value = "抬起取消";
modalText.value = "松开手指 取消发送";
isManualCancelBySlide = true;
} else if (offset > 50) {
touchBarText.value = "抬起发送";
modalText.value = "继续上滑可取消";
isManualCancelBySlide = false;
} else {
touchBarText.value = "抬起发送";
modalText.value = "正在录音";
isManualCancelBySlide = false;
}
}
}, 100);
function handleTouchEnd() {
isFingerTouchingScreen = false;
recorderManager.stop();
}
function onRecorderStart() {
if (!isFingerTouchingScreen) {
isFirstAuthrizedRecord = true;
recorderManager.stop();
return;
}
recordTimer = setInterval(() => {
recordTime += 1;
}, 1e3);
touchBarText.value = "抬起发送";
isRecording.value = true;
}
function onRecorderStop(res) {
var _a2, _b, _c, _d, _e, _f;
if (isFirstAuthrizedRecord) {
isFirstAuthrizedRecord = false;
initRecorder();
return;
}
if (isManualCancelBySlide || !isRecording.value) {
initRecorder();
return;
}
clearInterval(recordTimer);
const tempFilePath = res.tempFilePath;
const duration = res.duration ? res.duration : recordTime * 1e3;
const fileSize = res.fileSize ? res.fileSize : 48 * recordTime / 8 * 1024;
if (duration < 1e3) {
TUIKit_components_common_Toast_index.Toast({
message: "录音时间太短",
type: TUIKit_components_common_Toast_type.TOAST_TYPE.NORMAL,
duration: 1500
});
} else {
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: { file: { duration, tempFilePath, fileSize } },
needReadReceipt: TUIKit_components_TUIChat_utils_utils.isEnabledMessageReadReceiptGlobal()
};
(_f = common_vendor.Qt) == null ? void 0 : _f.sendAudioMessage(options);
}
initRecorder();
}
function onRecorderError() {
initRecorderData({ hasError: true });
initRecorderView();
}
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.o$1(switchAudio),
b: common_vendor.p({
file: common_vendor.unref(common_assets.audioIcon$1),
size: "23px",
hotAreaSize: "3px"
}),
c: props.isEnableAudio
}, props.isEnableAudio ? common_vendor.e({
d: common_vendor.t(common_vendor.unref(common_vendor.Wt).t(`TUIChat.${common_vendor.unref(touchBarText)}`)),
e: common_vendor.unref(isRecording)
}, common_vendor.unref(isRecording) ? {
f: common_vendor.t(common_vendor.unref(common_vendor.Wt).t(`TUIChat.${common_vendor.unref(modalText)}`))
} : {}, {
g: common_vendor.o$1(handleTouchStart),
h: common_vendor.o$1(handleLongPress),
i: common_vendor.o$1(
//@ts-ignore
(...args) => common_vendor.unref(handleTouchMove) && common_vendor.unref(handleTouchMove)(...args)
),
j: common_vendor.o$1(handleTouchEnd)
}) : {}, {
k: common_vendor.unref(isAudioTouchBarShow) ? 1 : ""
});
};
}
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-89320e8a"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIChat/message-input/message-input-audio.js.map

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"icon": "../../common/Icon"
}
}

View File

@@ -0,0 +1 @@
<view class="{{['data-v-89320e8a', 'message-input-audio', k && 'message-input-audio-open']}}"><icon wx:if="{{b}}" class="audio-message-icon data-v-89320e8a" bindonClick="{{a}}" u-i="89320e8a-0" bind:__l="__l" u-p="{{b}}"/><view wx:if="{{c}}" class="audio-input-touch-bar data-v-89320e8a" bindtouchstart="{{g}}" bindlongpress="{{h}}" bindtouchmove="{{i}}" bindtouchend="{{j}}"><label class="data-v-89320e8a">{{d}}</label><view wx:if="{{e}}" class="record-modal data-v-89320e8a"><view class="red-mask data-v-89320e8a"/><view class="float-element moving-slider data-v-89320e8a"/><view class="float-element modal-title data-v-89320e8a">{{f}}</view></view></view></view>

View File

@@ -0,0 +1,145 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
body.data-v-89320e8a, div.data-v-89320e8a, ul.data-v-89320e8a, ol.data-v-89320e8a, dt.data-v-89320e8a, dd.data-v-89320e8a, li.data-v-89320e8a, dl.data-v-89320e8a, h1.data-v-89320e8a, h2.data-v-89320e8a, h3.data-v-89320e8a, h4.data-v-89320e8a, p.data-v-89320e8a {
margin: 0;
padding: 0;
font-style: normal;
/* font:12px/22px"\5B8B\4F53",Arial,Helvetica,sans-serif; */
}
ol.data-v-89320e8a, ul.data-v-89320e8a, li.data-v-89320e8a {
list-style: none;
}
img.data-v-89320e8a {
border: 0;
vertical-align: middle;
pointer-events: none;
}
body.data-v-89320e8a {
color: #000;
background: #FFF;
}
.clear.data-v-89320e8a {
clear: both;
height: 1px;
width: 100%;
overflow: hidden;
margin-top: -1px;
}
a.data-v-89320e8a {
color: #000;
text-decoration: none;
cursor: pointer;
}
a.data-v-89320e8a:hover {
text-decoration: none;
}
input.data-v-89320e8a, textarea.data-v-89320e8a {
-webkit-user-select: auto;
user-select: auto;
}
input.data-v-89320e8a:focus, input.data-v-89320e8a:active, textarea.data-v-89320e8a:focus, textarea.data-v-89320e8a:active {
outline: none;
}
.chat-aside.data-v-89320e8a {
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);
}
.message-input-audio.data-v-89320e8a {
display: flex;
flex-direction: row;
align-items: center;
}
.message-input-audio .audio-message-icon.data-v-89320e8a {
margin-right: 3px;
}
.message-input-audio .audio-input-touch-bar.data-v-89320e8a {
height: 39px;
flex: 1;
border-radius: 10px;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
background-color: #fff;
}
.message-input-audio .audio-input-touch-bar .record-modal.data-v-89320e8a {
height: 300rpx;
width: 60vw;
background-color: rgba(0, 0, 0, 0.8);
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
z-index: 9999;
border-radius: 24rpx;
display: flex;
flex-direction: column;
overflow: hidden;
}
.message-input-audio .audio-input-touch-bar .record-modal .red-mask.data-v-89320e8a {
position: absolute;
inset: 0;
background-color: rgba(255, 62, 72, 0.5);
opacity: 0;
transition: opacity 10ms linear;
z-index: 1;
}
.message-input-audio .audio-input-touch-bar .record-modal .moving-slider.data-v-89320e8a {
margin: 10vw;
width: 40rpx;
height: 16rpx;
border-radius: 4rpx;
background-color: #006fff;
animation: loading-89320e8a 1s ease-in-out infinite alternate;
z-index: 2;
}
.message-input-audio .audio-input-touch-bar .record-modal .float-element.data-v-89320e8a {
position: relative;
z-index: 2;
}
@keyframes loading-89320e8a {
0% {
transform: translate(0, 0);
}
100% {
transform: translate(30vw, 0);
background-color: #f5634a;
width: 40px;
}
}
.message-input-audio .audio-input-touch-bar .modal-title.data-v-89320e8a {
text-align: center;
color: #fff;
}
.message-input-audio-open.data-v-89320e8a {
flex: 1;
}

View File

@@ -0,0 +1,214 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
require("../../../adapter-vue.js");
const TUIKit_components_TUIChat_utils_conversationDraft = require("../utils/conversationDraft.js");
const TUIKit_components_TUIChat_emojiConfig_index = require("../emoji-config/index.js");
const TUIKit_utils_env = require("../../../utils/env.js");
const TUIKit_components_TUIChat_utils_sendMessage = require("../utils/sendMessage.js");
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "message-input-editor",
props: {
placeholder: {
type: String,
default: "this is placeholder"
},
replayOrReferenceMessage: {
type: Object,
default: () => ({}),
required: false
},
isMuted: {
type: Boolean,
default: true
},
muteText: {
type: String,
default: ""
},
enableInput: {
type: Boolean,
default: true
},
enableAt: {
type: Boolean,
default: true
},
enableTyping: {
type: Boolean,
default: true
},
isGroup: {
type: Boolean,
default: false
}
},
emits: ["onTyping", "onFocus", "onAt"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emits = __emit;
const inputText = common_vendor.ref("");
common_vendor.ref();
const inputBlur = common_vendor.ref(true);
const inputContentEmpty = common_vendor.ref(true);
const allInsertedAtInfo = /* @__PURE__ */ new Map();
const currentConversation = common_vendor.ref();
const currentConversationID = common_vendor.ref("");
const currentQuoteMessage = common_vendor.ref();
common_vendor.onMounted(() => {
common_vendor.Jt.watch(common_vendor.o.CONV, {
currentConversation: onCurrentConversationUpdated
});
common_vendor.Jt.watch(common_vendor.o.CHAT, {
quoteMessage: onQuoteMessageUpdated
});
common_vendor.index.$on("insert-emoji", (data) => {
var _a;
inputText.value += (_a = data == null ? void 0 : data.emoji) == null ? void 0 : _a.name;
});
common_vendor.index.$on("send-message-in-emoji-picker", () => {
handleSendMessage();
});
});
common_vendor.onUnmounted(() => {
if (currentConversationID.value) {
TUIKit_components_TUIChat_utils_conversationDraft.DraftManager.setStore(currentConversationID.value, inputText.value, inputText.value, currentQuoteMessage.value);
}
common_vendor.index.$off("insertEmoji");
common_vendor.index.$off("send-message-in-emoji-picker");
common_vendor.Jt.unwatch(common_vendor.o.CONV, {
currentConversation: onCurrentConversationUpdated
});
common_vendor.Jt.unwatch(common_vendor.o.CHAT, {
quoteMessage: onQuoteMessageUpdated
});
reset();
});
const handleSendMessage = () => {
const messageList = getEditorContent();
resetEditor();
TUIKit_components_TUIChat_utils_sendMessage.sendMessages(messageList, currentConversation.value);
};
const insertAt = (atInfo) => {
if (!(allInsertedAtInfo == null ? void 0 : allInsertedAtInfo.has(atInfo == null ? void 0 : atInfo.id))) {
allInsertedAtInfo == null ? void 0 : allInsertedAtInfo.set(atInfo == null ? void 0 : atInfo.id, atInfo == null ? void 0 : atInfo.label);
}
inputText.value += atInfo == null ? void 0 : atInfo.label;
};
const getEditorContent = () => {
let text = inputText.value;
text = TUIKit_components_TUIChat_emojiConfig_index.transformTextWithEmojiNamesToKeys(text);
const atUserList = [];
allInsertedAtInfo == null ? void 0 : allInsertedAtInfo.forEach((value, key) => {
if (text == null ? void 0 : text.includes("@" + value)) {
atUserList.push(key);
}
});
const payload = {
text
};
if (atUserList == null ? void 0 : atUserList.length) {
payload.atUserList = atUserList;
}
return [
{
type: "text",
payload
}
];
};
const resetEditor = () => {
inputText.value = "";
inputContentEmpty.value = true;
allInsertedAtInfo == null ? void 0 : allInsertedAtInfo.clear();
};
const setEditorContent = (content) => {
inputText.value = content;
};
const onBlur = () => {
inputBlur.value = true;
};
const onFocus = (e) => {
var _a;
inputBlur.value = false;
emits("onFocus", (_a = e == null ? void 0 : e.detail) == null ? void 0 : _a.height);
};
const isEditorContentEmpty = () => {
var _a;
inputContentEmpty.value = ((_a = inputText == null ? void 0 : inputText.value) == null ? void 0 : _a.length) ? false : true;
};
const onInput = (e) => {
var _a, _b;
const text = (_a = e == null ? void 0 : e.detail) == null ? void 0 : _a.value;
isEditorContentEmpty();
if (props.isGroup && (text.endsWith("@") || text.endsWith("@\n"))) {
(_b = common_vendor.i) == null ? void 0 : _b.hideKeyboard();
emits("onAt", true);
}
};
common_vendor.watch(
() => [inputContentEmpty.value, inputBlur.value],
(newVal, oldVal) => {
if (newVal !== oldVal) {
emits("onTyping", inputContentEmpty.value, inputBlur.value);
}
},
{
immediate: true,
deep: true
}
);
function onCurrentConversationUpdated(conversation) {
const prevConversationID = currentConversationID.value;
currentConversation.value = conversation;
currentConversationID.value = conversation == null ? void 0 : conversation.conversationID;
if (prevConversationID !== currentConversationID.value) {
if (prevConversationID) {
TUIKit_components_TUIChat_utils_conversationDraft.DraftManager.setStore(
prevConversationID,
inputText.value,
inputText.value,
currentQuoteMessage.value
);
}
resetEditor();
if (currentConversationID.value) {
TUIKit_components_TUIChat_utils_conversationDraft.DraftManager.getStore(currentConversationID.value, setEditorContent);
}
}
}
function onQuoteMessageUpdated(options) {
currentQuoteMessage.value = options;
}
function reset() {
inputBlur.value = true;
currentConversation.value = null;
currentConversationID.value = "";
currentQuoteMessage.value = null;
resetEditor();
}
__expose({
insertAt,
resetEditor,
setEditorContent,
getEditorContent
});
return (_ctx, _cache) => {
return common_vendor.e({
a: props.isMuted
}, props.isMuted ? {
b: common_vendor.t(props.muteText)
} : {}, {
c: props.placeholder,
d: common_vendor.o$1(handleSendMessage),
e: common_vendor.o$1([($event) => common_vendor.isRef(inputText) ? inputText.value = $event.detail.value : null, onInput]),
f: common_vendor.o$1(onBlur),
g: common_vendor.o$1(onFocus),
h: common_vendor.unref(inputText),
i: !common_vendor.unref(TUIKit_utils_env.isPC) ? 1 : ""
});
};
}
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-6acc9af1"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIChat/message-input/message-input-editor.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="{{['data-v-6acc9af1', 'message-input-container', i && 'message-input-container-h5']}}"><view wx:if="{{a}}" class="message-input-mute data-v-6acc9af1">{{b}}</view><input id="editor" ref="inputRef" adjust-position="{{true}}" cursor-spacing="20" confirm-type="send" confirm-hold="{{true}}" maxlength="140" type="text" placeholder-class="input-placeholder" class="message-input-area data-v-6acc9af1" placeholder="{{c}}" auto-blur bindconfirm="{{d}}" bindinput="{{e}}" bindblur="{{f}}" bindfocus="{{g}}" value="{{h}}"></input></view>

View File

@@ -0,0 +1,104 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
body.data-v-6acc9af1, div.data-v-6acc9af1, ul.data-v-6acc9af1, ol.data-v-6acc9af1, dt.data-v-6acc9af1, dd.data-v-6acc9af1, li.data-v-6acc9af1, dl.data-v-6acc9af1, h1.data-v-6acc9af1, h2.data-v-6acc9af1, h3.data-v-6acc9af1, h4.data-v-6acc9af1, p.data-v-6acc9af1 {
margin: 0;
padding: 0;
font-style: normal;
/* font:12px/22px"\5B8B\4F53",Arial,Helvetica,sans-serif; */
}
ol.data-v-6acc9af1, ul.data-v-6acc9af1, li.data-v-6acc9af1 {
list-style: none;
}
img.data-v-6acc9af1 {
border: 0;
vertical-align: middle;
pointer-events: none;
}
body.data-v-6acc9af1 {
color: #000;
background: #FFF;
}
.clear.data-v-6acc9af1 {
clear: both;
height: 1px;
width: 100%;
overflow: hidden;
margin-top: -1px;
}
a.data-v-6acc9af1 {
color: #000;
text-decoration: none;
cursor: pointer;
}
a.data-v-6acc9af1:hover {
text-decoration: none;
}
input.data-v-6acc9af1, textarea.data-v-6acc9af1 {
-webkit-user-select: auto;
user-select: auto;
}
input.data-v-6acc9af1:focus, input.data-v-6acc9af1:active, textarea.data-v-6acc9af1:focus, textarea.data-v-6acc9af1:active {
outline: none;
}
.chat-aside.data-v-6acc9af1 {
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);
}
.message-input-container.data-v-6acc9af1 {
display: flex;
flex-direction: column;
flex: 1;
padding: 3px 10px 10px;
overflow: hidden;
}
.message-input-container-h5.data-v-6acc9af1 {
flex: 1;
height: auto;
background: #fff;
border-radius: 10px;
padding: 7px 0 7px 10px;
font-size: 16px !important;
max-height: 86px;
}
.message-input-container .message-input-mute.data-v-6acc9af1 {
flex: 1;
display: flex;
color: #999;
font-size: 14px;
justify-content: center;
align-items: center;
}
.message-input-container .message-input-area.data-v-6acc9af1 {
flex: 1;
overflow-y: scroll;
min-height: 25px;
}

View File

@@ -0,0 +1,94 @@
"use strict";
const common_vendor = require("../../../../../common/vendor.js");
require("../../../../adapter-vue.js");
const common_assets = require("../../../../../common/assets.js");
const TUIKit_utils_env = require("../../../../utils/env.js");
const TUIKit_components_TUIChat_emojiConfig_index = require("../../emoji-config/index.js");
if (!Math) {
Icon();
}
const Icon = () => "../../../common/Icon.js";
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "index",
props: {
displayType: { default: "editor" }
},
setup(__props) {
const props = __props;
const TYPES = common_vendor.qt.TYPES;
const quoteMessage = common_vendor.ref();
common_vendor.onMounted(() => {
common_vendor.Jt.watch(common_vendor.o.CHAT, {
quoteMessage: onQuoteMessageUpdated
});
});
common_vendor.onUnmounted(() => {
common_vendor.Jt.unwatch(common_vendor.o.CHAT, {
quoteMessage: onQuoteMessageUpdated
});
});
const quoteContentText = common_vendor.computed(() => {
var _a, _b;
let _quoteContentText;
switch ((_a = quoteMessage.value) == null ? void 0 : _a.type) {
case TYPES.MSG_TEXT:
_quoteContentText = TUIKit_components_TUIChat_emojiConfig_index.transformTextWithKeysToEmojiNames((_b = quoteMessage.value.payload) == null ? void 0 : _b.text);
break;
case TYPES.MSG_IMAGE:
_quoteContentText = common_vendor.Wt.t("TUIChat.图片");
break;
case TYPES.MSG_AUDIO:
_quoteContentText = common_vendor.Wt.t("TUIChat.语音");
break;
case TYPES.MSG_VIDEO:
_quoteContentText = common_vendor.Wt.t("TUIChat.视频");
break;
case TYPES.MSG_FILE:
_quoteContentText = common_vendor.Wt.t("TUIChat.文件");
break;
case TYPES.MSG_CUSTOM:
_quoteContentText = common_vendor.Wt.t("TUIChat.自定义");
break;
case TYPES.MSG_FACE:
_quoteContentText = common_vendor.Wt.t("TUIChat.表情");
break;
case TYPES.MSG_MERGER:
_quoteContentText = common_vendor.Wt.t("TUIChat.聊天记录");
break;
default:
_quoteContentText = common_vendor.Wt.t("TUIChat.消息");
break;
}
return _quoteContentText;
});
function cancelQuote() {
common_vendor.Jt.update(common_vendor.o.CHAT, "quoteMessage", { message: void 0, type: "quote" });
}
function onQuoteMessageUpdated(options) {
if ((options == null ? void 0 : options.message) && (options == null ? void 0 : options.type) === "quote") {
quoteMessage.value = options.message;
} else {
quoteMessage.value = void 0;
}
}
return (_ctx, _cache) => {
return common_vendor.e({
a: Boolean(common_vendor.unref(quoteMessage)) && props.displayType !== "audio"
}, Boolean(common_vendor.unref(quoteMessage)) && props.displayType !== "audio" ? {
b: common_vendor.t(common_vendor.unref(quoteMessage).nick || common_vendor.unref(quoteMessage).from),
c: common_vendor.t(common_vendor.unref(quoteContentText)),
d: common_vendor.o$1(cancelQuote),
e: common_vendor.p({
file: common_vendor.unref(common_assets.closeIcon$2),
width: "11px",
height: "11px"
}),
f: common_vendor.unref(TUIKit_utils_env.isUniFrameWork) ? 1 : "",
g: common_vendor.unref(TUIKit_utils_env.isH5) ? 1 : ""
} : {});
};
}
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-0be2008a"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIChat/message-input/message-input-quote/index.js.map

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"icon": "../../../common/Icon"
}
}

View File

@@ -0,0 +1 @@
<view wx:if="{{a}}" class="{{['data-v-0be2008a', 'input-quote-container', f && 'input-quote-container-uni', g && 'input-quote-container-h5']}}"><view class="input-quote-content data-v-0be2008a"><view class="max-one-line data-v-0be2008a">{{b}}: {{c}}</view><icon wx:if="{{e}}" class="input-quote-close-icon data-v-0be2008a" bindonClick="{{d}}" u-i="0be2008a-0" bind:__l="__l" u-p="{{e}}"/></view></view>

View File

@@ -0,0 +1,59 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.input-quote-container-h5.data-v-0be2008a, .input-quote-container-uni.data-v-0be2008a, .input-quote-container.data-v-0be2008a {
margin: 5px 100px 5px 8px;
display: flex;
flex: 0 1 auto;
}
.input-quote-container-h5 .input-quote-content.data-v-0be2008a, .input-quote-container-uni .input-quote-content.data-v-0be2008a, .input-quote-container .input-quote-content.data-v-0be2008a {
display: flex;
flex: 0 1 auto;
background-color: #fafafa;
border-radius: 8px;
padding: 12px;
font-size: 12px;
align-items: center;
line-height: 16px;
max-width: 100%;
box-sizing: border-box;
min-width: 0;
}
.input-quote-container-h5 .input-quote-content .max-one-line.data-v-0be2008a, .input-quote-container-uni .input-quote-content .max-one-line.data-v-0be2008a, .input-quote-container .input-quote-content .max-one-line.data-v-0be2008a {
flex: 0 1 auto;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.input-quote-container-h5 .input-quote-close-icon.data-v-0be2008a, .input-quote-container-uni .input-quote-close-icon.data-v-0be2008a, .input-quote-container .input-quote-close-icon.data-v-0be2008a {
margin-left: 5px;
padding: 5px;
}
.input-quote-container-uni.data-v-0be2008a {
margin: 5px 60px 0 30px;
}
.input-quote-container-h5.data-v-0be2008a {
margin: 5px 0 0;
}