@phonghq/go-chat 1.0.11 → 1.0.14
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/assets/icons/IconAiCheck.vue.d.ts +2 -0
- package/dist/assets/icons/call/IconClose.vue.d.ts +2 -0
- package/dist/assets/icons/call/IconSoundDownload.vue.d.ts +2 -0
- package/dist/chat/App.vue.d.ts +7 -2
- package/dist/chat/page/customer-detail/CustomerDetail.vue.d.ts +1 -1
- package/dist/chat/page/home/ChatList.vue.d.ts +29 -1
- package/dist/chat/page/home/ChatMessage.vue.d.ts +2 -1
- package/dist/chat/page/home/Home.vue.d.ts +1 -1
- package/dist/components/chat/ScrollEvent/ScrollEvent.vue.d.ts +1 -0
- package/dist/components/chat/call/Calling.vue.d.ts +8 -2
- package/dist/components/chat/common/input/InputSearch.vue.d.ts +1 -1
- package/dist/components/chat/select/SelectBase.vue.d.ts +22 -0
- package/dist/components/common/drawer/DrawerBase.vue.d.ts +1 -1
- package/dist/components/common/modal/ModalBase.vue.d.ts +1 -1
- package/dist/composable/useCallHelper.d.ts +7 -2
- package/dist/composable/useInitData.d.ts +2 -4
- package/dist/composable/usePlivo.d.ts +9 -0
- package/dist/go-chat.es.js +14676 -12322
- package/dist/go-chat.umd.js +44 -14
- package/dist/plugins/websocket.d.ts +12 -2
- package/dist/router/index.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/test/assets/icons/IconAiCheck.vue.js +28 -0
- package/dist/test/assets/icons/call/IconClose.vue.js +26 -0
- package/dist/test/assets/icons/call/IconMic.vue.js +9 -9
- package/dist/test/assets/icons/call/IconSoundDownload.vue.js +50 -0
- package/dist/test/chat/App.vue.js +144 -90
- package/dist/test/chat/page/customer-detail/CustomerDetail.vue.js +6 -5
- package/dist/test/chat/page/home/ChatList.vue.js +30 -9
- package/dist/test/chat/page/home/ChatMessage.vue.js +23 -12
- package/dist/test/chat/page/home/Home.vue.js +4 -3
- package/dist/test/chat/page/home/NewCustomer.vue.js +0 -12
- package/dist/test/components/chat/ScrollEvent/ScrollEvent.vue.js +7 -1
- package/dist/test/components/chat/call/Calling.vue.js +277 -111
- package/dist/test/components/chat/common/input/InputSearch.vue.js +2 -2
- package/dist/test/components/chat/select/SelectBase.vue.js +98 -0
- package/dist/test/components/common/drawer/DrawerBaseCustom.vue.js +0 -1
- package/dist/test/composable/data.json +32 -0
- package/dist/test/composable/useCallHelper.js +146 -33
- package/dist/test/composable/useDigibot.js +1 -1
- package/dist/test/composable/useInitData.js +17 -12
- package/dist/test/composable/usePlivo.js +138 -0
- package/dist/test/constant/color.js +1 -1
- package/dist/test/plugins/axios.js +2 -1
- package/dist/test/plugins/mqtt.js +11 -8
- package/dist/test/plugins/websocket.js +108 -19
- package/dist/test/router/index.js +39 -0
- package/dist/test/types/call.js +10 -1
- package/dist/test/utils/chat/auth.js +10 -2
- package/dist/test/utils/chat/call.js +48 -8
- package/dist/test/utils/chat/phone-string.js +4 -0
- package/dist/test/utils/chat/user.js +7 -2
- package/dist/test/views/NotFound.vue.js +47 -0
- package/dist/test/views/TenantPhone.vue.js +270 -0
- package/dist/types/call.d.ts +9 -0
- package/dist/types/chat/global.d.ts +4 -0
- package/dist/utils/chat/auth.d.ts +5 -1
- package/dist/utils/chat/call.d.ts +6 -2
- package/dist/utils/chat/phone-string.d.ts +1 -0
- package/dist/utils/chat/user.d.ts +4 -0
- package/dist/views/NotFound.vue.d.ts +2 -0
- package/dist/views/TenantPhone.vue.d.ts +2 -0
- package/package.json +2 -1
- package/dist/composable/TestSound.d.ts +0 -64
- package/dist/test/composable/TestSound.js +0 -196
|
@@ -14,7 +14,6 @@ import BaseSpin from '../components/chat/common/spin/BaseSpin.vue';
|
|
|
14
14
|
import Calling from '../components/chat/call/Calling.vue';
|
|
15
15
|
import { logout } from '../utils/chat/auth';
|
|
16
16
|
import MobileFooter from '../components/chat/layout/mobile/Footer.vue';
|
|
17
|
-
import { initWebSocket } from '../plugins/websocket';
|
|
18
17
|
import '../style/index.scss';
|
|
19
18
|
import { useDebounce } from '../utils/debounce';
|
|
20
19
|
const routerConfig = [
|
|
@@ -32,6 +31,13 @@ const routerConfig = [
|
|
|
32
31
|
routerPush(PAGE.CUSTOMER_DETAIL);
|
|
33
32
|
},
|
|
34
33
|
backTitle: 'Appointments'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: PAGE.CUSTOMER_CHECK_IN,
|
|
37
|
+
backFunc: () => {
|
|
38
|
+
routerPush(PAGE.CUSTOMER_DETAIL);
|
|
39
|
+
},
|
|
40
|
+
backTitle: 'Checkins'
|
|
35
41
|
}
|
|
36
42
|
];
|
|
37
43
|
const routerMobileConfig = computed(() => [
|
|
@@ -64,11 +70,19 @@ const routerMobileConfig = computed(() => [
|
|
|
64
70
|
routerPush(PAGE.CUSTOMER_DETAIL);
|
|
65
71
|
},
|
|
66
72
|
backTitle: 'Appointments'
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: PAGE.CUSTOMER_CHECK_IN,
|
|
76
|
+
backFunc: () => {
|
|
77
|
+
routerPush(PAGE.CUSTOMER_DETAIL);
|
|
78
|
+
},
|
|
79
|
+
backTitle: 'Checkins'
|
|
67
80
|
}
|
|
68
81
|
]);
|
|
69
82
|
const props = withDefaults(defineProps(), {
|
|
70
83
|
response: 'tablet'
|
|
71
84
|
});
|
|
85
|
+
const emit = defineEmits();
|
|
72
86
|
const { initPage } = useInitData();
|
|
73
87
|
onMounted(() => {
|
|
74
88
|
getResponsiveObserver();
|
|
@@ -86,6 +100,8 @@ const currentPageConfig = computed(() => {
|
|
|
86
100
|
const responsiveRender = computed(() => {
|
|
87
101
|
return props.response == 'mobile' ? props.response : responsiveObserver.value;
|
|
88
102
|
});
|
|
103
|
+
const list = computed(() => chatListRef.value?.listConversations ?? []);
|
|
104
|
+
const unreadCount = computed(() => list.value?.reduce((total, cur) => total + (cur?.unread_count ?? 0), 0) ?? 0);
|
|
89
105
|
const responsiveObserver = ref('tablet');
|
|
90
106
|
const appChatRef = ref();
|
|
91
107
|
const callingRef = ref(null);
|
|
@@ -94,7 +110,7 @@ const customerDetailRef = ref(null);
|
|
|
94
110
|
const homeComponentRef = ref(null);
|
|
95
111
|
const chatListRef = ref(null);
|
|
96
112
|
const selectReceiver = async (data) => {
|
|
97
|
-
if (receiverId.value != data?.receiver_id) {
|
|
113
|
+
if (receiverId.value != data?.receiver_id || responsiveRender.value === 'mobile') {
|
|
98
114
|
if (currentPage.value != PAGE.HOME) {
|
|
99
115
|
routerPush(PAGE.HOME);
|
|
100
116
|
}
|
|
@@ -106,6 +122,7 @@ const selectReceiver = async (data) => {
|
|
|
106
122
|
};
|
|
107
123
|
const handleCall = (user) => {
|
|
108
124
|
callingRef.value?.startCall(user);
|
|
125
|
+
// callingRef.value?.startAnswer('16013818811')
|
|
109
126
|
};
|
|
110
127
|
const getResponsiveObserver = useDebounce(() => {
|
|
111
128
|
// const div = document.getElementById('appChatMain')
|
|
@@ -126,8 +143,9 @@ const getResponsiveObserver = useDebounce(() => {
|
|
|
126
143
|
}
|
|
127
144
|
}
|
|
128
145
|
}, 50);
|
|
129
|
-
|
|
130
|
-
|
|
146
|
+
initPage({ props: props, response: props.response });
|
|
147
|
+
let __VLS_exposed;
|
|
148
|
+
defineExpose({ unreadCount });
|
|
131
149
|
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
132
150
|
const __VLS_defaults = {
|
|
133
151
|
response: 'tablet'
|
|
@@ -137,18 +155,20 @@ const __VLS_ctx = {
|
|
|
137
155
|
...{},
|
|
138
156
|
...{},
|
|
139
157
|
...{},
|
|
158
|
+
...{},
|
|
140
159
|
};
|
|
141
160
|
let __VLS_elements;
|
|
142
161
|
let __VLS_components;
|
|
143
162
|
let __VLS_directives;
|
|
144
163
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
145
|
-
...{ class: "go-chat-main max-w-full
|
|
164
|
+
...{ class: "go-chat-main max-w-full" },
|
|
165
|
+
...{ class: ({ 'p-8': !__VLS_ctx.isLib }) },
|
|
146
166
|
id: "appChatMain",
|
|
147
167
|
ref: "appChatRef",
|
|
148
168
|
});
|
|
149
169
|
/** @type {typeof __VLS_ctx.appChatRef} */ ;
|
|
150
170
|
// @ts-ignore
|
|
151
|
-
[appChatRef,];
|
|
171
|
+
[isLib, appChatRef,];
|
|
152
172
|
if (!__VLS_ctx.isRouterReady) {
|
|
153
173
|
// @ts-ignore
|
|
154
174
|
[isRouterReady,];
|
|
@@ -172,22 +192,38 @@ else if (__VLS_ctx.responsiveRender == 'mobile') {
|
|
|
172
192
|
// @ts-ignore
|
|
173
193
|
[responsiveRender,];
|
|
174
194
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
175
|
-
...{ class: "relative flex flex-col mx-auto w-
|
|
195
|
+
...{ class: "relative flex flex-col mx-auto w-full max-w-[350px] h-full bg-[#F9FAFC] overflow-hidden chat-mobile pt-4" },
|
|
176
196
|
});
|
|
177
197
|
/** @type {[typeof Calling, ]} */ ;
|
|
178
198
|
// @ts-ignore
|
|
179
199
|
const __VLS_8 = __VLS_asFunctionalComponent(Calling, new Calling({
|
|
200
|
+
...{ 'onUserCalling': {} },
|
|
180
201
|
ref: "callingRef",
|
|
181
202
|
responsive: (__VLS_ctx.responsiveRender),
|
|
182
203
|
}));
|
|
183
204
|
const __VLS_9 = __VLS_8({
|
|
205
|
+
...{ 'onUserCalling': {} },
|
|
184
206
|
ref: "callingRef",
|
|
185
207
|
responsive: (__VLS_ctx.responsiveRender),
|
|
186
208
|
}, ...__VLS_functionalComponentArgsRest(__VLS_8));
|
|
209
|
+
let __VLS_11;
|
|
210
|
+
let __VLS_12;
|
|
211
|
+
const __VLS_13 = ({ userCalling: {} },
|
|
212
|
+
{ onUserCalling: (...[$event]) => {
|
|
213
|
+
if (!!(!__VLS_ctx.isRouterReady))
|
|
214
|
+
return;
|
|
215
|
+
if (!!(__VLS_ctx.currentPage == __VLS_ctx.PAGE.TENANT_ERROR))
|
|
216
|
+
return;
|
|
217
|
+
if (!(__VLS_ctx.responsiveRender == 'mobile'))
|
|
218
|
+
return;
|
|
219
|
+
__VLS_ctx.emit('userCalling', $event);
|
|
220
|
+
// @ts-ignore
|
|
221
|
+
[responsiveRender, emit,];
|
|
222
|
+
} });
|
|
187
223
|
/** @type {typeof __VLS_ctx.callingRef} */ ;
|
|
188
|
-
var
|
|
224
|
+
var __VLS_14 = {};
|
|
189
225
|
// @ts-ignore
|
|
190
|
-
[
|
|
226
|
+
[callingRef,];
|
|
191
227
|
var __VLS_10;
|
|
192
228
|
if (__VLS_ctx.currentPageConfig?.backFunc) {
|
|
193
229
|
// @ts-ignore
|
|
@@ -213,8 +249,8 @@ else if (__VLS_ctx.responsiveRender == 'mobile') {
|
|
|
213
249
|
});
|
|
214
250
|
/** @type {[typeof IconArrowLeft, ]} */ ;
|
|
215
251
|
// @ts-ignore
|
|
216
|
-
const
|
|
217
|
-
const
|
|
252
|
+
const __VLS_17 = __VLS_asFunctionalComponent(IconArrowLeft, new IconArrowLeft({}));
|
|
253
|
+
const __VLS_18 = __VLS_17({}, ...__VLS_functionalComponentArgsRest(__VLS_17));
|
|
218
254
|
__VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
|
|
219
255
|
...{ class: "text-xl font-semibold text-chat-haze-900 ml-3" },
|
|
220
256
|
});
|
|
@@ -227,114 +263,114 @@ else if (__VLS_ctx.responsiveRender == 'mobile') {
|
|
|
227
263
|
});
|
|
228
264
|
/** @type {[typeof ChatList, ]} */ ;
|
|
229
265
|
// @ts-ignore
|
|
230
|
-
const
|
|
266
|
+
const __VLS_21 = __VLS_asFunctionalComponent(ChatList, new ChatList({
|
|
231
267
|
...{ 'onSelectReceiver': {} },
|
|
232
268
|
ref: "chatListRef",
|
|
233
269
|
...{ class: "w-full max-w-[500px] !bg-[#F9FAFC]" },
|
|
234
|
-
|
|
270
|
+
responsive: (__VLS_ctx.responsiveRender),
|
|
235
271
|
receiverId: (__VLS_ctx.receiverId),
|
|
236
272
|
}));
|
|
237
|
-
const
|
|
273
|
+
const __VLS_22 = __VLS_21({
|
|
238
274
|
...{ 'onSelectReceiver': {} },
|
|
239
275
|
ref: "chatListRef",
|
|
240
276
|
...{ class: "w-full max-w-[500px] !bg-[#F9FAFC]" },
|
|
241
|
-
|
|
277
|
+
responsive: (__VLS_ctx.responsiveRender),
|
|
242
278
|
receiverId: (__VLS_ctx.receiverId),
|
|
243
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
244
|
-
let
|
|
245
|
-
let
|
|
246
|
-
const
|
|
279
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_21));
|
|
280
|
+
let __VLS_24;
|
|
281
|
+
let __VLS_25;
|
|
282
|
+
const __VLS_26 = ({ selectReceiver: {} },
|
|
247
283
|
{ onSelectReceiver: (__VLS_ctx.selectReceiver) });
|
|
248
284
|
__VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CHAT_LIST) }, null, null);
|
|
249
285
|
/** @type {typeof __VLS_ctx.chatListRef} */ ;
|
|
250
|
-
var
|
|
286
|
+
var __VLS_27 = {};
|
|
251
287
|
// @ts-ignore
|
|
252
288
|
[currentPage, PAGE, responsiveRender, receiverId, selectReceiver, chatListRef,];
|
|
253
|
-
var
|
|
289
|
+
var __VLS_23;
|
|
254
290
|
/** @type {[typeof HomeComponent, ]} */ ;
|
|
255
291
|
// @ts-ignore
|
|
256
|
-
const
|
|
292
|
+
const __VLS_30 = __VLS_asFunctionalComponent(HomeComponent, new HomeComponent({
|
|
257
293
|
...{ 'onCall': {} },
|
|
258
294
|
ref: "homeComponentRef",
|
|
259
295
|
receiverId: (__VLS_ctx.receiverId),
|
|
260
296
|
...{ class: "h-full pt-4" },
|
|
261
|
-
|
|
297
|
+
responsive: (__VLS_ctx.responsiveRender),
|
|
262
298
|
}));
|
|
263
|
-
const
|
|
299
|
+
const __VLS_31 = __VLS_30({
|
|
264
300
|
...{ 'onCall': {} },
|
|
265
301
|
ref: "homeComponentRef",
|
|
266
302
|
receiverId: (__VLS_ctx.receiverId),
|
|
267
303
|
...{ class: "h-full pt-4" },
|
|
268
|
-
|
|
269
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
270
|
-
let
|
|
271
|
-
let
|
|
272
|
-
const
|
|
304
|
+
responsive: (__VLS_ctx.responsiveRender),
|
|
305
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_30));
|
|
306
|
+
let __VLS_33;
|
|
307
|
+
let __VLS_34;
|
|
308
|
+
const __VLS_35 = ({ call: {} },
|
|
273
309
|
{ onCall: (__VLS_ctx.handleCall) });
|
|
274
310
|
__VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.currentPage == __VLS_ctx.PAGE.HOME) }, null, null);
|
|
275
311
|
/** @type {typeof __VLS_ctx.homeComponentRef} */ ;
|
|
276
|
-
var
|
|
312
|
+
var __VLS_36 = {};
|
|
277
313
|
// @ts-ignore
|
|
278
314
|
[currentPage, PAGE, responsiveRender, receiverId, handleCall, homeComponentRef,];
|
|
279
|
-
var
|
|
315
|
+
var __VLS_32;
|
|
280
316
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_DETAIL) {
|
|
281
317
|
// @ts-ignore
|
|
282
318
|
[currentPage, PAGE,];
|
|
283
319
|
/** @type {[typeof CustomerDetail, ]} */ ;
|
|
284
320
|
// @ts-ignore
|
|
285
|
-
const
|
|
321
|
+
const __VLS_39 = __VLS_asFunctionalComponent(CustomerDetail, new CustomerDetail({
|
|
286
322
|
ref: "customerDetailRef",
|
|
287
323
|
receiverId: (__VLS_ctx.receiverId),
|
|
288
324
|
...{ class: "h-full" },
|
|
289
|
-
|
|
325
|
+
responsive: (__VLS_ctx.responsiveRender),
|
|
290
326
|
}));
|
|
291
|
-
const
|
|
327
|
+
const __VLS_40 = __VLS_39({
|
|
292
328
|
ref: "customerDetailRef",
|
|
293
329
|
receiverId: (__VLS_ctx.receiverId),
|
|
294
330
|
...{ class: "h-full" },
|
|
295
|
-
|
|
296
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
331
|
+
responsive: (__VLS_ctx.responsiveRender),
|
|
332
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_39));
|
|
297
333
|
/** @type {typeof __VLS_ctx.customerDetailRef} */ ;
|
|
298
|
-
var
|
|
334
|
+
var __VLS_42 = {};
|
|
299
335
|
// @ts-ignore
|
|
300
336
|
[responsiveRender, receiverId, customerDetailRef,];
|
|
301
|
-
var
|
|
337
|
+
var __VLS_41;
|
|
302
338
|
}
|
|
303
339
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_CHECK_IN) {
|
|
304
340
|
// @ts-ignore
|
|
305
341
|
[currentPage, PAGE,];
|
|
306
342
|
/** @type {[typeof CustomerCheckIn, ]} */ ;
|
|
307
343
|
// @ts-ignore
|
|
308
|
-
const
|
|
344
|
+
const __VLS_45 = __VLS_asFunctionalComponent(CustomerCheckIn, new CustomerCheckIn({
|
|
309
345
|
...{ class: "h-full" },
|
|
310
346
|
}));
|
|
311
|
-
const
|
|
347
|
+
const __VLS_46 = __VLS_45({
|
|
312
348
|
...{ class: "h-full" },
|
|
313
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
349
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_45));
|
|
314
350
|
}
|
|
315
351
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_APPOINTMENT) {
|
|
316
352
|
// @ts-ignore
|
|
317
353
|
[currentPage, PAGE,];
|
|
318
354
|
/** @type {[typeof CustomerAppointment, ]} */ ;
|
|
319
355
|
// @ts-ignore
|
|
320
|
-
const
|
|
356
|
+
const __VLS_49 = __VLS_asFunctionalComponent(CustomerAppointment, new CustomerAppointment({
|
|
321
357
|
...{ class: "h-full" },
|
|
322
358
|
}));
|
|
323
|
-
const
|
|
359
|
+
const __VLS_50 = __VLS_49({
|
|
324
360
|
...{ class: "h-full" },
|
|
325
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
361
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_49));
|
|
326
362
|
}
|
|
327
363
|
if (__VLS_ctx.currentPage != __VLS_ctx.PAGE.HOME) {
|
|
328
364
|
// @ts-ignore
|
|
329
365
|
[currentPage, PAGE,];
|
|
330
366
|
/** @type {[typeof MobileFooter, ]} */ ;
|
|
331
367
|
// @ts-ignore
|
|
332
|
-
const
|
|
368
|
+
const __VLS_53 = __VLS_asFunctionalComponent(MobileFooter, new MobileFooter({
|
|
333
369
|
...{ class: "shrink-0" },
|
|
334
370
|
}));
|
|
335
|
-
const
|
|
371
|
+
const __VLS_54 = __VLS_53({
|
|
336
372
|
...{ class: "shrink-0" },
|
|
337
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
373
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_53));
|
|
338
374
|
}
|
|
339
375
|
}
|
|
340
376
|
else {
|
|
@@ -343,29 +379,29 @@ else {
|
|
|
343
379
|
});
|
|
344
380
|
/** @type {[typeof ChatList, ]} */ ;
|
|
345
381
|
// @ts-ignore
|
|
346
|
-
const
|
|
382
|
+
const __VLS_57 = __VLS_asFunctionalComponent(ChatList, new ChatList({
|
|
347
383
|
...{ 'onSelectReceiver': {} },
|
|
348
384
|
ref: "chatListRef",
|
|
349
385
|
...{ class: "w-[38%] max-w-[500px] min-w-[450px]" },
|
|
350
|
-
|
|
386
|
+
responsive: (__VLS_ctx.responsiveRender),
|
|
351
387
|
receiverId: (__VLS_ctx.receiverId),
|
|
352
388
|
}));
|
|
353
|
-
const
|
|
389
|
+
const __VLS_58 = __VLS_57({
|
|
354
390
|
...{ 'onSelectReceiver': {} },
|
|
355
391
|
ref: "chatListRef",
|
|
356
392
|
...{ class: "w-[38%] max-w-[500px] min-w-[450px]" },
|
|
357
|
-
|
|
393
|
+
responsive: (__VLS_ctx.responsiveRender),
|
|
358
394
|
receiverId: (__VLS_ctx.receiverId),
|
|
359
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
360
|
-
let
|
|
361
|
-
let
|
|
362
|
-
const
|
|
395
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_57));
|
|
396
|
+
let __VLS_60;
|
|
397
|
+
let __VLS_61;
|
|
398
|
+
const __VLS_62 = ({ selectReceiver: {} },
|
|
363
399
|
{ onSelectReceiver: (__VLS_ctx.selectReceiver) });
|
|
364
400
|
/** @type {typeof __VLS_ctx.chatListRef} */ ;
|
|
365
|
-
var
|
|
401
|
+
var __VLS_63 = {};
|
|
366
402
|
// @ts-ignore
|
|
367
403
|
[responsiveRender, receiverId, selectReceiver, chatListRef,];
|
|
368
|
-
var
|
|
404
|
+
var __VLS_59;
|
|
369
405
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
370
406
|
...{ class: "chat-box-white grow flex flex-col h-full pt-6 overflow-hidden" },
|
|
371
407
|
});
|
|
@@ -393,8 +429,8 @@ else {
|
|
|
393
429
|
});
|
|
394
430
|
/** @type {[typeof IconArrowLeft, ]} */ ;
|
|
395
431
|
// @ts-ignore
|
|
396
|
-
const
|
|
397
|
-
const
|
|
432
|
+
const __VLS_66 = __VLS_asFunctionalComponent(IconArrowLeft, new IconArrowLeft({}));
|
|
433
|
+
const __VLS_67 = __VLS_66({}, ...__VLS_functionalComponentArgsRest(__VLS_66));
|
|
398
434
|
__VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
|
|
399
435
|
...{ class: "text-xl font-semibold text-chat-haze-900 ml-3" },
|
|
400
436
|
});
|
|
@@ -407,92 +443,108 @@ else {
|
|
|
407
443
|
});
|
|
408
444
|
/** @type {[typeof HomeComponent, ]} */ ;
|
|
409
445
|
// @ts-ignore
|
|
410
|
-
const
|
|
446
|
+
const __VLS_70 = __VLS_asFunctionalComponent(HomeComponent, new HomeComponent({
|
|
411
447
|
...{ 'onCall': {} },
|
|
412
448
|
ref: "homeComponentRef",
|
|
413
449
|
receiverId: (__VLS_ctx.receiverId),
|
|
414
450
|
...{ class: "h-full" },
|
|
415
|
-
|
|
451
|
+
responsive: (__VLS_ctx.responsiveRender),
|
|
416
452
|
}));
|
|
417
|
-
const
|
|
453
|
+
const __VLS_71 = __VLS_70({
|
|
418
454
|
...{ 'onCall': {} },
|
|
419
455
|
ref: "homeComponentRef",
|
|
420
456
|
receiverId: (__VLS_ctx.receiverId),
|
|
421
457
|
...{ class: "h-full" },
|
|
422
|
-
|
|
423
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
424
|
-
let
|
|
425
|
-
let
|
|
426
|
-
const
|
|
458
|
+
responsive: (__VLS_ctx.responsiveRender),
|
|
459
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_70));
|
|
460
|
+
let __VLS_73;
|
|
461
|
+
let __VLS_74;
|
|
462
|
+
const __VLS_75 = ({ call: {} },
|
|
427
463
|
{ onCall: (__VLS_ctx.handleCall) });
|
|
428
464
|
__VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.currentPage == __VLS_ctx.PAGE.HOME) }, null, null);
|
|
429
465
|
/** @type {typeof __VLS_ctx.homeComponentRef} */ ;
|
|
430
|
-
var
|
|
466
|
+
var __VLS_76 = {};
|
|
431
467
|
// @ts-ignore
|
|
432
468
|
[currentPage, PAGE, responsiveRender, receiverId, handleCall, homeComponentRef,];
|
|
433
|
-
var
|
|
469
|
+
var __VLS_72;
|
|
434
470
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_DETAIL) {
|
|
435
471
|
// @ts-ignore
|
|
436
472
|
[currentPage, PAGE,];
|
|
437
473
|
/** @type {[typeof CustomerDetail, ]} */ ;
|
|
438
474
|
// @ts-ignore
|
|
439
|
-
const
|
|
475
|
+
const __VLS_79 = __VLS_asFunctionalComponent(CustomerDetail, new CustomerDetail({
|
|
440
476
|
ref: "customerDetailRef",
|
|
441
477
|
receiverId: (__VLS_ctx.receiverId),
|
|
442
478
|
...{ class: "h-full" },
|
|
443
|
-
|
|
479
|
+
responsive: (__VLS_ctx.responsiveRender),
|
|
444
480
|
}));
|
|
445
|
-
const
|
|
481
|
+
const __VLS_80 = __VLS_79({
|
|
446
482
|
ref: "customerDetailRef",
|
|
447
483
|
receiverId: (__VLS_ctx.receiverId),
|
|
448
484
|
...{ class: "h-full" },
|
|
449
|
-
|
|
450
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
485
|
+
responsive: (__VLS_ctx.responsiveRender),
|
|
486
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_79));
|
|
451
487
|
/** @type {typeof __VLS_ctx.customerDetailRef} */ ;
|
|
452
|
-
var
|
|
488
|
+
var __VLS_82 = {};
|
|
453
489
|
// @ts-ignore
|
|
454
490
|
[responsiveRender, receiverId, customerDetailRef,];
|
|
455
|
-
var
|
|
491
|
+
var __VLS_81;
|
|
456
492
|
}
|
|
457
493
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_CHECK_IN) {
|
|
458
494
|
// @ts-ignore
|
|
459
495
|
[currentPage, PAGE,];
|
|
460
496
|
/** @type {[typeof CustomerCheckIn, ]} */ ;
|
|
461
497
|
// @ts-ignore
|
|
462
|
-
const
|
|
498
|
+
const __VLS_85 = __VLS_asFunctionalComponent(CustomerCheckIn, new CustomerCheckIn({
|
|
463
499
|
...{ class: "h-full" },
|
|
464
500
|
}));
|
|
465
|
-
const
|
|
501
|
+
const __VLS_86 = __VLS_85({
|
|
466
502
|
...{ class: "h-full" },
|
|
467
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
503
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_85));
|
|
468
504
|
}
|
|
469
505
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_APPOINTMENT) {
|
|
470
506
|
// @ts-ignore
|
|
471
507
|
[currentPage, PAGE,];
|
|
472
508
|
/** @type {[typeof CustomerAppointment, ]} */ ;
|
|
473
509
|
// @ts-ignore
|
|
474
|
-
const
|
|
510
|
+
const __VLS_89 = __VLS_asFunctionalComponent(CustomerAppointment, new CustomerAppointment({
|
|
475
511
|
...{ class: "h-full" },
|
|
476
512
|
}));
|
|
477
|
-
const
|
|
513
|
+
const __VLS_90 = __VLS_89({
|
|
478
514
|
...{ class: "h-full" },
|
|
479
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
515
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_89));
|
|
480
516
|
}
|
|
481
517
|
/** @type {[typeof Calling, ]} */ ;
|
|
482
518
|
// @ts-ignore
|
|
483
|
-
const
|
|
519
|
+
const __VLS_93 = __VLS_asFunctionalComponent(Calling, new Calling({
|
|
520
|
+
...{ 'onUserCalling': {} },
|
|
484
521
|
ref: "callingRef",
|
|
485
522
|
responsive: (__VLS_ctx.responsiveRender),
|
|
486
523
|
}));
|
|
487
|
-
const
|
|
524
|
+
const __VLS_94 = __VLS_93({
|
|
525
|
+
...{ 'onUserCalling': {} },
|
|
488
526
|
ref: "callingRef",
|
|
489
527
|
responsive: (__VLS_ctx.responsiveRender),
|
|
490
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
528
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_93));
|
|
529
|
+
let __VLS_96;
|
|
530
|
+
let __VLS_97;
|
|
531
|
+
const __VLS_98 = ({ userCalling: {} },
|
|
532
|
+
{ onUserCalling: (...[$event]) => {
|
|
533
|
+
if (!!(!__VLS_ctx.isRouterReady))
|
|
534
|
+
return;
|
|
535
|
+
if (!!(__VLS_ctx.currentPage == __VLS_ctx.PAGE.TENANT_ERROR))
|
|
536
|
+
return;
|
|
537
|
+
if (!!(__VLS_ctx.responsiveRender == 'mobile'))
|
|
538
|
+
return;
|
|
539
|
+
__VLS_ctx.emit('userCalling', $event);
|
|
540
|
+
// @ts-ignore
|
|
541
|
+
[responsiveRender, emit,];
|
|
542
|
+
} });
|
|
491
543
|
/** @type {typeof __VLS_ctx.callingRef} */ ;
|
|
492
|
-
var
|
|
544
|
+
var __VLS_99 = {};
|
|
493
545
|
// @ts-ignore
|
|
494
|
-
[
|
|
495
|
-
var
|
|
546
|
+
[callingRef,];
|
|
547
|
+
var __VLS_95;
|
|
496
548
|
}
|
|
497
549
|
/** @type {__VLS_StyleScopedClasses['go-chat-main']} */ ;
|
|
498
550
|
/** @type {__VLS_StyleScopedClasses['max-w-full']} */ ;
|
|
@@ -504,7 +556,7 @@ else {
|
|
|
504
556
|
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
505
557
|
/** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
|
|
506
558
|
/** @type {__VLS_StyleScopedClasses['mx-auto']} */ ;
|
|
507
|
-
/** @type {__VLS_StyleScopedClasses['w-
|
|
559
|
+
/** @type {__VLS_StyleScopedClasses['w-full']} */ ;
|
|
508
560
|
/** @type {__VLS_StyleScopedClasses['max-w-[350px]']} */ ;
|
|
509
561
|
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
510
562
|
/** @type {__VLS_StyleScopedClasses['bg-[#F9FAFC]']} */ ;
|
|
@@ -560,8 +612,10 @@ else {
|
|
|
560
612
|
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
561
613
|
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
562
614
|
// @ts-ignore
|
|
563
|
-
var
|
|
615
|
+
var __VLS_15 = __VLS_14, __VLS_28 = __VLS_27, __VLS_37 = __VLS_36, __VLS_43 = __VLS_42, __VLS_64 = __VLS_63, __VLS_77 = __VLS_76, __VLS_83 = __VLS_82, __VLS_100 = __VLS_99;
|
|
564
616
|
const __VLS_export = (await import('vue')).defineComponent({
|
|
617
|
+
setup: () => (__VLS_exposed),
|
|
618
|
+
__typeEmits: {},
|
|
565
619
|
__typeProps: {},
|
|
566
620
|
props: {},
|
|
567
621
|
});
|
|
@@ -47,7 +47,7 @@ const historyItems = computed(() => {
|
|
|
47
47
|
icon: IconDate,
|
|
48
48
|
label: 'Appointments',
|
|
49
49
|
value: userHistory.value?.appointment?.length ?? '',
|
|
50
|
-
click: userHistory.value?.appointment
|
|
50
|
+
click: userHistory.value?.appointment?.length
|
|
51
51
|
? () => {
|
|
52
52
|
routerPush(PAGE.CUSTOMER_APPOINTMENT);
|
|
53
53
|
}
|
|
@@ -61,6 +61,7 @@ const otherActions = [
|
|
|
61
61
|
{ icon: IconGroup, label: 'Add Groups' }
|
|
62
62
|
];
|
|
63
63
|
const getData = async () => {
|
|
64
|
+
userHistory.value = null;
|
|
64
65
|
userHistory.value = await getUserHistory(user.value?.phone?.slice(1) ?? '');
|
|
65
66
|
};
|
|
66
67
|
getData();
|
|
@@ -111,20 +112,20 @@ __VLS_asFunctionalElement(__VLS_elements.img)({
|
|
|
111
112
|
});
|
|
112
113
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
113
114
|
...{ class: " mt-5 text-center mx-auto" },
|
|
114
|
-
...{ class: ({ 'flex justify-between w-max': __VLS_ctx.
|
|
115
|
+
...{ class: ({ 'flex justify-between w-max': __VLS_ctx.responsive == 'tablet', 'grid grid-cols-3 w-full': __VLS_ctx.responsive == 'mobile' }) },
|
|
115
116
|
});
|
|
116
117
|
// @ts-ignore
|
|
117
|
-
[
|
|
118
|
+
[responsive, responsive,];
|
|
118
119
|
for (const [item, i] of __VLS_getVForSourceType((__VLS_ctx.customerTotalDetail))) {
|
|
119
120
|
// @ts-ignore
|
|
120
121
|
[customerTotalDetail,];
|
|
121
122
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
122
123
|
...{ class: "border-l border-chat-haze-100 first:border-none" },
|
|
123
|
-
...{ class: ({ 'w-full': __VLS_ctx.
|
|
124
|
+
...{ class: ({ 'w-full': __VLS_ctx.responsive == 'mobile', 'w-[130px]': __VLS_ctx.responsive == 'tablet' }) },
|
|
124
125
|
key: (i),
|
|
125
126
|
});
|
|
126
127
|
// @ts-ignore
|
|
127
|
-
[
|
|
128
|
+
[responsive, responsive,];
|
|
128
129
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
129
130
|
...{ class: "w-full flex items-center justify-center gap-1" },
|
|
130
131
|
});
|
|
@@ -17,6 +17,7 @@ import utc from 'dayjs/plugin/utc';
|
|
|
17
17
|
import timezone from 'dayjs/plugin/timezone';
|
|
18
18
|
import { useDigibot } from '../../../composable/useDigibot';
|
|
19
19
|
import { TIME_ZONE_UTC } from '../../../constant/datetime';
|
|
20
|
+
import IconAiCheck from '../../../assets/icons/IconAiCheck.vue';
|
|
20
21
|
dayjs.extend(updateLocale);
|
|
21
22
|
dayjs.extend(relativeTime);
|
|
22
23
|
dayjs.extend(utc);
|
|
@@ -92,7 +93,6 @@ const mqttMessageHandler = (topic, data) => {
|
|
|
92
93
|
if (index != -1) {
|
|
93
94
|
listConversations.value.splice(index, 1);
|
|
94
95
|
}
|
|
95
|
-
console.log(hasChatBox);
|
|
96
96
|
if (hasChatBox > -1) {
|
|
97
97
|
listConversations.value.splice(1, 0, data);
|
|
98
98
|
}
|
|
@@ -131,10 +131,12 @@ const getData = async (data, option) => {
|
|
|
131
131
|
await nextTick();
|
|
132
132
|
}
|
|
133
133
|
listConversations.value.push(...(res?.items ?? []));
|
|
134
|
-
console.log(listConversations.value);
|
|
135
134
|
checkHasReceiveId();
|
|
136
135
|
params.value.page = res?._meta?.currentPage || 1;
|
|
137
136
|
pageCount = res?._meta?.pageCount || 1;
|
|
137
|
+
if (option?.reset) {
|
|
138
|
+
getAllList();
|
|
139
|
+
}
|
|
138
140
|
}
|
|
139
141
|
catch (error) {
|
|
140
142
|
console.error(error);
|
|
@@ -143,9 +145,15 @@ const getData = async (data, option) => {
|
|
|
143
145
|
isLoadingSearch.value = false;
|
|
144
146
|
}
|
|
145
147
|
};
|
|
148
|
+
const getAllList = async () => {
|
|
149
|
+
while (params.value.page < pageCount && !scrollEventRef.value?.canScroll()) {
|
|
150
|
+
let page = params.value.page + 1;
|
|
151
|
+
await getData({ page });
|
|
152
|
+
}
|
|
153
|
+
};
|
|
146
154
|
const checkHasReceiveId = () => {
|
|
147
155
|
const hasReceiveId = listConversations.value?.some((e) => e.receiver_id === receiver_id.value && receiver_id.value);
|
|
148
|
-
if (props.
|
|
156
|
+
if (props.responsive == 'tablet') {
|
|
149
157
|
if (!hasReceiveId && listConversations.value?.length)
|
|
150
158
|
emit('selectReceiver', listConversations.value[0]);
|
|
151
159
|
}
|
|
@@ -182,7 +190,7 @@ const getTimeFromNow = (data) => {
|
|
|
182
190
|
return data ?? '';
|
|
183
191
|
};
|
|
184
192
|
getData({}, { reset: true });
|
|
185
|
-
const __VLS_exposed = { handleReadMessage };
|
|
193
|
+
const __VLS_exposed = { handleReadMessage, listConversations };
|
|
186
194
|
defineExpose(__VLS_exposed);
|
|
187
195
|
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
188
196
|
const __VLS_modelEmit = defineEmits();
|
|
@@ -208,13 +216,13 @@ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
|
208
216
|
const __VLS_0 = __VLS_asFunctionalComponent(InputSearch, new InputSearch({
|
|
209
217
|
...{ 'onSearch': {} },
|
|
210
218
|
...{ class: "h-[45px] grow" },
|
|
211
|
-
|
|
219
|
+
responsive: (__VLS_ctx.responsive),
|
|
212
220
|
modelValue: (__VLS_ctx.keyword),
|
|
213
221
|
}));
|
|
214
222
|
const __VLS_1 = __VLS_0({
|
|
215
223
|
...{ 'onSearch': {} },
|
|
216
224
|
...{ class: "h-[45px] grow" },
|
|
217
|
-
|
|
225
|
+
responsive: (__VLS_ctx.responsive),
|
|
218
226
|
modelValue: (__VLS_ctx.keyword),
|
|
219
227
|
}, ...__VLS_functionalComponentArgsRest(__VLS_0));
|
|
220
228
|
let __VLS_3;
|
|
@@ -222,7 +230,7 @@ let __VLS_4;
|
|
|
222
230
|
const __VLS_5 = ({ search: {} },
|
|
223
231
|
{ onSearch: (__VLS_ctx.handleSearch) });
|
|
224
232
|
// @ts-ignore
|
|
225
|
-
[
|
|
233
|
+
[responsive, keyword, handleSearch,];
|
|
226
234
|
var __VLS_2;
|
|
227
235
|
__VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
|
|
228
236
|
...{ class: "h-[45px] w-[45px] rounded-full flex-center bg-[#C7DEFF]" },
|
|
@@ -285,10 +293,10 @@ for (const [user] of __VLS_getVForSourceType((__VLS_ctx.listConversations))) {
|
|
|
285
293
|
});
|
|
286
294
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
287
295
|
...{ class: "w-full overflow-hidden flex items-center hover:bg-[#EDF5FF] cursor-pointer px-6 py-2" },
|
|
288
|
-
...{ class: ({ 'bg-[#EDF5FF]': __VLS_ctx.receiver_id == user.receiver_id && __VLS_ctx.
|
|
296
|
+
...{ class: ({ 'bg-[#EDF5FF]': __VLS_ctx.receiver_id == user.receiver_id && __VLS_ctx.responsive == 'tablet' }) },
|
|
289
297
|
});
|
|
290
298
|
// @ts-ignore
|
|
291
|
-
[
|
|
299
|
+
[responsive, receiver_id,];
|
|
292
300
|
/** @type {[typeof Avatar, ]} */ ;
|
|
293
301
|
// @ts-ignore
|
|
294
302
|
const __VLS_24 = __VLS_asFunctionalComponent(Avatar, new Avatar({
|
|
@@ -321,6 +329,18 @@ for (const [user] of __VLS_getVForSourceType((__VLS_ctx.listConversations))) {
|
|
|
321
329
|
...{ class: "font-semibold" },
|
|
322
330
|
});
|
|
323
331
|
(user.username);
|
|
332
|
+
if (user.id == __VLS_ctx.digibotId) {
|
|
333
|
+
// @ts-ignore
|
|
334
|
+
[digibotId,];
|
|
335
|
+
/** @type {[typeof IconAiCheck, ]} */ ;
|
|
336
|
+
// @ts-ignore
|
|
337
|
+
const __VLS_28 = __VLS_asFunctionalComponent(IconAiCheck, new IconAiCheck({
|
|
338
|
+
...{ class: "ml-2" },
|
|
339
|
+
}));
|
|
340
|
+
const __VLS_29 = __VLS_28({
|
|
341
|
+
...{ class: "ml-2" },
|
|
342
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_28));
|
|
343
|
+
}
|
|
324
344
|
if (user.unread_count) {
|
|
325
345
|
__VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
|
|
326
346
|
...{ class: "ml-2 bg-[#E60000] text-white text-xs font-bold px-2 py-[1px] flex-center rounded-full" },
|
|
@@ -394,6 +414,7 @@ var __VLS_17;
|
|
|
394
414
|
/** @type {__VLS_StyleScopedClasses['items-center']} */ ;
|
|
395
415
|
/** @type {__VLS_StyleScopedClasses['font-semibold']} */ ;
|
|
396
416
|
/** @type {__VLS_StyleScopedClasses['ml-2']} */ ;
|
|
417
|
+
/** @type {__VLS_StyleScopedClasses['ml-2']} */ ;
|
|
397
418
|
/** @type {__VLS_StyleScopedClasses['bg-[#E60000]']} */ ;
|
|
398
419
|
/** @type {__VLS_StyleScopedClasses['text-white']} */ ;
|
|
399
420
|
/** @type {__VLS_StyleScopedClasses['text-xs']} */ ;
|