消息
This commit is contained in:
59
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIChat/chat-header/index.js
vendored
Normal file
59
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIChat/chat-header/index.js
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
require("../../../adapter-vue.js");
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "index",
|
||||
props: ["isGroup"],
|
||||
emits: ["openGroupManagement"],
|
||||
setup(__props, { emit: __emit }) {
|
||||
const currentConversation = common_vendor.ref();
|
||||
const typingStatus = common_vendor.ref(false);
|
||||
const setChatHeaderContent = (content) => {
|
||||
var _a;
|
||||
(_a = common_vendor.i) == null ? void 0 : _a.setNavigationBarTitle({
|
||||
title: content || "云通信 IM"
|
||||
});
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
common_vendor.Jt.watch(common_vendor.o.CONV, {
|
||||
currentConversation: onCurrentConversationUpdated
|
||||
});
|
||||
common_vendor.Jt.watch(common_vendor.o.CHAT, {
|
||||
typingStatus: onTypingStatusUpdated
|
||||
});
|
||||
});
|
||||
common_vendor.onUnmounted(() => {
|
||||
common_vendor.Jt.unwatch(common_vendor.o.CONV, {
|
||||
currentConversation: onCurrentConversationUpdated
|
||||
});
|
||||
common_vendor.Jt.unwatch(common_vendor.o.CHAT, {
|
||||
typingStatus: onTypingStatusUpdated
|
||||
});
|
||||
});
|
||||
common_vendor.onLoad(() => {
|
||||
var _a;
|
||||
setChatHeaderContent((_a = currentConversation.value) == null ? void 0 : _a.getShowName());
|
||||
});
|
||||
function onCurrentConversationUpdated(conversation) {
|
||||
var _a;
|
||||
currentConversation.value = conversation;
|
||||
if (!typingStatus.value) {
|
||||
setChatHeaderContent((_a = currentConversation == null ? void 0 : currentConversation.value) == null ? void 0 : _a.getShowName());
|
||||
}
|
||||
}
|
||||
function onTypingStatusUpdated(status) {
|
||||
var _a;
|
||||
typingStatus.value = status;
|
||||
if (typingStatus.value) {
|
||||
setChatHeaderContent(common_vendor.Wt.t("TUIChat.对方正在输入"));
|
||||
} else {
|
||||
setChatHeaderContent((_a = currentConversation.value) == null ? void 0 : _a.getShowName());
|
||||
}
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return {};
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIChat/chat-header/index.js.map
|
||||
Reference in New Issue
Block a user