消息
This commit is contained in:
175
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-info/contact-info-config.js
vendored
Normal file
175
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-info/contact-info-config.js
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const TUIKit_constant = require("../../../constant.js");
|
||||
const TUIKit_components_TUIContact_utils_index = require("../utils/index.js");
|
||||
const contactMoreInfoConfig = {
|
||||
// set friends' remark
|
||||
setRemark: {
|
||||
key: "setRemark",
|
||||
label: "备注名",
|
||||
data: "",
|
||||
labelPosition: TUIKit_constant.CONTACT_INFO_LABEL_POSITION.LEFT,
|
||||
editable: true,
|
||||
editType: TUIKit_constant.CONTACT_INFO_MORE_EDIT_TYPE.INPUT,
|
||||
editing: false,
|
||||
editSubmitHandler: (props) => {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
if (props == null ? void 0 : props.isBothFriend) {
|
||||
const newRemarkValue = (_a = props == null ? void 0 : props.item) == null ? void 0 : _a.data;
|
||||
TUIKit_components_TUIContact_utils_index.updateFriendRemark((_b = props == null ? void 0 : props.contactInfoData) == null ? void 0 : _b.userID, newRemarkValue);
|
||||
((_c = props == null ? void 0 : props.item) == null ? void 0 : _c.editing) && (props.item.editing = false);
|
||||
((_d = props == null ? void 0 : props.item) == null ? void 0 : _d.data) && (props.item.data = (_e = props == null ? void 0 : props.contactInfoData) == null ? void 0 : _e.remark);
|
||||
} else {
|
||||
((_f = props == null ? void 0 : props.item) == null ? void 0 : _f.editing) && (props.item.editing = false);
|
||||
}
|
||||
}
|
||||
},
|
||||
// blocked list
|
||||
blackList: {
|
||||
key: "blackList",
|
||||
label: "加入黑名单",
|
||||
data: false,
|
||||
labelPosition: TUIKit_constant.CONTACT_INFO_LABEL_POSITION.LEFT,
|
||||
editable: true,
|
||||
editType: TUIKit_constant.CONTACT_INFO_MORE_EDIT_TYPE.SWITCH,
|
||||
editing: true,
|
||||
editSubmitHandler: (props) => {
|
||||
var _a, _b;
|
||||
if (props == null ? void 0 : props.isInBlackList) {
|
||||
TUIKit_components_TUIContact_utils_index.removeFromBlacklist((_a = props == null ? void 0 : props.contactInfoData) == null ? void 0 : _a.userID);
|
||||
} else {
|
||||
TUIKit_components_TUIContact_utils_index.addToBlacklist((_b = props == null ? void 0 : props.contactInfoData) == null ? void 0 : _b.userID);
|
||||
common_vendor.Jt.update(common_vendor.o.CUSTOM, "currentContactListKey", "blackList");
|
||||
}
|
||||
}
|
||||
},
|
||||
// Fill in verification words (applicant)
|
||||
setWords: {
|
||||
key: "setWords",
|
||||
label: "请填写验证信息",
|
||||
data: "",
|
||||
labelPosition: TUIKit_constant.CONTACT_INFO_LABEL_POSITION.TOP,
|
||||
editable: true,
|
||||
editType: TUIKit_constant.CONTACT_INFO_MORE_EDIT_TYPE.TEXTAREA,
|
||||
editing: true
|
||||
},
|
||||
// Display verification words (application recipient)
|
||||
displayWords: {
|
||||
key: "displayWords",
|
||||
label: "验证信息",
|
||||
data: "",
|
||||
labelPosition: TUIKit_constant.CONTACT_INFO_LABEL_POSITION.LEFT,
|
||||
editable: false
|
||||
}
|
||||
};
|
||||
const contactButtonConfig = {
|
||||
// ---------------------
|
||||
// group command config
|
||||
// ---------------------
|
||||
dismissGroup: {
|
||||
key: "dismissGroup",
|
||||
label: "解散群聊",
|
||||
type: TUIKit_constant.CONTACT_INFO_BUTTON_TYPE.CANCEL,
|
||||
onClick: (props) => {
|
||||
var _a;
|
||||
TUIKit_components_TUIContact_utils_index.dismissGroup((_a = props == null ? void 0 : props.contactInfoData) == null ? void 0 : _a.groupID);
|
||||
}
|
||||
},
|
||||
quitGroup: {
|
||||
key: "quitGroup",
|
||||
label: "退出群聊",
|
||||
type: TUIKit_constant.CONTACT_INFO_BUTTON_TYPE.CANCEL,
|
||||
onClick: (props) => {
|
||||
var _a;
|
||||
TUIKit_components_TUIContact_utils_index.quitGroup((_a = props == null ? void 0 : props.contactInfoData) == null ? void 0 : _a.groupID);
|
||||
}
|
||||
},
|
||||
joinGroup: {
|
||||
key: "joinGroup",
|
||||
label: "发送申请",
|
||||
type: TUIKit_constant.CONTACT_INFO_BUTTON_TYPE.SUBMIT,
|
||||
onClick: (props) => {
|
||||
var _a, _b;
|
||||
TUIKit_components_TUIContact_utils_index.joinGroup(
|
||||
(_a = props == null ? void 0 : props.contactInfoData) == null ? void 0 : _a.groupID,
|
||||
(_b = props == null ? void 0 : props.contactInfoMoreList[0]) == null ? void 0 : _b.data
|
||||
);
|
||||
}
|
||||
},
|
||||
joinAVChatGroup: {
|
||||
key: "joinAVChatGroup",
|
||||
label: "加入直播群",
|
||||
type: TUIKit_constant.CONTACT_INFO_BUTTON_TYPE.SUBMIT,
|
||||
onClick: (props) => {
|
||||
var _a;
|
||||
TUIKit_components_TUIContact_utils_index.joinGroup((_a = props == null ? void 0 : props.contactInfoData) == null ? void 0 : _a.groupID);
|
||||
}
|
||||
},
|
||||
enterGroupConversation: {
|
||||
key: "enterGroupConversation",
|
||||
label: "进入群聊",
|
||||
type: TUIKit_constant.CONTACT_INFO_BUTTON_TYPE.SUBMIT,
|
||||
onClick: (props) => {
|
||||
TUIKit_components_TUIContact_utils_index.enterConversation(props == null ? void 0 : props.contactInfoData);
|
||||
}
|
||||
},
|
||||
// ---------------------
|
||||
// friend command config
|
||||
// ---------------------
|
||||
addFriend: {
|
||||
key: "addFriend",
|
||||
label: "发送申请",
|
||||
type: TUIKit_constant.CONTACT_INFO_BUTTON_TYPE.SUBMIT,
|
||||
onClick: (props) => {
|
||||
var _a, _b, _c;
|
||||
TUIKit_components_TUIContact_utils_index.addFriend({
|
||||
to: (_a = props == null ? void 0 : props.contactInfoData) == null ? void 0 : _a.userID,
|
||||
source: "AddSource_Type_Web",
|
||||
remark: (_b = props == null ? void 0 : props.contactInfoMoreList[1]) == null ? void 0 : _b.data,
|
||||
wording: (_c = props == null ? void 0 : props.contactInfoMoreList[0]) == null ? void 0 : _c.data
|
||||
});
|
||||
}
|
||||
},
|
||||
deleteFriend: {
|
||||
key: "deleteFriend",
|
||||
label: "删除好友",
|
||||
type: TUIKit_constant.CONTACT_INFO_BUTTON_TYPE.CANCEL,
|
||||
onClick: (props) => {
|
||||
var _a;
|
||||
TUIKit_components_TUIContact_utils_index.deleteFriend((_a = props == null ? void 0 : props.contactInfoData) == null ? void 0 : _a.userID);
|
||||
}
|
||||
},
|
||||
enterC2CConversation: {
|
||||
key: "enterC2CConversation",
|
||||
label: "发送消息",
|
||||
type: TUIKit_constant.CONTACT_INFO_BUTTON_TYPE.SUBMIT,
|
||||
onClick: (props) => {
|
||||
TUIKit_components_TUIContact_utils_index.enterConversation(props == null ? void 0 : props.contactInfoData);
|
||||
}
|
||||
},
|
||||
// ---------------------
|
||||
// friend application command config
|
||||
// ---------------------
|
||||
acceptFriendApplication: {
|
||||
key: "acceptFriendApplication",
|
||||
label: "同意",
|
||||
type: TUIKit_constant.CONTACT_INFO_BUTTON_TYPE.SUBMIT,
|
||||
onClick: (props) => {
|
||||
var _a;
|
||||
TUIKit_components_TUIContact_utils_index.acceptFriendApplication((_a = props == null ? void 0 : props.contactInfoData) == null ? void 0 : _a.userID);
|
||||
common_vendor.Jt.update(common_vendor.o.CUSTOM, "currentContactListKey", "friendList");
|
||||
}
|
||||
},
|
||||
refuseFriendApplication: {
|
||||
key: "refuseFriendApplication",
|
||||
label: "拒绝",
|
||||
type: TUIKit_constant.CONTACT_INFO_BUTTON_TYPE.CANCEL,
|
||||
onClick: (props) => {
|
||||
var _a;
|
||||
TUIKit_components_TUIContact_utils_index.refuseFriendApplication((_a = props == null ? void 0 : props.contactInfoData) == null ? void 0 : _a.userID);
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.contactButtonConfig = contactButtonConfig;
|
||||
exports.contactMoreInfoConfig = contactMoreInfoConfig;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIContact/contact-info/contact-info-config.js.map
|
||||
287
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-info/index.js
vendored
Normal file
287
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-info/index.js
vendored
Normal file
@@ -0,0 +1,287 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
require("../../../adapter-vue.js");
|
||||
const TUIKit_utils_env = require("../../../utils/env.js");
|
||||
const TUIKit_components_TUIContact_utils_index = require("../utils/index.js");
|
||||
const TUIKit_components_TUIContact_contactInfo_contactInfoConfig = require("./contact-info-config.js");
|
||||
const common_assets = require("../../../../common/assets.js");
|
||||
const TUIKit_constant = require("../../../constant.js");
|
||||
const TUIKit_components_TUIChat_utils_utils = require("../../TUIChat/utils/utils.js");
|
||||
if (!Math) {
|
||||
(Icon + SwitchBar)();
|
||||
}
|
||||
const Icon = () => "../../common/Icon.js";
|
||||
const SwitchBar = () => "../../common/SwitchBar/index.js";
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "index",
|
||||
emits: ["switchConversation"],
|
||||
setup(__props, { emit: __emit }) {
|
||||
const emits = __emit;
|
||||
const contactInfoData = common_vendor.ref({});
|
||||
const contactInfoBasicList = common_vendor.ref([]);
|
||||
const contactInfoMoreList = common_vendor.ref([]);
|
||||
const contactInfoButtonList = common_vendor.ref([]);
|
||||
const setEditing = (item) => {
|
||||
item.editing = true;
|
||||
};
|
||||
const isGroup = common_vendor.computed(
|
||||
() => {
|
||||
var _a;
|
||||
return ((_a = contactInfoData.value) == null ? void 0 : _a.groupID) ? true : false;
|
||||
}
|
||||
);
|
||||
const isApplication = common_vendor.computed(() => {
|
||||
return TUIKit_components_TUIContact_utils_index.isApplicationType(contactInfoData == null ? void 0 : contactInfoData.value);
|
||||
});
|
||||
const isBothFriend = common_vendor.ref(false);
|
||||
const isGroupMember = common_vendor.computed(() => {
|
||||
var _a, _b;
|
||||
return ((_b = (_a = contactInfoData.value) == null ? void 0 : _a.selfInfo) == null ? void 0 : _b.userID) ? true : false;
|
||||
});
|
||||
const isInBlackList = common_vendor.computed(() => {
|
||||
var _a;
|
||||
return !isGroup.value && ((_a = blackList.value) == null ? void 0 : _a.findIndex(
|
||||
(item) => {
|
||||
var _a2;
|
||||
return (item == null ? void 0 : item.userID) === ((_a2 = contactInfoData.value) == null ? void 0 : _a2.userID);
|
||||
}
|
||||
)) >= 0;
|
||||
});
|
||||
const blackList = common_vendor.ref([]);
|
||||
common_vendor.onMounted(() => {
|
||||
common_vendor.Jt.watch(common_vendor.o.CUSTOM, {
|
||||
currentContactInfo: onCurrentContactInfoUpdated
|
||||
});
|
||||
common_vendor.Jt.watch(common_vendor.o.USER, {
|
||||
userBlacklist: onUserBlacklistUpdated
|
||||
});
|
||||
});
|
||||
common_vendor.onUnmounted(() => {
|
||||
common_vendor.Jt.unwatch(common_vendor.o.CUSTOM, {
|
||||
currentContactInfo: onCurrentContactInfoUpdated
|
||||
});
|
||||
common_vendor.Jt.unwatch(common_vendor.o.USER, {
|
||||
userBlacklist: onUserBlacklistUpdated
|
||||
});
|
||||
});
|
||||
const resetContactInfoUIData = () => {
|
||||
contactInfoData.value = {};
|
||||
contactInfoBasicList.value = [];
|
||||
contactInfoMoreList.value = [];
|
||||
contactInfoButtonList.value = [];
|
||||
};
|
||||
const resetContactSearchingUIData = () => {
|
||||
var _a, _b;
|
||||
common_vendor.Jt.update(common_vendor.o.CUSTOM, "currentContactInfo", {});
|
||||
common_vendor.Jt.update(common_vendor.o.CUSTOM, "currentContactSearchingStatus", false);
|
||||
((_a = common_vendor.i) == null ? void 0 : _a.closeSearching) && ((_b = common_vendor.i) == null ? void 0 : _b.closeSearching());
|
||||
};
|
||||
const onContactInfoEmitSubmit = (item) => {
|
||||
item.editSubmitHandler && item.editSubmitHandler({
|
||||
item,
|
||||
contactInfoData: contactInfoData.value,
|
||||
isBothFriend: isBothFriend.value,
|
||||
isInBlackList: isInBlackList.value
|
||||
});
|
||||
};
|
||||
const onContactInfoButtonClicked = (item) => {
|
||||
item.onClick && item.onClick({
|
||||
contactInfoData: contactInfoData.value,
|
||||
contactInfoMoreList: contactInfoMoreList.value
|
||||
});
|
||||
if (item.key === "enterGroupConversation" || item.key === "enterC2CConversation") {
|
||||
emits("switchConversation", contactInfoData.value);
|
||||
resetContactSearchingUIData();
|
||||
}
|
||||
};
|
||||
const generateMoreInfo = async () => {
|
||||
var _a, _b, _c, _d, _e;
|
||||
if (!isApplication.value) {
|
||||
if (!isGroup.value && !isBothFriend.value && !isInBlackList.value || isGroup.value && !isGroupMember.value && ((_a = contactInfoData.value) == null ? void 0 : _a.type) !== ((_c = (_b = common_vendor.qt) == null ? void 0 : _b.TYPES) == null ? void 0 : _c.GRP_AVCHATROOM)) {
|
||||
TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactMoreInfoConfig.setWords.data = "";
|
||||
contactInfoMoreList.value.push(TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactMoreInfoConfig.setWords);
|
||||
}
|
||||
if (!isGroup.value && !isInBlackList.value) {
|
||||
TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactMoreInfoConfig.setRemark.data = ((_d = contactInfoData.value) == null ? void 0 : _d.remark) || "";
|
||||
TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactMoreInfoConfig.setRemark.editing = false;
|
||||
contactInfoMoreList.value.push(TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactMoreInfoConfig.setRemark);
|
||||
}
|
||||
if (!isGroup.value && (isBothFriend.value || isInBlackList.value)) {
|
||||
TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactMoreInfoConfig.blackList.data = isInBlackList.value || false;
|
||||
contactInfoMoreList.value.push(TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactMoreInfoConfig.blackList);
|
||||
}
|
||||
} else {
|
||||
TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactMoreInfoConfig.displayWords.data = ((_e = contactInfoData.value) == null ? void 0 : _e.wording) || "";
|
||||
contactInfoMoreList.value.push(TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactMoreInfoConfig.displayWords);
|
||||
}
|
||||
};
|
||||
const generateButton = () => {
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
||||
if (isInBlackList.value) {
|
||||
return;
|
||||
}
|
||||
if (isApplication.value) {
|
||||
if (((_a = contactInfoData.value) == null ? void 0 : _a.type) === ((_c = (_b = common_vendor.qt) == null ? void 0 : _b.TYPES) == null ? void 0 : _c.SNS_APPLICATION_SENT_TO_ME)) {
|
||||
(_d = contactInfoButtonList == null ? void 0 : contactInfoButtonList.value) == null ? void 0 : _d.push(
|
||||
TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactButtonConfig.refuseFriendApplication
|
||||
);
|
||||
(_e = contactInfoButtonList == null ? void 0 : contactInfoButtonList.value) == null ? void 0 : _e.push(
|
||||
TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactButtonConfig.acceptFriendApplication
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (isGroup.value && isGroupMember.value) {
|
||||
switch ((_g = (_f = contactInfoData.value) == null ? void 0 : _f.selfInfo) == null ? void 0 : _g.role) {
|
||||
case "Owner":
|
||||
(_h = contactInfoButtonList == null ? void 0 : contactInfoButtonList.value) == null ? void 0 : _h.push(TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactButtonConfig.dismissGroup);
|
||||
break;
|
||||
default:
|
||||
(_i = contactInfoButtonList == null ? void 0 : contactInfoButtonList.value) == null ? void 0 : _i.push(TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactButtonConfig.quitGroup);
|
||||
break;
|
||||
}
|
||||
(_j = contactInfoButtonList == null ? void 0 : contactInfoButtonList.value) == null ? void 0 : _j.push(
|
||||
TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactButtonConfig.enterGroupConversation
|
||||
);
|
||||
} else if (!isGroup.value && isBothFriend.value) {
|
||||
(_k = contactInfoButtonList == null ? void 0 : contactInfoButtonList.value) == null ? void 0 : _k.push(TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactButtonConfig.deleteFriend);
|
||||
(_l = contactInfoButtonList == null ? void 0 : contactInfoButtonList.value) == null ? void 0 : _l.push(
|
||||
TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactButtonConfig.enterC2CConversation
|
||||
);
|
||||
} else {
|
||||
if (isGroup.value) {
|
||||
(_p = contactInfoButtonList == null ? void 0 : contactInfoButtonList.value) == null ? void 0 : _p.push(
|
||||
((_m = contactInfoData.value) == null ? void 0 : _m.type) === ((_o = (_n = common_vendor.qt) == null ? void 0 : _n.TYPES) == null ? void 0 : _o.GRP_AVCHATROOM) ? TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactButtonConfig.joinAVChatGroup : TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactButtonConfig.joinGroup
|
||||
);
|
||||
} else {
|
||||
(_q = contactInfoButtonList == null ? void 0 : contactInfoButtonList.value) == null ? void 0 : _q.push(TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactButtonConfig.addFriend);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
function onUserBlacklistUpdated(userBlacklist) {
|
||||
blackList.value = userBlacklist;
|
||||
}
|
||||
async function onCurrentContactInfoUpdated(contactInfo) {
|
||||
var _a;
|
||||
if (contactInfoData.value && contactInfo && JSON.stringify(contactInfoData.value) === JSON.stringify(contactInfo)) {
|
||||
return;
|
||||
}
|
||||
resetContactInfoUIData();
|
||||
contactInfoData.value = TUIKit_components_TUIChat_utils_utils.deepCopy(contactInfo) || {};
|
||||
if (!contactInfoData.value || ((_a = Object.keys(contactInfoData.value)) == null ? void 0 : _a.length) === 0) {
|
||||
return;
|
||||
}
|
||||
contactInfoBasicList.value = TUIKit_components_TUIContact_utils_index.generateContactInfoBasic(
|
||||
contactInfoData.value
|
||||
);
|
||||
isBothFriend.value = await TUIKit_components_TUIContact_utils_index.isFriend(contactInfoData.value);
|
||||
generateMoreInfo();
|
||||
generateButton();
|
||||
if (contactInfo.infoKeyList) {
|
||||
contactInfoMoreList.value = contactInfo.infoKeyList.map((key) => {
|
||||
return TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactMoreInfoConfig[key];
|
||||
});
|
||||
}
|
||||
if (contactInfo.btnKeyList) {
|
||||
contactInfoButtonList.value = contactInfo.btnKeyList.map((key) => {
|
||||
return TUIKit_components_TUIContact_contactInfo_contactInfoConfig.contactButtonConfig[key];
|
||||
});
|
||||
}
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: typeof common_vendor.unref(contactInfoData) === "object" && Object.keys(common_vendor.unref(contactInfoData)).length
|
||||
}, typeof common_vendor.unref(contactInfoData) === "object" && Object.keys(common_vendor.unref(contactInfoData)).length ? common_vendor.e({
|
||||
b: !common_vendor.unref(TUIKit_utils_env.isPC)
|
||||
}, !common_vendor.unref(TUIKit_utils_env.isPC) ? {
|
||||
c: common_vendor.p({
|
||||
file: common_vendor.unref(common_assets.backIcon)
|
||||
}),
|
||||
d: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-header-icon"),
|
||||
e: common_vendor.o$1(resetContactSearchingUIData),
|
||||
f: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("TUIContact.添加好友/群聊")),
|
||||
g: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-header-title"),
|
||||
h: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-header")
|
||||
} : {}, {
|
||||
i: common_vendor.t(common_vendor.unref(TUIKit_components_TUIContact_utils_index.generateContactInfoName)(common_vendor.unref(contactInfoData))),
|
||||
j: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-basic-text-name"),
|
||||
k: common_vendor.f(common_vendor.unref(contactInfoBasicList), (item, k0, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(`${common_vendor.unref(common_vendor.Wt).t(`TUIContact.${item.label}`)}:
|
||||
${item.data}`),
|
||||
b: item.label
|
||||
};
|
||||
}),
|
||||
l: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-basic-text-other"),
|
||||
m: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-basic-text"),
|
||||
n: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-basic-avatar"),
|
||||
o: common_vendor.unref(TUIKit_components_TUIContact_utils_index.generateAvatar)(common_vendor.unref(contactInfoData)),
|
||||
p: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-basic"),
|
||||
q: common_vendor.unref(contactInfoMoreList)[0]
|
||||
}, common_vendor.unref(contactInfoMoreList)[0] ? {
|
||||
r: common_vendor.f(common_vendor.unref(contactInfoMoreList), (item, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(`${common_vendor.unref(common_vendor.Wt).t(`TUIContact.${item.label}`)}`),
|
||||
b: !item.editing
|
||||
}, !item.editing ? common_vendor.e({
|
||||
c: common_vendor.t(item.data),
|
||||
d: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-more-item-content-text-data"),
|
||||
e: item.editable
|
||||
}, item.editable ? {
|
||||
f: "e2a6c8d8-1-" + i0,
|
||||
g: common_vendor.p({
|
||||
file: common_vendor.unref(common_assets.editIcon),
|
||||
width: "14px",
|
||||
height: "14px"
|
||||
}),
|
||||
h: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-more-item-content-text-icon"),
|
||||
i: common_vendor.o$1(($event) => setEditing(item), item.key)
|
||||
} : {}, {
|
||||
j: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-more-item-content-text")
|
||||
}) : item.editType === common_vendor.unref(TUIKit_constant.CONTACT_INFO_MORE_EDIT_TYPE).INPUT ? {
|
||||
l: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-more-item-content-input"),
|
||||
m: common_vendor.o$1(($event) => onContactInfoEmitSubmit(item), item.key),
|
||||
n: common_vendor.o$1(($event) => onContactInfoEmitSubmit(item), item.key),
|
||||
o: item.data,
|
||||
p: common_vendor.o$1(($event) => item.data = $event.detail.value, item.key)
|
||||
} : item.editType === common_vendor.unref(TUIKit_constant.CONTACT_INFO_MORE_EDIT_TYPE).TEXTAREA ? {
|
||||
r: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-more-item-content-textarea"),
|
||||
s: item.data,
|
||||
t: common_vendor.o$1(($event) => item.data = $event.detail.value, item.key)
|
||||
} : item.editType === common_vendor.unref(TUIKit_constant.CONTACT_INFO_MORE_EDIT_TYPE).SWITCH ? {
|
||||
w: "e2a6c8d8-2-" + i0,
|
||||
x: common_vendor.p({
|
||||
value: item.data
|
||||
}),
|
||||
y: common_vendor.o$1(($event) => onContactInfoEmitSubmit(item), item.key)
|
||||
} : {}, {
|
||||
k: item.editType === common_vendor.unref(TUIKit_constant.CONTACT_INFO_MORE_EDIT_TYPE).INPUT,
|
||||
q: item.editType === common_vendor.unref(TUIKit_constant.CONTACT_INFO_MORE_EDIT_TYPE).TEXTAREA,
|
||||
v: item.editType === common_vendor.unref(TUIKit_constant.CONTACT_INFO_MORE_EDIT_TYPE).SWITCH,
|
||||
z: item.key,
|
||||
A: common_vendor.n(item.labelPosition === common_vendor.unref(TUIKit_constant.CONTACT_INFO_LABEL_POSITION).TOP ? "tui-contact-info-more-item-top" : "tui-contact-info-more-item-left")
|
||||
});
|
||||
}),
|
||||
s: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-more-item-label"),
|
||||
t: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-more-item-content"),
|
||||
v: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-more-item"),
|
||||
w: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-more")
|
||||
} : {}, {
|
||||
x: common_vendor.f(common_vendor.unref(contactInfoButtonList), (item, k0, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(common_vendor.unref(common_vendor.Wt).t(`TUIContact.${item.label}`)),
|
||||
b: item.key,
|
||||
c: common_vendor.n(item.type === common_vendor.unref(TUIKit_constant.CONTACT_INFO_BUTTON_TYPE).CANCEL ? `tui-contact-info-button-item-cancel` : `tui-contact-info-button-item-submit`),
|
||||
d: common_vendor.o$1(($event) => onContactInfoButtonClicked(item), item.key)
|
||||
};
|
||||
}),
|
||||
y: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-button-item"),
|
||||
z: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5-button"),
|
||||
A: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-info-h5")
|
||||
}) : {});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-e2a6c8d8"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIContact/contact-info/index.js.map
|
||||
7
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-info/index.json
vendored
Normal file
7
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-info/index.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"icon": "../../common/Icon",
|
||||
"switch-bar": "../../common/SwitchBar/index"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-info/index.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-info/index.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view wx:if="{{a}}" class="{{['data-v-e2a6c8d8', 'tui-contact-info', A]}}"><view wx:if="{{b}}" class="{{['data-v-e2a6c8d8', 'tui-contact-info-header', h]}}"><view class="{{['data-v-e2a6c8d8', 'tui-contact-info-header-icon', d]}}" bindtap="{{e}}"><icon wx:if="{{c}}" class="data-v-e2a6c8d8" u-i="e2a6c8d8-0" bind:__l="__l" u-p="{{c}}"/></view><view class="{{['data-v-e2a6c8d8', 'tui-contact-info-header-title', g]}}">{{f}}</view></view><view class="{{['data-v-e2a6c8d8', 'tui-contact-info-basic', p]}}"><view class="{{['data-v-e2a6c8d8', 'tui-contact-info-basic-text', m]}}"><view class="{{['data-v-e2a6c8d8', 'tui-contact-info-basic-text-name', j]}}">{{i}}</view><view wx:for="{{k}}" wx:for-item="item" wx:key="b" class="{{['data-v-e2a6c8d8', 'tui-contact-info-basic-text-other', l]}}">{{item.a}}</view></view><image class="{{['data-v-e2a6c8d8', 'tui-contact-info-basic-avatar', n]}}" src="{{o}}"></image></view><view wx:if="{{q}}" class="{{['data-v-e2a6c8d8', 'tui-contact-info-more', w]}}"><view wx:for="{{r}}" wx:for-item="item" wx:key="z" class="{{['data-v-e2a6c8d8', 'tui-contact-info-more-item', v, item.A]}}"><view class="{{['data-v-e2a6c8d8', 'tui-contact-info-more-item-label', s]}}">{{item.a}}</view><view class="{{['data-v-e2a6c8d8', 'tui-contact-info-more-item-content', t]}}"><view wx:if="{{item.b}}" class="{{['data-v-e2a6c8d8', 'tui-contact-info-more-item-content-text', item.j]}}"><view class="{{['data-v-e2a6c8d8', 'tui-contact-info-more-item-content-text-data', item.d]}}">{{item.c}}</view><view wx:if="{{item.e}}" class="{{['data-v-e2a6c8d8', 'tui-contact-info-more-item-content-text-icon', item.h]}}" bindtap="{{item.i}}"><icon wx:if="{{item.g}}" class="data-v-e2a6c8d8" u-i="{{item.f}}" bind:__l="__l" u-p="{{item.g}}"/></view></view><input wx:elif="{{item.k}}" class="{{['data-v-e2a6c8d8', 'tui-contact-info-more-item-content-input', item.l]}}" type="text" bindconfirm="{{item.m}}" bindkeyup="{{item.n}}" value="{{item.o}}" bindinput="{{item.p}}"></input><textarea wx:elif="{{item.q}}" class="{{['data-v-e2a6c8d8', 'tui-contact-info-more-item-content-textarea', item.r]}}" confirm-type="done" value="{{item.s}}" bindinput="{{item.t}}"/><view wx:elif="{{item.v}}" class="data-v-e2a6c8d8" bindtap="{{item.y}}"><switch-bar wx:if="{{item.x}}" class="data-v-e2a6c8d8" u-i="{{item.w}}" bind:__l="__l" u-p="{{item.x}}"/></view></view></view></view><view class="{{['data-v-e2a6c8d8', 'tui-contact-info-button', z]}}"><button wx:for="{{x}}" wx:for-item="item" wx:key="b" class="{{['data-v-e2a6c8d8', 'tui-contact-info-button-item', y, item.c]}}" bindtap="{{item.d}}">{{item.a}}</button></view></view>
|
||||
314
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-info/index.wxss
vendored
Normal file
314
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-info/index.wxss
vendored
Normal file
@@ -0,0 +1,314 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.tui-contact-info.data-v-e2a6c8d8 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f7f8fa;
|
||||
display: flex;
|
||||
padding: 30px;
|
||||
box-sizing: border-box;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
.tui-contact-info-basic.data-v-e2a6c8d8 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-bottom: 15px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
.tui-contact-info-basic-text.data-v-e2a6c8d8 {
|
||||
flex: 1;
|
||||
}
|
||||
.tui-contact-info-basic-text-name.data-v-e2a6c8d8 {
|
||||
font-size: 24px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.tui-contact-info-basic-text-other.data-v-e2a6c8d8 {
|
||||
font-size: 16px;
|
||||
padding: 6px 0;
|
||||
font-weight: 400;
|
||||
color: #999;
|
||||
}
|
||||
.tui-contact-info-basic-avatar.data-v-e2a6c8d8 {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
.tui-contact-info-more.data-v-e2a6c8d8 {
|
||||
padding: 15px 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.tui-contact-info-more-item.data-v-e2a6c8d8 {
|
||||
display: flex;
|
||||
padding: 6px 0;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
min-height: 56px;
|
||||
}
|
||||
.tui-contact-info-more-item-label.data-v-e2a6c8d8 {
|
||||
color: #999;
|
||||
height: -webkit-fit-content;
|
||||
height: fit-content;
|
||||
}
|
||||
.tui-contact-info-more-item-left.data-v-e2a6c8d8 {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
.tui-contact-info-more-item-left .tui-contact-info-more-item-label.data-v-e2a6c8d8 {
|
||||
width: 80px;
|
||||
}
|
||||
.tui-contact-info-more-item-top.data-v-e2a6c8d8 {
|
||||
flex-direction: column;
|
||||
}
|
||||
.tui-contact-info-more-item-content.data-v-e2a6c8d8 {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
color: #333;
|
||||
overflow: hidden;
|
||||
}
|
||||
.tui-contact-info-more-item-content-text.data-v-e2a6c8d8 {
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
}
|
||||
.tui-contact-info-more-item-content-text-data.data-v-e2a6c8d8 {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.tui-contact-info-more-item-content-text-icon.data-v-e2a6c8d8 {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.tui-contact-info-more-item-content-input.data-v-e2a6c8d8, .tui-contact-info-more-item-content-textarea.data-v-e2a6c8d8 {
|
||||
flex: 1;
|
||||
border: 1px solid #e8e8e9;
|
||||
border-radius: 4px;
|
||||
padding: 4px;
|
||||
color: inherit;
|
||||
}
|
||||
.tui-contact-info-more-item-content-input.data-v-e2a6c8d8 {
|
||||
height: 22px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.tui-contact-info-more-item-content-textarea.data-v-e2a6c8d8 {
|
||||
resize: none;
|
||||
height: 100px;
|
||||
}
|
||||
.tui-contact-info-button.data-v-e2a6c8d8 {
|
||||
display: flex;
|
||||
padding: 30px;
|
||||
justify-content: center;
|
||||
}
|
||||
.tui-contact-info-button-item.data-v-e2a6c8d8 {
|
||||
margin: 15px;
|
||||
min-width: 142px;
|
||||
height: 36px;
|
||||
padding: 8px 20px;
|
||||
border-radius: 4px;
|
||||
border: none;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
font-weight: 400;
|
||||
letter-spacing: 0;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.tui-contact-info-button-item-submit.data-v-e2a6c8d8 {
|
||||
border: 1px solid #006eff;
|
||||
background: #006eff;
|
||||
color: #fff;
|
||||
}
|
||||
.tui-contact-info-button-item-cancel.data-v-e2a6c8d8 {
|
||||
border: 1px solid #e54545;
|
||||
background: transparent;
|
||||
color: #e54545;
|
||||
}
|
||||
.tui-contact-info-h5.data-v-e2a6c8d8 {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.tui-contact-info-h5-header.data-v-e2a6c8d8 {
|
||||
background-color: #fff;
|
||||
padding: 10px !important;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.tui-contact-info-h5-header-title.data-v-e2a6c8d8 {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
margin-right: 30px;
|
||||
}
|
||||
.tui-contact-info-h5-basic.data-v-e2a6c8d8 {
|
||||
padding: 10px !important;
|
||||
background: #fff;
|
||||
margin-top: 10px !important;
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
justify-content: left;
|
||||
border-bottom: none;
|
||||
}
|
||||
.tui-contact-info-h5-basic-text-name.data-v-e2a6c8d8 {
|
||||
font-size: 20px;
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
.tui-contact-info-h5-basic-text-other.data-v-e2a6c8d8 {
|
||||
font-size: 14px;
|
||||
padding: 3px 0;
|
||||
}
|
||||
.tui-contact-info-h5-basic-avatar.data-v-e2a6c8d8 {
|
||||
border-radius: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.tui-contact-info-h5-more.data-v-e2a6c8d8 {
|
||||
background: #fff;
|
||||
margin-top: 10px !important;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
}
|
||||
.tui-contact-info-h5-more-item.data-v-e2a6c8d8 {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
padding: 10px !important;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.tui-contact-info-h5-more-item-label.data-v-e2a6c8d8 {
|
||||
color: #000;
|
||||
}
|
||||
.tui-contact-info-h5-more-item-content.data-v-e2a6c8d8 {
|
||||
overflow: hidden;
|
||||
color: #979797;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.tui-contact-info-h5-more-item-content-text.data-v-e2a6c8d8 {
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.tui-contact-info-h5-more-item-content-text-data.data-v-e2a6c8d8 {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.tui-contact-info-h5-more-item.data-v-e2a6c8d8:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.tui-contact-info-h5-button.data-v-e2a6c8d8 {
|
||||
margin-top: 10px !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0;
|
||||
background-color: #fff;
|
||||
}
|
||||
.tui-contact-info-h5-button-item.data-v-e2a6c8d8 {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
border: none;
|
||||
padding: 16px !important;
|
||||
font-size: 16px;
|
||||
border-bottom: 1px solid #eee;
|
||||
height: -webkit-fit-content;
|
||||
height: fit-content;
|
||||
}
|
||||
.tui-contact-info-h5-button-item.data-v-e2a6c8d8::after {
|
||||
border: none;
|
||||
}
|
||||
.tui-contact-info-h5-button-item-textarea.data-v-e2a6c8d8 {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
.tui-contact-info-h5-button-item.data-v-e2a6c8d8:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.tui-contact-info-h5-button .tui-contact-info-button-item-cancel.data-v-e2a6c8d8 {
|
||||
background-color: #fff;
|
||||
color: #e54545;
|
||||
}
|
||||
.tui-contact-info-h5-button .tui-contact-info-button-item-submit.data-v-e2a6c8d8 {
|
||||
background-color: #fff;
|
||||
color: #006eff;
|
||||
}
|
||||
body.data-v-e2a6c8d8, div.data-v-e2a6c8d8, ul.data-v-e2a6c8d8, ol.data-v-e2a6c8d8, dt.data-v-e2a6c8d8, dd.data-v-e2a6c8d8, li.data-v-e2a6c8d8, dl.data-v-e2a6c8d8, h1.data-v-e2a6c8d8, h2.data-v-e2a6c8d8, h3.data-v-e2a6c8d8, h4.data-v-e2a6c8d8, p.data-v-e2a6c8d8 {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-style: normal;
|
||||
/* font:12px/22px"\5B8B\4F53",Arial,Helvetica,sans-serif; */
|
||||
}
|
||||
ol.data-v-e2a6c8d8, ul.data-v-e2a6c8d8, li.data-v-e2a6c8d8 {
|
||||
list-style: none;
|
||||
}
|
||||
img.data-v-e2a6c8d8 {
|
||||
border: 0;
|
||||
vertical-align: middle;
|
||||
pointer-events: none;
|
||||
}
|
||||
body.data-v-e2a6c8d8 {
|
||||
color: #000;
|
||||
background: #FFF;
|
||||
}
|
||||
.clear.data-v-e2a6c8d8 {
|
||||
clear: both;
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
margin-top: -1px;
|
||||
}
|
||||
a.data-v-e2a6c8d8 {
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
a.data-v-e2a6c8d8:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
input.data-v-e2a6c8d8, textarea.data-v-e2a6c8d8 {
|
||||
-webkit-user-select: auto;
|
||||
user-select: auto;
|
||||
}
|
||||
input.data-v-e2a6c8d8:focus, input.data-v-e2a6c8d8:active, textarea.data-v-e2a6c8d8:focus, textarea.data-v-e2a6c8d8:active {
|
||||
outline: none;
|
||||
}
|
||||
.chat-aside.data-v-e2a6c8d8 {
|
||||
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);
|
||||
}
|
||||
119
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-list/contact-list-item/index.js
vendored
Normal file
119
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-list/contact-list-item/index.js
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../../common/vendor.js");
|
||||
require("../../../../adapter-vue.js");
|
||||
const TUIKit_components_TUIContact_utils_index = require("../../utils/index.js");
|
||||
const TUIKit_utils_env = require("../../../../utils/env.js");
|
||||
if (!Math) {
|
||||
Avatar();
|
||||
}
|
||||
const Avatar = () => "../../../common/Avatar/index.js";
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "index",
|
||||
props: {
|
||||
item: { default: () => ({}) },
|
||||
displayOnlineStatus: { type: Boolean, default: false }
|
||||
},
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const userOnlineStatusMap = common_vendor.inject("userOnlineStatusMap");
|
||||
const isOnline = common_vendor.ref(false);
|
||||
const groupType = {
|
||||
[common_vendor.qt.TYPES.GRP_WORK]: "Work",
|
||||
[common_vendor.qt.TYPES.GRP_AVCHATROOM]: "AVChatRoom",
|
||||
[common_vendor.qt.TYPES.GRP_PUBLIC]: "Public",
|
||||
[common_vendor.qt.TYPES.GRP_MEETING]: "Meeting",
|
||||
[common_vendor.qt.TYPES.GRP_COMMUNITY]: "Community"
|
||||
};
|
||||
const otherContentForSow = common_vendor.computed(() => {
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
||||
let content = "";
|
||||
if (((_a = props.item) == null ? void 0 : _a.type) === ((_c = (_b = common_vendor.qt) == null ? void 0 : _b.TYPES) == null ? void 0 : _c.SNS_APPLICATION_SENT_TO_ME) || ((_d = props.item) == null ? void 0 : _d.type) === ((_f = (_e = common_vendor.qt) == null ? void 0 : _e.TYPES) == null ? void 0 : _f.SNS_APPLICATION_SENT_BY_ME)) {
|
||||
content = ((_g = props.item) == null ? void 0 : _g.wording) || "";
|
||||
} else if ((_h = props.item) == null ? void 0 : _h.groupID) {
|
||||
content = `ID:${(_i = props.item) == null ? void 0 : _i.groupID}`;
|
||||
}
|
||||
return content;
|
||||
});
|
||||
const groupTypeForShow = common_vendor.computed(() => {
|
||||
var _a, _b;
|
||||
let type = "";
|
||||
if ((_a = props.item) == null ? void 0 : _a.groupID) {
|
||||
type = groupType[(_b = props.item) == null ? void 0 : _b.type];
|
||||
}
|
||||
return type;
|
||||
});
|
||||
const showApplicationStatus = common_vendor.computed(() => {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
if (((_a = props.item) == null ? void 0 : _a.type) === ((_c = (_b = common_vendor.qt) == null ? void 0 : _b.TYPES) == null ? void 0 : _c.SNS_APPLICATION_SENT_BY_ME)) {
|
||||
return {
|
||||
style: "text",
|
||||
label: "等待验证"
|
||||
};
|
||||
} else if (((_d = props.item) == null ? void 0 : _d.type) === ((_f = (_e = common_vendor.qt) == null ? void 0 : _e.TYPES) == null ? void 0 : _f.SNS_APPLICATION_SENT_TO_ME)) {
|
||||
return {
|
||||
style: "button",
|
||||
label: "同意",
|
||||
onClick: () => {
|
||||
var _a2;
|
||||
TUIKit_components_TUIContact_utils_index.acceptFriendApplication((_a2 = props.item) == null ? void 0 : _a2.userID);
|
||||
}
|
||||
};
|
||||
}
|
||||
return false;
|
||||
});
|
||||
common_vendor.watch(
|
||||
() => userOnlineStatusMap == null ? void 0 : userOnlineStatusMap.value,
|
||||
() => {
|
||||
isOnline.value = getOnlineStatus();
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true
|
||||
}
|
||||
);
|
||||
function getOnlineStatus() {
|
||||
var _a, _b, _c;
|
||||
return !!(props.displayOnlineStatus && (userOnlineStatusMap == null ? void 0 : userOnlineStatusMap.value) && ((_a = props.item) == null ? void 0 : _a.userID) && ((_c = (_b = userOnlineStatusMap.value) == null ? void 0 : _b[props.item.userID]) == null ? void 0 : _c.statusType) === common_vendor.qt.TYPES.USER_STATUS_ONLINE);
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.p({
|
||||
useSkeletonAnimation: true,
|
||||
url: common_vendor.unref(TUIKit_components_TUIContact_utils_index.generateAvatar)(props.item)
|
||||
}),
|
||||
b: props.displayOnlineStatus && props.item
|
||||
}, props.displayOnlineStatus && props.item ? {
|
||||
c: common_vendor.unref(isOnline) ? 1 : "",
|
||||
d: !common_vendor.unref(isOnline) ? 1 : ""
|
||||
} : {}, {
|
||||
e: common_vendor.t(common_vendor.unref(TUIKit_components_TUIContact_utils_index.generateName)(props.item)),
|
||||
f: common_vendor.unref(otherContentForSow)
|
||||
}, common_vendor.unref(otherContentForSow) ? {
|
||||
g: common_vendor.t(common_vendor.unref(otherContentForSow))
|
||||
} : {}, {
|
||||
h: common_vendor.unref(groupTypeForShow)
|
||||
}, common_vendor.unref(groupTypeForShow) ? {
|
||||
i: common_vendor.t(common_vendor.unref(groupTypeForShow))
|
||||
} : {}, {
|
||||
j: common_vendor.unref(showApplicationStatus)
|
||||
}, common_vendor.unref(showApplicationStatus) ? common_vendor.e({
|
||||
k: common_vendor.unref(showApplicationStatus).style === "text"
|
||||
}, common_vendor.unref(showApplicationStatus).style === "text" ? {
|
||||
l: common_vendor.t(common_vendor.unref(common_vendor.Wt).t(`TUIContact.${common_vendor.unref(showApplicationStatus).label}`))
|
||||
} : common_vendor.unref(showApplicationStatus).style === "button" ? {
|
||||
n: common_vendor.t(common_vendor.unref(common_vendor.Wt).t(`TUIContact.${common_vendor.unref(showApplicationStatus).label}`)),
|
||||
o: common_vendor.o$1(
|
||||
//@ts-ignore
|
||||
(...args) => common_vendor.unref(showApplicationStatus).onClick && common_vendor.unref(showApplicationStatus).onClick(...args)
|
||||
)
|
||||
} : {}, {
|
||||
m: common_vendor.unref(showApplicationStatus).style === "button"
|
||||
}) : {}, {
|
||||
p: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-list-card-h5")
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-cbb84739"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIContact/contact-list/contact-list-item/index.js.map
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"avatar": "../../../common/Avatar/index"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-cbb84739', 'tui-contact-list-card', p]}}"><view class="tui-contact-list-card-left data-v-cbb84739"><avatar wx:if="{{a}}" class="tui-contact-list-card-left-avatar data-v-cbb84739" u-i="cbb84739-0" bind:__l="__l" u-p="{{a}}"/><view wx:if="{{b}}" class="{{['data-v-cbb84739', 'online-status', c && 'online-status-online', d && 'online-status-offline']}}"/></view><view class="tui-contact-list-card-main data-v-cbb84739"><view class="tui-contact-list-card-main-name data-v-cbb84739">{{e}}</view><view wx:if="{{f}}" class="tui-contact-list-card-main-other data-v-cbb84739">{{g}}</view></view><view class="tui-contact-list-card-right data-v-cbb84739"><view wx:if="{{h}}" class="tui-contact-list-card-right-group-type data-v-cbb84739">{{i}}</view><view wx:if="{{j}}" class="tui-contact-list-card-right-application data-v-cbb84739"><view wx:if="{{k}}" class="tui-contact-list-card-right-application-text data-v-cbb84739">{{l}}</view><button wx:elif="{{m}}" class="tui-contact-list-card-right-application-button data-v-cbb84739" catchtap="{{o}}">{{n}}</button></view></view></view>
|
||||
114
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-list/contact-list-item/index.wxss
vendored
Normal file
114
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-list/contact-list-item/index.wxss
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.tui-contact-list-card.data-v-cbb84739 {
|
||||
padding: 5px 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
}
|
||||
.tui-contact-list-card-left.data-v-cbb84739 {
|
||||
position: relative;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
.tui-contact-list-card-left-avatar.data-v-cbb84739 {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.tui-contact-list-card-left .online-status.data-v-cbb84739 {
|
||||
box-sizing: border-box;
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
left: 30px;
|
||||
top: 30px;
|
||||
border: 2px solid #fff;
|
||||
box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 50%;
|
||||
}
|
||||
.tui-contact-list-card-left .online-status-online.data-v-cbb84739 {
|
||||
background: #29cc85;
|
||||
}
|
||||
.tui-contact-list-card-left .online-status-offline.data-v-cbb84739 {
|
||||
background: #a4a4a4;
|
||||
}
|
||||
.tui-contact-list-card-main.data-v-cbb84739 {
|
||||
flex: 1;
|
||||
padding: 0 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.tui-contact-list-card-main-name.data-v-cbb84739, .tui-contact-list-card-main-other.data-v-cbb84739 {
|
||||
font-size: 14px;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.tui-contact-list-card-main-other.data-v-cbb84739 {
|
||||
color: #999;
|
||||
}
|
||||
.tui-contact-list-card-right.data-v-cbb84739 {
|
||||
width: -webkit-fit-content;
|
||||
width: fit-content;
|
||||
}
|
||||
.tui-contact-list-card-right-group-type.data-v-cbb84739 {
|
||||
padding: 0 4px;
|
||||
line-height: 14px;
|
||||
font-size: 12px;
|
||||
border-radius: 1px;
|
||||
font-weight: 400;
|
||||
color: rgba(0, 0, 0, 0.3);
|
||||
border: 1px solid rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
.tui-contact-list-card-right-application-text.data-v-cbb84739 {
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
}
|
||||
.tui-contact-list-card-right-application-button.data-v-cbb84739 {
|
||||
border: 1px solid #006eff;
|
||||
background: #006eff;
|
||||
color: #fff;
|
||||
padding: 3px 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
line-height: 150%;
|
||||
}
|
||||
.tui-contact-list-card-right-application-button.data-v-cbb84739::after {
|
||||
border: none;
|
||||
}
|
||||
.tui-contact-list-card-h5.data-v-cbb84739 {
|
||||
cursor: none !important;
|
||||
}
|
||||
295
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-list/index.js
vendored
Normal file
295
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-list/index.js
vendored
Normal file
@@ -0,0 +1,295 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
require("../../../adapter-vue.js");
|
||||
const common_assets = require("../../../../common/assets.js");
|
||||
const TUIKit_components_TUIChat_utils_utils = require("../../TUIChat/utils/utils.js");
|
||||
const TUIKit_utils_env = require("../../../utils/env.js");
|
||||
if (!Math) {
|
||||
(Icon + ContactListItem)();
|
||||
}
|
||||
const Icon = () => "../../common/Icon.js";
|
||||
const ContactListItem = () => "./contact-list-item/index.js";
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "index",
|
||||
setup(__props) {
|
||||
const currentContactListKey = common_vendor.ref("");
|
||||
const currentContactInfo = common_vendor.ref({});
|
||||
const contactListMap = common_vendor.ref({
|
||||
friendApplicationList: {
|
||||
key: "friendApplicationList",
|
||||
title: "新的联系人",
|
||||
list: [],
|
||||
unreadCount: 0
|
||||
},
|
||||
blackList: {
|
||||
key: "blackList",
|
||||
title: "黑名单",
|
||||
list: []
|
||||
},
|
||||
groupList: {
|
||||
key: "groupList",
|
||||
title: "我的群聊",
|
||||
list: []
|
||||
},
|
||||
friendList: {
|
||||
key: "friendList",
|
||||
title: "我的好友",
|
||||
list: []
|
||||
}
|
||||
});
|
||||
const contactSearchingStatus = common_vendor.ref(false);
|
||||
const contactSearchResult = common_vendor.ref();
|
||||
const displayOnlineStatus = common_vendor.ref(false);
|
||||
const userOnlineStatusMap = common_vendor.ref();
|
||||
const isContactSearchNoResult = common_vendor.computed(() => {
|
||||
var _a, _b, _c, _d;
|
||||
return !((_b = (_a = contactSearchResult == null ? void 0 : contactSearchResult.value) == null ? void 0 : _a.user) == null ? void 0 : _b.list[0]) && !((_d = (_c = contactSearchResult == null ? void 0 : contactSearchResult.value) == null ? void 0 : _c.group) == null ? void 0 : _d.list[0]);
|
||||
});
|
||||
common_vendor.onMounted(() => {
|
||||
common_vendor.Jt.watch(common_vendor.o.APP, {
|
||||
enabledCustomerServicePlugin: onCustomerServiceCommercialPluginUpdated
|
||||
});
|
||||
common_vendor.Jt.watch(common_vendor.o.GRP, {
|
||||
groupList: onGroupListUpdated
|
||||
});
|
||||
common_vendor.Jt.watch(common_vendor.o.USER, {
|
||||
userBlacklist: onUserBlacklistUpdated,
|
||||
displayOnlineStatus: onDisplayOnlineStatusUpdated,
|
||||
userStatusList: onUserStatusListUpdated
|
||||
});
|
||||
common_vendor.Jt.watch(common_vendor.o.FRIEND, {
|
||||
friendList: onFriendListUpdated,
|
||||
friendApplicationList: onFriendApplicationListUpdated,
|
||||
friendApplicationUnreadCount: onFriendApplicationUnreadCountUpdated
|
||||
});
|
||||
common_vendor.Jt.watch(common_vendor.o.CUSTOM, {
|
||||
currentContactSearchingStatus: onCurrentContactSearchingStatusUpdated,
|
||||
currentContactSearchResult: onCurrentContactSearchResultUpdated,
|
||||
currentContactListKey: onCurrentContactListKeyUpdated,
|
||||
currentContactInfo: onCurrentContactInfoUpdated
|
||||
});
|
||||
});
|
||||
common_vendor.onUnmounted(() => {
|
||||
common_vendor.Jt.unwatch(common_vendor.o.APP, {
|
||||
enabledCustomerServicePlugin: onCustomerServiceCommercialPluginUpdated
|
||||
});
|
||||
common_vendor.Jt.unwatch(common_vendor.o.GRP, {
|
||||
groupList: onGroupListUpdated
|
||||
});
|
||||
common_vendor.Jt.unwatch(common_vendor.o.USER, {
|
||||
userBlacklist: onUserBlacklistUpdated,
|
||||
displayOnlineStatus: onDisplayOnlineStatusUpdated,
|
||||
userStatusList: onUserStatusListUpdated
|
||||
});
|
||||
common_vendor.Jt.unwatch(common_vendor.o.FRIEND, {
|
||||
friendList: onFriendListUpdated,
|
||||
friendApplicationList: onFriendApplicationListUpdated,
|
||||
friendApplicationUnreadCount: onFriendApplicationUnreadCountUpdated
|
||||
});
|
||||
common_vendor.Jt.unwatch(common_vendor.o.CUSTOM, {
|
||||
currentContactSearchingStatus: onCurrentContactSearchingStatusUpdated,
|
||||
currentContactSearchResult: onCurrentContactSearchResultUpdated,
|
||||
currentContactListKey: onCurrentContactListKeyUpdated,
|
||||
currentContactInfo: onCurrentContactInfoUpdated
|
||||
});
|
||||
});
|
||||
function toggleCurrentContactList(key) {
|
||||
if (currentContactListKey.value === key) {
|
||||
currentContactListKey.value = "";
|
||||
currentContactInfo.value = {};
|
||||
common_vendor.Jt.update(common_vendor.o.CUSTOM, "currentContactListKey", "");
|
||||
common_vendor.Jt.update(common_vendor.o.CUSTOM, "currentContactInfo", {});
|
||||
} else {
|
||||
currentContactListKey.value = key;
|
||||
common_vendor.Jt.update(common_vendor.o.CUSTOM, "currentContactListKey", key);
|
||||
if (key === "friendApplicationList") {
|
||||
common_vendor.ts.setFriendApplicationRead();
|
||||
}
|
||||
}
|
||||
}
|
||||
function selectItem(item) {
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h;
|
||||
currentContactInfo.value = item;
|
||||
if (contactSearchingStatus.value) {
|
||||
let targetListItem;
|
||||
if ((_a = currentContactInfo.value) == null ? void 0 : _a.userID) {
|
||||
targetListItem = (_d = (_c = (_b = contactListMap.value) == null ? void 0 : _b.friendList) == null ? void 0 : _c.list) == null ? void 0 : _d.find(
|
||||
(item2) => {
|
||||
var _a2;
|
||||
return (item2 == null ? void 0 : item2.userID) === ((_a2 = currentContactInfo.value) == null ? void 0 : _a2.userID);
|
||||
}
|
||||
);
|
||||
} else if ((_e = currentContactInfo.value) == null ? void 0 : _e.groupID) {
|
||||
targetListItem = (_h = (_g = (_f = contactListMap.value) == null ? void 0 : _f.groupList) == null ? void 0 : _g.list) == null ? void 0 : _h.find(
|
||||
(item2) => {
|
||||
var _a2;
|
||||
return (item2 == null ? void 0 : item2.groupID) === ((_a2 = currentContactInfo.value) == null ? void 0 : _a2.groupID);
|
||||
}
|
||||
);
|
||||
}
|
||||
if (targetListItem) {
|
||||
currentContactInfo.value = targetListItem;
|
||||
}
|
||||
}
|
||||
common_vendor.Jt.update(common_vendor.o.CUSTOM, "currentContactInfo", currentContactInfo.value);
|
||||
}
|
||||
function onDisplayOnlineStatusUpdated(status) {
|
||||
displayOnlineStatus.value = status;
|
||||
}
|
||||
function onUserStatusListUpdated(list) {
|
||||
if ((list == null ? void 0 : list.size) > 0) {
|
||||
userOnlineStatusMap.value = Object.fromEntries(list == null ? void 0 : list.entries());
|
||||
}
|
||||
}
|
||||
function onCustomerServiceCommercialPluginUpdated(isEnabled) {
|
||||
if (!isEnabled) {
|
||||
return;
|
||||
}
|
||||
const contactListExtensionID = common_vendor.E.TUIContact.EXTENSION.CONTACT_LIST.EXT_ID;
|
||||
const tuiContactExtensionList = common_vendor.R.getExtensionList(contactListExtensionID);
|
||||
const customerData = tuiContactExtensionList.find((extension) => {
|
||||
const { name, accountList = [] } = extension.data || {};
|
||||
return name === "customer" && accountList.length > 0;
|
||||
});
|
||||
if (customerData) {
|
||||
const { data, text } = customerData;
|
||||
const { accountList } = data || {};
|
||||
common_vendor.Zt.getUserProfile({ userIDList: accountList }).then((res) => {
|
||||
if (res.data.length > 0) {
|
||||
const customerList = {
|
||||
title: text,
|
||||
list: res.data.map((item, index) => {
|
||||
return {
|
||||
...item,
|
||||
renderKey: generateRenderKey("customerList", item, index),
|
||||
infoKeyList: [],
|
||||
btnKeyList: ["enterC2CConversation"]
|
||||
};
|
||||
}),
|
||||
key: "customerList"
|
||||
};
|
||||
contactListMap.value = { ...contactListMap.value, customerList };
|
||||
}
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
}
|
||||
function onGroupListUpdated(groupList) {
|
||||
updateContactListMap("groupList", groupList);
|
||||
}
|
||||
function onUserBlacklistUpdated(userBlacklist) {
|
||||
updateContactListMap("blackList", userBlacklist);
|
||||
}
|
||||
function onFriendApplicationUnreadCountUpdated(friendApplicationUnreadCount) {
|
||||
contactListMap.value.friendApplicationList.unreadCount = friendApplicationUnreadCount;
|
||||
}
|
||||
function onFriendListUpdated(friendList) {
|
||||
updateContactListMap("friendList", friendList);
|
||||
}
|
||||
function onFriendApplicationListUpdated(friendApplicationList) {
|
||||
updateContactListMap("friendApplicationList", friendApplicationList);
|
||||
}
|
||||
function updateContactListMap(key, list) {
|
||||
contactListMap.value[key].list = list;
|
||||
contactListMap.value[key].list.map((item, index) => item.renderKey = generateRenderKey(key, item, index));
|
||||
updateCurrentContactInfoFromList(contactListMap.value[key].list, key);
|
||||
}
|
||||
function updateCurrentContactInfoFromList(list, type) {
|
||||
var _a, _b;
|
||||
if (!((_a = currentContactInfo.value) == null ? void 0 : _a.userID) && !((_b = currentContactInfo.value) == null ? void 0 : _b.groupID)) {
|
||||
return;
|
||||
}
|
||||
if (type === currentContactListKey.value || contactSearchingStatus.value) {
|
||||
currentContactInfo.value = (list == null ? void 0 : list.find(
|
||||
(item) => {
|
||||
var _a2, _b2;
|
||||
return (item == null ? void 0 : item.groupID) && (item == null ? void 0 : item.groupID) === ((_a2 = currentContactInfo.value) == null ? void 0 : _a2.groupID) || (item == null ? void 0 : item.userID) && (item == null ? void 0 : item.userID) === ((_b2 = currentContactInfo.value) == null ? void 0 : _b2.userID);
|
||||
}
|
||||
)) || {};
|
||||
common_vendor.Jt.update(common_vendor.o.CUSTOM, "currentContactInfo", currentContactInfo.value);
|
||||
}
|
||||
}
|
||||
function generateRenderKey(contactListMapKey, contactInfo, index) {
|
||||
return `${contactListMapKey}-${contactInfo.userID || contactInfo.groupID || "index" + index}`;
|
||||
}
|
||||
function onCurrentContactSearchResultUpdated(searchResult) {
|
||||
contactSearchResult.value = searchResult;
|
||||
}
|
||||
function onCurrentContactSearchingStatusUpdated(searchingStatus) {
|
||||
contactSearchingStatus.value = searchingStatus;
|
||||
common_vendor.Jt.update(common_vendor.o.CUSTOM, "currentContactInfo", {});
|
||||
common_vendor.Jt.update(common_vendor.o.CUSTOM, "currentContactListKey", "");
|
||||
}
|
||||
function onCurrentContactInfoUpdated(contactInfo) {
|
||||
currentContactInfo.value = contactInfo;
|
||||
}
|
||||
function onCurrentContactListKeyUpdated(contactListKey) {
|
||||
currentContactListKey.value = contactListKey;
|
||||
}
|
||||
common_vendor.provide("userOnlineStatusMap", userOnlineStatusMap);
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: !common_vendor.unref(contactSearchingStatus)
|
||||
}, !common_vendor.unref(contactSearchingStatus) ? {
|
||||
b: common_vendor.f(common_vendor.unref(contactListMap), (contactListObj, key, i0) => {
|
||||
return common_vendor.e({
|
||||
a: "2682c040-0-" + i0,
|
||||
b: common_vendor.p({
|
||||
file: common_vendor.unref(currentContactListKey) === key ? common_vendor.unref(common_assets.downSVG) : common_vendor.unref(common_assets.rightIcon),
|
||||
width: "16px",
|
||||
height: "16px"
|
||||
}),
|
||||
c: common_vendor.t(common_vendor.unref(common_vendor.Wt).t(`TUIContact.${contactListObj.title}`)),
|
||||
d: contactListObj.unreadCount
|
||||
}, contactListObj.unreadCount ? {
|
||||
e: common_vendor.t(contactListObj.unreadCount)
|
||||
} : {}, {
|
||||
f: common_vendor.o$1(($event) => toggleCurrentContactList(key), key),
|
||||
g: common_vendor.f(contactListObj.list, (contactListItem, k1, i1) => {
|
||||
return {
|
||||
a: contactListItem.renderKey,
|
||||
b: "2682c040-1-" + i0 + "-" + i1,
|
||||
c: common_vendor.p({
|
||||
item: common_vendor.unref(TUIKit_components_TUIChat_utils_utils.deepCopy)(contactListItem),
|
||||
displayOnlineStatus: common_vendor.unref(displayOnlineStatus) && key === "friendList"
|
||||
}),
|
||||
d: contactListItem.renderKey,
|
||||
e: common_vendor.o$1(($event) => selectItem(contactListItem), contactListItem.renderKey)
|
||||
};
|
||||
}),
|
||||
h: common_vendor.n(common_vendor.unref(currentContactListKey) === key ? "" : "hidden"),
|
||||
i: key
|
||||
});
|
||||
}),
|
||||
c: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-list-h5")
|
||||
} : common_vendor.e({
|
||||
d: common_vendor.f(common_vendor.unref(contactSearchResult), (item, key, i0) => {
|
||||
return common_vendor.e({
|
||||
a: item.list[0]
|
||||
}, item.list[0] ? {
|
||||
b: common_vendor.t(common_vendor.unref(common_vendor.Wt).t(`TUIContact.${item.label}`)),
|
||||
c: common_vendor.f(item.list, (listItem, index, i1) => {
|
||||
return {
|
||||
a: "2682c040-2-" + i0 + "-" + i1,
|
||||
b: common_vendor.p({
|
||||
item: listItem,
|
||||
displayOnlineStatus: false
|
||||
}),
|
||||
c: index,
|
||||
d: common_vendor.o$1(($event) => selectItem(listItem), index)
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
d: key
|
||||
});
|
||||
}),
|
||||
e: common_vendor.unref(isContactSearchNoResult)
|
||||
}, common_vendor.unref(isContactSearchNoResult) ? {
|
||||
f: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("TUIContact.无搜索结果"))
|
||||
} : {}));
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-2682c040"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIContact/contact-list/index.js.map
|
||||
7
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-list/index.json
vendored
Normal file
7
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-list/index.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"icon": "../../common/Icon",
|
||||
"contact-list-item": "./contact-list-item/index"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-list/index.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-list/index.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view wx:if="{{a}}" class="{{['data-v-2682c040', 'tui-contact-list', c]}}"><view wx:for="{{b}}" wx:for-item="contactListObj" wx:key="i" class="tui-contact-list-item data-v-2682c040"><view class="tui-contact-list-item-header data-v-2682c040" bindtap="{{contactListObj.f}}"><view class="tui-contact-list-item-header-left data-v-2682c040"><icon wx:if="{{contactListObj.b}}" class="data-v-2682c040" u-i="{{contactListObj.a}}" bind:__l="__l" u-p="{{contactListObj.b}}"/><view class="data-v-2682c040">{{contactListObj.c}}</view></view><view class="tui-contact-list-item-header-right data-v-2682c040"><label wx:if="{{contactListObj.d}}" class="tui-contact-list-item-header-right-unread data-v-2682c040">{{contactListObj.e}}</label></view></view><view class="{{['data-v-2682c040', 'tui-contact-list-item-main', contactListObj.h]}}"><view wx:for="{{contactListObj.g}}" wx:for-item="contactListItem" wx:key="d" class="{{['tui-contact-list-item-main-item', 'data-v-2682c040', 'selected']}}" bindtap="{{contactListItem.e}}"><contact-list-item wx:if="{{contactListItem.c}}" class="data-v-2682c040" key="{{contactListItem.a}}" u-i="{{contactListItem.b}}" bind:__l="__l" u-p="{{contactListItem.c}}"/></view></view></view></view><view wx:else class="tui-contact-list data-v-2682c040"><view wx:for="{{d}}" wx:for-item="item" wx:key="d" class="tui-contact-list-item data-v-2682c040"><view wx:if="{{item.a}}" class="tui-contact-search-list data-v-2682c040"><view class="tui-contact-search-list-title data-v-2682c040">{{item.b}}</view><view wx:for="{{item.c}}" wx:for-item="listItem" wx:key="c" class="{{['tui-contact-search-list-item', 'data-v-2682c040', 'selected']}}" bindtap="{{listItem.d}}"><contact-list-item wx:if="{{listItem.b}}" class="data-v-2682c040" u-i="{{listItem.a}}" bind:__l="__l" u-p="{{listItem.b}}"/></view></view></view><view wx:if="{{e}}" class="tui-contact-search-list-default data-v-2682c040">{{f}}</view></view>
|
||||
157
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-list/index.wxss
vendored
Normal file
157
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-list/index.wxss
vendored
Normal file
@@ -0,0 +1,157 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.tui-contact-list.data-v-2682c040 {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
list-style: none;
|
||||
}
|
||||
.tui-contact-list-item.data-v-2682c040 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.tui-contact-list-item-header.data-v-2682c040 {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
padding: 10px 15px;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.tui-contact-list-item-header-left.data-v-2682c040 {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
.tui-contact-list-item-header-right.data-v-2682c040 {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.tui-contact-list-item-header-right-unread.data-v-2682c040 {
|
||||
display: flex;
|
||||
min-width: 10px;
|
||||
width: -webkit-fit-content;
|
||||
width: fit-content;
|
||||
padding: 0 2.5px;
|
||||
height: 15px;
|
||||
font-size: 10px;
|
||||
text-align: center;
|
||||
line-height: 15px;
|
||||
border-radius: 7.5px;
|
||||
background: red;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #fff;
|
||||
}
|
||||
.tui-contact-list-item-main.data-v-2682c040 {
|
||||
padding: 0 15px !important;
|
||||
}
|
||||
.tui-contact-list-item-main.hidden.data-v-2682c040 {
|
||||
display: none;
|
||||
}
|
||||
.tui-contact-list-item-main-item.data-v-2682c040 {
|
||||
padding: 5px 0;
|
||||
}
|
||||
.tui-contact-search-list.data-v-2682c040 {
|
||||
padding: 0 15px !important;
|
||||
}
|
||||
.tui-contact-search-list-title.data-v-2682c040 {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
border-bottom: 1px solid #f4f5f9;
|
||||
}
|
||||
.tui-contact-search-list-item.data-v-2682c040 {
|
||||
padding: 5px 0;
|
||||
}
|
||||
.tui-contact-search-list-default.data-v-2682c040 {
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
.tui-contact-list-h5 .tui-contact-list-item .tui-contact-list-item-header.data-v-2682c040 {
|
||||
cursor: none;
|
||||
}
|
||||
.tui-contact-list-h5 .tui-contact-list-item .tui-contact-list-item-header.data-v-2682c040:active,
|
||||
.tui-contact-list-h5 .tui-contact-list-item .tui-contact-list-item-main-item.data-v-2682c040:active {
|
||||
background-color: #eef0f3;
|
||||
}
|
||||
body.data-v-2682c040, div.data-v-2682c040, ul.data-v-2682c040, ol.data-v-2682c040, dt.data-v-2682c040, dd.data-v-2682c040, li.data-v-2682c040, dl.data-v-2682c040, h1.data-v-2682c040, h2.data-v-2682c040, h3.data-v-2682c040, h4.data-v-2682c040, p.data-v-2682c040 {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-style: normal;
|
||||
/* font:12px/22px"\5B8B\4F53",Arial,Helvetica,sans-serif; */
|
||||
}
|
||||
ol.data-v-2682c040, ul.data-v-2682c040, li.data-v-2682c040 {
|
||||
list-style: none;
|
||||
}
|
||||
img.data-v-2682c040 {
|
||||
border: 0;
|
||||
vertical-align: middle;
|
||||
pointer-events: none;
|
||||
}
|
||||
body.data-v-2682c040 {
|
||||
color: #000;
|
||||
background: #FFF;
|
||||
}
|
||||
.clear.data-v-2682c040 {
|
||||
clear: both;
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
margin-top: -1px;
|
||||
}
|
||||
a.data-v-2682c040 {
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
a.data-v-2682c040:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
input.data-v-2682c040, textarea.data-v-2682c040 {
|
||||
-webkit-user-select: auto;
|
||||
user-select: auto;
|
||||
}
|
||||
input.data-v-2682c040:focus, input.data-v-2682c040:active, textarea.data-v-2682c040:focus, textarea.data-v-2682c040:active {
|
||||
outline: none;
|
||||
}
|
||||
.chat-aside.data-v-2682c040 {
|
||||
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);
|
||||
}
|
||||
132
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-search/index.js
vendored
Normal file
132
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-search/index.js
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
"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_utils_lodash = require("../../../utils/lodash.js");
|
||||
if (!Math) {
|
||||
Icon();
|
||||
}
|
||||
const Icon = () => "../../common/Icon.js";
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "index",
|
||||
setup(__props) {
|
||||
const searchingPlaceholder = common_vendor.Wt.t("TUIContact.输入ID");
|
||||
const isSearching = common_vendor.ref(false);
|
||||
const searchValue = common_vendor.ref("");
|
||||
const searchResult = common_vendor.ref({
|
||||
user: {
|
||||
label: "联系人",
|
||||
list: []
|
||||
},
|
||||
group: {
|
||||
label: "群聊",
|
||||
list: []
|
||||
}
|
||||
});
|
||||
const changeContactSearchingStatus = TUIKit_utils_lodash.debounce(function(status) {
|
||||
isSearching.value = status;
|
||||
}, 200);
|
||||
const search = async () => {
|
||||
if (!searchValue.value) {
|
||||
return;
|
||||
}
|
||||
common_vendor.R.callService({
|
||||
serviceName: common_vendor.E.TUISearch.SERVICE.NAME,
|
||||
method: common_vendor.E.TUISearch.SERVICE.METHOD.SEARCH_USER,
|
||||
params: {
|
||||
userID: searchValue.value
|
||||
}
|
||||
}).then((res) => {
|
||||
searchResult.value.user.list = res.data;
|
||||
}).catch((error) => {
|
||||
searchResult.value.user.list = [];
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/contact-search/index.vue:111", "search user error", error);
|
||||
});
|
||||
common_vendor.R.callService({
|
||||
serviceName: common_vendor.E.TUISearch.SERVICE.NAME,
|
||||
method: common_vendor.E.TUISearch.SERVICE.METHOD.SEARCH_GROUP,
|
||||
params: {
|
||||
groupID: searchValue.value
|
||||
}
|
||||
}).then((res) => {
|
||||
searchResult.value.group.list = [res.data.group];
|
||||
}).catch((error) => {
|
||||
searchResult.value.group.list = [];
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/contact-search/index.vue:125", "search group error", error);
|
||||
});
|
||||
};
|
||||
common_vendor.watch(
|
||||
() => searchResult.value,
|
||||
() => {
|
||||
common_vendor.Jt.update(
|
||||
common_vendor.o.CUSTOM,
|
||||
"currentContactSearchResult",
|
||||
searchResult.value
|
||||
);
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => isSearching.value,
|
||||
() => {
|
||||
common_vendor.Jt.update(
|
||||
common_vendor.o.CUSTOM,
|
||||
"currentContactSearchingStatus",
|
||||
isSearching.value
|
||||
);
|
||||
if (isSearching.value) {
|
||||
searchValue.value = "";
|
||||
searchResult.value.user.list = [];
|
||||
searchResult.value.group.list = [];
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
common_vendor.i.updateContactSearch = search;
|
||||
common_vendor.i.closeSearching = () => {
|
||||
isSearching.value = false;
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: !common_vendor.unref(isSearching) || !common_vendor.unref(TUIKit_utils_env.isPC)
|
||||
}, !common_vendor.unref(isSearching) || !common_vendor.unref(TUIKit_utils_env.isPC) ? {
|
||||
b: common_vendor.p({
|
||||
file: common_vendor.unref(isSearching) ? common_vendor.unref(common_assets.backIcon) : common_vendor.unref(common_assets.addSVG),
|
||||
width: common_vendor.unref(isSearching) ? "20px" : "14px",
|
||||
height: common_vendor.unref(isSearching) ? "20px" : "14px"
|
||||
}),
|
||||
c: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-search-h5-header-icon"),
|
||||
d: common_vendor.o$1(($event) => common_vendor.unref(changeContactSearchingStatus)(!common_vendor.unref(isSearching))),
|
||||
e: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("TUIContact.添加好友/群聊")),
|
||||
f: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-search-h5-header-title"),
|
||||
g: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-search-h5-header"),
|
||||
h: common_vendor.n(common_vendor.unref(isSearching) && "tui-contact-searching-h5-header"),
|
||||
i: common_vendor.o$1(($event) => common_vendor.unref(changeContactSearchingStatus)(true))
|
||||
} : {}, {
|
||||
j: common_vendor.unref(isSearching)
|
||||
}, common_vendor.unref(isSearching) ? {
|
||||
k: common_vendor.unref(searchingPlaceholder),
|
||||
l: common_vendor.o$1(search),
|
||||
m: common_vendor.o$1(search),
|
||||
n: common_vendor.o$1(search),
|
||||
o: common_vendor.unref(searchValue),
|
||||
p: common_vendor.o$1(($event) => common_vendor.isRef(searchValue) ? searchValue.value = $event.detail.value : null),
|
||||
q: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("取消")),
|
||||
r: common_vendor.o$1(($event) => isSearching.value = false),
|
||||
s: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-search-h5-main")
|
||||
} : {}, {
|
||||
t: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "tui-contact-search-h5")
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-efa1a0fe"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIContact/contact-search/index.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-search/index.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-search/index.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"icon": "../../common/Icon"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-search/index.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-search/index.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-efa1a0fe', 'tui-contact-search', t]}}"><view wx:if="{{a}}" class="{{['data-v-efa1a0fe', 'tui-contact-search-header', g, h]}}" bindtap="{{i}}"><view class="{{['data-v-efa1a0fe', 'tui-contact-search-header-icon', c]}}" catchtap="{{d}}"><icon wx:if="{{b}}" class="data-v-efa1a0fe" u-i="efa1a0fe-0" bind:__l="__l" u-p="{{b}}"/></view><view class="{{['data-v-efa1a0fe', 'tui-contact-search-header-title', f]}}">{{e}}</view></view><view wx:if="{{j}}" class="{{['data-v-efa1a0fe', 'tui-contact-search-main', s]}}"><input class="tui-contact-search-main-input data-v-efa1a0fe" type="text" placeholder="{{k}}" enterkeyhint="search" bindkeyup="{{l}}" bindblur="{{m}}" bindconfirm="{{n}}" value="{{o}}" bindinput="{{p}}"></input><view class="tui-contact-search-main-cancel data-v-efa1a0fe" bindtap="{{r}}">{{q}}</view></view></view>
|
||||
96
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-search/index.wxss
vendored
Normal file
96
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/contact-search/index.wxss
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.tui-contact-search.data-v-efa1a0fe {
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
padding: 12px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
border-bottom: 1px solid #f4f5f9;
|
||||
flex-direction: column;
|
||||
}
|
||||
.tui-contact-search-header.data-v-efa1a0fe, .tui-contact-search-main.data-v-efa1a0fe {
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
.tui-contact-search-header.data-v-efa1a0fe {
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.tui-contact-search-header-icon.data-v-efa1a0fe {
|
||||
padding-right: 10px;
|
||||
}
|
||||
.tui-contact-search-header-title.data-v-efa1a0fe {
|
||||
font-size: 14px;
|
||||
}
|
||||
.tui-contact-search-main.data-v-efa1a0fe {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex: 1;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
.tui-contact-search-main-input.data-v-efa1a0fe {
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
border-radius: 5px;
|
||||
padding: 7px;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
.tui-contact-search-main-input.data-v-efa1a0fe:focus {
|
||||
outline: none;
|
||||
border: 1px solid #006eff;
|
||||
}
|
||||
.tui-contact-search-main-cancel.data-v-efa1a0fe {
|
||||
padding-left: 10px;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.tui-contact-search-h5-header.data-v-efa1a0fe {
|
||||
width: 100%;
|
||||
}
|
||||
.tui-contact-searching-h5-header.data-v-efa1a0fe {
|
||||
padding-bottom: 10px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.tui-contact-searching-h5-header .tui-contact-search-h5-header-title.data-v-efa1a0fe {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
margin-right: 30px;
|
||||
}
|
||||
4
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/index.js
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/index.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
const TUIKit_components_index = require("../index.js");
|
||||
wx.createPage(TUIKit_components_index.MiniProgramPage$2);
|
||||
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/TUIKit/components/TUIContact/index.js.map
|
||||
9
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/index.json
vendored
Normal file
9
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/index.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"navigationBarTitleText": "腾讯云 IM",
|
||||
"usingComponents": {
|
||||
"select-friend": "./select-friend/index",
|
||||
"contact-search": "./contact-search/index",
|
||||
"contact-list": "./contact-list/index",
|
||||
"contact-info": "./contact-info/index"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/index.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/index.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<select-friend wx:if="{{a}}" class="data-v-32d81a7d" u-i="32d81a7d-0" bind:__l="__l"/><view wx:elif="{{b}}" class="{{['data-v-32d81a7d', 'tui-contact', h]}}"><view class="{{['data-v-32d81a7d', 'tui-contact-left', d]}}"><contact-search class="data-v-32d81a7d" u-i="32d81a7d-1" bind:__l="__l"/><contact-list class="{{['data-v-32d81a7d', 'tui-contact-left-list', c]}}" u-i="32d81a7d-2" bind:__l="__l"/></view><view wx:if="{{e}}" class="{{['data-v-32d81a7d', 'tui-contact-right', g]}}"><contact-info class="data-v-32d81a7d" bindswitchConversation="{{f}}" u-i="32d81a7d-3" bind:__l="__l"/></view></view>
|
||||
109
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/index.wxss
vendored
Normal file
109
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/index.wxss
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
body.data-v-32d81a7d, div.data-v-32d81a7d, ul.data-v-32d81a7d, ol.data-v-32d81a7d, dt.data-v-32d81a7d, dd.data-v-32d81a7d, li.data-v-32d81a7d, dl.data-v-32d81a7d, h1.data-v-32d81a7d, h2.data-v-32d81a7d, h3.data-v-32d81a7d, h4.data-v-32d81a7d, p.data-v-32d81a7d {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-style: normal;
|
||||
/* font:12px/22px"\5B8B\4F53",Arial,Helvetica,sans-serif; */
|
||||
}
|
||||
ol.data-v-32d81a7d, ul.data-v-32d81a7d, li.data-v-32d81a7d {
|
||||
list-style: none;
|
||||
}
|
||||
img.data-v-32d81a7d {
|
||||
border: 0;
|
||||
vertical-align: middle;
|
||||
pointer-events: none;
|
||||
}
|
||||
body.data-v-32d81a7d {
|
||||
color: #000;
|
||||
background: #FFF;
|
||||
}
|
||||
.clear.data-v-32d81a7d {
|
||||
clear: both;
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
margin-top: -1px;
|
||||
}
|
||||
a.data-v-32d81a7d {
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
a.data-v-32d81a7d:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
input.data-v-32d81a7d, textarea.data-v-32d81a7d {
|
||||
-webkit-user-select: auto;
|
||||
user-select: auto;
|
||||
}
|
||||
input.data-v-32d81a7d:focus, input.data-v-32d81a7d:active, textarea.data-v-32d81a7d:focus, textarea.data-v-32d81a7d:active {
|
||||
outline: none;
|
||||
}
|
||||
.chat-aside.data-v-32d81a7d {
|
||||
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-contact.data-v-32d81a7d {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
}
|
||||
.tui-contact-left.data-v-32d81a7d {
|
||||
min-width: 285px;
|
||||
flex: 0 0 24%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.tui-contact-right.data-v-32d81a7d {
|
||||
border-left: 1px solid #f4f5f9;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
.tui-contact-h5.data-v-32d81a7d {
|
||||
position: relative;
|
||||
}
|
||||
.tui-contact-h5-left.data-v-32d81a7d, .tui-contact-h5-right.data-v-32d81a7d {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
.tui-contact-h5-right.data-v-32d81a7d {
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
}
|
||||
.tui-contact-h5-left-list.data-v-32d81a7d {
|
||||
overflow-y: auto;
|
||||
}
|
||||
91
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/select-friend/index.js
vendored
Normal file
91
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/select-friend/index.js
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
require("../../../adapter-vue.js");
|
||||
const TUIKit_components_common_Toast_index = require("../../common/Toast/index.js");
|
||||
const TUIKit_components_TUIContact_server = require("../server.js");
|
||||
const TUIKit_components_common_Toast_type = require("../../common/Toast/type.js");
|
||||
if (!Math) {
|
||||
SelectUser();
|
||||
}
|
||||
const SelectUser = () => "../../common/SelectUser/index.js";
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "index",
|
||||
setup(__props) {
|
||||
const TUIContactServer = TUIKit_components_TUIContact_server.TUIContactServer.getInstance();
|
||||
const TUIConstants = TUIContactServer.constants;
|
||||
const needSearch = common_vendor.ref(false);
|
||||
const friendList = common_vendor.ref([]);
|
||||
const userList = common_vendor.ref([]);
|
||||
const TUISearchServer = common_vendor.ref(null);
|
||||
const selectOptions = common_vendor.ref({
|
||||
isRadio: false,
|
||||
isNeedSearch: false,
|
||||
title: ""
|
||||
});
|
||||
const generateSearchServer = (isNeedSearch) => {
|
||||
TUISearchServer.value = common_vendor.R.getService(TUIConstants.TUISearch.SERVICE.NAME);
|
||||
if (TUISearchServer.value) {
|
||||
needSearch.value = isNeedSearch;
|
||||
} else {
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/select-friend/index.vue:41", "请添加 TUISearch 组件");
|
||||
}
|
||||
};
|
||||
common_vendor.watchEffect(() => {
|
||||
const params = TUIContactServer.getOnCallParams(TUIConstants.TUIContact.SERVICE.METHOD.SELECT_FRIEND);
|
||||
selectOptions.value.title = params.title;
|
||||
selectOptions.value.isRadio = params.isRadio;
|
||||
selectOptions.value.isNeedSearch = params.isNeedSearch;
|
||||
if (params.isNeedSearch) {
|
||||
generateSearchServer(params.isNeedSearch);
|
||||
}
|
||||
common_vendor.ts.getFriendList().then((res) => {
|
||||
friendList.value = res.data.map((item) => item.profile);
|
||||
userList.value = friendList.value;
|
||||
}).catch((err) => {
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/select-friend/index.vue:57", "getFriendList error:", err);
|
||||
});
|
||||
});
|
||||
const handleSelectedResult = (memberList) => {
|
||||
common_vendor.Jt.update(common_vendor.o.CUSTOM, "isShowSelectFriendComponent", false);
|
||||
const callback = TUIContactServer.getOnCallCallback(TUIConstants.TUIContact.SERVICE.METHOD.SELECT_FRIEND);
|
||||
callback && callback(memberList);
|
||||
};
|
||||
const searchFail = () => {
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIGroup.该用户不存在"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.ERROR
|
||||
});
|
||||
userList.value = [...friendList.value];
|
||||
};
|
||||
const handleSearch = async (val) => {
|
||||
if (!val) {
|
||||
return userList.value = friendList.value;
|
||||
}
|
||||
try {
|
||||
const imResponse = await TUISearchServer.value.searchUser(val);
|
||||
if (!imResponse.data[0]) {
|
||||
return searchFail();
|
||||
}
|
||||
userList.value = imResponse.data;
|
||||
const searchAllResult = friendList.value.filter((item) => item.userID === imResponse.data[0].userID);
|
||||
friendList.value = searchAllResult.length ? friendList.value : [...friendList.value, ...userList.value];
|
||||
} catch (error) {
|
||||
return searchFail();
|
||||
}
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o$1(handleSearch),
|
||||
b: common_vendor.o$1(handleSelectedResult),
|
||||
c: common_vendor.p({
|
||||
isRadio: common_vendor.unref(selectOptions).isRadio,
|
||||
isNeedSearch: common_vendor.unref(selectOptions).isNeedSearch,
|
||||
title: common_vendor.unref(selectOptions).title,
|
||||
userList: common_vendor.unref(userList)
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIContact/select-friend/index.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/select-friend/index.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/select-friend/index.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"select-user": "../../common/SelectUser/index"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/select-friend/index.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/select-friend/index.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<select-user wx:if="{{c}}" bindsearch="{{a}}" bindcomplete="{{b}}" u-i="ffa11ea6-0" bind:__l="__l" u-p="{{c}}"/>
|
||||
0
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/select-friend/index.wxss
vendored
Normal file
0
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/select-friend/index.wxss
vendored
Normal file
36
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/server.js
vendored
Normal file
36
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/server.js
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../common/vendor.js");
|
||||
const TUIKit_utils_env = require("../../utils/env.js");
|
||||
class TUIContactServer {
|
||||
constructor() {
|
||||
common_vendor.R.registerService(common_vendor.E.TUIContact.SERVICE.NAME, this);
|
||||
this.onCallParamsMap = /* @__PURE__ */ new Map();
|
||||
this.onCallCallbackMap = /* @__PURE__ */ new Map();
|
||||
this.constants = common_vendor.E;
|
||||
}
|
||||
static getInstance() {
|
||||
if (!TUIContactServer.instance) {
|
||||
TUIContactServer.instance = new TUIContactServer();
|
||||
}
|
||||
return TUIContactServer.instance;
|
||||
}
|
||||
getOnCallParams(method) {
|
||||
return this.onCallParamsMap.get(method);
|
||||
}
|
||||
getOnCallCallback(method) {
|
||||
return this.onCallCallbackMap.get(method);
|
||||
}
|
||||
async onCall(method, params, callback) {
|
||||
var _a;
|
||||
this.onCallParamsMap.set(method, params);
|
||||
this.onCallCallbackMap.set(method, callback);
|
||||
if (method === common_vendor.E.TUIContact.SERVICE.METHOD.SELECT_FRIEND) {
|
||||
common_vendor.Jt.update(common_vendor.o.CUSTOM, "isShowSelectFriendComponent", true);
|
||||
TUIKit_utils_env.isUniFrameWork && ((_a = common_vendor.i) == null ? void 0 : _a.reLaunch({
|
||||
url: "/TUIKit/components/TUIContact/index"
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.TUIContactServer = TUIContactServer;
|
||||
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/TUIKit/components/TUIContact/server.js.map
|
||||
289
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/utils/index.js
vendored
Normal file
289
unpackage/dist/dev/mp-weixin/TUIKit/components/TUIContact/utils/index.js
vendored
Normal file
@@ -0,0 +1,289 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const TUIKit_components_common_Toast_index = require("../../common/Toast/index.js");
|
||||
const TUIKit_components_common_Toast_type = require("../../common/Toast/type.js");
|
||||
const generateAvatar = (item) => {
|
||||
var _a;
|
||||
return (item == null ? void 0 : item.avatar) || ((_a = item == null ? void 0 : item.profile) == null ? void 0 : _a.avatar) || (item == null ? void 0 : item.groupID) && "https://web.sdk.qcloud.com/im/assets/images/Public.svg" || "https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png";
|
||||
};
|
||||
const generateName = (item) => {
|
||||
var _a;
|
||||
return (item == null ? void 0 : item.remark) || (item == null ? void 0 : item.name) || ((_a = item == null ? void 0 : item.profile) == null ? void 0 : _a.nick) || (item == null ? void 0 : item.nick) || (item == null ? void 0 : item.groupID) || (item == null ? void 0 : item.userID) || "";
|
||||
};
|
||||
const generateContactInfoName = (item) => {
|
||||
var _a;
|
||||
return (item == null ? void 0 : item.name) || ((_a = item == null ? void 0 : item.profile) == null ? void 0 : _a.nick) || (item == null ? void 0 : item.nick) || (item == null ? void 0 : item.groupID) || (item == null ? void 0 : item.userID) || "";
|
||||
};
|
||||
const generateContactInfoBasic = (contactInfo) => {
|
||||
var _a;
|
||||
const res = [
|
||||
{
|
||||
label: (contactInfo == null ? void 0 : contactInfo.groupID) ? "群ID" : "ID",
|
||||
data: (contactInfo == null ? void 0 : contactInfo.groupID) || (contactInfo == null ? void 0 : contactInfo.userID) || ""
|
||||
}
|
||||
];
|
||||
if (!isApplicationType(contactInfo)) {
|
||||
res.push({
|
||||
label: (contactInfo == null ? void 0 : contactInfo.groupID) ? "群类型" : "个性签名",
|
||||
data: (contactInfo == null ? void 0 : contactInfo.type) || ((_a = contactInfo == null ? void 0 : contactInfo.profile) == null ? void 0 : _a.selfSignature) || ""
|
||||
});
|
||||
}
|
||||
return res;
|
||||
};
|
||||
const isApplicationType = (info) => {
|
||||
var _a, _b, _c, _d;
|
||||
return (info == null ? void 0 : info.type) === ((_b = (_a = common_vendor.qt) == null ? void 0 : _a.TYPES) == null ? void 0 : _b.SNS_APPLICATION_SENT_TO_ME) || (info == null ? void 0 : info.type) === ((_d = (_c = common_vendor.qt) == null ? void 0 : _c.TYPES) == null ? void 0 : _d.SNS_APPLICATION_SENT_BY_ME);
|
||||
};
|
||||
const isFriend = (info) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if ((info == null ? void 0 : info.groupID) || !(info == null ? void 0 : info.userID)) {
|
||||
resolve(false);
|
||||
return;
|
||||
}
|
||||
if (info == null ? void 0 : info.addTime) {
|
||||
resolve(true);
|
||||
return;
|
||||
}
|
||||
common_vendor.ts.checkFriend({
|
||||
userIDList: [info == null ? void 0 : info.userID],
|
||||
type: common_vendor.qt.TYPES.SNS_CHECK_TYPE_BOTH
|
||||
}).then((res) => {
|
||||
var _a, _b;
|
||||
switch ((_b = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.successUserIDList[0]) == null ? void 0 : _b.relation) {
|
||||
case common_vendor.qt.TYPES.SNS_TYPE_NO_RELATION:
|
||||
resolve(false);
|
||||
break;
|
||||
case common_vendor.qt.TYPES.SNS_TYPE_A_WITH_B:
|
||||
resolve(false);
|
||||
break;
|
||||
case common_vendor.qt.TYPES.SNS_TYPE_B_WITH_A:
|
||||
resolve(false);
|
||||
break;
|
||||
case common_vendor.qt.TYPES.SNS_TYPE_BOTH_WAY:
|
||||
resolve(true);
|
||||
break;
|
||||
default:
|
||||
resolve(false);
|
||||
break;
|
||||
}
|
||||
}).catch((error) => {
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/utils/index.ts:111", "checkFriend error", error);
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
};
|
||||
const updateFriendRemark = (userID, remark) => {
|
||||
var _a;
|
||||
if (((_a = remark == null ? void 0 : remark.replace(/[^\u0000-\u00ff]/g, "aa")) == null ? void 0 : _a.length) > 96) {
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.修改备注失败: 备注长度不得超过 96 字节"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.ERROR
|
||||
});
|
||||
return;
|
||||
}
|
||||
common_vendor.ts.updateFriend({
|
||||
userID,
|
||||
remark
|
||||
}).then(() => {
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.修改备注成功"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.SUCCESS
|
||||
});
|
||||
}).catch((error) => {
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/utils/index.ts:138", "update friend remark failed:", error);
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.修改备注失败"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.ERROR
|
||||
});
|
||||
});
|
||||
};
|
||||
const deleteFriend = (userID) => {
|
||||
common_vendor.ts.deleteFriend({
|
||||
userIDList: [userID],
|
||||
type: common_vendor.qt.TYPES.SNS_DELETE_TYPE_BOTH
|
||||
}).then((res) => {
|
||||
const { successUserIDList } = res.data;
|
||||
if (successUserIDList[0].userID === userID) {
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.删除好友成功"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.SUCCESS
|
||||
});
|
||||
} else {
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.删除好友失败"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.ERROR
|
||||
});
|
||||
}
|
||||
}).catch((error) => {
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/utils/index.ts:167", "delete friend failed:", error);
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.删除好友失败"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.ERROR
|
||||
});
|
||||
});
|
||||
};
|
||||
const addFriend = (params) => {
|
||||
common_vendor.ts.addFriend(params).then(() => {
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.申请已发送"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.SUCCESS
|
||||
});
|
||||
}).catch((error) => {
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/utils/index.ts:185", "delete friend failed:", error);
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.申请发送失败"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.ERROR
|
||||
});
|
||||
});
|
||||
};
|
||||
const enterConversation = (item) => {
|
||||
const conversationID = (item == null ? void 0 : item.groupID) ? `GROUP${item == null ? void 0 : item.groupID}` : `C2C${item == null ? void 0 : item.userID}`;
|
||||
common_vendor.Xt.switchConversation(conversationID).catch(
|
||||
(error) => {
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/utils/index.ts:200", "switch conversation failed:", error);
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.进入会话失败"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.ERROR
|
||||
});
|
||||
}
|
||||
);
|
||||
};
|
||||
const acceptFriendApplication = (userID) => {
|
||||
common_vendor.ts.acceptFriendApplication({
|
||||
userID,
|
||||
type: common_vendor.qt.TYPES.SNS_APPLICATION_AGREE_AND_ADD
|
||||
}).then(() => {
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.添加好友成功"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.SUCCESS
|
||||
});
|
||||
}).catch((error) => {
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/utils/index.ts:222", "accept friend application failed:", error);
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.同意好友申请失败"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.ERROR
|
||||
});
|
||||
});
|
||||
};
|
||||
const refuseFriendApplication = (userID) => {
|
||||
common_vendor.ts.refuseFriendApplication(userID).then(() => {
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.拒绝成功"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.SUCCESS
|
||||
});
|
||||
}).catch((error) => {
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/utils/index.ts:240", "accept friend application failed:", error);
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.拒绝好友申请失败"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.ERROR
|
||||
});
|
||||
});
|
||||
};
|
||||
const dismissGroup = (groupID) => {
|
||||
common_vendor.es.dismissGroup(groupID).then(() => {
|
||||
var _a, _b;
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.解散群聊成功"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.SUCCESS
|
||||
});
|
||||
((_a = common_vendor.i) == null ? void 0 : _a.updateContactSearch) && ((_b = common_vendor.i) == null ? void 0 : _b.updateContactSearch());
|
||||
}).catch((error) => {
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/utils/index.ts:259", "dismiss group failed:", error);
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.解散群聊失败"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.ERROR
|
||||
});
|
||||
});
|
||||
};
|
||||
const quitGroup = (groupID) => {
|
||||
common_vendor.es.quitGroup(groupID).then(() => {
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.退出群组成功"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.SUCCESS
|
||||
});
|
||||
}).catch((error) => {
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/utils/index.ts:277", "quit group failed:", error);
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.退出群组失败"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.ERROR
|
||||
});
|
||||
});
|
||||
};
|
||||
const joinGroup = (groupID, applyMessage) => {
|
||||
common_vendor.es.joinGroup({
|
||||
groupID,
|
||||
applyMessage
|
||||
}).then((imResponse) => {
|
||||
var _a;
|
||||
switch ((_a = imResponse == null ? void 0 : imResponse.data) == null ? void 0 : _a.status) {
|
||||
case common_vendor.qt.TYPES.JOIN_STATUS_WAIT_APPROVAL:
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.等待管理员同意"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.SUCCESS
|
||||
});
|
||||
break;
|
||||
case common_vendor.qt.TYPES.JOIN_STATUS_SUCCESS:
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.加群成功"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.SUCCESS
|
||||
});
|
||||
break;
|
||||
case common_vendor.qt.TYPES.JOIN_STATUS_ALREADY_IN_GROUP:
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.您已是群成员"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.SUCCESS
|
||||
});
|
||||
break;
|
||||
}
|
||||
}).catch((error) => {
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/utils/index.ts:316", "join group failed:", error);
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: "申请入群失败",
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.ERROR
|
||||
});
|
||||
});
|
||||
};
|
||||
const addToBlacklist = (userID, successCallBack) => {
|
||||
common_vendor.Zt.addToBlacklist({
|
||||
userIDList: [userID]
|
||||
}).then(() => {
|
||||
successCallBack && successCallBack();
|
||||
}).catch((error) => {
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/utils/index.ts:333", "add to blacklist failed:", error);
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.加入黑名单失败"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.ERROR
|
||||
});
|
||||
});
|
||||
};
|
||||
const removeFromBlacklist = (userID, successCallBack) => {
|
||||
common_vendor.Zt.removeFromBlacklist({
|
||||
userIDList: [userID]
|
||||
}).then(() => {
|
||||
successCallBack && successCallBack();
|
||||
}).catch((error) => {
|
||||
common_vendor.index.__f__("warn", "at TUIKit/components/TUIContact/utils/index.ts:353", "remove from blacklist failed:", error);
|
||||
TUIKit_components_common_Toast_index.Toast({
|
||||
message: common_vendor.Wt.t("TUIContact.移除黑名单失败"),
|
||||
type: TUIKit_components_common_Toast_type.TOAST_TYPE.ERROR
|
||||
});
|
||||
});
|
||||
};
|
||||
exports.acceptFriendApplication = acceptFriendApplication;
|
||||
exports.addFriend = addFriend;
|
||||
exports.addToBlacklist = addToBlacklist;
|
||||
exports.deleteFriend = deleteFriend;
|
||||
exports.dismissGroup = dismissGroup;
|
||||
exports.enterConversation = enterConversation;
|
||||
exports.generateAvatar = generateAvatar;
|
||||
exports.generateContactInfoBasic = generateContactInfoBasic;
|
||||
exports.generateContactInfoName = generateContactInfoName;
|
||||
exports.generateName = generateName;
|
||||
exports.isApplicationType = isApplicationType;
|
||||
exports.isFriend = isFriend;
|
||||
exports.joinGroup = joinGroup;
|
||||
exports.quitGroup = quitGroup;
|
||||
exports.refuseFriendApplication = refuseFriendApplication;
|
||||
exports.removeFromBlacklist = removeFromBlacklist;
|
||||
exports.updateFriendRemark = updateFriendRemark;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIContact/utils/index.js.map
|
||||
Reference in New Issue
Block a user