@tuotoo/kiwi-pc-plugin-toolbar 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -35920,7 +35920,10 @@ const _hoisted_15 = { class: "call-type" };
35920
35920
  const _hoisted_16 = { class: "call-duration" };
35921
35921
  const _hoisted_17 = { class: "popup-actions" };
35922
35922
  const _hoisted_18 = { class: "warning-tips" };
35923
- const _hoisted_19 = { class: "call-plugin-customer-container" };
35923
+ const _hoisted_19 = {
35924
+ key: 0,
35925
+ class: "call-plugin-customer-container"
35926
+ };
35924
35927
  const _hoisted_20 = { class: "call-plugin-customer-header" };
35925
35928
  const _hoisted_21 = {
35926
35929
  key: 0,
@@ -36023,6 +36026,10 @@ const _sfc_main = {
36023
36026
  type: Boolean,
36024
36027
  default: false
36025
36028
  },
36029
+ showCustomerInfo: {
36030
+ type: Boolean,
36031
+ default: false
36032
+ },
36026
36033
  onPluginReady: Function,
36027
36034
  onCallSuccess: Function,
36028
36035
  onMessage: Function,
@@ -36100,8 +36107,12 @@ const _sfc_main = {
36100
36107
  break;
36101
36108
  }
36102
36109
  if (showCallMsg.value) className += " show-call-msg";
36110
+ if (props.showCustomerInfo) className += " show-customer-info";
36103
36111
  return className;
36104
36112
  });
36113
+ const popupWidth = computed(() => {
36114
+ return props.showCustomerInfo ? 900 : 441;
36115
+ });
36105
36116
  onMounted(async () => {
36106
36117
  initDeviceData();
36107
36118
  await getEmployeeInfo();
@@ -36155,6 +36166,7 @@ const _sfc_main = {
36155
36166
  case "Error":
36156
36167
  case "SeatBusy":
36157
36168
  case "CallUnexpected":
36169
+ case "InsufficientBalance":
36158
36170
  showError.value = true;
36159
36171
  closeMsg.value = e.msg;
36160
36172
  initData();
@@ -36274,14 +36286,15 @@ const _sfc_main = {
36274
36286
  }
36275
36287
  const callPopupRect = callDom.getBoundingClientRect();
36276
36288
  const { innerWidth } = window;
36289
+ const maxW = popupWidth.value + 20;
36277
36290
  if (props.popupPosition.includes("left")) {
36278
- if (innerWidth - callPopupRect.left < 920) {
36279
- x2 = innerWidth - 900 - 40;
36291
+ if (innerWidth - callPopupRect.left < maxW) {
36292
+ x2 = innerWidth - popupWidth.value - 40;
36280
36293
  callDom.style.transform = `translate(${x2}px, ${y}px)`;
36281
36294
  }
36282
36295
  } else if (props.popupPosition.includes("right")) {
36283
- if (callPopupRect.right < 920) {
36284
- x2 = 900 + 40 - innerWidth;
36296
+ if (callPopupRect.right < maxW) {
36297
+ x2 = popupWidth.value + 40 - innerWidth;
36285
36298
  callDom.style.transform = `translate(${x2}px, ${y}px)`;
36286
36299
  }
36287
36300
  }
@@ -36380,6 +36393,7 @@ const _sfc_main = {
36380
36393
  });
36381
36394
  };
36382
36395
  const realGetCustomerDetail = async () => {
36396
+ if (!props.showCustomerInfo) return;
36383
36397
  if (!callerInfo.value.OriginalMobile) return;
36384
36398
  await axios.get(apiHost.value + `/company/${props.initConfig.companyID}/call/customer?mobile=${callerInfo.value.OriginalMobile}`, {
36385
36399
  headers: {
@@ -36651,7 +36665,7 @@ const _sfc_main = {
36651
36665
  }),
36652
36666
  _cache[36] || (_cache[36] = createTextVNode(" 通话结束后,当前弹窗将自动关闭,请尽快操作 ", -1))
36653
36667
  ]),
36654
- createBaseVNode("div", _hoisted_19, [
36668
+ props.showCustomerInfo ? (openBlock(), createElementBlock("div", _hoisted_19, [
36655
36669
  createBaseVNode("div", _hoisted_20, [
36656
36670
  _cache[37] || (_cache[37] = createTextVNode(" 客户详情 ", -1)),
36657
36671
  customerDetail.value.ID ? (openBlock(), createElementBlock("div", _hoisted_21, [
@@ -36678,7 +36692,7 @@ const _sfc_main = {
36678
36692
  initConfig: props.initConfig,
36679
36693
  onRefreshCustomerDetail: realGetCustomerDetail
36680
36694
  }, null, 8, ["CustomerDetail", "initConfig"])) : createCommentVNode("", true)
36681
- ]),
36695
+ ])) : createCommentVNode("", true),
36682
36696
  createBaseVNode("div", _hoisted_22, [
36683
36697
  _cache[41] || (_cache[41] = createBaseVNode("div", { class: "call-plugin-record-header" }, " 通话详情 ", -1)),
36684
36698
  createBaseVNode("div", {
@@ -36947,6 +36961,8 @@ class CallPluginWrapper {
36947
36961
  // 是否显示SIP列表
36948
36962
  showRobotList: false,
36949
36963
  // 是否显示话术列表
36964
+ showCustomerInfo: false,
36965
+ // 是否显示客户信息
36950
36966
  initConfig: {
36951
36967
  // companyID: '',
36952
36968
  // employeeID: '',
@@ -36976,6 +36992,7 @@ class CallPluginWrapper {
36976
36992
  showSeatStatus: this.options.showSeatStatus,
36977
36993
  showSipList: this.options.showSipList,
36978
36994
  showRobotList: this.options.showRobotList,
36995
+ showCustomerInfo: this.options.showCustomerInfo,
36979
36996
  onPluginReady: this.options.onPluginReady,
36980
36997
  onMessage: this.options.onMessage,
36981
36998
  onCallSuccess: this.options.onCallSuccess,
@@ -36991,9 +37008,11 @@ class CallPluginWrapper {
36991
37008
  showCallOut(mobile) {
36992
37009
  this.instance.openCallerInfoDialog(mobile);
36993
37010
  }
37011
+ offline() {
37012
+ if (this.options.showSeatStatus) this.instance.toggleSeatStatus("offline");
37013
+ }
36994
37014
  // 公共方法:销毁插件
36995
37015
  destroy() {
36996
- if (this.options.showSeatStatus) this.instance.toggleSeatStatus("offline");
36997
37016
  this.app.unmount();
36998
37017
  this.container.innerHTML = "";
36999
37018
  }