@phonghq/go-chat 1.0.44 → 1.0.45
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PAGE_RESPONSIVE } from '../types/chat/global';
|
|
2
2
|
export declare const responsiveObserver: import("vue").Ref<PAGE_RESPONSIVE, PAGE_RESPONSIVE>;
|
|
3
|
-
export declare function useListenEvent(): {
|
|
3
|
+
export declare function useListenEvent(callBackResizeChange?: (data?: any) => void): {
|
|
4
4
|
getResponsiveObserver: () => void;
|
|
5
5
|
};
|
package/dist/go-chat.es.js
CHANGED
|
@@ -67584,22 +67584,22 @@ const UW = /* @__PURE__ */ Pt(DW, [["render", LW]]), BW = { class: "flex flex-co
|
|
|
67584
67584
|
]));
|
|
67585
67585
|
}
|
|
67586
67586
|
}), sr = _e("tablet");
|
|
67587
|
-
function FW() {
|
|
67587
|
+
function FW(e) {
|
|
67588
67588
|
Mi(() => {
|
|
67589
|
-
window.addEventListener("resize",
|
|
67589
|
+
window.addEventListener("resize", t);
|
|
67590
67590
|
}), wo(() => {
|
|
67591
|
-
window.removeEventListener("resize",
|
|
67591
|
+
window.removeEventListener("resize", t);
|
|
67592
67592
|
});
|
|
67593
|
-
const
|
|
67594
|
-
const
|
|
67595
|
-
if (!
|
|
67596
|
-
const
|
|
67597
|
-
|
|
67598
|
-
},
|
|
67599
|
-
|
|
67593
|
+
const n = () => {
|
|
67594
|
+
const i = document.getElementById("appChatMain");
|
|
67595
|
+
if (!i) return;
|
|
67596
|
+
const o = (i == null ? void 0 : i.offsetWidth) ?? 0;
|
|
67597
|
+
o >= 1180 ? sr.value != "window" && (e == null || e(), sr.value = "window") : o >= 640 ? sr.value != "tablet" && (e == null || e(), sr.value = "tablet") : sr.value != "mobile" && (e == null || e(), wn.value == ut.HOME && (wn.value = ut.CHAT_LIST), sr.value = "mobile");
|
|
67598
|
+
}, t = fs(() => {
|
|
67599
|
+
n();
|
|
67600
67600
|
}, 50);
|
|
67601
67601
|
return {
|
|
67602
|
-
getResponsiveObserver:
|
|
67602
|
+
getResponsiveObserver: n
|
|
67603
67603
|
};
|
|
67604
67604
|
}
|
|
67605
67605
|
const qW = {
|
|
@@ -67695,80 +67695,81 @@ const qW = {
|
|
|
67695
67695
|
backTitle: "Checkins"
|
|
67696
67696
|
}
|
|
67697
67697
|
];
|
|
67698
|
-
}), r = e, s = t,
|
|
67698
|
+
}), r = e, s = t, u = (b) => {
|
|
67699
|
+
var C, M;
|
|
67700
|
+
b != null && b.conversation_id ? (C = E.value) == null || C.initData({
|
|
67701
|
+
conversation_id: b == null ? void 0 : b.conversation_id,
|
|
67702
|
+
is_unknown: (b == null ? void 0 : b.is_unknown) || "0"
|
|
67703
|
+
}) : (M = E.value) == null || M.initData();
|
|
67704
|
+
}, { initPage: l } = x$(), { getResponsiveObserver: d } = FW(u);
|
|
67699
67705
|
Mi(() => {
|
|
67700
|
-
|
|
67706
|
+
d(), r.isLib && (kK(), O());
|
|
67701
67707
|
}), wo(() => {
|
|
67702
67708
|
});
|
|
67703
|
-
const
|
|
67709
|
+
const c = Te(() => _.value === "mobile" ? o.value.find((b) => b.id == wn.value) : i.find((b) => b.id == wn.value)), _ = Te(() => r.response == "mobile" ? r.response : sr.value), f = Te(() => {
|
|
67704
67710
|
var b, C, M, N;
|
|
67705
|
-
return (((C = (b =
|
|
67711
|
+
return (((C = (b = E.value) == null ? void 0 : b.listConversationsAll) == null ? void 0 : C.reduce(
|
|
67706
67712
|
(w, U) => w + ((U == null ? void 0 : U.unread_count) ?? 0),
|
|
67707
67713
|
0
|
|
67708
|
-
)) ?? 0) + (((N = (M =
|
|
67714
|
+
)) ?? 0) + (((N = (M = E.value) == null ? void 0 : M.listConversationsUnknown) == null ? void 0 : N.reduce(
|
|
67709
67715
|
(w, U) => w + ((U == null ? void 0 : U.unread_count) ?? 0),
|
|
67710
67716
|
0
|
|
67711
67717
|
)) ?? 0);
|
|
67712
|
-
}), f = Te(() => {
|
|
67713
|
-
var b, C;
|
|
67714
|
-
return ((b = h.value) == null ? void 0 : b.listConversationsAll.find((M) => M.receiver_id == m.value)) ?? ((C = h.value) == null ? void 0 : C.listConversationsUnknown.find((M) => M.receiver_id == m.value)) ?? null;
|
|
67715
67718
|
}), a = Te(() => {
|
|
67719
|
+
var b, C;
|
|
67720
|
+
return ((b = E.value) == null ? void 0 : b.listConversationsAll.find((M) => M.receiver_id == y.value)) ?? ((C = E.value) == null ? void 0 : C.listConversationsUnknown.find((M) => M.receiver_id == y.value)) ?? null;
|
|
67721
|
+
}), p = Te(() => {
|
|
67716
67722
|
var b;
|
|
67717
|
-
return ((b =
|
|
67718
|
-
}),
|
|
67723
|
+
return ((b = m.value) == null ? void 0 : b.callStatus) ?? null;
|
|
67724
|
+
}), v = _e(), m = _e(null), y = _e(null), g = _e(null), h = _e(null), E = _e(null), I = _e(null), T = async (b) => {
|
|
67719
67725
|
var C, M;
|
|
67720
|
-
(
|
|
67721
|
-
},
|
|
67726
|
+
(y.value != (b == null ? void 0 : b.receiver_id) || _.value === "mobile") && (wn.value != ut.HOME && zn(ut.HOME), y.value = b == null ? void 0 : b.receiver_id, await Qn(), (C = E.value) == null || C.handleReadMessage(), (M = h.value) == null || M.getData(b));
|
|
67727
|
+
}, A = (b) => {
|
|
67722
67728
|
var C, M;
|
|
67723
|
-
((C = Ue.value) == null ? void 0 : C.user_type) == "tenant" && (
|
|
67724
|
-
},
|
|
67725
|
-
var
|
|
67726
|
-
await
|
|
67727
|
-
|
|
67728
|
-
var b;
|
|
67729
|
-
(b = E.value) == null || b.open();
|
|
67729
|
+
((C = Ue.value) == null ? void 0 : C.user_type) == "tenant" && (m.value ? (M = m.value) == null || M.startCall(b) : s("call", b));
|
|
67730
|
+
}, O = async () => {
|
|
67731
|
+
var C, M;
|
|
67732
|
+
const b = await l({ props: r, responsive: _.value });
|
|
67733
|
+
!((C = Ue.value) != null && C.tenant_phone) && ((M = Ue.value) == null ? void 0 : M.user_type) == "tenant" && (s("error:noPhoneTenant"), zn(ut.NOT_TENANT_PHONE)), u(b);
|
|
67730
67734
|
}, D = () => {
|
|
67731
67735
|
var b;
|
|
67732
|
-
(b =
|
|
67733
|
-
}, B = (
|
|
67734
|
-
var
|
|
67735
|
-
b
|
|
67736
|
-
conversation_id: b == null ? void 0 : b.conversation_id,
|
|
67737
|
-
is_unknown: (b == null ? void 0 : b.is_unknown) || "0"
|
|
67738
|
-
}) : (M = h.value) == null || M.initData();
|
|
67736
|
+
(b = I.value) == null || b.open();
|
|
67737
|
+
}, B = () => {
|
|
67738
|
+
var b;
|
|
67739
|
+
(b = E.value) == null || b.handleReadMessage();
|
|
67739
67740
|
};
|
|
67740
67741
|
return n({
|
|
67741
67742
|
get unreadCount() {
|
|
67742
|
-
return
|
|
67743
|
+
return f.value;
|
|
67743
67744
|
},
|
|
67744
67745
|
get callStatus() {
|
|
67745
|
-
return
|
|
67746
|
+
return p.value;
|
|
67746
67747
|
},
|
|
67747
67748
|
get callLabel() {
|
|
67748
67749
|
var b;
|
|
67749
|
-
return ((b =
|
|
67750
|
+
return ((b = m.value) == null ? void 0 : b.label) ?? "";
|
|
67750
67751
|
},
|
|
67751
67752
|
getUserRemote: () => {
|
|
67752
67753
|
var b;
|
|
67753
|
-
return ((b =
|
|
67754
|
+
return ((b = m.value) == null ? void 0 : b.userRemoter) ?? null;
|
|
67754
67755
|
},
|
|
67755
67756
|
startCall: async () => {
|
|
67756
67757
|
var b;
|
|
67757
|
-
await ((b =
|
|
67758
|
+
await ((b = m.value) == null ? void 0 : b.answer());
|
|
67758
67759
|
},
|
|
67759
67760
|
endCall: () => {
|
|
67760
67761
|
var b;
|
|
67761
|
-
return (b =
|
|
67762
|
+
return (b = m.value) == null ? void 0 : b.endCall();
|
|
67762
67763
|
},
|
|
67763
|
-
openSettings:
|
|
67764
|
-
initData: (b) =>
|
|
67764
|
+
openSettings: D,
|
|
67765
|
+
initData: (b) => u(b)
|
|
67765
67766
|
}), (b, C) => {
|
|
67766
67767
|
var M, N, w, U, V;
|
|
67767
67768
|
return ie(), de("div", {
|
|
67768
67769
|
class: "go-chat-main max-w-full",
|
|
67769
67770
|
id: "appChatMain",
|
|
67770
67771
|
ref_key: "appChatRef",
|
|
67771
|
-
ref:
|
|
67772
|
+
ref: v
|
|
67772
67773
|
}, [
|
|
67773
67774
|
te(nu) ? te(wn) == te(ut).TENANT_ERROR ? (ie(), Be(k$, {
|
|
67774
67775
|
key: 1,
|
|
@@ -67776,28 +67777,28 @@ const qW = {
|
|
|
67776
67777
|
})) : te(wn) == te(ut).REGISTER_TENANT ? (ie(), Be(xW, { key: 2 })) : te(wn) == te(ut).REGISTER_SUCCESS ? (ie(), Be(UW, { key: 3 })) : te(wn) == te(ut).NOT_TENANT_PHONE ? (ie(), Be(jW, {
|
|
67777
67778
|
key: 4,
|
|
67778
67779
|
"is-lib": r.isLib,
|
|
67779
|
-
onTryAgain: C[0] || (C[0] = (P) =>
|
|
67780
|
+
onTryAgain: C[0] || (C[0] = (P) => O())
|
|
67780
67781
|
}, null, 8, ["is-lib"])) : (ie(), de("div", VW, [
|
|
67781
67782
|
ne("div", GW, [
|
|
67782
67783
|
b.isLib ? (ie(), Be(mW, {
|
|
67783
67784
|
key: 0,
|
|
67784
67785
|
ref_key: "callingRef",
|
|
67785
|
-
ref:
|
|
67786
|
+
ref: m,
|
|
67786
67787
|
onUserCalling: C[1] || (C[1] = (P) => s("userCalling", P)),
|
|
67787
|
-
responsive:
|
|
67788
|
+
responsive: _.value
|
|
67788
67789
|
}, null, 8, ["responsive"])) : ct("", !0),
|
|
67789
|
-
|
|
67790
|
+
_.value == "mobile" ? (ie(), de("div", HW, [
|
|
67790
67791
|
ne("div", zW, [
|
|
67791
67792
|
ne("div", YW, [
|
|
67792
|
-
(M =
|
|
67793
|
+
(M = c.value) != null && M.backFunc && !((N = c.value) != null && N.isHidden) ? (ie(), de("button", {
|
|
67793
67794
|
key: 0,
|
|
67794
67795
|
class: "flex items-center",
|
|
67795
|
-
onClick: C[2] || (C[2] = (P) =>
|
|
67796
|
+
onClick: C[2] || (C[2] = (P) => c.value.backFunc())
|
|
67796
67797
|
}, [
|
|
67797
67798
|
Ge(H_),
|
|
67798
67799
|
ne("div", KW, [
|
|
67799
|
-
ne("p", $W, nt(
|
|
67800
|
-
ne("p", WW, nt(
|
|
67800
|
+
ne("p", $W, nt(c.value.backTitle ?? ""), 1),
|
|
67801
|
+
ne("p", WW, nt(c.value.subTitle ?? ""), 1)
|
|
67801
67802
|
])
|
|
67802
67803
|
])) : ((w = te(Ue)) == null ? void 0 : w.user_type) == "tenant" ? (ie(), de("div", QW, [
|
|
67803
67804
|
C[9] || (C[9] = Iu(" 🏢 ")),
|
|
@@ -67817,38 +67818,38 @@ const qW = {
|
|
|
67817
67818
|
ne("div", eQ, [
|
|
67818
67819
|
tn(Ge(rm, {
|
|
67819
67820
|
ref_key: "chatListRef",
|
|
67820
|
-
ref:
|
|
67821
|
+
ref: E,
|
|
67821
67822
|
class: "w-full max-w-[500px] !bg-[#F9FAFC]",
|
|
67822
|
-
responsive:
|
|
67823
|
-
onSelectReceiver:
|
|
67824
|
-
"receiver-id":
|
|
67825
|
-
"onUpdate:receiverId": C[4] || (C[4] = (P) =>
|
|
67823
|
+
responsive: _.value,
|
|
67824
|
+
onSelectReceiver: T,
|
|
67825
|
+
"receiver-id": y.value,
|
|
67826
|
+
"onUpdate:receiverId": C[4] || (C[4] = (P) => y.value = P)
|
|
67826
67827
|
}, null, 8, ["responsive", "receiver-id"]), [
|
|
67827
67828
|
[Bn, te(wn) == te(ut).CHAT_LIST]
|
|
67828
67829
|
]),
|
|
67829
67830
|
tn(Ge(bm, {
|
|
67830
67831
|
ref_key: "homeComponentRef",
|
|
67831
|
-
ref:
|
|
67832
|
-
"receiver-id":
|
|
67832
|
+
ref: h,
|
|
67833
|
+
"receiver-id": y.value,
|
|
67833
67834
|
class: "h-full",
|
|
67834
|
-
onCall:
|
|
67835
|
+
onCall: A,
|
|
67835
67836
|
onBack: C[5] || (C[5] = (P) => {
|
|
67836
67837
|
var L, q;
|
|
67837
|
-
return (q = (L =
|
|
67838
|
+
return (q = (L = c.value).backFunc) == null ? void 0 : q.call(L);
|
|
67838
67839
|
}),
|
|
67839
|
-
onInputFocus:
|
|
67840
|
-
conversation:
|
|
67841
|
-
responsive:
|
|
67840
|
+
onInputFocus: B,
|
|
67841
|
+
conversation: a.value,
|
|
67842
|
+
responsive: _.value
|
|
67842
67843
|
}, null, 8, ["receiver-id", "conversation", "responsive"]), [
|
|
67843
67844
|
[Bn, te(wn) == te(ut).HOME]
|
|
67844
67845
|
]),
|
|
67845
67846
|
te(wn) == te(ut).CUSTOMER_DETAIL ? (ie(), Be(Sm, {
|
|
67846
67847
|
key: 0,
|
|
67847
67848
|
ref_key: "customerDetailRef",
|
|
67848
|
-
ref:
|
|
67849
|
-
"receiver-id":
|
|
67849
|
+
ref: g,
|
|
67850
|
+
"receiver-id": y.value,
|
|
67850
67851
|
class: "w-full h-full",
|
|
67851
|
-
responsive:
|
|
67852
|
+
responsive: _.value
|
|
67852
67853
|
}, null, 8, ["receiver-id", "responsive"])) : ct("", !0),
|
|
67853
67854
|
te(wn) == te(ut).CUSTOMER_CHECK_IN ? (ie(), Be(Im, {
|
|
67854
67855
|
key: 1,
|
|
@@ -67862,44 +67863,44 @@ const qW = {
|
|
|
67862
67863
|
])) : (ie(), de("div", tQ, [
|
|
67863
67864
|
Ge(rm, {
|
|
67864
67865
|
ref_key: "chatListRef",
|
|
67865
|
-
ref:
|
|
67866
|
+
ref: E,
|
|
67866
67867
|
class: "w-[38%] max-w-[500px] min-w-[300px] xl:min-w-[450px] border-r layout-border",
|
|
67867
|
-
responsive:
|
|
67868
|
-
onSelectReceiver:
|
|
67868
|
+
responsive: _.value,
|
|
67869
|
+
onSelectReceiver: T,
|
|
67869
67870
|
onOpenPhoneNumpad: C[6] || (C[6] = (P) => s("openPhoneNumpad")),
|
|
67870
|
-
"receiver-id":
|
|
67871
|
-
"onUpdate:receiverId": C[7] || (C[7] = (P) =>
|
|
67871
|
+
"receiver-id": y.value,
|
|
67872
|
+
"onUpdate:receiverId": C[7] || (C[7] = (P) => y.value = P)
|
|
67872
67873
|
}, null, 8, ["responsive", "receiver-id"]),
|
|
67873
67874
|
ne("div", nQ, [
|
|
67874
|
-
(V =
|
|
67875
|
+
(V = c.value) != null && V.backFunc ? (ie(), de("div", iQ, [
|
|
67875
67876
|
ne("button", {
|
|
67876
67877
|
class: "flex items-center",
|
|
67877
|
-
onClick: C[8] || (C[8] = (P) =>
|
|
67878
|
+
onClick: C[8] || (C[8] = (P) => c.value.backFunc())
|
|
67878
67879
|
}, [
|
|
67879
67880
|
Ge(H_),
|
|
67880
|
-
ne("span", oQ, nt(
|
|
67881
|
+
ne("span", oQ, nt(c.value.backTitle ?? ""), 1)
|
|
67881
67882
|
])
|
|
67882
67883
|
])) : ct("", !0),
|
|
67883
67884
|
ne("div", rQ, [
|
|
67884
67885
|
tn(Ge(bm, {
|
|
67885
67886
|
ref_key: "homeComponentRef",
|
|
67886
|
-
ref:
|
|
67887
|
-
"receiver-id":
|
|
67887
|
+
ref: h,
|
|
67888
|
+
"receiver-id": y.value,
|
|
67888
67889
|
class: "h-full",
|
|
67889
|
-
onCall:
|
|
67890
|
-
onInputFocus:
|
|
67891
|
-
responsive:
|
|
67892
|
-
conversation:
|
|
67890
|
+
onCall: A,
|
|
67891
|
+
onInputFocus: B,
|
|
67892
|
+
responsive: _.value,
|
|
67893
|
+
conversation: a.value
|
|
67893
67894
|
}, null, 8, ["receiver-id", "responsive", "conversation"]), [
|
|
67894
|
-
[Bn, te(wn) == te(ut).HOME &&
|
|
67895
|
+
[Bn, te(wn) == te(ut).HOME && y.value]
|
|
67895
67896
|
]),
|
|
67896
67897
|
te(wn) == te(ut).CUSTOMER_DETAIL ? (ie(), Be(Sm, {
|
|
67897
67898
|
key: 0,
|
|
67898
67899
|
ref_key: "customerDetailRef",
|
|
67899
|
-
ref:
|
|
67900
|
-
"receiver-id":
|
|
67900
|
+
ref: g,
|
|
67901
|
+
"receiver-id": y.value,
|
|
67901
67902
|
class: "h-full",
|
|
67902
|
-
responsive:
|
|
67903
|
+
responsive: _.value
|
|
67903
67904
|
}, null, 8, ["receiver-id", "responsive"])) : ct("", !0),
|
|
67904
67905
|
te(wn) == te(ut).CUSTOMER_CHECK_IN ? (ie(), Be(Im, {
|
|
67905
67906
|
key: 1,
|
package/dist/go-chat.umd.js
CHANGED
|
@@ -22,4 +22,4 @@
|
|
|
22
22
|
c-.176-.414-.027-.888.326-1.153l1.293-.97
|
|
23
23
|
c.39-.293.563-.795.417-1.173L6.66 3.102
|
|
24
24
|
A1.125 1.125 0 0 0 5.569 2.25H3.5
|
|
25
|
-
A1.25 1.25 0 0 0 2.25 3.5v3.25z"></path></svg></div><h2 class="mt-4 text-3xl font-semibold text-gray-700">No Tenant Phone Found</h2><p class="mt-1 text-xl text-chat-haze-500 max-w-[700px]"> There is currently no phone number configured for this tenant. </p>`,3)),v.createElementVNode("button",{class:"mt-6 px-4 py-2 rounded-xl h-14 w-[150px] bg-chat-primary text-white text-lg font-semibold hover:bg-blue-700 transition",onClick:s[0]||(s[0]=u=>t())}," Try Again ")]))}}),Do=v.ref("tablet");function o$(){v.onMounted(()=>{window.addEventListener("resize",n)}),v.onUnmounted(()=>{window.removeEventListener("resize",n)});const e=()=>{const t=document.getElementById("appChatMain");if(!t)return;const i=(t==null?void 0:t.offsetWidth)??0;i>=1180?Do.value!="window"&&(Do.value="window"):i>=640?Do.value!="tablet"&&(Do.value="tablet"):Do.value!="mobile"&&(Xt.value==Xe.HOME&&(Xt.value=Xe.CHAT_LIST),Do.value="mobile")},n=Xo(()=>{e()},50);return{getResponsiveObserver:e}}const r$={key:0,class:"m-auto flex-center sc-full"},s$={key:5,class:"grow h-full overflow-hidden flex flex-col"},l$={class:"w-full grow flex overflow-hidden relative"},u$={key:1,class:"grow relative flex flex-col mx-auto w-full h-full bg-[#F9FAFC] overflow-hidden chat-mobile pt-4"},d$={class:"text-[#141B34] px-6 shrink-0"},c$={class:"flex items-center justify-between"},_$={class:"ml-3"},a$={class:"text-xl font-semibold text-left text-chat-haze-900"},f$={class:"text-sm font-medium text-chat-haze-900"},p$={key:1,class:"flex gap-2"},v$={class:"text-chat-haze-700"},m$={class:"font-medium text-gray-700"},h$={key:2},y$={class:"grow overflow-hidden"},g$={key:2,class:"flex h-full w-full relative"},E$={class:"bg-white grow flex flex-col h-full overflow-hidden"},T$={key:0,class:"text-[#141B34] px-6 mt-4"},S$={class:"text-xl font-semibold text-chat-haze-900 ml-3"},b$={class:"grow overflow-hidden"},I$=v.defineComponent({__name:"App",props:{token:{},id:{},domain:{},response:{default:"tablet"},isLib:{type:Boolean}},emits:["userCalling","close","openPhoneNumpad","error:noPhoneTenant","call"],setup(e,{expose:n,emit:t}){const i=[{id:Xe.HOME,backFunc:null,backTitle:""},{id:Xe.CUSTOMER_DETAIL,backFunc:()=>{wn(Xe.HOME)},backTitle:""},{id:Xe.CUSTOMER_APPOINTMENT,backFunc:()=>{wn(Xe.CUSTOMER_DETAIL)},backTitle:"Appointments"},{id:Xe.CUSTOMER_CHECK_IN,backFunc:()=>{wn(Xe.CUSTOMER_DETAIL)},backTitle:"Checkins"}],o=v.computed(()=>{var b,A;return[{id:Xe.CHAT_LIST,backFunc:r.isLib?void 0:()=>{CR()},backTitle:"Go Chat",subTitle:((b=Oe.value)==null?void 0:b.user_type)=="tenant"?so(((A=Oe.value)==null?void 0:A.tenant_phone)??""):""},{id:Xe.HOME,backFunc:()=>{wn(Xe.CHAT_LIST)},backTitle:"",isHidden:!0},{id:Xe.CUSTOMER_DETAIL,backFunc:()=>{wn(Xe.HOME)},backTitle:""},{id:Xe.CUSTOMER_APPOINTMENT,backFunc:()=>{wn(Xe.CUSTOMER_DETAIL)},backTitle:"Appointments"},{id:Xe.CUSTOMER_CHECK_IN,backFunc:()=>{wn(Xe.CUSTOMER_DETAIL)},backTitle:"Checkins"}]}),r=e,s=t,{initPage:u}=XY(),{getResponsiveObserver:l}=o$();v.onMounted(()=>{console.log("222222222222222222"),l(),r.isLib&&(tY(),R())}),v.onUnmounted(()=>{});const d=v.computed(()=>c.value==="mobile"?o.value.find(b=>b.id==Xt.value):i.find(b=>b.id==Xt.value)),c=v.computed(()=>r.response=="mobile"?r.response:Do.value),_=v.computed(()=>{var b,A,N,w;return(((A=(b=y.value)==null?void 0:b.listConversationsAll)==null?void 0:A.reduce((x,B)=>x+((B==null?void 0:B.unread_count)??0),0))??0)+(((w=(N=y.value)==null?void 0:N.listConversationsUnknown)==null?void 0:w.reduce((x,B)=>x+((B==null?void 0:B.unread_count)??0),0))??0)}),a=v.computed(()=>{var b,A;return((b=y.value)==null?void 0:b.listConversationsAll.find(N=>N.receiver_id==h.value))??((A=y.value)==null?void 0:A.listConversationsUnknown.find(N=>N.receiver_id==h.value))??null}),f=v.computed(()=>{var b;return((b=m.value)==null?void 0:b.callStatus)??null}),p=v.ref(),m=v.ref(null),h=v.ref(null),g=v.ref(null),E=v.ref(null),y=v.ref(null),T=v.ref(null),C=async b=>{var A,N;(h.value!=(b==null?void 0:b.receiver_id)||c.value==="mobile")&&(Xt.value!=Xe.HOME&&wn(Xe.HOME),h.value=b==null?void 0:b.receiver_id,await v.nextTick(),(A=y.value)==null||A.handleReadMessage(),(N=E.value)==null||N.getData(b))},S=b=>{var A,N;((A=Oe.value)==null?void 0:A.user_type)=="tenant"&&(m.value?(N=m.value)==null||N.startCall(b):s("call",b))},R=async()=>{var b,A;await u({props:r,responsive:c.value}),!((b=Oe.value)!=null&&b.tenant_phone)&&((A=Oe.value)==null?void 0:A.user_type)=="tenant"&&(s("error:noPhoneTenant"),wn(Xe.NOT_TENANT_PHONE))},O=()=>{var b;(b=T.value)==null||b.open()},k=()=>{var b;(b=y.value)==null||b.handleReadMessage()},j=b=>{var A,N;b!=null&&b.conversation_id?(A=y.value)==null||A.initData({conversation_id:b==null?void 0:b.conversation_id,is_unknown:(b==null?void 0:b.is_unknown)||"0"}):(N=y.value)==null||N.initData()};return n({get unreadCount(){return _.value},get callStatus(){return f.value},get callLabel(){var b;return((b=m.value)==null?void 0:b.label)??""},getUserRemote:()=>{var b;return((b=m.value)==null?void 0:b.userRemoter)??null},startCall:async()=>{var b;await((b=m.value)==null?void 0:b.answer())},endCall:()=>{var b;return(b=m.value)==null?void 0:b.endCall()},openSettings:O,initData:b=>j(b)}),(b,A)=>{var N,w,x,B,G;return v.openBlock(),v.createElementBlock("div",{class:"go-chat-main max-w-full",id:"appChatMain",ref_key:"appChatRef",ref:p},[v.unref(bu)?v.unref(Xt)==v.unref(Xe).TENANT_ERROR?(v.openBlock(),v.createBlock(tK,{key:1,class:"mt-10"})):v.unref(Xt)==v.unref(Xe).REGISTER_TENANT?(v.openBlock(),v.createBlock(QK,{key:2})):v.unref(Xt)==v.unref(Xe).REGISTER_SUCCESS?(v.openBlock(),v.createBlock(t$,{key:3})):v.unref(Xt)==v.unref(Xe).NOT_TENANT_PHONE?(v.openBlock(),v.createBlock(i$,{key:4,"is-lib":r.isLib,onTryAgain:A[0]||(A[0]=D=>R())},null,8,["is-lib"])):(v.openBlock(),v.createElementBlock("div",s$,[v.createElementVNode("div",l$,[b.isLib?(v.openBlock(),v.createBlock(DK,{key:0,ref_key:"callingRef",ref:m,onUserCalling:A[1]||(A[1]=D=>s("userCalling",D)),responsive:c.value},null,8,["responsive"])):v.createCommentVNode("",!0),c.value=="mobile"?(v.openBlock(),v.createElementBlock("div",u$,[v.createElementVNode("div",d$,[v.createElementVNode("div",c$,[(N=d.value)!=null&&N.backFunc&&!((w=d.value)!=null&&w.isHidden)?(v.openBlock(),v.createElementBlock("button",{key:0,class:"flex items-center",onClick:A[2]||(A[2]=D=>d.value.backFunc())},[v.createVNode(A_),v.createElementVNode("div",_$,[v.createElementVNode("p",a$,v.toDisplayString(d.value.backTitle??""),1),v.createElementVNode("p",f$,v.toDisplayString(d.value.subTitle??""),1)])])):((x=v.unref(Oe))==null?void 0:x.user_type)=="tenant"?(v.openBlock(),v.createElementBlock("div",p$,[A[9]||(A[9]=v.createTextVNode(" 🏢 ")),v.createElementVNode("div",v$,[v.createElementVNode("div",m$,v.toDisplayString(v.unref(so)(((B=v.unref(Oe))==null?void 0:B.tenant_phone)??"")??""),1)])])):(v.openBlock(),v.createElementBlock("span",h$)),r.isLib?(v.openBlock(),v.createElementBlock("button",{key:3,class:"w-10 h-10",onClick:A[3]||(A[3]=D=>s("close"))},[v.createVNode(BK)])):v.createCommentVNode("",!0)])]),v.createElementVNode("div",y$,[v.withDirectives(v.createVNode(jM,{ref_key:"chatListRef",ref:y,class:"w-full max-w-[500px] !bg-[#F9FAFC]",responsive:c.value,onSelectReceiver:C,"receiver-id":h.value,"onUpdate:receiverId":A[4]||(A[4]=D=>h.value=D)},null,8,["responsive","receiver-id"]),[[v.vShow,v.unref(Xt)==v.unref(Xe).CHAT_LIST]]),v.withDirectives(v.createVNode(IN,{ref_key:"homeComponentRef",ref:E,"receiver-id":h.value,class:"h-full",onCall:S,onBack:A[5]||(A[5]=D=>{var U,q;return(q=(U=d.value).backFunc)==null?void 0:q.call(U)}),onInputFocus:k,conversation:a.value,responsive:c.value},null,8,["receiver-id","conversation","responsive"]),[[v.vShow,v.unref(Xt)==v.unref(Xe).HOME]]),v.unref(Xt)==v.unref(Xe).CUSTOMER_DETAIL?(v.openBlock(),v.createBlock(AN,{key:0,ref_key:"customerDetailRef",ref:g,"receiver-id":h.value,class:"w-full h-full",responsive:c.value},null,8,["receiver-id","responsive"])):v.createCommentVNode("",!0),v.unref(Xt)==v.unref(Xe).CUSTOMER_CHECK_IN?(v.openBlock(),v.createBlock(ON,{key:1,class:"w-full h-full"})):v.createCommentVNode("",!0),v.unref(Xt)==v.unref(Xe).CUSTOMER_APPOINTMENT?(v.openBlock(),v.createBlock(wN,{key:2,class:"w-full h-full"})):v.createCommentVNode("",!0)])])):(v.openBlock(),v.createElementBlock("div",g$,[v.createVNode(jM,{ref_key:"chatListRef",ref:y,class:"w-[38%] max-w-[500px] min-w-[300px] xl:min-w-[450px] border-r layout-border",responsive:c.value,onSelectReceiver:C,onOpenPhoneNumpad:A[6]||(A[6]=D=>s("openPhoneNumpad")),"receiver-id":h.value,"onUpdate:receiverId":A[7]||(A[7]=D=>h.value=D)},null,8,["responsive","receiver-id"]),v.createElementVNode("div",E$,[(G=d.value)!=null&&G.backFunc?(v.openBlock(),v.createElementBlock("div",T$,[v.createElementVNode("button",{class:"flex items-center",onClick:A[8]||(A[8]=D=>d.value.backFunc())},[v.createVNode(A_),v.createElementVNode("span",S$,v.toDisplayString(d.value.backTitle??""),1)])])):v.createCommentVNode("",!0),v.createElementVNode("div",b$,[v.withDirectives(v.createVNode(IN,{ref_key:"homeComponentRef",ref:E,"receiver-id":h.value,class:"h-full",onCall:S,onInputFocus:k,responsive:c.value,conversation:a.value},null,8,["receiver-id","responsive","conversation"]),[[v.vShow,v.unref(Xt)==v.unref(Xe).HOME&&h.value]]),v.unref(Xt)==v.unref(Xe).CUSTOMER_DETAIL?(v.openBlock(),v.createBlock(AN,{key:0,ref_key:"customerDetailRef",ref:g,"receiver-id":h.value,class:"h-full",responsive:c.value},null,8,["receiver-id","responsive"])):v.createCommentVNode("",!0),v.unref(Xt)==v.unref(Xe).CUSTOMER_CHECK_IN?(v.openBlock(),v.createBlock(ON,{key:1,class:"h-full"})):v.createCommentVNode("",!0),v.unref(Xt)==v.unref(Xe).CUSTOMER_APPOINTMENT?(v.openBlock(),v.createBlock(wN,{key:2,class:"h-full"})):v.createCommentVNode("",!0)])])])),v.renderSlot(b.$slots,"right")])])):(v.openBlock(),v.createElementBlock("div",r$,[v.createVNode(Y8)]))],512)}}});qi.PLIVO_CALL_STATUS=Fe,qi.default=I$,Object.defineProperties(qi,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
25
|
+
A1.25 1.25 0 0 0 2.25 3.5v3.25z"></path></svg></div><h2 class="mt-4 text-3xl font-semibold text-gray-700">No Tenant Phone Found</h2><p class="mt-1 text-xl text-chat-haze-500 max-w-[700px]"> There is currently no phone number configured for this tenant. </p>`,3)),v.createElementVNode("button",{class:"mt-6 px-4 py-2 rounded-xl h-14 w-[150px] bg-chat-primary text-white text-lg font-semibold hover:bg-blue-700 transition",onClick:s[0]||(s[0]=u=>t())}," Try Again ")]))}}),Do=v.ref("tablet");function o$(e){v.onMounted(()=>{window.addEventListener("resize",t)}),v.onUnmounted(()=>{window.removeEventListener("resize",t)});const n=()=>{const i=document.getElementById("appChatMain");if(!i)return;const o=(i==null?void 0:i.offsetWidth)??0;o>=1180?Do.value!="window"&&(e==null||e(),Do.value="window"):o>=640?Do.value!="tablet"&&(e==null||e(),Do.value="tablet"):Do.value!="mobile"&&(e==null||e(),Xt.value==Xe.HOME&&(Xt.value=Xe.CHAT_LIST),Do.value="mobile")},t=Xo(()=>{n()},50);return{getResponsiveObserver:n}}const r$={key:0,class:"m-auto flex-center sc-full"},s$={key:5,class:"grow h-full overflow-hidden flex flex-col"},l$={class:"w-full grow flex overflow-hidden relative"},u$={key:1,class:"grow relative flex flex-col mx-auto w-full h-full bg-[#F9FAFC] overflow-hidden chat-mobile pt-4"},d$={class:"text-[#141B34] px-6 shrink-0"},c$={class:"flex items-center justify-between"},_$={class:"ml-3"},a$={class:"text-xl font-semibold text-left text-chat-haze-900"},f$={class:"text-sm font-medium text-chat-haze-900"},p$={key:1,class:"flex gap-2"},v$={class:"text-chat-haze-700"},m$={class:"font-medium text-gray-700"},h$={key:2},y$={class:"grow overflow-hidden"},g$={key:2,class:"flex h-full w-full relative"},E$={class:"bg-white grow flex flex-col h-full overflow-hidden"},T$={key:0,class:"text-[#141B34] px-6 mt-4"},S$={class:"text-xl font-semibold text-chat-haze-900 ml-3"},b$={class:"grow overflow-hidden"},I$=v.defineComponent({__name:"App",props:{token:{},id:{},domain:{},response:{default:"tablet"},isLib:{type:Boolean}},emits:["userCalling","close","openPhoneNumpad","error:noPhoneTenant","call"],setup(e,{expose:n,emit:t}){const i=[{id:Xe.HOME,backFunc:null,backTitle:""},{id:Xe.CUSTOMER_DETAIL,backFunc:()=>{wn(Xe.HOME)},backTitle:""},{id:Xe.CUSTOMER_APPOINTMENT,backFunc:()=>{wn(Xe.CUSTOMER_DETAIL)},backTitle:"Appointments"},{id:Xe.CUSTOMER_CHECK_IN,backFunc:()=>{wn(Xe.CUSTOMER_DETAIL)},backTitle:"Checkins"}],o=v.computed(()=>{var b,A;return[{id:Xe.CHAT_LIST,backFunc:r.isLib?void 0:()=>{CR()},backTitle:"Go Chat",subTitle:((b=Oe.value)==null?void 0:b.user_type)=="tenant"?so(((A=Oe.value)==null?void 0:A.tenant_phone)??""):""},{id:Xe.HOME,backFunc:()=>{wn(Xe.CHAT_LIST)},backTitle:"",isHidden:!0},{id:Xe.CUSTOMER_DETAIL,backFunc:()=>{wn(Xe.HOME)},backTitle:""},{id:Xe.CUSTOMER_APPOINTMENT,backFunc:()=>{wn(Xe.CUSTOMER_DETAIL)},backTitle:"Appointments"},{id:Xe.CUSTOMER_CHECK_IN,backFunc:()=>{wn(Xe.CUSTOMER_DETAIL)},backTitle:"Checkins"}]}),r=e,s=t,u=b=>{var A,N;b!=null&&b.conversation_id?(A=T.value)==null||A.initData({conversation_id:b==null?void 0:b.conversation_id,is_unknown:(b==null?void 0:b.is_unknown)||"0"}):(N=T.value)==null||N.initData()},{initPage:l}=XY(),{getResponsiveObserver:d}=o$(u);v.onMounted(()=>{d(),r.isLib&&(tY(),O())}),v.onUnmounted(()=>{});const c=v.computed(()=>_.value==="mobile"?o.value.find(b=>b.id==Xt.value):i.find(b=>b.id==Xt.value)),_=v.computed(()=>r.response=="mobile"?r.response:Do.value),a=v.computed(()=>{var b,A,N,w;return(((A=(b=T.value)==null?void 0:b.listConversationsAll)==null?void 0:A.reduce((x,B)=>x+((B==null?void 0:B.unread_count)??0),0))??0)+(((w=(N=T.value)==null?void 0:N.listConversationsUnknown)==null?void 0:w.reduce((x,B)=>x+((B==null?void 0:B.unread_count)??0),0))??0)}),f=v.computed(()=>{var b,A;return((b=T.value)==null?void 0:b.listConversationsAll.find(N=>N.receiver_id==g.value))??((A=T.value)==null?void 0:A.listConversationsUnknown.find(N=>N.receiver_id==g.value))??null}),p=v.computed(()=>{var b;return((b=h.value)==null?void 0:b.callStatus)??null}),m=v.ref(),h=v.ref(null),g=v.ref(null),E=v.ref(null),y=v.ref(null),T=v.ref(null),C=v.ref(null),S=async b=>{var A,N;(g.value!=(b==null?void 0:b.receiver_id)||_.value==="mobile")&&(Xt.value!=Xe.HOME&&wn(Xe.HOME),g.value=b==null?void 0:b.receiver_id,await v.nextTick(),(A=T.value)==null||A.handleReadMessage(),(N=y.value)==null||N.getData(b))},R=b=>{var A,N;((A=Oe.value)==null?void 0:A.user_type)=="tenant"&&(h.value?(N=h.value)==null||N.startCall(b):s("call",b))},O=async()=>{var A,N;const b=await l({props:r,responsive:_.value});!((A=Oe.value)!=null&&A.tenant_phone)&&((N=Oe.value)==null?void 0:N.user_type)=="tenant"&&(s("error:noPhoneTenant"),wn(Xe.NOT_TENANT_PHONE)),u(b)},k=()=>{var b;(b=C.value)==null||b.open()},j=()=>{var b;(b=T.value)==null||b.handleReadMessage()};return n({get unreadCount(){return a.value},get callStatus(){return p.value},get callLabel(){var b;return((b=h.value)==null?void 0:b.label)??""},getUserRemote:()=>{var b;return((b=h.value)==null?void 0:b.userRemoter)??null},startCall:async()=>{var b;await((b=h.value)==null?void 0:b.answer())},endCall:()=>{var b;return(b=h.value)==null?void 0:b.endCall()},openSettings:k,initData:b=>u(b)}),(b,A)=>{var N,w,x,B,G;return v.openBlock(),v.createElementBlock("div",{class:"go-chat-main max-w-full",id:"appChatMain",ref_key:"appChatRef",ref:m},[v.unref(bu)?v.unref(Xt)==v.unref(Xe).TENANT_ERROR?(v.openBlock(),v.createBlock(tK,{key:1,class:"mt-10"})):v.unref(Xt)==v.unref(Xe).REGISTER_TENANT?(v.openBlock(),v.createBlock(QK,{key:2})):v.unref(Xt)==v.unref(Xe).REGISTER_SUCCESS?(v.openBlock(),v.createBlock(t$,{key:3})):v.unref(Xt)==v.unref(Xe).NOT_TENANT_PHONE?(v.openBlock(),v.createBlock(i$,{key:4,"is-lib":r.isLib,onTryAgain:A[0]||(A[0]=D=>O())},null,8,["is-lib"])):(v.openBlock(),v.createElementBlock("div",s$,[v.createElementVNode("div",l$,[b.isLib?(v.openBlock(),v.createBlock(DK,{key:0,ref_key:"callingRef",ref:h,onUserCalling:A[1]||(A[1]=D=>s("userCalling",D)),responsive:_.value},null,8,["responsive"])):v.createCommentVNode("",!0),_.value=="mobile"?(v.openBlock(),v.createElementBlock("div",u$,[v.createElementVNode("div",d$,[v.createElementVNode("div",c$,[(N=c.value)!=null&&N.backFunc&&!((w=c.value)!=null&&w.isHidden)?(v.openBlock(),v.createElementBlock("button",{key:0,class:"flex items-center",onClick:A[2]||(A[2]=D=>c.value.backFunc())},[v.createVNode(A_),v.createElementVNode("div",_$,[v.createElementVNode("p",a$,v.toDisplayString(c.value.backTitle??""),1),v.createElementVNode("p",f$,v.toDisplayString(c.value.subTitle??""),1)])])):((x=v.unref(Oe))==null?void 0:x.user_type)=="tenant"?(v.openBlock(),v.createElementBlock("div",p$,[A[9]||(A[9]=v.createTextVNode(" 🏢 ")),v.createElementVNode("div",v$,[v.createElementVNode("div",m$,v.toDisplayString(v.unref(so)(((B=v.unref(Oe))==null?void 0:B.tenant_phone)??"")??""),1)])])):(v.openBlock(),v.createElementBlock("span",h$)),r.isLib?(v.openBlock(),v.createElementBlock("button",{key:3,class:"w-10 h-10",onClick:A[3]||(A[3]=D=>s("close"))},[v.createVNode(BK)])):v.createCommentVNode("",!0)])]),v.createElementVNode("div",y$,[v.withDirectives(v.createVNode(jM,{ref_key:"chatListRef",ref:T,class:"w-full max-w-[500px] !bg-[#F9FAFC]",responsive:_.value,onSelectReceiver:S,"receiver-id":g.value,"onUpdate:receiverId":A[4]||(A[4]=D=>g.value=D)},null,8,["responsive","receiver-id"]),[[v.vShow,v.unref(Xt)==v.unref(Xe).CHAT_LIST]]),v.withDirectives(v.createVNode(IN,{ref_key:"homeComponentRef",ref:y,"receiver-id":g.value,class:"h-full",onCall:R,onBack:A[5]||(A[5]=D=>{var U,q;return(q=(U=c.value).backFunc)==null?void 0:q.call(U)}),onInputFocus:j,conversation:f.value,responsive:_.value},null,8,["receiver-id","conversation","responsive"]),[[v.vShow,v.unref(Xt)==v.unref(Xe).HOME]]),v.unref(Xt)==v.unref(Xe).CUSTOMER_DETAIL?(v.openBlock(),v.createBlock(AN,{key:0,ref_key:"customerDetailRef",ref:E,"receiver-id":g.value,class:"w-full h-full",responsive:_.value},null,8,["receiver-id","responsive"])):v.createCommentVNode("",!0),v.unref(Xt)==v.unref(Xe).CUSTOMER_CHECK_IN?(v.openBlock(),v.createBlock(ON,{key:1,class:"w-full h-full"})):v.createCommentVNode("",!0),v.unref(Xt)==v.unref(Xe).CUSTOMER_APPOINTMENT?(v.openBlock(),v.createBlock(wN,{key:2,class:"w-full h-full"})):v.createCommentVNode("",!0)])])):(v.openBlock(),v.createElementBlock("div",g$,[v.createVNode(jM,{ref_key:"chatListRef",ref:T,class:"w-[38%] max-w-[500px] min-w-[300px] xl:min-w-[450px] border-r layout-border",responsive:_.value,onSelectReceiver:S,onOpenPhoneNumpad:A[6]||(A[6]=D=>s("openPhoneNumpad")),"receiver-id":g.value,"onUpdate:receiverId":A[7]||(A[7]=D=>g.value=D)},null,8,["responsive","receiver-id"]),v.createElementVNode("div",E$,[(G=c.value)!=null&&G.backFunc?(v.openBlock(),v.createElementBlock("div",T$,[v.createElementVNode("button",{class:"flex items-center",onClick:A[8]||(A[8]=D=>c.value.backFunc())},[v.createVNode(A_),v.createElementVNode("span",S$,v.toDisplayString(c.value.backTitle??""),1)])])):v.createCommentVNode("",!0),v.createElementVNode("div",b$,[v.withDirectives(v.createVNode(IN,{ref_key:"homeComponentRef",ref:y,"receiver-id":g.value,class:"h-full",onCall:R,onInputFocus:j,responsive:_.value,conversation:f.value},null,8,["receiver-id","responsive","conversation"]),[[v.vShow,v.unref(Xt)==v.unref(Xe).HOME&&g.value]]),v.unref(Xt)==v.unref(Xe).CUSTOMER_DETAIL?(v.openBlock(),v.createBlock(AN,{key:0,ref_key:"customerDetailRef",ref:E,"receiver-id":g.value,class:"h-full",responsive:_.value},null,8,["receiver-id","responsive"])):v.createCommentVNode("",!0),v.unref(Xt)==v.unref(Xe).CUSTOMER_CHECK_IN?(v.openBlock(),v.createBlock(ON,{key:1,class:"h-full"})):v.createCommentVNode("",!0),v.unref(Xt)==v.unref(Xe).CUSTOMER_APPOINTMENT?(v.openBlock(),v.createBlock(wN,{key:2,class:"h-full"})):v.createCommentVNode("",!0)])])])),v.renderSlot(b.$slots,"right")])])):(v.openBlock(),v.createElementBlock("div",r$,[v.createVNode(Y8)]))],512)}}});qi.PLIVO_CALL_STATUS=Fe,qi.default=I$,Object.defineProperties(qi,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -92,10 +92,19 @@ const props = withDefaults(defineProps(), {
|
|
|
92
92
|
response: 'tablet'
|
|
93
93
|
});
|
|
94
94
|
const emit = defineEmits();
|
|
95
|
+
const handleExposeInit = (init_data) => {
|
|
96
|
+
if (init_data?.conversation_id) {
|
|
97
|
+
chatListRef.value?.initData({
|
|
98
|
+
conversation_id: init_data?.conversation_id,
|
|
99
|
+
is_unknown: init_data?.is_unknown || '0'
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
else
|
|
103
|
+
chatListRef.value?.initData();
|
|
104
|
+
};
|
|
95
105
|
const { initPage } = useInitData();
|
|
96
|
-
const { getResponsiveObserver } = useListenEvent();
|
|
106
|
+
const { getResponsiveObserver } = useListenEvent(handleExposeInit);
|
|
97
107
|
onMounted(() => {
|
|
98
|
-
console.log('222222222222222222');
|
|
99
108
|
getResponsiveObserver();
|
|
100
109
|
if (props.isLib) {
|
|
101
110
|
defineRootColor();
|
|
@@ -181,12 +190,7 @@ const handleInitPage = async () => {
|
|
|
181
190
|
// routerPush(PAGE.REGISTER_TENANT)
|
|
182
191
|
// }
|
|
183
192
|
}
|
|
184
|
-
|
|
185
|
-
// chatListRef.value?.initData({
|
|
186
|
-
// conversation_id: init_data?.conversation_id,
|
|
187
|
-
// is_unknown: init_data?.is_unknown || '0'
|
|
188
|
-
// })
|
|
189
|
-
// } else chatListRef.value?.initData()
|
|
193
|
+
handleExposeInit(init_data);
|
|
190
194
|
};
|
|
191
195
|
// const handleEndCall = (data: IResUser | null, type: string) => {
|
|
192
196
|
// setTimeout(() => {
|
|
@@ -205,16 +209,6 @@ const openSettings = () => {
|
|
|
205
209
|
const handleReadMessage = () => {
|
|
206
210
|
chatListRef.value?.handleReadMessage();
|
|
207
211
|
};
|
|
208
|
-
const handleExposeInit = (init_data) => {
|
|
209
|
-
if (init_data?.conversation_id) {
|
|
210
|
-
chatListRef.value?.initData({
|
|
211
|
-
conversation_id: init_data?.conversation_id,
|
|
212
|
-
is_unknown: init_data?.is_unknown || '0'
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
else
|
|
216
|
-
chatListRef.value?.initData();
|
|
217
|
-
};
|
|
218
212
|
let __VLS_exposed;
|
|
219
213
|
defineExpose({
|
|
220
214
|
get unreadCount() {
|
|
@@ -5,7 +5,7 @@ import { useDebounce } from '../utils/debounce';
|
|
|
5
5
|
// import router from '../router'
|
|
6
6
|
//PINIA
|
|
7
7
|
export const responsiveObserver = ref('tablet');
|
|
8
|
-
export function useListenEvent() {
|
|
8
|
+
export function useListenEvent(callBackResizeChange) {
|
|
9
9
|
onMounted(() => {
|
|
10
10
|
window.addEventListener('resize', getResponsiveObserverDebounce);
|
|
11
11
|
});
|
|
@@ -19,16 +19,19 @@ export function useListenEvent() {
|
|
|
19
19
|
const width = appChatRef?.offsetWidth ?? 0;
|
|
20
20
|
if (width >= 1180) {
|
|
21
21
|
if (responsiveObserver.value != 'window') {
|
|
22
|
+
callBackResizeChange?.();
|
|
22
23
|
responsiveObserver.value = 'window';
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
else if (width >= 640) {
|
|
26
27
|
if (responsiveObserver.value != 'tablet') {
|
|
28
|
+
callBackResizeChange?.();
|
|
27
29
|
responsiveObserver.value = 'tablet';
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
else {
|
|
31
33
|
if (responsiveObserver.value != 'mobile') {
|
|
34
|
+
callBackResizeChange?.();
|
|
32
35
|
if (currentPage.value == PAGE.HOME) {
|
|
33
36
|
currentPage.value = PAGE.CHAT_LIST;
|
|
34
37
|
}
|