@phonghq/go-chat 1.0.39 → 1.0.41
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/go-chat.es.js +4263 -4229
- package/dist/go-chat.umd.js +22 -13
- package/dist/test/chat/App.vue.js +73 -64
- package/dist/test/chat/page/home/ChatMessageItem.vue.js +20 -13
- package/dist/test/chat/page/home/InputChat.vue.js +25 -5
- package/dist/test/components/chat/call/Calling.vue.js +1 -1
- package/dist/test/utils/chat/auth.js +0 -1
- package/dist/test/utils/chat/call.js +18 -12
- package/package.json +1 -1
|
@@ -21,6 +21,7 @@ import IconCloseCircle from '../assets/icons/IconCloseCircle.vue';
|
|
|
21
21
|
import Setting from '../chat/page/setting/Setting.vue';
|
|
22
22
|
import SettingSuccess from '../chat/page/setting/SettingSuccess.vue';
|
|
23
23
|
import { goChatError } from '../composable/useError';
|
|
24
|
+
import NotTenantPhone from '@/views/NotTenantPhone.vue';
|
|
24
25
|
const routerConfig = [
|
|
25
26
|
{ id: PAGE.HOME, backFunc: null, backTitle: '' },
|
|
26
27
|
{
|
|
@@ -162,9 +163,9 @@ const getResponsiveObserverDebounce = useDebounce(() => {
|
|
|
162
163
|
}, 50);
|
|
163
164
|
const handleInitPage = async () => {
|
|
164
165
|
await initPage({ props: props, response: responsiveRender.value });
|
|
165
|
-
console.log(dataProfile.value, '55555555555555555');
|
|
166
166
|
if (!dataProfile.value?.tenant_phone && dataProfile.value?.user_type == 'tenant') {
|
|
167
167
|
emit('error:noPhoneTenant');
|
|
168
|
+
routerPush(PAGE.TENANT_ERROR);
|
|
168
169
|
// if (dataProfile.value?.has_business_tenant_phone) {
|
|
169
170
|
// routerPush(PAGE.REGISTER_SUCCESS)
|
|
170
171
|
// } else {
|
|
@@ -474,35 +475,43 @@ else {
|
|
|
474
475
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
475
476
|
...{ class: "grow overflow-hidden" },
|
|
476
477
|
});
|
|
478
|
+
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.TENANT_ERROR) {
|
|
479
|
+
// @ts-ignore
|
|
480
|
+
[currentPage, PAGE,];
|
|
481
|
+
/** @type {[typeof NotTenantPhone, ]} */ ;
|
|
482
|
+
// @ts-ignore
|
|
483
|
+
const __VLS_35 = __VLS_asFunctionalComponent(NotTenantPhone, new NotTenantPhone({}));
|
|
484
|
+
const __VLS_36 = __VLS_35({}, ...__VLS_functionalComponentArgsRest(__VLS_35));
|
|
485
|
+
}
|
|
477
486
|
/** @type {[typeof ChatList, ]} */ ;
|
|
478
487
|
// @ts-ignore
|
|
479
|
-
const
|
|
488
|
+
const __VLS_39 = __VLS_asFunctionalComponent(ChatList, new ChatList({
|
|
480
489
|
...{ 'onSelectReceiver': {} },
|
|
481
490
|
ref: "chatListRef",
|
|
482
491
|
...{ class: "w-full max-w-[500px] !bg-[#F9FAFC]" },
|
|
483
492
|
responsive: (__VLS_ctx.responsiveRender),
|
|
484
493
|
receiverId: (__VLS_ctx.receiverId),
|
|
485
494
|
}));
|
|
486
|
-
const
|
|
495
|
+
const __VLS_40 = __VLS_39({
|
|
487
496
|
...{ 'onSelectReceiver': {} },
|
|
488
497
|
ref: "chatListRef",
|
|
489
498
|
...{ class: "w-full max-w-[500px] !bg-[#F9FAFC]" },
|
|
490
499
|
responsive: (__VLS_ctx.responsiveRender),
|
|
491
500
|
receiverId: (__VLS_ctx.receiverId),
|
|
492
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
493
|
-
let
|
|
494
|
-
let
|
|
495
|
-
const
|
|
501
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_39));
|
|
502
|
+
let __VLS_42;
|
|
503
|
+
let __VLS_43;
|
|
504
|
+
const __VLS_44 = ({ selectReceiver: {} },
|
|
496
505
|
{ onSelectReceiver: (__VLS_ctx.selectReceiver) });
|
|
497
506
|
__VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CHAT_LIST) }, null, null);
|
|
498
507
|
/** @type {typeof __VLS_ctx.chatListRef} */ ;
|
|
499
|
-
var
|
|
508
|
+
var __VLS_45 = {};
|
|
500
509
|
// @ts-ignore
|
|
501
510
|
[currentPage, PAGE, responsiveRender, receiverId, selectReceiver, chatListRef,];
|
|
502
|
-
var
|
|
511
|
+
var __VLS_41;
|
|
503
512
|
/** @type {[typeof HomeComponent, ]} */ ;
|
|
504
513
|
// @ts-ignore
|
|
505
|
-
const
|
|
514
|
+
const __VLS_48 = __VLS_asFunctionalComponent(HomeComponent, new HomeComponent({
|
|
506
515
|
...{ 'onCall': {} },
|
|
507
516
|
...{ 'onBack': {} },
|
|
508
517
|
...{ 'onInputFocus': {} },
|
|
@@ -511,7 +520,7 @@ else {
|
|
|
511
520
|
...{ class: "h-full pt-4" },
|
|
512
521
|
responsive: (__VLS_ctx.responsiveRender),
|
|
513
522
|
}));
|
|
514
|
-
const
|
|
523
|
+
const __VLS_49 = __VLS_48({
|
|
515
524
|
...{ 'onCall': {} },
|
|
516
525
|
...{ 'onBack': {} },
|
|
517
526
|
...{ 'onInputFocus': {} },
|
|
@@ -519,12 +528,12 @@ else {
|
|
|
519
528
|
receiverId: (__VLS_ctx.receiverId),
|
|
520
529
|
...{ class: "h-full pt-4" },
|
|
521
530
|
responsive: (__VLS_ctx.responsiveRender),
|
|
522
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
523
|
-
let
|
|
524
|
-
let
|
|
525
|
-
const
|
|
531
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_48));
|
|
532
|
+
let __VLS_51;
|
|
533
|
+
let __VLS_52;
|
|
534
|
+
const __VLS_53 = ({ call: {} },
|
|
526
535
|
{ onCall: (__VLS_ctx.handleCall) });
|
|
527
|
-
const
|
|
536
|
+
const __VLS_54 = ({ back: {} },
|
|
528
537
|
{ onBack: (...[$event]) => {
|
|
529
538
|
if (!!(!__VLS_ctx.isRouterReady))
|
|
530
539
|
return;
|
|
@@ -540,72 +549,72 @@ else {
|
|
|
540
549
|
// @ts-ignore
|
|
541
550
|
[responsiveRender, currentPageConfig, receiverId, handleCall,];
|
|
542
551
|
} });
|
|
543
|
-
const
|
|
552
|
+
const __VLS_55 = ({ inputFocus: {} },
|
|
544
553
|
{ onInputFocus: (__VLS_ctx.handleReadMessage) });
|
|
545
554
|
__VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.currentPage == __VLS_ctx.PAGE.HOME) }, null, null);
|
|
546
555
|
/** @type {typeof __VLS_ctx.homeComponentRef} */ ;
|
|
547
|
-
var
|
|
556
|
+
var __VLS_56 = {};
|
|
548
557
|
// @ts-ignore
|
|
549
558
|
[currentPage, PAGE, handleReadMessage, homeComponentRef,];
|
|
550
|
-
var
|
|
559
|
+
var __VLS_50;
|
|
551
560
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_DETAIL) {
|
|
552
561
|
// @ts-ignore
|
|
553
562
|
[currentPage, PAGE,];
|
|
554
563
|
/** @type {[typeof CustomerDetail, ]} */ ;
|
|
555
564
|
// @ts-ignore
|
|
556
|
-
const
|
|
565
|
+
const __VLS_59 = __VLS_asFunctionalComponent(CustomerDetail, new CustomerDetail({
|
|
557
566
|
ref: "customerDetailRef",
|
|
558
567
|
receiverId: (__VLS_ctx.receiverId),
|
|
559
568
|
...{ class: "w-full h-full" },
|
|
560
569
|
responsive: (__VLS_ctx.responsiveRender),
|
|
561
570
|
}));
|
|
562
|
-
const
|
|
571
|
+
const __VLS_60 = __VLS_59({
|
|
563
572
|
ref: "customerDetailRef",
|
|
564
573
|
receiverId: (__VLS_ctx.receiverId),
|
|
565
574
|
...{ class: "w-full h-full" },
|
|
566
575
|
responsive: (__VLS_ctx.responsiveRender),
|
|
567
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
576
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_59));
|
|
568
577
|
/** @type {typeof __VLS_ctx.customerDetailRef} */ ;
|
|
569
|
-
var
|
|
578
|
+
var __VLS_62 = {};
|
|
570
579
|
// @ts-ignore
|
|
571
580
|
[responsiveRender, receiverId, customerDetailRef,];
|
|
572
|
-
var
|
|
581
|
+
var __VLS_61;
|
|
573
582
|
}
|
|
574
583
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_CHECK_IN) {
|
|
575
584
|
// @ts-ignore
|
|
576
585
|
[currentPage, PAGE,];
|
|
577
586
|
/** @type {[typeof CustomerCheckIn, ]} */ ;
|
|
578
587
|
// @ts-ignore
|
|
579
|
-
const
|
|
588
|
+
const __VLS_65 = __VLS_asFunctionalComponent(CustomerCheckIn, new CustomerCheckIn({
|
|
580
589
|
...{ class: "w-full h-full" },
|
|
581
590
|
}));
|
|
582
|
-
const
|
|
591
|
+
const __VLS_66 = __VLS_65({
|
|
583
592
|
...{ class: "w-full h-full" },
|
|
584
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
593
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_65));
|
|
585
594
|
}
|
|
586
595
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_APPOINTMENT) {
|
|
587
596
|
// @ts-ignore
|
|
588
597
|
[currentPage, PAGE,];
|
|
589
598
|
/** @type {[typeof CustomerAppointment, ]} */ ;
|
|
590
599
|
// @ts-ignore
|
|
591
|
-
const
|
|
600
|
+
const __VLS_69 = __VLS_asFunctionalComponent(CustomerAppointment, new CustomerAppointment({
|
|
592
601
|
...{ class: "w-full h-full" },
|
|
593
602
|
}));
|
|
594
|
-
const
|
|
603
|
+
const __VLS_70 = __VLS_69({
|
|
595
604
|
...{ class: "w-full h-full" },
|
|
596
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
605
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_69));
|
|
597
606
|
}
|
|
598
607
|
if (__VLS_ctx.currentPage != __VLS_ctx.PAGE.HOME) {
|
|
599
608
|
// @ts-ignore
|
|
600
609
|
[currentPage, PAGE,];
|
|
601
610
|
/** @type {[typeof MobileFooter, ]} */ ;
|
|
602
611
|
// @ts-ignore
|
|
603
|
-
const
|
|
612
|
+
const __VLS_73 = __VLS_asFunctionalComponent(MobileFooter, new MobileFooter({
|
|
604
613
|
...{ class: "shrink-0" },
|
|
605
614
|
}));
|
|
606
|
-
const
|
|
615
|
+
const __VLS_74 = __VLS_73({
|
|
607
616
|
...{ class: "shrink-0" },
|
|
608
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
617
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_73));
|
|
609
618
|
}
|
|
610
619
|
}
|
|
611
620
|
else {
|
|
@@ -614,29 +623,29 @@ else {
|
|
|
614
623
|
});
|
|
615
624
|
/** @type {[typeof ChatList, ]} */ ;
|
|
616
625
|
// @ts-ignore
|
|
617
|
-
const
|
|
626
|
+
const __VLS_77 = __VLS_asFunctionalComponent(ChatList, new ChatList({
|
|
618
627
|
...{ 'onSelectReceiver': {} },
|
|
619
628
|
ref: "chatListRef",
|
|
620
629
|
...{ class: "w-[38%] max-w-[500px] min-w-[450px]" },
|
|
621
630
|
responsive: (__VLS_ctx.responsiveRender),
|
|
622
631
|
receiverId: (__VLS_ctx.receiverId),
|
|
623
632
|
}));
|
|
624
|
-
const
|
|
633
|
+
const __VLS_78 = __VLS_77({
|
|
625
634
|
...{ 'onSelectReceiver': {} },
|
|
626
635
|
ref: "chatListRef",
|
|
627
636
|
...{ class: "w-[38%] max-w-[500px] min-w-[450px]" },
|
|
628
637
|
responsive: (__VLS_ctx.responsiveRender),
|
|
629
638
|
receiverId: (__VLS_ctx.receiverId),
|
|
630
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
631
|
-
let
|
|
632
|
-
let
|
|
633
|
-
const
|
|
639
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_77));
|
|
640
|
+
let __VLS_80;
|
|
641
|
+
let __VLS_81;
|
|
642
|
+
const __VLS_82 = ({ selectReceiver: {} },
|
|
634
643
|
{ onSelectReceiver: (__VLS_ctx.selectReceiver) });
|
|
635
644
|
/** @type {typeof __VLS_ctx.chatListRef} */ ;
|
|
636
|
-
var
|
|
645
|
+
var __VLS_83 = {};
|
|
637
646
|
// @ts-ignore
|
|
638
647
|
[responsiveRender, receiverId, selectReceiver, chatListRef,];
|
|
639
|
-
var
|
|
648
|
+
var __VLS_79;
|
|
640
649
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
641
650
|
...{ class: "chat-box-white grow flex flex-col h-full pt-6 overflow-hidden" },
|
|
642
651
|
});
|
|
@@ -668,8 +677,8 @@ else {
|
|
|
668
677
|
});
|
|
669
678
|
/** @type {[typeof IconArrowLeft, ]} */ ;
|
|
670
679
|
// @ts-ignore
|
|
671
|
-
const
|
|
672
|
-
const
|
|
680
|
+
const __VLS_86 = __VLS_asFunctionalComponent(IconArrowLeft, new IconArrowLeft({}));
|
|
681
|
+
const __VLS_87 = __VLS_86({}, ...__VLS_functionalComponentArgsRest(__VLS_86));
|
|
673
682
|
__VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
|
|
674
683
|
...{ class: "text-xl font-semibold text-chat-haze-900 ml-3" },
|
|
675
684
|
});
|
|
@@ -682,7 +691,7 @@ else {
|
|
|
682
691
|
});
|
|
683
692
|
/** @type {[typeof HomeComponent, ]} */ ;
|
|
684
693
|
// @ts-ignore
|
|
685
|
-
const
|
|
694
|
+
const __VLS_90 = __VLS_asFunctionalComponent(HomeComponent, new HomeComponent({
|
|
686
695
|
...{ 'onCall': {} },
|
|
687
696
|
...{ 'onInputFocus': {} },
|
|
688
697
|
ref: "homeComponentRef",
|
|
@@ -690,72 +699,72 @@ else {
|
|
|
690
699
|
...{ class: "h-full" },
|
|
691
700
|
responsive: (__VLS_ctx.responsiveRender),
|
|
692
701
|
}));
|
|
693
|
-
const
|
|
702
|
+
const __VLS_91 = __VLS_90({
|
|
694
703
|
...{ 'onCall': {} },
|
|
695
704
|
...{ 'onInputFocus': {} },
|
|
696
705
|
ref: "homeComponentRef",
|
|
697
706
|
receiverId: (__VLS_ctx.receiverId),
|
|
698
707
|
...{ class: "h-full" },
|
|
699
708
|
responsive: (__VLS_ctx.responsiveRender),
|
|
700
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
701
|
-
let
|
|
702
|
-
let
|
|
703
|
-
const
|
|
709
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_90));
|
|
710
|
+
let __VLS_93;
|
|
711
|
+
let __VLS_94;
|
|
712
|
+
const __VLS_95 = ({ call: {} },
|
|
704
713
|
{ onCall: (__VLS_ctx.handleCall) });
|
|
705
|
-
const
|
|
714
|
+
const __VLS_96 = ({ inputFocus: {} },
|
|
706
715
|
{ onInputFocus: (__VLS_ctx.handleReadMessage) });
|
|
707
716
|
__VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.currentPage == __VLS_ctx.PAGE.HOME && __VLS_ctx.receiverId) }, null, null);
|
|
708
717
|
/** @type {typeof __VLS_ctx.homeComponentRef} */ ;
|
|
709
|
-
var
|
|
718
|
+
var __VLS_97 = {};
|
|
710
719
|
// @ts-ignore
|
|
711
720
|
[currentPage, PAGE, responsiveRender, receiverId, receiverId, handleCall, handleReadMessage, homeComponentRef,];
|
|
712
|
-
var
|
|
721
|
+
var __VLS_92;
|
|
713
722
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_DETAIL) {
|
|
714
723
|
// @ts-ignore
|
|
715
724
|
[currentPage, PAGE,];
|
|
716
725
|
/** @type {[typeof CustomerDetail, ]} */ ;
|
|
717
726
|
// @ts-ignore
|
|
718
|
-
const
|
|
727
|
+
const __VLS_100 = __VLS_asFunctionalComponent(CustomerDetail, new CustomerDetail({
|
|
719
728
|
ref: "customerDetailRef",
|
|
720
729
|
receiverId: (__VLS_ctx.receiverId),
|
|
721
730
|
...{ class: "h-full" },
|
|
722
731
|
responsive: (__VLS_ctx.responsiveRender),
|
|
723
732
|
}));
|
|
724
|
-
const
|
|
733
|
+
const __VLS_101 = __VLS_100({
|
|
725
734
|
ref: "customerDetailRef",
|
|
726
735
|
receiverId: (__VLS_ctx.receiverId),
|
|
727
736
|
...{ class: "h-full" },
|
|
728
737
|
responsive: (__VLS_ctx.responsiveRender),
|
|
729
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
738
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_100));
|
|
730
739
|
/** @type {typeof __VLS_ctx.customerDetailRef} */ ;
|
|
731
|
-
var
|
|
740
|
+
var __VLS_103 = {};
|
|
732
741
|
// @ts-ignore
|
|
733
742
|
[responsiveRender, receiverId, customerDetailRef,];
|
|
734
|
-
var
|
|
743
|
+
var __VLS_102;
|
|
735
744
|
}
|
|
736
745
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_CHECK_IN) {
|
|
737
746
|
// @ts-ignore
|
|
738
747
|
[currentPage, PAGE,];
|
|
739
748
|
/** @type {[typeof CustomerCheckIn, ]} */ ;
|
|
740
749
|
// @ts-ignore
|
|
741
|
-
const
|
|
750
|
+
const __VLS_106 = __VLS_asFunctionalComponent(CustomerCheckIn, new CustomerCheckIn({
|
|
742
751
|
...{ class: "h-full" },
|
|
743
752
|
}));
|
|
744
|
-
const
|
|
753
|
+
const __VLS_107 = __VLS_106({
|
|
745
754
|
...{ class: "h-full" },
|
|
746
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
755
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_106));
|
|
747
756
|
}
|
|
748
757
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_APPOINTMENT) {
|
|
749
758
|
// @ts-ignore
|
|
750
759
|
[currentPage, PAGE,];
|
|
751
760
|
/** @type {[typeof CustomerAppointment, ]} */ ;
|
|
752
761
|
// @ts-ignore
|
|
753
|
-
const
|
|
762
|
+
const __VLS_110 = __VLS_asFunctionalComponent(CustomerAppointment, new CustomerAppointment({
|
|
754
763
|
...{ class: "h-full" },
|
|
755
764
|
}));
|
|
756
|
-
const
|
|
765
|
+
const __VLS_111 = __VLS_110({
|
|
757
766
|
...{ class: "h-full" },
|
|
758
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
767
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_110));
|
|
759
768
|
}
|
|
760
769
|
}
|
|
761
770
|
}
|
|
@@ -865,7 +874,7 @@ else {
|
|
|
865
874
|
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
866
875
|
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
867
876
|
// @ts-ignore
|
|
868
|
-
var __VLS_25 = __VLS_24,
|
|
877
|
+
var __VLS_25 = __VLS_24, __VLS_46 = __VLS_45, __VLS_57 = __VLS_56, __VLS_63 = __VLS_62, __VLS_84 = __VLS_83, __VLS_98 = __VLS_97, __VLS_104 = __VLS_103;
|
|
869
878
|
const __VLS_export = (await import('vue')).defineComponent({
|
|
870
879
|
setup: () => (__VLS_exposed),
|
|
871
880
|
__typeEmits: {},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
import Avatar from '../../../components/chat/customer/Avatar.vue';
|
|
3
|
+
import { dataProfile } from '../../../utils/chat/auth';
|
|
3
4
|
import { computed, nextTick } from 'vue';
|
|
4
5
|
import { MessageState } from '../../../constant/message';
|
|
5
6
|
import IconPhoneCancel from '../../../assets/icons/call/IconPhoneCancel.vue';
|
|
@@ -193,19 +194,25 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
|
|
|
193
194
|
(__VLS_ctx.getCallDuration(__VLS_ctx.message?.duration ?? 0));
|
|
194
195
|
// @ts-ignore
|
|
195
196
|
[message, getCallDuration,];
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
197
|
+
if (__VLS_ctx.dataProfile?.user_type == 'tenant') {
|
|
198
|
+
// @ts-ignore
|
|
199
|
+
[dataProfile,];
|
|
200
|
+
__VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
|
|
201
|
+
...{ onClick: (...[$event]) => {
|
|
202
|
+
if (!(__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyMessage))
|
|
203
|
+
return;
|
|
204
|
+
if (!(__VLS_ctx.message.is_call == 1))
|
|
205
|
+
return;
|
|
206
|
+
if (!(__VLS_ctx.dataProfile?.user_type == 'tenant'))
|
|
207
|
+
return;
|
|
208
|
+
__VLS_ctx.emit('callAgain');
|
|
209
|
+
// @ts-ignore
|
|
210
|
+
[emit,];
|
|
211
|
+
} },
|
|
212
|
+
...{ class: "flex-center h-10 rounded-xl bg-chat-haze-200 font-semibold" },
|
|
213
|
+
});
|
|
214
|
+
__VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({});
|
|
215
|
+
}
|
|
209
216
|
}
|
|
210
217
|
else if (__VLS_ctx.message.message) {
|
|
211
218
|
// @ts-ignore
|
|
@@ -212,6 +212,23 @@ __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
|
|
|
212
212
|
var __VLS_8;
|
|
213
213
|
}
|
|
214
214
|
var __VLS_2;
|
|
215
|
+
const __VLS_13 = {}.EmojiPicker;
|
|
216
|
+
/** @type {[typeof __VLS_components.EmojiPicker, typeof __VLS_components.emojiPicker, ]} */ ;
|
|
217
|
+
// @ts-ignore
|
|
218
|
+
EmojiPicker;
|
|
219
|
+
// @ts-ignore
|
|
220
|
+
const __VLS_14 = __VLS_asFunctionalComponent(__VLS_13, new __VLS_13({
|
|
221
|
+
...{ class: "opacity-0 pointer-events-none absolute" },
|
|
222
|
+
native: (true),
|
|
223
|
+
offset: (2),
|
|
224
|
+
hideSearch: true,
|
|
225
|
+
}));
|
|
226
|
+
const __VLS_15 = __VLS_14({
|
|
227
|
+
...{ class: "opacity-0 pointer-events-none absolute" },
|
|
228
|
+
native: (true),
|
|
229
|
+
offset: (2),
|
|
230
|
+
hideSearch: true,
|
|
231
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_14));
|
|
215
232
|
__VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
|
|
216
233
|
...{ onClick: (...[$event]) => {
|
|
217
234
|
__VLS_ctx.handleSendMessage('message');
|
|
@@ -222,8 +239,8 @@ __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
|
|
|
222
239
|
});
|
|
223
240
|
/** @type {[typeof IconPlan, ]} */ ;
|
|
224
241
|
// @ts-ignore
|
|
225
|
-
const
|
|
226
|
-
const
|
|
242
|
+
const __VLS_18 = __VLS_asFunctionalComponent(IconPlan, new IconPlan({}));
|
|
243
|
+
const __VLS_19 = __VLS_18({}, ...__VLS_functionalComponentArgsRest(__VLS_18));
|
|
227
244
|
__VLS_asFunctionalElement(__VLS_elements.label, __VLS_elements.label)({
|
|
228
245
|
...{ class: "shrink-0 cursor-pointer relative -translate-y-1" },
|
|
229
246
|
});
|
|
@@ -242,12 +259,12 @@ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
|
242
259
|
});
|
|
243
260
|
/** @type {[typeof IconPlus, ]} */ ;
|
|
244
261
|
// @ts-ignore
|
|
245
|
-
const
|
|
262
|
+
const __VLS_22 = __VLS_asFunctionalComponent(IconPlus, new IconPlus({
|
|
246
263
|
...{ class: "text-white" },
|
|
247
264
|
}));
|
|
248
|
-
const
|
|
265
|
+
const __VLS_23 = __VLS_22({
|
|
249
266
|
...{ class: "text-white" },
|
|
250
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
267
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_22));
|
|
251
268
|
/** @type {__VLS_StyleScopedClasses['z-10']} */ ;
|
|
252
269
|
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
253
270
|
/** @type {__VLS_StyleScopedClasses['gap-2']} */ ;
|
|
@@ -273,6 +290,9 @@ const __VLS_18 = __VLS_17({
|
|
|
273
290
|
/** @type {__VLS_StyleScopedClasses['h-11']} */ ;
|
|
274
291
|
/** @type {__VLS_StyleScopedClasses['w-10']} */ ;
|
|
275
292
|
/** @type {__VLS_StyleScopedClasses['!w-[300px]']} */ ;
|
|
293
|
+
/** @type {__VLS_StyleScopedClasses['opacity-0']} */ ;
|
|
294
|
+
/** @type {__VLS_StyleScopedClasses['pointer-events-none']} */ ;
|
|
295
|
+
/** @type {__VLS_StyleScopedClasses['absolute']} */ ;
|
|
276
296
|
/** @type {__VLS_StyleScopedClasses['h-11']} */ ;
|
|
277
297
|
/** @type {__VLS_StyleScopedClasses['w-10']} */ ;
|
|
278
298
|
/** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
|
|
@@ -41,7 +41,6 @@ export const getProfile = async () => {
|
|
|
41
41
|
export const checkTenantPhone = async () => {
|
|
42
42
|
const id = localStorage.getItem('chat_id');
|
|
43
43
|
const res = await axios.get(`/api/v1/message/tenant/get-info?tenant_name=${id}`);
|
|
44
|
-
console.log(res, '5555555555555555');
|
|
45
44
|
if (res.error || !res?.data)
|
|
46
45
|
throw new Error(res.error);
|
|
47
46
|
if (dataProfile.value)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import axios from '../../plugins/axios';
|
|
2
2
|
import { dataProfile } from '../../utils/chat/auth';
|
|
3
|
+
import { useError } from '../../composable/useError';
|
|
4
|
+
const { showError } = useError();
|
|
3
5
|
const BARE_WEBSOCKET_URL = 'https://web-socket.dev01.dtsmart.dev';
|
|
4
6
|
// const BARE_WEBSOCKET_URL = 'https://web-socket-test.dev01.dtsmart.dev'
|
|
5
7
|
// const BARE_WEBSOCKET_URL = 'http://192.168.1.173:3000'
|
|
@@ -138,18 +140,22 @@ export const getPlivoAccessToken = async () => {
|
|
|
138
140
|
return result?.accessToken;
|
|
139
141
|
};
|
|
140
142
|
export const createSipAccount = async (data) => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
try {
|
|
144
|
+
const url = BARE_WEBSOCKET_URL + '/ws/create-sip-account';
|
|
145
|
+
const response = await fetch(url, {
|
|
146
|
+
method: 'POST',
|
|
147
|
+
body: JSON.stringify(data),
|
|
148
|
+
headers: {
|
|
149
|
+
['Content-Type']: 'application/json'
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
if (!response.ok) {
|
|
153
|
+
throw new Error(`Response status: ${response.status}`);
|
|
147
154
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
155
|
+
const result = await response.json();
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
catch (e) {
|
|
159
|
+
showError('We’re having trouble connecting the call. Please try again in a moment');
|
|
151
160
|
}
|
|
152
|
-
const result = await response.json();
|
|
153
|
-
console.log(result);
|
|
154
|
-
return result;
|
|
155
161
|
};
|