消息
This commit is contained in:
79
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIConversation/conversation-header/index.js
vendored
Normal file
79
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIConversation/conversation-header/index.js
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
require("../../../adapter-vue.js");
|
||||
const TUIKit_components_TUIConversation_conversationHeader_server = require("./server.js");
|
||||
if (!Math) {
|
||||
Icon();
|
||||
}
|
||||
const Icon = () => "../../common/Icon.js";
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "index",
|
||||
setup(__props, { expose: __expose }) {
|
||||
const showChildren = common_vendor.ref([]);
|
||||
const convHeaderRef = common_vendor.ref();
|
||||
const menuList = common_vendor.computed(() => {
|
||||
return TUIKit_components_TUIConversation_conversationHeader_server.ConversationHeaderServer.getInstance().getMenu();
|
||||
});
|
||||
common_vendor.onMounted(() => {
|
||||
showChildren.value = [];
|
||||
});
|
||||
const handleMenu = (item) => {
|
||||
const { data: { children }, listener = { onClicked: () => {
|
||||
} } } = item;
|
||||
if (children) {
|
||||
showChildren.value = showChildren.value.length > 0 ? [] : children;
|
||||
} else {
|
||||
listener.onClicked(item);
|
||||
closeChildren();
|
||||
}
|
||||
};
|
||||
const closeChildren = () => {
|
||||
showChildren.value = [];
|
||||
};
|
||||
__expose({
|
||||
closeChildren
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.unref(menuList).length > 0
|
||||
}, common_vendor.unref(menuList).length > 0 ? {
|
||||
b: common_vendor.f(common_vendor.unref(menuList), (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: item.icon && !item.data.children
|
||||
}, item.icon && !item.data.children ? {
|
||||
b: "c7a8f8e3-0-" + i0,
|
||||
c: common_vendor.p({
|
||||
file: item.icon
|
||||
})
|
||||
} : {}, {
|
||||
d: common_vendor.t(item.text),
|
||||
e: common_vendor.o$1(($event) => handleMenu(item), index),
|
||||
f: index
|
||||
});
|
||||
})
|
||||
} : {}, {
|
||||
c: common_vendor.unref(showChildren).length > 0
|
||||
}, common_vendor.unref(showChildren).length > 0 ? {
|
||||
d: common_vendor.f(common_vendor.unref(showChildren), (childrenItem, childrenIndex, i0) => {
|
||||
return common_vendor.e({
|
||||
a: childrenItem.icon
|
||||
}, childrenItem.icon ? {
|
||||
b: "c7a8f8e3-1-" + i0,
|
||||
c: common_vendor.p({
|
||||
file: childrenItem.icon
|
||||
})
|
||||
} : {}, {
|
||||
d: common_vendor.t(childrenItem.text),
|
||||
e: common_vendor.o$1(($event) => handleMenu(childrenItem), childrenIndex),
|
||||
f: childrenIndex
|
||||
});
|
||||
})
|
||||
} : {}, {
|
||||
e: common_vendor.unref(convHeaderRef)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-c7a8f8e3"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIConversation/conversation-header/index.js.map
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"icon": "../../common/Icon"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view ref="{{e}}" class="tui-conversation-header data-v-c7a8f8e3"><view wx:if="{{a}}" class="list data-v-c7a8f8e3"><view wx:for="{{b}}" wx:for-item="item" wx:key="f" class="list-item data-v-c7a8f8e3"><view class="tui-conversation-header-item data-v-c7a8f8e3" catchtap="{{item.e}}"><icon wx:if="{{item.a}}" class="tui-conversation-header-item-icon data-v-c7a8f8e3" u-i="{{item.b}}" bind:__l="__l" u-p="{{item.c}}"/><view wx:else class="plus data-v-c7a8f8e3"/><view class="tui-conversation-header-item-title data-v-c7a8f8e3">{{item.d}}</view></view></view></view><view wx:if="{{c}}" class="tui-conversation-header-children list data-v-c7a8f8e3"><view wx:for="{{d}}" wx:for-item="childrenItem" wx:key="f" class="list-item data-v-c7a8f8e3"><view class="tui-conversation-header-item data-v-c7a8f8e3" bindtap="{{childrenItem.e}}"><icon wx:if="{{childrenItem.a}}" class="tui-conversation-header-item-icon data-v-c7a8f8e3" u-i="{{childrenItem.b}}" bind:__l="__l" u-p="{{childrenItem.c}}"/><view class="tui-conversation-header-item-title data-v-c7a8f8e3">{{childrenItem.d}}</view></view></view></view></view>
|
||||
179
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIConversation/conversation-header/index.wxss
vendored
Normal file
179
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIConversation/conversation-header/index.wxss
vendored
Normal file
@@ -0,0 +1,179 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
body.data-v-c7a8f8e3, div.data-v-c7a8f8e3, ul.data-v-c7a8f8e3, ol.data-v-c7a8f8e3, dt.data-v-c7a8f8e3, dd.data-v-c7a8f8e3, li.data-v-c7a8f8e3, dl.data-v-c7a8f8e3, h1.data-v-c7a8f8e3, h2.data-v-c7a8f8e3, h3.data-v-c7a8f8e3, h4.data-v-c7a8f8e3, p.data-v-c7a8f8e3 {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-style: normal;
|
||||
/* font:12px/22px"\5B8B\4F53",Arial,Helvetica,sans-serif; */
|
||||
}
|
||||
ol.data-v-c7a8f8e3, ul.data-v-c7a8f8e3, li.data-v-c7a8f8e3 {
|
||||
list-style: none;
|
||||
}
|
||||
img.data-v-c7a8f8e3 {
|
||||
border: 0;
|
||||
vertical-align: middle;
|
||||
pointer-events: none;
|
||||
}
|
||||
body.data-v-c7a8f8e3 {
|
||||
color: #000;
|
||||
background: #FFF;
|
||||
}
|
||||
.clear.data-v-c7a8f8e3 {
|
||||
clear: both;
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
margin-top: -1px;
|
||||
}
|
||||
a.data-v-c7a8f8e3 {
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
a.data-v-c7a8f8e3:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
input.data-v-c7a8f8e3, textarea.data-v-c7a8f8e3 {
|
||||
-webkit-user-select: auto;
|
||||
user-select: auto;
|
||||
}
|
||||
input.data-v-c7a8f8e3:focus, input.data-v-c7a8f8e3:active, textarea.data-v-c7a8f8e3:focus, textarea.data-v-c7a8f8e3:active {
|
||||
outline: none;
|
||||
}
|
||||
.chat-aside.data-v-c7a8f8e3 {
|
||||
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);
|
||||
}
|
||||
.tui-conversation.data-v-c7a8f8e3 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.tui-conversation-list.data-v-c7a8f8e3 {
|
||||
overflow: auto;
|
||||
}
|
||||
.tui-conversation-header.data-v-c7a8f8e3 {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
.tui-conversation-header .list.data-v-c7a8f8e3 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #F4F5F9;
|
||||
padding: 7px 0;
|
||||
}
|
||||
.tui-conversation-header .list-item.data-v-c7a8f8e3 {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
position: relative;
|
||||
padding: 7px;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.tui-conversation-header-item.data-v-c7a8f8e3 {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.tui-conversation-header-item-title.data-v-c7a8f8e3 {
|
||||
padding: 0 8px;
|
||||
font-size: 16px;
|
||||
font-weight: normal;
|
||||
}
|
||||
.tui-conversation-header-children.data-v-c7a8f8e3 {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
z-index: 3;
|
||||
padding: 7px 9px;
|
||||
border-bottom: none;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 3px 7px 0 #0003;
|
||||
flex-direction: column;
|
||||
}
|
||||
.network.data-v-c7a8f8e3 {
|
||||
padding: 0 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.network .icon-error.data-v-c7a8f8e3 {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
border-radius: 15px;
|
||||
background: red;
|
||||
color: #fff;
|
||||
font-style: normal;
|
||||
}
|
||||
.network-content.data-v-c7a8f8e3 {
|
||||
padding: 5px;
|
||||
font-size: 12px;
|
||||
line-height: 22px;
|
||||
}
|
||||
.plus.data-v-c7a8f8e3 {
|
||||
display: inline-block;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
}
|
||||
.plus.data-v-c7a8f8e3::before,
|
||||
.plus.data-v-c7a8f8e3::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
background-color: #232832;
|
||||
border-radius: 0.5px;
|
||||
width: 1px;
|
||||
height: 14px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
}
|
||||
.plus.data-v-c7a8f8e3::after {
|
||||
transform: rotate(90deg);
|
||||
width: 0.5px;
|
||||
}
|
||||
.tui-conversation.data-v-c7a8f8e3 {
|
||||
background: #fff;
|
||||
}
|
||||
.network-content.data-v-c7a8f8e3 {
|
||||
font-family: PingFangSC-Regular;
|
||||
font-weight: 400;
|
||||
color: #e54545;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
60
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIConversation/conversation-header/server.js
vendored
Normal file
60
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIConversation/conversation-header/server.js
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const TUIKit_utils_env = require("../../../utils/env.js");
|
||||
const common_assets = require("../../../../common/assets.js");
|
||||
const TUIKit_constant = require("../../../constant.js");
|
||||
class ConversationHeaderServer {
|
||||
static getInstance() {
|
||||
if (!ConversationHeaderServer.instance) {
|
||||
ConversationHeaderServer.instance = new ConversationHeaderServer();
|
||||
}
|
||||
return ConversationHeaderServer.instance;
|
||||
}
|
||||
getMenu() {
|
||||
const list = this.generateMenuList();
|
||||
if (!TUIKit_utils_env.isPC && list.length > 0) {
|
||||
return [{
|
||||
text: common_vendor.Wt.t("TUIConversation.发起会话"),
|
||||
data: {
|
||||
name: "all",
|
||||
children: list
|
||||
}
|
||||
}];
|
||||
}
|
||||
return list;
|
||||
}
|
||||
generateMenuList() {
|
||||
const list = [
|
||||
{
|
||||
icon: common_assets.C2C,
|
||||
text: common_vendor.Wt.t("TUIConversation.发起单聊"),
|
||||
data: {
|
||||
name: TUIKit_constant.CONV_CREATE_TYPE.TYPEC2C
|
||||
},
|
||||
listener: {
|
||||
onClicked: this.createConversation.bind(this)
|
||||
}
|
||||
},
|
||||
{
|
||||
icon: common_assets.createGroup,
|
||||
text: common_vendor.Wt.t("TUIConversation.发起群聊"),
|
||||
data: {
|
||||
name: TUIKit_constant.CONV_CREATE_TYPE.TYPEGROUP
|
||||
},
|
||||
listener: {
|
||||
onClicked: this.createConversation.bind(this)
|
||||
}
|
||||
}
|
||||
];
|
||||
return list;
|
||||
}
|
||||
createConversation(item) {
|
||||
common_vendor.R.callService({
|
||||
serviceName: common_vendor.E.TUIConversation.SERVICE.NAME,
|
||||
method: common_vendor.E.TUIConversation.SERVICE.METHOD.CREATE_CONVERSATION,
|
||||
params: item
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.ConversationHeaderServer = ConversationHeaderServer;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIConversation/conversation-header/server.js.map
|
||||
Reference in New Issue
Block a user