jiuyiUniapp/jiuyi2/unpackage/dist/dev/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-customer-service.js

97 lines
4.2 KiB
JavaScript

"use strict";
const TUIKit_tuiCustomerServicePlugin_adapterVue = require("../adapter-vue.js");
const TUIKit_tuiCustomerServicePlugin_utils_index = require("../utils/index.js");
const TUIKit_tuiCustomerServicePlugin_constant = require("../constant.js");
const common_vendor = require("../../../common/vendor.js");
const MessageBranch = () => "./message-branch.js";
const MessageForm = () => "./message-form/index.js";
const MessageIMRobotWelcome = () => "./message-robot-welcome.js";
const MessageProductCard = () => "./message-product-card.js";
const MessageRichText = () => "./message-rich-text.js";
const MessageStream = () => "./message-stream.js";
const { computed } = TUIKit_tuiCustomerServicePlugin_adapterVue.vue;
const _sfc_main = {
components: {
MessageBranch,
MessageForm,
MessageProductCard,
MessageRichText,
MessageIMRobotWelcome,
MessageStream
},
props: {
message: {
type: Object,
default: () => ({})
}
},
emits: ["sendMessage"],
setup(props, { emit }) {
const payload = computed(() => {
var _a, _b;
return props.message && TUIKit_tuiCustomerServicePlugin_utils_index.JSONToObject((_b = (_a = props.message) == null ? void 0 : _a.payload) == null ? void 0 : _b.data);
});
const sendTextMessage = (text) => {
emit("sendMessage", text);
};
return {
payload,
sendTextMessage,
CUSTOM_MESSAGE_SRC: TUIKit_tuiCustomerServicePlugin_constant.CUSTOM_MESSAGE_SRC
};
}
};
if (!Array) {
const _component_MessageBranch = common_vendor.resolveComponent("MessageBranch");
const _component_MessageIMRobotWelcome = common_vendor.resolveComponent("MessageIMRobotWelcome");
const _component_MessageForm = common_vendor.resolveComponent("MessageForm");
const _component_MessageProductCard = common_vendor.resolveComponent("MessageProductCard");
const _component_MessageRichText = common_vendor.resolveComponent("MessageRichText");
const _component_MessageStream = common_vendor.resolveComponent("MessageStream");
(_component_MessageBranch + _component_MessageIMRobotWelcome + _component_MessageForm + _component_MessageProductCard + _component_MessageRichText + _component_MessageStream)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $setup.payload.src === $setup.CUSTOM_MESSAGE_SRC.BRANCH || $setup.payload.src === $setup.CUSTOM_MESSAGE_SRC.BRANCH_NUMBER || $setup.payload.src === $setup.CUSTOM_MESSAGE_SRC.ROBOT_MSG && $setup.payload.subtype !== "welcome_msg"
}, $setup.payload.src === $setup.CUSTOM_MESSAGE_SRC.BRANCH || $setup.payload.src === $setup.CUSTOM_MESSAGE_SRC.BRANCH_NUMBER || $setup.payload.src === $setup.CUSTOM_MESSAGE_SRC.ROBOT_MSG && $setup.payload.subtype !== "welcome_msg" ? {
b: common_vendor.o$1($setup.sendTextMessage),
c: common_vendor.p({
payload: $setup.payload
})
} : {}, {
d: $setup.payload.src === $setup.CUSTOM_MESSAGE_SRC.ROBOT_MSG && $setup.payload.subtype === "welcome_msg"
}, $setup.payload.src === $setup.CUSTOM_MESSAGE_SRC.ROBOT_MSG && $setup.payload.subtype === "welcome_msg" ? {
e: common_vendor.o$1($setup.sendTextMessage),
f: common_vendor.p({
payload: $setup.payload
})
} : {}, {
g: $setup.payload.src === $setup.CUSTOM_MESSAGE_SRC.FROM_INPUT
}, $setup.payload.src === $setup.CUSTOM_MESSAGE_SRC.FROM_INPUT ? {
h: common_vendor.o$1($setup.sendTextMessage),
i: common_vendor.p({
payload: $setup.payload
})
} : {}, {
j: $setup.payload.src === $setup.CUSTOM_MESSAGE_SRC.PRODUCT_CARD
}, $setup.payload.src === $setup.CUSTOM_MESSAGE_SRC.PRODUCT_CARD ? {
k: common_vendor.p({
payload: $setup.payload
})
} : {}, {
l: $setup.payload.src === $setup.CUSTOM_MESSAGE_SRC.RICH_TEXT
}, $setup.payload.src === $setup.CUSTOM_MESSAGE_SRC.RICH_TEXT ? {
m: common_vendor.p({
payload: $setup.payload
})
} : {}, {
n: $setup.payload.src === $setup.CUSTOM_MESSAGE_SRC.STREAM_TEXT
}, $setup.payload.src === $setup.CUSTOM_MESSAGE_SRC.STREAM_TEXT ? {
o: common_vendor.p({
payload: $setup.payload
})
} : {});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);