@@ -53,6 +53,14 @@ class TalkingDataAdSearch {
5353 this . custom = new Object ( ) ;
5454 }
5555
56+ setCategory ( category ) {
57+ this . category = category ;
58+ }
59+
60+ setContent ( content ) {
61+ this . content = content ;
62+ }
63+
5664 setDestination ( destination ) {
5765 this . destination = destination ;
5866 }
@@ -79,12 +87,75 @@ class TalkingDataAdSearch {
7987
8088 get adSearchString ( ) {
8189 return JSON . stringify ( {
90+ 'category' :this . category ,
91+ 'content' :this . content ,
8292 'destination' :this . destination ,
8393 'origin' :this . origin ,
84- 'item_id' :this . item_id ,
85- 'item_location_id' :this . item_location_id ,
86- 'start_date' :this . start_date ,
87- 'end_date' :this . end_date ,
94+ 'itemId' :this . itemId ,
95+ 'itemLocationId' :this . itemLocationId ,
96+ 'startDate' :this . startDate ,
97+ 'endDate' :this . endDate ,
98+ } ) ;
99+ }
100+
101+ }
102+
103+
104+ class TalkingDataTransaction {
105+
106+ constructor ( ) {
107+
108+ }
109+
110+ setTransactionId ( transactionId ) {
111+ this . transactionId = transactionId ;
112+ }
113+
114+ setCategory ( category ) {
115+ this . category = category ;
116+ }
117+
118+ setAmount ( amount ) {
119+ this . amount = amount ;
120+ }
121+
122+ setPersonA ( personA ) {
123+ this . personA = personA ;
124+ }
125+
126+ setPersonB ( personB ) {
127+ this . personB = personB ;
128+ }
129+
130+ setStartDate ( startDate ) {
131+ this . startDate = startDate ;
132+ }
133+
134+ setEndDate ( endDate ) {
135+ this . endDate = endDate ;
136+ }
137+
138+ setCurrencyType ( currencyType ) {
139+ this . currencyType = currencyType ;
140+ }
141+
142+ setContent ( content ) {
143+ this . content = content ;
144+ }
145+
146+
147+
148+ get transactionStr ( ) {
149+ return JSON . stringify ( {
150+ 'transactionId' :this . transactionId ,
151+ 'category' :this . category ,
152+ 'amount' :this . amount ,
153+ 'personA' :this . personA ,
154+ 'personB' :this . personB ,
155+ 'startDate' :this . startDate ,
156+ 'endDate' :this . endDate ,
157+ 'currencyType' :this . currencyType ,
158+ 'content' :this . content ,
88159 } ) ;
89160 }
90161
@@ -115,6 +186,15 @@ class TalkingDataAdTracking {
115186 TDADT . onRegister ( account ) ;
116187 }
117188
189+ static onRegisterWithinvitationCode ( account , invitationCode ) {
190+ if ( typeof account !== 'string' ) {
191+ return ;
192+ }
193+ if ( typeof invitationCode !== 'string' ) {
194+ return ;
195+ }
196+ TDADT . onRegisterWithinvitationCode ( account , invitationCode ) ;
197+ }
118198 /**
119199 * 登录
120200 * iOS Android
@@ -315,7 +395,284 @@ class TalkingDataAdTracking {
315395 static onAdSearch ( adSearch ) {
316396 TDADT . onAdSearch ( adSearch ) ;
317397 }
398+
399+ static onSearch ( adSearch ) {
400+ TDADT . onSearch ( adSearch ) ;
401+ }
402+
403+ static onCreateCard ( account , method , content )
404+ {
405+ if ( typeof account !== 'string' ) {
406+ return ;
407+ } ;
408+ if ( typeof method !== 'string' ) {
409+ return ;
410+ } ;
411+ if ( typeof content !== 'string' ) {
412+ return ;
413+ }
414+ TDADT . onCreateCard ( account , method , content ) ;
415+ }
416+
417+ static onFavorite ( category , content )
418+ {
419+ if ( typeof category !== 'string' ) {
420+ return ;
421+ } ;
422+
423+ if ( typeof content !== 'string' ) {
424+ return ;
425+ }
426+ TDADT . onFavorite ( category , content ) ;
427+ }
428+
429+ static onShare ( account , content )
430+ {
431+ if ( typeof account !== 'string' ) {
432+ return ;
433+ } ;
434+ if ( typeof content !== 'string' ) {
435+ return ;
436+ }
437+ TDADT . onShare ( account , content ) ;
438+ }
439+
440+ static onPunch ( account , punchId )
441+ {
442+ if ( typeof account !== 'string' ) {
443+ return ;
444+ } ;
445+ if ( typeof punchId !== 'string' ) {
446+ return ;
447+ }
448+ TDADT . onPunch ( account , punchId ) ;
449+ }
450+
451+ static onReservation ( account , reservationId , category , amount , term )
452+ {
453+ if ( typeof account !== 'string' ) {
454+ return ;
455+ } ;
456+ if ( typeof reservationId !== 'string' ) {
457+ return ;
458+ }
459+ if ( typeof category !== 'string' ) {
460+ return ;
461+ }
462+ if ( typeof amount !== 'number' ) {
463+ return ;
464+ }
465+ if ( typeof term !== 'string' ) {
466+ return ;
467+ }
468+
469+ TDADT . onReservation ( account , reservationId , category , amount , term ) ;
470+ }
471+
472+ static onBooking ( account , bookingId , category , amount , content )
473+ {
474+ if ( typeof account !== 'string' ) {
475+ return ;
476+ } ;
477+ if ( typeof bookingId !== 'string' ) {
478+ return ;
479+ }
480+ if ( typeof category !== 'string' ) {
481+ return ;
482+ }
483+ if ( typeof amount !== 'number' ) {
484+ return ;
485+ }
486+ if ( typeof content !== 'string' ) {
487+ return ;
488+ }
489+
490+ TDADT . onBooking ( account , bookingId , category , amount , content ) ;
491+ }
492+
493+ static onContact ( account , content )
494+ {
495+ if ( typeof account !== 'string' ) {
496+ return ;
497+ } ;
498+
499+ if ( typeof content !== 'string' ) {
500+ return ;
501+ }
502+
503+ TDADT . onContact ( account , content ) ;
504+ }
505+
506+ static onLearn ( account , course , begin , duration )
507+ {
508+ if ( typeof account !== 'string' ) {
509+ return ;
510+ } ;
511+
512+ if ( typeof course !== 'string' ) {
513+ return ;
514+ }
515+
516+ if ( typeof begin !== 'number' ) {
517+ return ;
518+ }
519+
520+ if ( typeof duration !== 'number' ) {
521+ return ;
522+ }
523+ TDADT . onLearn ( account , course , begin , duration )
524+ }
525+
526+ static onRead ( account , book , begin , duration )
527+ {
528+ if ( typeof account !== 'string' ) {
529+ return ;
530+ } ;
531+
532+ if ( typeof book !== 'string' ) {
533+ return ;
534+ }
535+
536+ if ( typeof begin !== 'number' ) {
537+ return ;
538+ }
539+
540+ if ( typeof duration !== 'number' ) {
541+ return ;
542+ }
543+ TDADT . onRead ( account , book , begin , duration )
544+ }
545+
546+ static onBrowse ( account , content , begin , duration )
547+ {
548+ if ( typeof account !== 'string' ) {
549+ return ;
550+ } ;
551+
552+ if ( typeof content !== 'string' ) {
553+ return ;
554+ }
555+
556+ if ( typeof begin !== 'number' ) {
557+ return ;
558+ }
559+
560+ if ( typeof duration !== 'number' ) {
561+ return ;
562+ }
563+ TDADT . onBrowse ( account , content , begin , duration )
564+ }
565+
566+
567+ static onTransaction ( account , transactionStr ) {
568+ if ( typeof account !== 'string' ) {
569+ return ;
570+ } ;
571+
572+ if ( typeof transactionStr !== 'string' ) {
573+ return ;
574+ }
575+
576+ TDADT . onTransaction ( account , transactionStr ) ;
577+ }
578+
579+ static onCredit ( account , amount , content )
580+ {
581+ if ( typeof account !== 'string' ) {
582+ return ;
583+ } ;
584+ if ( typeof amount !== 'number' ) {
585+ return ;
586+ }
587+ if ( typeof content !== 'string' ) {
588+ return ;
589+ }
590+ TDADT . onCredit ( account , amount , content )
591+ }
592+
593+ static onChargeBack ( account , orderId , reason , type )
594+ {
595+ if ( typeof account !== 'string' ) {
596+ return ;
597+ } ;
598+ if ( typeof orderId !== 'string' ) {
599+ return ;
600+ }
601+ if ( typeof reason !== 'string' ) {
602+ return ;
603+ }
604+ if ( typeof type !== 'string' ) {
605+ return ;
606+ }
607+ TDADT . onChargeBack ( account , orderId , reason , type )
608+ }
609+
610+ static onTrialFinished ( account , content )
611+ {
612+ if ( typeof account !== 'string' ) {
613+ return ;
614+ } ;
615+ if ( typeof content !== 'string' ) {
616+ return ;
617+ }
618+ TDADT . onTrialFinished ( account , content )
619+ }
620+
621+ static onGuideFinished ( account , content )
622+ {
623+ if ( typeof account !== 'string' ) {
624+ return ;
625+ } ;
626+ if ( typeof content !== 'string' ) {
627+ return ;
628+ }
629+ TDADT . onGuideFinished ( account , content )
630+ }
631+ static onPreviewFinished ( account , content )
632+ {
633+ if ( typeof account !== 'string' ) {
634+ return ;
635+ } ;
636+ if ( typeof content !== 'string' ) {
637+ return ;
638+ }
639+ TDADT . onPreviewFinished ( account , content )
640+ }
641+ static onFreeFinished ( account , content )
642+ {
643+ if ( typeof account !== 'string' ) {
644+ return ;
645+ } ;
646+ if ( typeof content !== 'string' ) {
647+ return ;
648+ }
649+ TDADT . onFreeFinished ( account , content )
650+ }
651+
652+ static onLevelPass ( account , levelId )
653+ {
654+ if ( typeof account !== 'string' ) {
655+ return ;
656+ } ;
657+ if ( typeof levelId !== 'string' ) {
658+ return ;
659+ }
660+ TDADT . onLevelPass ( account , levelId )
661+ }
662+
663+
664+ static onAchievementUnlock ( account , achievementId )
665+ {
666+ if ( typeof account !== 'string' ) {
667+ return ;
668+ } ;
669+ if ( typeof achievementId !== 'string' ) {
670+ return ;
671+ }
672+ TDADT . onAchievementUnlock ( account , achievementId )
673+ }
674+
318675
319676}
320677
321- export { TalkingDataAdTracking , TalkingDataADTOrder , TalkingDataADTShoppingCart , TalkingDataAdSearch } ;
678+ export { TalkingDataAdTracking , TalkingDataADTOrder , TalkingDataADTShoppingCart , TalkingDataAdSearch , TalkingDataTransaction } ;
0 commit comments