176 lines
6.8 KiB
JavaScript
176 lines
6.8 KiB
JavaScript
"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
|