This commit is contained in:
pengxiaolong
2025-05-13 19:39:53 +08:00
parent 37da6765b8
commit c006a8e63d
1232 changed files with 96963 additions and 883 deletions

View File

@@ -0,0 +1,140 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
let vueVersion;
vueVersion = 3;
const VueUni = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
EMPTY_OBJ: common_vendor.EMPTY_OBJ,
EffectScope: common_vendor.EffectScope,
Fragment: common_vendor.Fragment,
ReactiveEffect: common_vendor.ReactiveEffect,
Text: common_vendor.Text,
c: common_vendor.c,
callWithAsyncErrorHandling: common_vendor.callWithAsyncErrorHandling,
callWithErrorHandling: common_vendor.callWithErrorHandling,
camelize: common_vendor.camelize,
computed: common_vendor.computed,
createApp: common_vendor.createApp,
createPropsRestProxy: common_vendor.createPropsRestProxy,
createSSRApp: common_vendor.createSSRApp,
createVNode: common_vendor.createVNode,
createVueApp: common_vendor.createVueApp,
customRef: common_vendor.customRef,
d: common_vendor.d,
defineAsyncComponent: common_vendor.defineAsyncComponent,
defineComponent: common_vendor.defineComponent,
defineEmits: common_vendor.defineEmits,
defineExpose: common_vendor.defineExpose,
defineProps: common_vendor.defineProps,
devtoolsComponentAdded: common_vendor.devtoolsComponentAdded,
devtoolsComponentRemoved: common_vendor.devtoolsComponentRemoved,
devtoolsComponentUpdated: common_vendor.devtoolsComponentUpdated,
diff: common_vendor.diff,
e: common_vendor.e,
effect: common_vendor.effect,
effectScope: common_vendor.effectScope,
f: common_vendor.f,
findComponentPropsData: common_vendor.findComponentPropsData,
gei: common_vendor.gei,
getCurrentInstance: common_vendor.getCurrentInstance,
getCurrentScope: common_vendor.getCurrentScope,
getExposeProxy: common_vendor.getExposeProxy,
guardReactiveProps: common_vendor.guardReactiveProps,
h: common_vendor.h,
hasInjectionContext: common_vendor.hasInjectionContext,
hasQueueJob: common_vendor.hasQueueJob,
inject: common_vendor.inject,
injectHook: common_vendor.injectHook,
invalidateJob: common_vendor.invalidateJob,
get isInSSRComponentSetup() {
return common_vendor.isInSSRComponentSetup;
},
isProxy: common_vendor.isProxy,
isReactive: common_vendor.isReactive,
isReadonly: common_vendor.isReadonly,
isRef: common_vendor.isRef,
isShallow: common_vendor.isShallow,
j: common_vendor.j,
logError: common_vendor.logError,
m: common_vendor.m,
markRaw: common_vendor.markRaw,
mergeDefaults: common_vendor.mergeDefaults,
mergeModels: common_vendor.mergeModels,
mergeProps: common_vendor.mergeProps,
n: common_vendor.n,
nextTick: common_vendor.nextTick$1,
normalizeClass: common_vendor.normalizeClass,
normalizeProps: common_vendor.normalizeProps,
normalizeStyle: common_vendor.normalizeStyle,
o: common_vendor.o$1,
onActivated: common_vendor.onActivated,
onBeforeMount: common_vendor.onBeforeMount,
onBeforeUnmount: common_vendor.onBeforeUnmount,
onBeforeUpdate: common_vendor.onBeforeUpdate,
onDeactivated: common_vendor.onDeactivated,
onErrorCaptured: common_vendor.onErrorCaptured,
onMounted: common_vendor.onMounted,
onRenderTracked: common_vendor.onRenderTracked,
onRenderTriggered: common_vendor.onRenderTriggered,
onScopeDispose: common_vendor.onScopeDispose,
onServerPrefetch: common_vendor.onServerPrefetch,
onUnmounted: common_vendor.onUnmounted,
onUpdated: common_vendor.onUpdated,
p: common_vendor.p,
patch: common_vendor.patch,
provide: common_vendor.provide,
proxyRefs: common_vendor.proxyRefs,
pruneComponentPropsCache: common_vendor.pruneComponentPropsCache,
queuePostFlushCb: common_vendor.queuePostFlushCb,
r: common_vendor.r,
reactive: common_vendor.reactive,
readonly: common_vendor.readonly,
ref: common_vendor.ref,
resolveComponent: common_vendor.resolveComponent,
resolveDirective: common_vendor.resolveDirective,
resolveFilter: common_vendor.resolveFilter,
s: common_vendor.s,
setCurrentRenderingInstance: common_vendor.setCurrentRenderingInstance,
setTemplateRef: common_vendor.setTemplateRef,
setupDevtoolsPlugin: common_vendor.setupDevtoolsPlugin,
shallowReactive: common_vendor.shallowReactive,
shallowReadonly: common_vendor.shallowReadonly,
shallowRef: common_vendor.shallowRef,
sr: common_vendor.sr,
stop: common_vendor.stop,
t: common_vendor.t,
toDisplayString: common_vendor.toDisplayString,
toHandlerKey: common_vendor.toHandlerKey,
toHandlers: common_vendor.toHandlers,
toRaw: common_vendor.toRaw,
toRef: common_vendor.toRef,
toRefs: common_vendor.toRefs,
toValue: common_vendor.toValue,
triggerRef: common_vendor.triggerRef,
unref: common_vendor.unref,
updateProps: common_vendor.updateProps,
useAttrs: common_vendor.useAttrs,
useCssModule: common_vendor.useCssModule,
useCssVars: common_vendor.useCssVars,
useModel: common_vendor.useModel,
useSSRContext: common_vendor.useSSRContext,
useSlots: common_vendor.useSlots,
version: common_vendor.version,
get vueVersion() {
return vueVersion;
},
w: common_vendor.w,
warn: common_vendor.warn,
watch: common_vendor.watch,
watchEffect: common_vendor.watchEffect,
watchPostEffect: common_vendor.watchPostEffect,
watchSyncEffect: common_vendor.watchSyncEffect,
withAsyncContext: common_vendor.withAsyncContext,
withCtx: common_vendor.withCtx,
withDefaults: common_vendor.withDefaults,
withDirectives: common_vendor.withDirectives,
withModifiers: common_vendor.withModifiers,
withScopeId: common_vendor.withScopeId
}, Symbol.toStringTag, { value: "Module" }));
exports.VueUni = VueUni;
//# sourceMappingURL=../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/adapter-vue-uniapp.js.map

View File

@@ -0,0 +1,75 @@
"use strict";
var _a, _b, _c, _d, _e, _f;
const common_vendor = require("../../common/vendor.js");
let VueBasic = {
default: {}
};
VueBasic = common_vendor._Vue ? common_vendor._Vue : VueBasic;
let vueVersion;
let createVNode = (arg1, arg2) => {
return {};
};
let render = (arg1, arg2) => {
return;
};
let defineProps = () => {
return;
};
let defineEmits = () => {
return;
};
let withDefaults = (arg) => {
return arg;
};
try {
if (((_a = VueBasic == null ? void 0 : VueBasic.default) == null ? void 0 : _a.version) && ((_c = (_b = VueBasic == null ? void 0 : VueBasic.default) == null ? void 0 : _b.version) == null ? void 0 : _c.startsWith("2.7."))) {
vueVersion = 2.7;
} else if (((_d = VueBasic == null ? void 0 : VueBasic.default) == null ? void 0 : _d.version) && ((_f = (_e = VueBasic == null ? void 0 : VueBasic.default) == null ? void 0 : _e.version) == null ? void 0 : _f.startsWith("2."))) {
vueVersion = 2;
} else {
vueVersion = 3;
createVNode = VueBasic == null ? void 0 : VueBasic.createVNode;
render = VueBasic == null ? void 0 : VueBasic.render;
defineProps = VueBasic == null ? void 0 : VueBasic.defineProps;
defineEmits = VueBasic == null ? void 0 : VueBasic.defineEmits;
withDefaults = VueBasic == null ? void 0 : VueBasic.withDefaults;
}
} catch (error) {
vueVersion = 3;
createVNode = VueBasic == null ? void 0 : VueBasic.createVNode;
render = VueBasic == null ? void 0 : VueBasic.render;
defineProps = VueBasic == null ? void 0 : VueBasic.defineProps;
defineEmits = VueBasic == null ? void 0 : VueBasic.defineEmits;
withDefaults = VueBasic == null ? void 0 : VueBasic.withDefaults;
}
common_vendor.index.__f__("warn", "at TUIKit/tui-customer-service-plugin/adapter-vue-web.ts:64", `[adapter-vue]: vue version is ${vueVersion}`);
exports.vue = VueBasic;
if (vueVersion === 2) {
exports.vue = common_vendor.VueApi;
}
const VueWeb = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
get createVNode() {
return createVNode;
},
get defineEmits() {
return defineEmits;
},
get defineProps() {
return defineProps;
},
get render() {
return render;
},
get vue() {
return exports.vue;
},
get vueVersion() {
return vueVersion;
},
get withDefaults() {
return withDefaults;
}
}, Symbol.toStringTag, { value: "Module" }));
exports.VueWeb = VueWeb;
//# sourceMappingURL=../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/adapter-vue-web.js.map

View File

@@ -0,0 +1,10 @@
"use strict";
const TUIKit_tuiCustomerServicePlugin_adapterVueUniapp = require("./adapter-vue-uniapp.js");
const TUIKit_tuiCustomerServicePlugin_adapterVueWeb = require("./adapter-vue-web.js");
let vue = TUIKit_tuiCustomerServicePlugin_adapterVueUniapp.VueUni;
if (window && !window.uni) {
vue = { ...TUIKit_tuiCustomerServicePlugin_adapterVueWeb.VueWeb, ...TUIKit_tuiCustomerServicePlugin_adapterVueWeb.vue };
}
const vue$1 = vue;
exports.vue = vue$1;
//# sourceMappingURL=../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/adapter-vue.js.map

View File

@@ -0,0 +1,41 @@
"use strict";
const TUIKit_tuiCustomerServicePlugin_utils_env = require("../utils/env.js");
const common_vendor = require("../../../common/vendor.js");
const _sfc_main = {
props: {
src: {
type: String,
default: ""
},
width: {
type: String,
default: "16px"
},
height: {
type: String,
default: "16px"
}
},
setup(props) {
return {
props,
isApp: TUIKit_tuiCustomerServicePlugin_utils_env.isApp
};
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $setup.isApp
}, $setup.isApp ? {
b: $setup.props.src,
c: $setup.props.width,
d: $setup.props.height
} : {
e: $setup.props.src,
f: $setup.props.width,
g: $setup.props.height
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-d0031c07"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/components/customer-icon.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="common-icon-container data-v-d0031c07"><image wx:if="{{a}}" class="common-icon data-v-d0031c07" src="{{b}}" style="{{'width:' + c + ';' + ('height:' + d)}}"/><image wx:else class="common-icon data-v-d0031c07" src="{{e}}" style="{{'width:' + f + ';' + ('height:' + g)}}"></image></view>

View File

@@ -0,0 +1,30 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.common-icon-container.data-v-d0031c07 {
display: flex;
justify-content: center;
align-items: center;
}

View File

@@ -0,0 +1,62 @@
"use strict";
const TUIKit_tuiCustomerServicePlugin_adapterVue = require("../adapter-vue.js");
const common_assets = require("../../../common/assets.js");
const common_vendor = require("../../../common/vendor.js");
const Icon = () => "./customer-icon.js";
const { computed } = TUIKit_tuiCustomerServicePlugin_adapterVue.vue;
const _sfc_main = {
components: {
Icon
},
props: {
payload: {
type: Object,
default: () => ({})
}
},
emits: ["sendMessage"],
setup(props, { emit }) {
const content = computed(() => {
var _a;
return ((_a = props == null ? void 0 : props.payload) == null ? void 0 : _a.content) || {
header: void 0,
items: []
};
});
const handleContentListItemClick = (branch) => {
emit("sendMessage", { text: branch.content });
};
return {
content,
handleContentListItemClick,
iconRight: common_assets.iconRight
};
}
};
if (!Array) {
const _component_Icon = common_vendor.resolveComponent("Icon");
_component_Icon();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $setup.content.header || $setup.content.title
}, $setup.content.header || $setup.content.title ? {
b: common_vendor.t($setup.content.header || $setup.content.title)
} : {}, {
c: common_vendor.f($setup.content.items, (item, index, i0) => {
return {
a: common_vendor.t(item.content),
b: "00f6aa80-0-" + i0,
c: index,
d: common_vendor.o$1(($event) => $setup.handleContentListItemClick(item), index)
};
}),
d: common_vendor.p({
src: $setup.iconRight
}),
e: $setup.content.header ? "1px 0 0px 0" : "0px 0 1px 0"
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-branch.js.map

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"icon": "./customer-icon"
}
}

View File

@@ -0,0 +1 @@
<view class="branch-card"><view wx:if="{{a}}" class="branch-title">{{b}}</view><view wx:for="{{c}}" wx:for-item="item" wx:key="c" class="branch-item" style="{{'border-width:' + e}}" bindtap="{{item.d}}">{{item.a}} <icon wx:if="{{d}}" u-i="{{item.b}}" bind:__l="__l" u-p="{{d}}"/></view></view>

View File

@@ -0,0 +1,44 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.branch-card {
min-width: 250px;
max-width: 350px;
}
.branch-card .branch-title {
margin-bottom: 8px;
border-radius: 0 10px 10px;
}
.branch-card .branch-item {
display: flex;
justify-content: space-between;
border-style: dotted;
border-color: #d8d8d8;
font-weight: 400;
color: #368dff;
padding-top: 5px;
cursor: pointer;
padding-bottom: 5px;
}

View File

@@ -0,0 +1,97 @@
"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);
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-customer-service.js.map

View File

@@ -0,0 +1,11 @@
{
"component": true,
"usingComponents": {
"message-branch": "./message-branch",
"message-form": "./message-form/index",
"message-i-m-robot-welcome": "./message-robot-welcome",
"message-product-card": "./message-product-card",
"message-rich-text": "./message-rich-text",
"message-stream": "./message-stream"
}
}

View File

@@ -0,0 +1 @@
<view class="custom"><view wx:if="{{a}}"><message-branch wx:if="{{c}}" bindsendMessage="{{b}}" u-i="7db9e138-0" bind:__l="__l" u-p="{{c}}"/></view><view wx:if="{{d}}"><message-i-m-robot-welcome wx:if="{{f}}" bindsendMessage="{{e}}" u-i="7db9e138-1" bind:__l="__l" u-p="{{f}}"/></view><view wx:if="{{g}}"><message-form wx:if="{{i}}" bindsendMessage="{{h}}" u-i="7db9e138-2" bind:__l="__l" u-p="{{i}}"/></view><view wx:if="{{j}}"><message-product-card wx:if="{{k}}" u-i="7db9e138-3" bind:__l="__l" u-p="{{k}}"/></view><view wx:if="{{l}}"><message-rich-text wx:if="{{m}}" u-i="7db9e138-4" bind:__l="__l" u-p="{{m}}"/></view><view wx:if="{{n}}"><message-stream wx:if="{{o}}" u-i="7db9e138-5" bind:__l="__l" u-p="{{o}}"/></view></view>

View File

@@ -0,0 +1,42 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
props: {
title: {
type: String,
default: ""
},
list: {
type: Array,
default: () => []
}
},
emits: ["input-click"],
setup(props, { emit }) {
const listItemClick = (branch) => {
emit("input-click", branch);
};
return {
props,
listItemClick
};
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $setup.props.title
}, $setup.props.title ? {
b: common_vendor.t($setup.props.title)
} : {}, {
c: common_vendor.f($setup.props.list, (item, index, i0) => {
return {
a: common_vendor.t(item.content),
b: index,
c: common_vendor.o$1(($event) => $setup.listItemClick(item), index)
};
})
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-form/form-branch.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="form-branch-container"><view wx:if="{{a}}" class="card-title">{{b}}</view><view wx:for="{{c}}" wx:for-item="item" wx:key="b" class="form-branch-item" bindtap="{{item.c}}">{{item.a}}</view></view>

View File

@@ -0,0 +1,35 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.form-branch-container .card-title {
margin-bottom: 8px;
}
.form-branch-container .form-branch-item {
font-weight: 400;
color: #368dff;
padding-top: 5px;
cursor: pointer;
padding-bottom: 5px;
}

View File

@@ -0,0 +1,39 @@
"use strict";
const TUIKit_tuiCustomerServicePlugin_adapterVue = require("../../adapter-vue.js");
const common_vendor = require("../../../../common/vendor.js");
const { ref } = TUIKit_tuiCustomerServicePlugin_adapterVue.vue;
const _sfc_main = {
props: {
title: {
type: String,
default: ""
}
},
emits: ["input-submit"],
setup(props, { emit }) {
const disabled = ref(false);
const text = ref("");
const listItemClick = () => {
disabled.value = true;
emit("input-submit", text.value);
};
return {
disabled,
text,
listItemClick,
props
};
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.t($setup.props.title),
b: $setup.text,
c: common_vendor.o$1(($event) => $setup.text = $event.detail.value),
d: $setup.disabled,
e: common_vendor.o$1((...args) => $setup.listItemClick && $setup.listItemClick(...args))
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-form/form-input.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="form-input-container"><view class="card-title">{{a}}</view><view class="form-input-box"><input class="form-input" value="{{b}}" bindinput="{{c}}"></input><button class="form-button" disabled="{{d}}" bindtap="{{e}}"/></view></view>

View File

@@ -0,0 +1,62 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.form-input-container .card-title {
margin-bottom: 8px;
}
.form-input-container .form-input-box {
display: flex;
}
.form-input-container .form-input-box button:disabled {
background: #d8d8d8;
}
.form-input-container .form-input {
width: 100%;
height: 36px;
border-radius: 8px 0 0 8px;
border: 1px #dddddd solid;
}
.form-input-container .form-button {
position: relative;
height: 40px;
width: 42px;
font-size: 16px;
border-radius: 0 8px 8px 0;
border: 0 #dddddd solid;
background: #006eff;
color: white;
cursor: pointer;
}
.form-input-container .form-button::before {
content: "";
position: absolute;
width: 10px;
height: 10px;
top: 50%;
right: 40%;
border-left: 2px solid #fff;
border-bottom: 2px solid #fff;
transform: translate(0, -50%) rotate(-135deg);
}

View File

@@ -0,0 +1,64 @@
"use strict";
const TUIKit_tuiCustomerServicePlugin_adapterVue = require("../../adapter-vue.js");
const common_vendor = require("../../../../common/vendor.js");
const FormBranch = () => "./form-branch.js";
const FormInput = () => "./form-input.js";
const { computed } = TUIKit_tuiCustomerServicePlugin_adapterVue.vue;
const _sfc_main = {
components: {
FormBranch,
FormInput
},
props: {
payload: {
type: Object,
default: () => ({})
}
},
emits: ["sendMessage"],
setup(props, { emit }) {
const content = computed(() => {
var _a;
return ((_a = props.payload) == null ? void 0 : _a.content) || {
type: 0,
header: "",
items: []
};
});
const handleContentListItemClick = (branch) => {
emit("sendMessage", { text: branch.content });
};
const handleFormSaveInputSubmit = (text) => {
emit("sendMessage", { text });
};
return {
content,
handleContentListItemClick,
handleFormSaveInputSubmit
};
}
};
if (!Array) {
const _component_FormBranch = common_vendor.resolveComponent("FormBranch");
const _component_FormInput = common_vendor.resolveComponent("FormInput");
(_component_FormBranch + _component_FormInput)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $setup.content.type === 1
}, $setup.content.type === 1 ? {
b: common_vendor.o$1($setup.handleContentListItemClick),
c: common_vendor.p({
title: $setup.content.header,
list: $setup.content.items
})
} : {
d: common_vendor.o$1($setup.handleFormSaveInputSubmit),
e: common_vendor.p({
title: $setup.content.header
})
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-form/index.js.map

View File

@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"form-branch": "./form-branch",
"form-input": "./form-input"
}
}

View File

@@ -0,0 +1 @@
<view wx:if="{{a}}" class="message-form"><form-branch wx:if="{{c}}" bindinputClick="{{b}}" u-i="6e5fe136-0" bind:__l="__l" u-p="{{c}}"/></view><view wx:else class="message-form"><form-input wx:if="{{e}}" bindinputSubmit="{{d}}" u-i="6e5fe136-1" bind:__l="__l" u-p="{{e}}"/></view>

View File

@@ -0,0 +1,28 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.message-form {
max-width: 300px;
}

View File

@@ -0,0 +1,42 @@
"use strict";
const common_vendor = require("../../../common/vendor.js");
const TUIKit_tuiCustomerServicePlugin_utils_env = require("../utils/env.js");
const _sfc_main = {
props: {
payload: {
type: Object,
default: () => ({})
}
},
emits: ["sendMessage"],
setup(props) {
const jumpProductCard = () => {
if (window) {
window.open(props.payload.content.url, "_blank");
} else {
common_vendor.index && common_vendor.index.navigateTo({ url: `/TUIKit/components/TUIChat/web-view?url=${props.payload.content.url}` });
}
};
return {
props,
isApp: TUIKit_tuiCustomerServicePlugin_utils_env.isApp,
jumpProductCard
};
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $setup.isApp
}, $setup.isApp ? {
b: $setup.props.payload.content.pic
} : {
c: $setup.props.payload.content.pic
}, {
d: common_vendor.t($setup.props.payload.content.header),
e: common_vendor.t($setup.props.payload.content.desc),
f: common_vendor.o$1((...args) => $setup.jumpProductCard && $setup.jumpProductCard(...args))
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-24d6579f"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-product-card.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="message-product-card data-v-24d6579f" bindtap="{{f}}"><image wx:if="{{a}}" class="product-img data-v-24d6579f" src="{{b}}"/><image wx:else class="product-img data-v-24d6579f" src="{{c}}"></image><view class="product-card-information data-v-24d6579f"><view class="product-card-title data-v-24d6579f">{{d}}</view><view class="product-card-description data-v-24d6579f">{{e}}</view></view></view>

View File

@@ -0,0 +1,62 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.message-product-card.data-v-24d6579f {
min-width: 224px;
max-width: 288px;
background: #fff;
border: 1px solid #ddd;
display: flex;
padding: 12px;
border-radius: 5px;
}
.message-product-card .product-img.data-v-24d6579f {
width: 86px;
height: 86px;
}
.message-product-card .product-card-information.data-v-24d6579f {
margin-left: 12px;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.message-product-card .product-card-information .product-card-title.data-v-24d6579f {
font-size: 12px;
max-width: 165px;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
word-break: break-all;
}
.message-product-card .product-card-information .product-card-description.data-v-24d6579f {
font-size: 16px;
max-width: 165px;
color: #ff6c2e;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

View File

@@ -0,0 +1,58 @@
"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 RatingStar = () => "./message-rating-star.js";
const RatingNumber = () => "./message-rating-number.js";
const { computed } = TUIKit_tuiCustomerServicePlugin_adapterVue.vue;
const _sfc_main = {
components: {
RatingStar,
RatingNumber
},
props: {
message: {
type: Object,
default: () => ({})
}
},
emits: ["sendMessage"],
setup(props, { emit }) {
const ratingTemplate = computed(() => {
const data = props.message && TUIKit_tuiCustomerServicePlugin_utils_index.JSONToObject(props.message.payload.data);
return data == null ? void 0 : data.menuContent;
});
const sendCustomMessage = (data) => {
emit("sendMessage", data);
};
return {
sendCustomMessage,
ratingTemplate,
RATING_TEMPLATE_TYPE: TUIKit_tuiCustomerServicePlugin_constant.RATING_TEMPLATE_TYPE
};
}
};
if (!Array) {
const _component_RatingStar = common_vendor.resolveComponent("RatingStar");
const _component_RatingNumber = common_vendor.resolveComponent("RatingNumber");
(_component_RatingStar + _component_RatingNumber)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $setup.ratingTemplate.type === $setup.RATING_TEMPLATE_TYPE.STAR
}, $setup.ratingTemplate.type === $setup.RATING_TEMPLATE_TYPE.STAR ? {
b: common_vendor.o$1($setup.sendCustomMessage),
c: common_vendor.p({
ratingTemplate: $setup.ratingTemplate
})
} : {
d: common_vendor.o$1($setup.sendCustomMessage),
e: common_vendor.p({
ratingTemplate: $setup.ratingTemplate
})
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-rating/index.js.map

View File

@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"rating-star": "./message-rating-star",
"rating-number": "./message-rating-number"
}
}

View File

@@ -0,0 +1 @@
<rating-star wx:if="{{a}}" bindsendMessage="{{b}}" u-i="26f3a104-0" bind:__l="__l" u-p="{{c}}"/><rating-number wx:else bindsendMessage="{{d}}" u-i="26f3a104-1" bind:__l="__l" u-p="{{e||''}}"/>

View File

@@ -0,0 +1,115 @@
"use strict";
const TUIKit_tuiCustomerServicePlugin_adapterVue = require("../../adapter-vue.js");
const TUIKit_tuiCustomerServicePlugin_constant = require("../../constant.js");
const common_vendor = require("../../../../common/vendor.js");
const { computed, ref, watchEffect } = TUIKit_tuiCustomerServicePlugin_adapterVue.vue;
const _sfc_main = {
props: {
ratingTemplate: {
type: Object,
default: () => ({})
}
},
emits: ["sendMessage"],
setup(props, { emit }) {
const hasReply = ref(false);
const sessionId = ref("");
const selectValue = ref(-1);
const hoverValue = ref(-1);
const hasExpire = ref(false);
const desc = computed(() => {
var _a;
return (_a = props.ratingTemplate) == null ? void 0 : _a.menu.map((item) => item.content);
});
const numberList = computed(() => {
var _a;
return (_a = props.ratingTemplate) == null ? void 0 : _a.menu.map((item, index) => index);
});
watchEffect(() => {
sessionId.value = props.ratingTemplate.sessionId || "";
if (props.ratingTemplate.selected != void 0) {
for (let i = 0; i < props.ratingTemplate.menu.length; i++) {
if (props.ratingTemplate.menu[i].id == props.ratingTemplate.selected.id) {
hasReply.value = true;
selectValue.value = i;
break;
}
}
}
const timestamp = Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3);
if (timestamp > props.ratingTemplate.expireTime) {
hasExpire.value = true;
}
});
const setValue = (val) => {
if (!hasReply.value) {
selectValue.value = val;
}
};
const setHoverValue = (value) => {
if (!hasReply.value) {
hoverValue.value = value;
}
};
const submitRatingStar = () => {
if (selectValue.value >= 0) {
const submitData = {
data: JSON.stringify({
src: TUIKit_tuiCustomerServicePlugin_constant.CUSTOM_MESSAGE_SRC.MENU_SELECTED,
menuSelected: {
id: props.ratingTemplate.menu[selectValue.value].id,
content: props.ratingTemplate.menu[selectValue.value].content,
sessionId: sessionId.value
},
customerServicePlugin: 0
})
};
hasReply.value = true;
emit("sendMessage", submitData);
}
};
return {
props,
hasReply,
sessionId,
selectValue,
hoverValue,
hasExpire,
desc,
numberList,
setValue,
setHoverValue,
submitRatingStar
};
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: common_vendor.t($setup.props.ratingTemplate.head),
b: common_vendor.f($setup.numberList, (item, index, i0) => {
return {
a: common_vendor.t(item + 1),
b: index,
c: !(index !== $setup.selectValue && index !== $setup.hoverValue) ? 1 : "",
d: index !== $setup.selectValue && index !== $setup.hoverValue ? 1 : "",
e: index === 0 ? "0px" : "20px",
f: common_vendor.o$1(($event) => $setup.setValue(index), index),
g: common_vendor.o$1(($event) => $setup.setHoverValue(index), index),
h: common_vendor.o$1(($event) => $setup.setHoverValue(-1), index)
};
}),
c: "5px",
d: common_vendor.t($setup.hoverValue === -1 ? $setup.selectValue === -1 ? "如果满意请给好评哦~" : $setup.desc[$setup.selectValue] : $setup.desc[$setup.hoverValue]),
e: "10px",
f: "10px",
g: $setup.hasReply || $setup.hasExpire,
h: common_vendor.o$1((...args) => $setup.submitRatingStar && $setup.submitRatingStar(...args)),
i: $setup.hasReply
}, $setup.hasReply ? {
j: common_vendor.t($setup.props.ratingTemplate.tail),
k: "20px"
} : {});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-1a21fdf4"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-rating/message-rating-number.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="message-rating-star data-v-1a21fdf4"><view class="rating-head data-v-1a21fdf4">{{a}}</view><view class="rating-card data-v-1a21fdf4"><label class="card-title data-v-1a21fdf4">请对本次服务进行评价</label><view class="card-wrapper data-v-1a21fdf4"><view class="data-v-1a21fdf4" style="max-width:250px"><view wx:for="{{b}}" wx:for-item="item" wx:key="b" class="{{['data-v-1a21fdf4', item.c && 'active', item.d && 'de-active']}}" style="{{'margin-left:' + item.e + ';' + ('margin:' + c)}}" bindtap="{{item.f}}" bindmouseenter="{{item.g}}" bindmouseleave="{{item.h}}">{{item.a}}</view></view></view><view class="data-v-1a21fdf4" style="{{'margin-top:' + e + ';' + ('margin-bottom:' + f)}}">{{d}}</view><button class="submit-button data-v-1a21fdf4" disabled="{{g}}" bindtap="{{h}}"> 提交评价 </button></view><view wx:if="{{i}}" class="rating-tail data-v-1a21fdf4" style="{{'margin-top:' + k}}">{{j}}</view></view>

View File

@@ -0,0 +1,103 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.rating-head.data-v-1a21fdf4 {
font-size: 14px;
font-weight: 400;
color: #999;
}
.rating-tail.data-v-1a21fdf4 {
font-size: 14px;
font-weight: 400;
color: #999;
}
.card-title.data-v-1a21fdf4 {
font-size: 14px;
font-weight: 500;
}
.rating-card.data-v-1a21fdf4 {
min-width: 270px;
width: 50%;
background: #fbfbfb;
border-radius: 20px;
border: 0;
margin-top: 10px;
padding-top: 20px;
padding-bottom: 20px;
}
.rating-card button.data-v-1a21fdf4:disabled {
background: #d8d8d8;
}
.message-rating-star.data-v-1a21fdf4 {
text-align: center;
display: flex;
flex-flow: column wrap;
justify-content: center;
padding-bottom: 30px;
align-items: center;
}
.card-wrapper.data-v-1a21fdf4 {
display: flex;
flex-wrap: wrap;
justify-content: center;
padding-top: 10px;
}
.submit-button.data-v-1a21fdf4 {
width: 50%;
height: 50px;
background-color: #0365f9;
font-size: 18px;
font-weight: 400;
color: white;
border: 0;
border-radius: 8px;
cursor: pointer;
}
.de-active.data-v-1a21fdf4 {
height: 34px;
width: 34px;
display: inline-block;
border: 0 solid #006eff0d;
border-radius: 5px;
color: #006eff;
font-weight: 400;
font-size: 16px;
text-align: center;
line-height: 34px;
background: #006eff0d;
}
.active.data-v-1a21fdf4 {
width: 34px;
height: 34px;
display: inline-block;
background: linear-gradient(136.96deg, rgba(10, 124, 255, 0.3) -39.64%, #0a7cff 131.39%);
border-radius: 5px;
color: white;
font-weight: 400;
font-size: 16px;
border: 0 solid #0a7cff;
text-align: center;
line-height: 34px;
}

View File

@@ -0,0 +1,148 @@
"use strict";
const TUIKit_tuiCustomerServicePlugin_adapterVue = require("../../adapter-vue.js");
const TUIKit_tuiCustomerServicePlugin_constant = require("../../constant.js");
const common_assets = require("../../../../common/assets.js");
const common_vendor = require("../../../../common/vendor.js");
const Icon = () => "../customer-icon.js";
const { computed, ref, watchEffect } = TUIKit_tuiCustomerServicePlugin_adapterVue.vue;
const _sfc_main = {
components: {
Icon
},
props: {
ratingTemplate: {
type: Object,
default: () => ({})
}
},
emits: ["sendMessage"],
setup(props, { emit }) {
const hasReply = ref(false);
const sessionId = ref("");
const value = ref(-1);
const hoverValue = ref(-1);
const hasExpire = ref(false);
watchEffect(() => {
sessionId.value = props.ratingTemplate.sessionId || "";
if (props.ratingTemplate.selected != void 0) {
for (let i = 0; i < props.ratingTemplate.menu.length; i++) {
if (props.ratingTemplate.menu[i].id == props.ratingTemplate.selected.id) {
hasReply.value = true;
value.value = i;
break;
}
}
}
const timestamp = Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3);
if (timestamp > props.ratingTemplate.expireTime) {
hasExpire.value = true;
}
});
const desc = computed(() => {
var _a;
return (_a = props.ratingTemplate) == null ? void 0 : _a.menu.map((item) => {
return item.content;
});
});
const starList = computed(() => {
var _a;
return (_a = props.ratingTemplate) == null ? void 0 : _a.menu.map((item, index) => {
if (hoverValue.value !== -1) {
return index <= hoverValue.value ? 1 : 0;
} else {
return index <= value.value ? 1 : 0;
}
});
});
const setValue = (val) => {
if (hasReply.value) {
return;
}
value.value = val;
};
const setHoverValue = (value2) => {
if (hasReply.value) {
return;
}
hoverValue.value = value2;
};
const submitRatingStar = async () => {
if (value.value < 0) {
return;
}
const submitData = {
data: JSON.stringify({
src: TUIKit_tuiCustomerServicePlugin_constant.CUSTOM_MESSAGE_SRC.MENU_SELECTED,
menuSelected: {
id: props.ratingTemplate.menu[value.value].id,
content: props.ratingTemplate.menu[value.value].content,
sessionId: sessionId.value
},
customerServicePlugin: 0
})
};
hasReply.value = true;
emit("sendMessage", submitData);
};
return {
props,
hasReply,
sessionId,
value,
hoverValue,
hasExpire,
desc,
starList,
setValue,
setHoverValue,
submitRatingStar,
star: common_assets.star$1,
starLine: common_assets.starLine
};
}
};
if (!Array) {
const _component_Icon = common_vendor.resolveComponent("Icon");
_component_Icon();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: common_vendor.t($setup.props.ratingTemplate.head),
b: common_vendor.f($setup.starList, (item, index, i0) => {
return common_vendor.e({
a: item === 1
}, item === 1 ? {
b: "da3c7d81-0-" + i0,
c: common_vendor.p({
src: $setup.star,
width: "30px",
height: "30px"
})
} : {
d: "da3c7d81-1-" + i0,
e: common_vendor.p({
src: $setup.starLine,
width: "30px",
height: "30px"
})
}, {
f: index,
g: common_vendor.o$1(($event) => $setup.setValue(index), index),
h: common_vendor.o$1(($event) => $setup.setHoverValue(index), index),
i: common_vendor.o$1(($event) => $setup.setHoverValue(-1), index)
});
}),
c: common_vendor.t($setup.hoverValue === -1 ? $setup.value === -1 ? "如果满意请给好评哦~" : $setup.desc[$setup.value] : $setup.desc[$setup.hoverValue]),
d: "10px",
e: "10px",
f: $setup.hasReply || $setup.hasExpire,
g: common_vendor.o$1((...args) => $setup.submitRatingStar && $setup.submitRatingStar(...args)),
h: $setup.hasReply
}, $setup.hasReply ? {
i: common_vendor.t($setup.props.ratingTemplate.tail),
j: "20px"
} : {});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-da3c7d81"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-rating/message-rating-star.js.map

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"icon": "../customer-icon"
}
}

View File

@@ -0,0 +1 @@
<view class="message-rating-star data-v-da3c7d81"><view class="rating-head data-v-da3c7d81">{{a}}</view><view class="rating-card data-v-da3c7d81"><label class="card-title data-v-da3c7d81">请对本次服务进行评价</label><view class="card-wrapper data-v-da3c7d81"><view class="data-v-da3c7d81" style="max-width:200px"><view wx:for="{{b}}" wx:for-item="item" wx:key="f" class="data-v-da3c7d81" style="display:inline-block" bindtap="{{item.g}}" bindmouseenter="{{item.h}}" bindmouseleave="{{item.i}}"><icon wx:if="{{item.a}}" class="data-v-da3c7d81" u-i="{{item.b}}" bind:__l="__l" u-p="{{item.c}}"/><icon wx:else class="data-v-da3c7d81" u-i="{{item.d}}" bind:__l="__l" u-p="{{item.e||''}}"/></view></view></view><view class="data-v-da3c7d81" style="{{'margin-top:' + d + ';' + ('margin-bottom:' + e)}}">{{c}}</view><button class="submit-button data-v-da3c7d81" disabled="{{f}}" bindtap="{{g}}"> 提交评价 </button></view><view wx:if="{{h}}" class="rating-tail data-v-da3c7d81" style="{{'margin-top:' + j}}">{{i}}</view></view>

View File

@@ -0,0 +1,77 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.rating-head.data-v-da3c7d81 {
font-size: 14px;
font-weight: 400;
color: #999;
}
.rating-tail.data-v-da3c7d81 {
font-size: 14px;
font-weight: 400;
color: #999;
}
.card-title.data-v-da3c7d81 {
font-size: 14px;
font-weight: 500;
}
.rating-card.data-v-da3c7d81 {
min-width: 270px;
width: 50%;
background: #fbfbfb;
border-radius: 20px;
border: 0;
margin-top: 10px;
padding-top: 20px;
padding-bottom: 20px;
}
.rating-card button.data-v-da3c7d81:disabled {
background: #d8d8d8;
}
.message-rating-star.data-v-da3c7d81 {
text-align: center;
display: flex;
flex-flow: column wrap;
justify-content: center;
padding-bottom: 30px;
align-items: center;
}
.card-wrapper.data-v-da3c7d81 {
display: flex;
flex-wrap: wrap;
justify-content: center;
padding-top: 10px;
}
.submit-button.data-v-da3c7d81 {
width: 50%;
height: 50px;
background-color: #0365f9;
font-size: 18px;
font-weight: 400;
color: white;
border: 0;
border-radius: 8px;
cursor: pointer;
}

View File

@@ -0,0 +1,32 @@
"use strict";
const TUIKit_tuiCustomerServicePlugin_adapterVue = require("../adapter-vue.js");
const common_vendor = require("../../../common/vendor.js");
const { computed } = TUIKit_tuiCustomerServicePlugin_adapterVue.vue;
const _sfc_main = {
props: {
payload: {
type: Object,
default: () => ({})
}
},
setup(props) {
const formatedContent = computed(() => {
let richtext = common_vendor.marked.parse(props.payload.content);
const regex = new RegExp("<img", "gi");
richtext = richtext.replace(regex, `<img style="max-width: 100%;"`);
return richtext;
});
return {
props,
formatedContent
};
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: $setup.formatedContent
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-rich-text.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="rich-text"><rich-text nodes="{{a}}"/></view>

View File

@@ -0,0 +1,44 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.rich-text div,
.rich-text ul,
.rich-text ol,
.rich-text dt,
.rich-text dd,
.rich-text li,
.rich-text dl,
.rich-text h1,
.rich-text h2,
.rich-text h3,
.rich-text h4,
.rich-text p,
.rich-text img,
.rich-text a {
max-width: 100%;
}
.rich-text a {
color: blue;
}

View File

@@ -0,0 +1,86 @@
"use strict";
const TUIKit_tuiCustomerServicePlugin_adapterVue = require("../adapter-vue.js");
const common_assets = require("../../../common/assets.js");
const common_vendor = require("../../../common/vendor.js");
const Icon = () => "./customer-icon.js";
const { reactive, toRefs } = TUIKit_tuiCustomerServicePlugin_adapterVue.vue;
const _sfc_main = {
components: {
Icon
},
props: {
payload: {
type: Object,
default: () => ({ content: { title: "", items: [] } })
}
},
emits: ["sendMessage"],
setup(props, { emit }) {
var _a, _b, _c, _d, _e, _f;
const data = reactive({
// title
title: ((_b = (_a = props.payload) == null ? void 0 : _a.content) == null ? void 0 : _b.title) || "",
// all branch list
list: ((_d = (_c = props.payload) == null ? void 0 : _c.content) == null ? void 0 : _d.items) || [],
// current branch list
showList: (((_f = (_e = props.payload) == null ? void 0 : _e.content) == null ? void 0 : _f.items) || []).slice(0, 5),
// current page number
pageNumber: 1
});
const handleContentListItemClick = (branch) => {
emit("sendMessage", { text: branch.content });
};
const changeBranchList = () => {
var _a2, _b2;
if (data.pageNumber * 5 >= ((_a2 = data.list) == null ? void 0 : _a2.length)) {
data.pageNumber = 0;
}
data.showList = (_b2 = data.list) == null ? void 0 : _b2.slice(
data.pageNumber * 5,
data.pageNumber * 5 + 5
);
data.pageNumber += 1;
};
return {
...toRefs(data),
handleContentListItemClick,
imRobotGuess: common_assets.imRobotGuess,
refresh: common_assets.refresh,
iconRight: common_assets.iconRight,
changeBranchList
};
}
};
if (!Array) {
const _component_Icon = common_vendor.resolveComponent("Icon");
_component_Icon();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: common_vendor.p({
src: $setup.imRobotGuess
}),
b: _ctx.title
}, _ctx.title ? {
c: common_vendor.t(_ctx.title)
} : {}, {
d: common_vendor.p({
src: $setup.refresh
}),
e: common_vendor.o$1(($event) => $setup.changeBranchList()),
f: common_vendor.f(_ctx.showList, (item, index, i0) => {
return {
a: common_vendor.t(item.content),
b: "4cb3a3d1-2-" + i0,
c: index,
d: common_vendor.o$1(($event) => $setup.handleContentListItemClick(item), index)
};
}),
g: common_vendor.p({
src: $setup.iconRight
})
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-robot-welcome.js.map

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"icon": "./customer-icon"
}
}

View File

@@ -0,0 +1 @@
<view class="welcome-card"><view class="welcome-title"><view class="welcome-title-left-container"><icon wx:if="{{a}}" u-i="4cb3a3d1-0" bind:__l="__l" u-p="{{a}}"/><view wx:if="{{b}}" class="card-title">{{c}}</view></view><view class="change-wrapper" bindtap="{{e}}"><icon wx:if="{{d}}" u-i="4cb3a3d1-1" bind:__l="__l" u-p="{{d}}"/></view></view><view wx:for="{{f}}" wx:for-item="item" wx:key="c" class="welcome-item" bindtap="{{item.d}}"><view>{{item.a}}</view><icon wx:if="{{g}}" u-i="{{item.b}}" bind:__l="__l" u-p="{{g}}"/></view></view>

View File

@@ -0,0 +1,77 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.welcome-card {
min-width: 250px;
max-width: 350px;
/* stylelint-disable */
/* stylelint-enable */
}
.welcome-card .welcome-title {
display: flex;
height: 40px;
justify-content: space-between;
align-items: center;
}
.welcome-card .welcome-title-left-container {
display: flex;
align-items: center;
}
.welcome-card .card-title {
display: inline-block;
margin-left: 8px;
font-size: 16px;
}
.welcome-card .el-link {
display: block;
font-weight: 400;
padding-top: 5px;
padding-bottom: 5px;
}
.welcome-card .el-link__inner {
display: flex;
justify-content: space-between;
align-items: center;
}
.welcome-card .branch-number {
margin-left: 15px;
margin-right: 15px;
font-size: 20px;
display: inline-block;
}
.welcome-card .change-wrapper {
cursor: pointer;
}
.welcome-card .welcome-item {
padding: 6px;
color: #999;
display: flex;
justify-content: space-between;
align-items: center;
cursor: pointer;
}
.welcome-card .welcome-item:hover {
background: #f2f7ff;
}

View File

@@ -0,0 +1,71 @@
"use strict";
const TUIKit_tuiCustomerServicePlugin_adapterVue = require("../adapter-vue.js");
const common_vendor = require("../../../common/vendor.js");
const { ref, watchEffect, onBeforeUnmount, onMounted } = TUIKit_tuiCustomerServicePlugin_adapterVue.vue;
const _sfc_main = {
props: {
payload: {
type: Object,
default: () => ({})
}
},
setup(props) {
const content = ref("");
const displayedContent = ref("");
const isFinished = ref(false);
let intervalId = null;
let currentIndex = 0;
const updateDisplayedContent = () => {
if (intervalId) {
window.clearInterval(intervalId);
}
intervalId = window.setInterval(() => {
if (currentIndex < content.value.length) {
displayedContent.value += content.value[currentIndex];
currentIndex++;
} else {
window.clearInterval(intervalId);
intervalId = null;
}
}, 50);
};
onMounted(() => {
var _a, _b;
content.value = ((_b = (_a = props == null ? void 0 : props.payload) == null ? void 0 : _a.chunks) == null ? void 0 : _b.join("")) ?? "";
displayedContent.value = content.value;
currentIndex = content.value.length;
});
watchEffect(() => {
var _a, _b;
const newContent = ((_b = (_a = props == null ? void 0 : props.payload) == null ? void 0 : _a.chunks) == null ? void 0 : _b.join("")) ?? "";
if (newContent.length > currentIndex) {
content.value = newContent;
updateDisplayedContent();
}
});
watchEffect(() => {
var _a;
isFinished.value = ((_a = props == null ? void 0 : props.payload) == null ? void 0 : _a.isFinished) === 1;
});
onBeforeUnmount(() => {
if (intervalId) {
window.clearInterval(intervalId);
}
});
return {
content,
props,
isFinished,
displayedContent
};
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: common_vendor.t($setup.displayedContent),
b: !$setup.isFinished
}, !$setup.isFinished ? {} : {});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-35feeb52"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-stream.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="message-stream data-v-35feeb52">{{a}}<label wx:if="{{b}}" class="blinking-cursor data-v-35feeb52"/></view>

View File

@@ -0,0 +1,45 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.message-stream.data-v-35feeb52 {
word-break: break-all;
font-size: 14px;
}
.message-stream .blinking-cursor.data-v-35feeb52 {
display: inline-block;
width: 1px;
height: 16px;
background-color: black;
animation: blink-35feeb52 1s step-end infinite;
vertical-align: sub;
}
@keyframes blink-35feeb52 {
0%, 100% {
background-color: transparent;
}
50% {
background-color: black;
}
}

View File

@@ -0,0 +1,40 @@
"use strict";
const CUSTOM_MESSAGE_SRC = {
OFFICIAL_ACCOUNT: "1",
MINI_APP: "2",
MINI_APP_SERVICE_ACCOUNT: "3",
BACKEND_INTERNAL: "4",
WEB: "5",
SESSION_MESSAGE_SLICE: "6",
MINI_APP_AUTO: "7",
INTERNAL: "8",
MENU: "9",
MENU_SELECTED: "10",
CLIENT_STATE: "11",
TYPING_STATE: "12",
ROBOT: "13",
BRANCH: "15",
BRANCH_NUMBER: 15,
MEMBER: "17",
NO_SEAT_ONLINE: "18",
END: "19",
TIMEOUT: "20",
FROM_INPUT: "21",
PRODUCT_CARD: "22",
SATISFACTION_CON: "23",
USER_SATISFACTION: "24",
ROBOT_MSG: "29",
RICH_TEXT: "30",
STREAM_TEXT: "31"
};
const RATING_TEMPLATE_TYPE = {
STAR: 1,
NUMBER: 2
};
const TYPES = {
MSG_CUSTOM: "TIMCustomElem"
};
exports.CUSTOM_MESSAGE_SRC = CUSTOM_MESSAGE_SRC;
exports.RATING_TEMPLATE_TYPE = RATING_TEMPLATE_TYPE;
exports.TYPES = TYPES;
//# sourceMappingURL=../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/constant.js.map

View File

@@ -0,0 +1,65 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const TUIKit_tuiCustomerServicePlugin_utils_index = require("./utils/index.js");
const MessageCustomerService = () => "./components/message-customer-service.js";
const MessageRating = () => "./components/message-rating/index.js";
const _sfc_main = {
components: {
MessageCustomerService,
MessageRating
},
props: {
message: {
type: Object,
default: () => ({})
}
},
setup(props) {
const sendTextMessage = (payload) => {
common_vendor.R.callService({
serviceName: common_vendor.E.TUIChat.SERVICE.NAME,
method: common_vendor.E.TUIChat.SERVICE.METHOD.SEND_TEXT_MESSAGE,
params: { payload }
});
};
const sendCustomMessage = (payload) => {
common_vendor.R.callService({
serviceName: common_vendor.E.TUIChat.SERVICE.NAME,
method: common_vendor.E.TUIChat.SERVICE.METHOD.SEND_CUSTOM_MESSAGE,
params: { payload }
});
};
return {
props,
sendTextMessage,
sendCustomMessage,
isCustomerServiceMessage: TUIKit_tuiCustomerServicePlugin_utils_index.isCustomerServiceMessage,
isMessageRating: TUIKit_tuiCustomerServicePlugin_utils_index.isMessageRating
};
}
};
if (!Array) {
const _component_MessageRating = common_vendor.resolveComponent("MessageRating");
const _component_MessageCustomerService = common_vendor.resolveComponent("MessageCustomerService");
(_component_MessageRating + _component_MessageCustomerService)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $setup.isMessageRating($setup.props.message)
}, $setup.isMessageRating($setup.props.message) ? {
b: common_vendor.o$1($setup.sendCustomMessage),
c: common_vendor.p({
message: $setup.props.message
})
} : $setup.isCustomerServiceMessage($setup.props.message) ? {
e: common_vendor.o$1($setup.sendTextMessage),
f: common_vendor.p({
message: $setup.props.message
})
} : {}, {
d: $setup.isCustomerServiceMessage($setup.props.message)
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/index.js.map

View File

@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"message-customer-service": "./components/message-customer-service",
"message-rating": "./components/message-rating/index"
}
}

View File

@@ -0,0 +1 @@
<view class="message-custom"><message-rating wx:if="{{a}}" bindsendMessage="{{b}}" u-i="0d18a251-0" bind:__l="__l" u-p="{{c}}"/><message-customer-service wx:elif="{{d}}" bindsendMessage="{{e}}" u-i="0d18a251-1" bind:__l="__l" u-p="{{f}}"/></view>

View File

@@ -0,0 +1,87 @@
"use strict";
var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
const common_vendor = require("../../common/vendor.js");
const TUIKit_tuiCustomerServicePlugin_utils_index = require("./utils/index.js");
const _TUICustomerServer = class _TUICustomerServer {
constructor() {
__publicField(this, "customerServiceAccounts");
common_vendor.index.__f__("log", "at TUIKit/tui-customer-service-plugin/server.ts:12", "TUICustomerServer.init ok");
common_vendor.R.registerService(common_vendor.E.TUICustomerServicePlugin.SERVICE.NAME, this);
common_vendor.R.registerExtension(common_vendor.E.TUIContact.EXTENSION.CONTACT_LIST.EXT_ID, this);
this.customerServiceAccounts = ["@customer_service_account"];
}
static getInstance() {
if (!_TUICustomerServer.instance) {
_TUICustomerServer.instance = new _TUICustomerServer();
}
return _TUICustomerServer.instance;
}
// Set customer service number
setCustomerServiceAccounts(accounts) {
this.customerServiceAccounts = accounts;
}
// Obtain customer service number
getCustomerServiceAccounts() {
return this.customerServiceAccounts;
}
// Determine if the current session is a customer service session
isCustomerConversation(conversationID) {
const userID = conversationID && conversationID.slice(3) || "";
return this.customerServiceAccounts.indexOf(userID) > -1;
}
// Determine if the current message is a customer service message
isCustomerServicePluginMessage(message) {
if (!message || !this.isCustomerConversation(message.conversationID)) {
return false;
}
return TUIKit_tuiCustomerServicePlugin_utils_index.isCustomerServiceMessage(message) || TUIKit_tuiCustomerServicePlugin_utils_index.isMessageInvisible(message);
}
onGetExtension(extensionID) {
if (extensionID === common_vendor.E.TUIContact.EXTENSION.CONTACT_LIST.EXT_ID) {
return [
{
weight: 0,
icon: "",
text: "客服号",
data: {
name: "customer",
accountList: this.customerServiceAccounts
}
}
];
}
}
onCall(method, params) {
switch (method) {
case common_vendor.E.TUICustomerServicePlugin.SERVICE.METHOD.ACTIVE_CONVERSATION:
if (this.isCustomerConversation(params.conversationID)) {
common_vendor.R.callService({
serviceName: common_vendor.E.TUIChat.SERVICE.NAME,
method: common_vendor.E.TUIChat.SERVICE.METHOD.SET_CHAT_TYPE,
params: { chatType: "customerService" }
});
common_vendor.R.callService({
serviceName: common_vendor.E.TUIChat.SERVICE.NAME,
method: common_vendor.E.TUIChat.SERVICE.METHOD.SEND_CUSTOM_MESSAGE,
params: {
to: params.conversationID.slice(3),
conversationType: "C2C",
payload: {
data: JSON.stringify({ src: "7", customerServicePlugin: 0 })
}
}
});
}
break;
}
}
};
__publicField(_TUICustomerServer, "instance");
let TUICustomerServer = _TUICustomerServer;
exports.TUICustomerServer = TUICustomerServer;
//# sourceMappingURL=../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/server.js.map

View File

@@ -0,0 +1,8 @@
"use strict";
const common_vendor = require("../../../common/vendor.js");
common_vendor.g() === "pc";
common_vendor.g() === "h5";
common_vendor.g() === "wechat";
const isApp = common_vendor.g() === "app";
exports.isApp = isApp;
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/utils/env.js.map

View File

@@ -0,0 +1,56 @@
"use strict";
const TUIKit_tuiCustomerServicePlugin_constant = require("../constant.js");
function isJSON(str) {
if (typeof str === "string") {
try {
const data = JSON.parse(str);
if (data) {
return true;
}
return false;
} catch (error) {
return false;
}
}
return false;
}
function JSONToObject(str) {
if (!isJSON(str)) {
return str;
}
return JSON.parse(str);
}
function isCustomerServiceMessage(message) {
var _a;
const customerServicePayload = JSONToObject((_a = message == null ? void 0 : message.payload) == null ? void 0 : _a.data);
return Number(customerServicePayload == null ? void 0 : customerServicePayload.customerServicePlugin) === 0 || Number(customerServicePayload == null ? void 0 : customerServicePayload.chatbotPlugin) === 1;
}
const isMessageRating = (message) => {
var _a;
const customerServicePayload = JSONToObject((_a = message == null ? void 0 : message.payload) == null ? void 0 : _a.data);
return isCustomerServiceMessage(message) && customerServicePayload.src === TUIKit_tuiCustomerServicePlugin_constant.CUSTOM_MESSAGE_SRC.MENU;
};
const isMessageInvisible = (message) => {
var _a, _b;
const customerServicePayload = JSONToObject((_a = message == null ? void 0 : message.payload) == null ? void 0 : _a.data);
const robotCommandArray = ["feedback", "updateBotStatus"];
const whiteList = [
TUIKit_tuiCustomerServicePlugin_constant.CUSTOM_MESSAGE_SRC.MENU,
TUIKit_tuiCustomerServicePlugin_constant.CUSTOM_MESSAGE_SRC.BRANCH,
TUIKit_tuiCustomerServicePlugin_constant.CUSTOM_MESSAGE_SRC.BRANCH_NUMBER,
TUIKit_tuiCustomerServicePlugin_constant.CUSTOM_MESSAGE_SRC.FROM_INPUT,
TUIKit_tuiCustomerServicePlugin_constant.CUSTOM_MESSAGE_SRC.PRODUCT_CARD,
TUIKit_tuiCustomerServicePlugin_constant.CUSTOM_MESSAGE_SRC.ROBOT_MSG,
TUIKit_tuiCustomerServicePlugin_constant.CUSTOM_MESSAGE_SRC.RICH_TEXT,
TUIKit_tuiCustomerServicePlugin_constant.CUSTOM_MESSAGE_SRC.STREAM_TEXT
];
const isCustomerMessage = (message == null ? void 0 : message.type) === TUIKit_tuiCustomerServicePlugin_constant.TYPES.MSG_CUSTOM;
const isCustomerInvisible = (customerServicePayload == null ? void 0 : customerServicePayload.src) && !whiteList.includes(customerServicePayload == null ? void 0 : customerServicePayload.src);
const isRobot = (customerServicePayload == null ? void 0 : customerServicePayload.src) === TUIKit_tuiCustomerServicePlugin_constant.CUSTOM_MESSAGE_SRC.ROBOT && robotCommandArray.indexOf((_b = customerServicePayload == null ? void 0 : customerServicePayload.content) == null ? void 0 : _b.command) !== -1;
return isCustomerMessage && (isCustomerInvisible || isRobot);
};
exports.JSONToObject = JSONToObject;
exports.isCustomerServiceMessage = isCustomerServiceMessage;
exports.isMessageInvisible = isMessageInvisible;
exports.isMessageRating = isMessageRating;
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/utils/index.js.map