esoftplay-event 0.0.0-a

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.
Files changed (121) hide show
  1. package/config.json +11 -0
  2. package/event/additional.tsx +188 -0
  3. package/event/additional_input.tsx +316 -0
  4. package/event/block_invitation.tsx +48 -0
  5. package/event/countdown.tsx +72 -0
  6. package/event/counter_cashier.tsx +180 -0
  7. package/event/counter_cashier_report.tsx +114 -0
  8. package/event/counter_cashier_sell.tsx +135 -0
  9. package/event/counter_eo.tsx +451 -0
  10. package/event/counter_history.tsx +74 -0
  11. package/event/counter_history_item.tsx +48 -0
  12. package/event/counter_info.tsx +96 -0
  13. package/event/counter_lm.tsx +273 -0
  14. package/event/counter_menu.tsx +85 -0
  15. package/event/counter_report.tsx +105 -0
  16. package/event/counter_report_breakdown.tsx +93 -0
  17. package/event/counter_report_detail.tsx +238 -0
  18. package/event/counter_report_detail_list.tsx +56 -0
  19. package/event/counter_request.tsx +136 -0
  20. package/event/counter_request_detail.tsx +211 -0
  21. package/event/counter_section.tsx +32 -0
  22. package/event/counter_send.tsx +277 -0
  23. package/event/counter_status.tsx +32 -0
  24. package/event/counter_type.tsx +23 -0
  25. package/event/counter_user_list.tsx +197 -0
  26. package/event/counter_user_list_item.tsx +143 -0
  27. package/event/coupon.tsx +124 -0
  28. package/event/coupon_claim.tsx +198 -0
  29. package/event/coupon_claim_detail.tsx +175 -0
  30. package/event/coupon_claim_history.tsx +279 -0
  31. package/event/coupon_claim_reimburse.tsx +111 -0
  32. package/event/coupon_claim_reimburse_history.tsx +72 -0
  33. package/event/coupon_claim_reimburse_history_detail.tsx +117 -0
  34. package/event/coupon_claim_staff.tsx +256 -0
  35. package/event/coupon_detail.tsx +98 -0
  36. package/event/coupon_event_list.tsx +77 -0
  37. package/event/coupon_generate.tsx +258 -0
  38. package/event/coupon_generate_event.tsx +79 -0
  39. package/event/coupon_generate_list.tsx +56 -0
  40. package/event/date_picker.tsx +152 -0
  41. package/event/detail.tsx +352 -0
  42. package/event/entrance.tsx +215 -0
  43. package/event/entrance_again.tsx +200 -0
  44. package/event/entrance_failed.tsx +190 -0
  45. package/event/entrance_idcard.tsx +203 -0
  46. package/event/entrance_list.tsx +264 -0
  47. package/event/entrance_list_item.tsx +88 -0
  48. package/event/entrance_log.tsx +130 -0
  49. package/event/entrance_success.tsx +155 -0
  50. package/event/entrance_warning.tsx +91 -0
  51. package/event/exchange_reward.tsx +31 -0
  52. package/event/exchange_reward_result.tsx +137 -0
  53. package/event/exchange_ticket.tsx +234 -0
  54. package/event/exchange_ticket_list.tsx +191 -0
  55. package/event/exchange_ticket_result.tsx +211 -0
  56. package/event/exit.tsx +91 -0
  57. package/event/exit_failed.tsx +135 -0
  58. package/event/exit_list.tsx +118 -0
  59. package/event/exit_log.tsx +131 -0
  60. package/event/exit_success.tsx +143 -0
  61. package/event/exit_temporary.tsx +226 -0
  62. package/event/hall_in.tsx +148 -0
  63. package/event/hall_in_failed.tsx +270 -0
  64. package/event/hall_in_list.tsx +222 -0
  65. package/event/hall_in_log.tsx +134 -0
  66. package/event/hall_in_success.tsx +132 -0
  67. package/event/hall_out.tsx +143 -0
  68. package/event/hall_out_failed.tsx +133 -0
  69. package/event/hall_out_list.tsx +215 -0
  70. package/event/hall_out_log.tsx +133 -0
  71. package/event/hall_out_success.tsx +130 -0
  72. package/event/list.tsx +219 -0
  73. package/event/list_filter.tsx +124 -0
  74. package/event/log.tsx +435 -0
  75. package/event/qc_idcard.tsx +209 -0
  76. package/event/qc_idcard_failed.tsx +78 -0
  77. package/event/qc_idcard_success.tsx +68 -0
  78. package/event/queue_out.tsx +186 -0
  79. package/event/queue_pricing.tsx +152 -0
  80. package/event/randomseat.tsx +33 -0
  81. package/event/review.tsx +117 -0
  82. package/event/review_add.tsx +342 -0
  83. package/event/review_detail.tsx +67 -0
  84. package/event/review_item.tsx +76 -0
  85. package/event/scan_item.tsx +66 -0
  86. package/event/schedule.tsx +135 -0
  87. package/event/seat.tsx +628 -0
  88. package/event/seat_autopick.tsx +120 -0
  89. package/event/seat_map.tsx +408 -0
  90. package/event/seat_map_matrix.tsx +94 -0
  91. package/event/seat_map_test.tsx +401 -0
  92. package/event/ticket_list.tsx +722 -0
  93. package/event/ticket_list2.tsx +680 -0
  94. package/event/timer.tsx +58 -0
  95. package/event/tms.tsx +103 -0
  96. package/event/tms_add.tsx +94 -0
  97. package/event/tms_add_result.tsx +175 -0
  98. package/event/tms_dashboard.tsx +89 -0
  99. package/event/tms_event_list.tsx +66 -0
  100. package/event/turnstile_event_gate.tsx +74 -0
  101. package/event/turnstile_event_item.tsx +41 -0
  102. package/event/turnstile_event_list.tsx +69 -0
  103. package/event/turnstile_event_ticket.tsx +95 -0
  104. package/event/turnstile_settings.tsx +327 -0
  105. package/event/turnstile_settings_otp.tsx +58 -0
  106. package/event/turnstile_settings_status.tsx +50 -0
  107. package/event/voucher.tsx +149 -0
  108. package/event/voucher_multi.tsx +181 -0
  109. package/fonts/Arial.ttf +0 -0
  110. package/fonts/ArialBold.ttf +0 -0
  111. package/fonts/DecoNumbers.ttf +0 -0
  112. package/fonts/MonoSpace.ttf +0 -0
  113. package/fonts/SFProText.ttf +0 -0
  114. package/fonts/digital.ttf +0 -0
  115. package/fonts/mono.ttf +0 -0
  116. package/id.json +1113 -0
  117. package/index.js +2 -0
  118. package/libs.json +1 -0
  119. package/mover.js +0 -0
  120. package/package.json +16 -0
  121. package/publisher.js +84 -0
@@ -0,0 +1,118 @@
1
+ // withHooks
2
+
3
+ import { applyStyle } from 'esoftplay';
4
+ import { ComponentButton } from 'esoftplay/cache/component/button/import';
5
+ import { ComponentHeader } from 'esoftplay/cache/component/header/import';
6
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
7
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
8
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
9
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
10
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
11
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
12
+ import { TicketItemProperty } from 'esoftplay/cache/ticket/item/import';
13
+ import { UserClass } from 'esoftplay/cache/user/class/import';
14
+ import esp from 'esoftplay/esp';
15
+ import useSafeState from 'esoftplay/state';
16
+ import React from 'react';
17
+ import { Platform, Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
18
+
19
+
20
+ export interface EventExit_listArgs {
21
+
22
+ }
23
+ export interface EventExit_listProps {
24
+
25
+ }
26
+ export default function m(props: EventExit_listProps): any {
27
+ const { data, scan_type, url_ticket_update, url_ticket_detail, price_type, gate_type, event_id, selectGate, typeScanner, event_title, configPriority }: any = LibNavigation.getArgsAll<any>(props)
28
+ const [result, setResult] = useSafeState<any>(data)
29
+ const [useAll, setUseAll] = useSafeState<boolean>(true)
30
+
31
+ const transformStyle = Platform.OS == "ios" ? { transform: [{ scaleY: - 1 }] } : { transform: [{ rotateX: '180deg' }] }
32
+ function renderItem(item: any, i: number) {
33
+ return (
34
+ <Pressable onPress={() => {
35
+ setResult(LibObject.set(result, item?.checked == 0 ? 1 : 0)('list', i, 'checked'))
36
+ setUseAll(false)
37
+ }} key={i} style={{ margin: 10, marginBottom: 10, marginTop: 5, padding: 10, borderRadius: 10, backgroundColor: LibStyle.colorPrimary, flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'space-between' }}>
38
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail' style={{ fontSize: 20, fontWeight: 'bold', flexWrap: 'wrap', color: TicketItemProperty.textColor(item?.color), marginRight: 10 }}>{item?.price_name}</Text>
39
+ <LibIcon.Ionicons name={item?.checked == 1 ? 'checkmark-circle' : 'radio-button-off-outline'} size={26} color={TicketItemProperty.textColor(item?.color)} />
40
+ </Pressable>
41
+ )
42
+ }
43
+
44
+ let args = {
45
+ selectGate: selectGate,
46
+ fromPage: 'bigbang/gate_info',
47
+ event_id: event_id,
48
+ event_title: event_title,
49
+ typeScanner: typeScanner,
50
+ gate_type: gate_type,
51
+ price_type: price_type,
52
+ url_ticket_detail: url_ticket_detail,
53
+ url_ticket_update: url_ticket_update,
54
+ configPriority: configPriority,
55
+ data: result,
56
+ scan_type: scan_type
57
+ }
58
+
59
+ function quit(): void {
60
+ let a = result?.list?.filter((item: any) => item.checked == 1).map((it: any) => it.id)
61
+ if (a.length == 0) {
62
+ LibToastProperty.show(esp.lang("event/exit_list", "select_ticket"))
63
+ return
64
+ } else {
65
+ let url = "event_tms_out_confirm"
66
+ let post = {
67
+ event_id: event_id,
68
+ ids: JSON.stringify(a),
69
+ gate_id: selectGate?.id,
70
+ trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
71
+ price_id: result?.list?.filter((item: any) => item.checked == 1).map((it: any) => it.price_id),
72
+ scanned_out: LibUtils.moment().format('YYYY-MM-DD HH:mm:ss'),
73
+ }
74
+
75
+ LibNavigation.replace('event/exit_success', { ...args, url, post })
76
+ }
77
+ }
78
+
79
+ return (
80
+ <View style={{ flex: 1, backgroundColor: '#fff' }}>
81
+ <ComponentHeader title={esp.lang("event/exit_list", "header_title")} subtitle={esp.lang("event/exit_list", "exit_gate", data?.event_name)} />
82
+ <ScrollView style={{ marginTop: 20 }}>
83
+ {
84
+ result?.list?.map(renderItem)
85
+ }
86
+ </ScrollView>
87
+ <View style={{ padding: 10 }}>
88
+ <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'space-between' }}>
89
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode={'tail'} style={{ fontWeight: 'bold', fontSize: 14, letterSpacing: 1 }}>{result?.list?.filter((item: any) => item.checked == 1).length + " Tiket digunakan"}</Text>
90
+ <TouchableOpacity onPress={() => {
91
+ let a = result?.list?.map((item: any, i: number) => {
92
+ return { ...item, checked: useAll ? 0 : 1 }
93
+ })
94
+ let b = {
95
+ ...result,
96
+ list: a
97
+ }
98
+ setResult(b)
99
+ setUseAll(useAll ? false : true)
100
+ }} style={applyStyle({ paddingHorizontal: 15, borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 35, borderRadius: 16, backgroundColor: useAll ? LibStyle.colorRed : LibStyle.colorGreen, flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center' })} >
101
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: '#fff', marginRight: 15 })} >{useAll ? esp.lang("event/entrance_list", "cancel_use") : esp.lang("event/entrance_list", "use_all")}</Text>
102
+ <LibIcon.Ionicons size={18} color="#fff" name={useAll ? "close" : "checkmark-done"} />
103
+ </TouchableOpacity>
104
+ </View>
105
+
106
+ <ComponentButton
107
+ label={esp.lang("event/exit_list", "exit")}
108
+ backgroundColor={LibStyle.colorRed}
109
+ onPress={() => {
110
+ quit()
111
+ }}
112
+ style={{ marginTop: 30 }}
113
+ />
114
+
115
+ </View>
116
+ </View>
117
+ )
118
+ }
@@ -0,0 +1,131 @@
1
+ // withHooks
2
+ import { useEffect } from 'react';
3
+
4
+ import { BigbangGate_infoProperty } from 'esoftplay/cache/bigbang/gate_info/import';
5
+ import { EventExit_successProperty } from 'esoftplay/cache/event/exit_success/import';
6
+ import { EventLogProperty } from 'esoftplay/cache/event/log/import';
7
+ import { LibLoading } from 'esoftplay/cache/lib/loading/import';
8
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
9
+ import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
10
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
11
+ import { UseCondition } from 'esoftplay/cache/use/condition/import';
12
+ import esp from 'esoftplay/esp';
13
+ import useSafeState from 'esoftplay/state';
14
+ import { useTimeout } from 'esoftplay/timeout';
15
+ import React from 'react';
16
+ import { Text, View } from 'react-native';
17
+ import Pressable from '../lib/pressable';
18
+
19
+
20
+ export interface EventExit_logArgs {
21
+
22
+ }
23
+ export interface EventExit_logProps {
24
+ onPress: (type: string, title: string) => void
25
+ }
26
+
27
+ export interface ExitLogItem {
28
+ text: string
29
+ subtitle: string
30
+ value: string
31
+ onPress: () => void
32
+ valuecolor?: string
33
+ }
34
+
35
+ function Item(props: ExitLogItem) {
36
+ return (
37
+ <Pressable
38
+ onPress={() => {
39
+ props.onPress()
40
+ }} style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', marginHorizontal: 15, paddingVertical: 6, borderBottomWidth: 1, borderBottomColor: LibStyle.colorLightGrey }}>
41
+ <View>
42
+ <LibTextstyle text={props.text} textStyle="subhead" />
43
+ <Text style={{ marginTop: 3, fontSize: 12, color: LibStyle.colorBrown }}>{props.subtitle}</Text>
44
+ </View>
45
+ <LibTextstyle text={LibUtils.number(props.value)} style={{ color: props.valuecolor ? props.valuecolor : "#000" }} textStyle="title2" />
46
+ </Pressable>
47
+ )
48
+ }
49
+
50
+
51
+ export default function m(props: EventExit_logProps): any {
52
+
53
+ const logExit = BigbangGate_infoProperty.counterState().useSelector(s => s)
54
+ const backupExit = EventExit_successProperty.syncTicketExit().useSelector(s => s)
55
+ const [loading, setLoading] = useSafeState<boolean>(true)
56
+ const timeout = useTimeout()
57
+
58
+ function syncExitData() {
59
+ BigbangGate_infoProperty.subscribeSyncExit().trigger(EventExit_successProperty.syncTicketExit().get())
60
+ timeout(() => {
61
+ setLoading(false)
62
+ }, 1000)
63
+ }
64
+
65
+ function forceSyncExitData() {
66
+ BigbangGate_infoProperty.subscribeSyncExitReset().trigger(EventExit_successProperty.syncTicketExit().get())
67
+ timeout(() => {
68
+ setLoading(false)
69
+ }, 1000)
70
+ }
71
+
72
+ useEffect(() => {
73
+ syncExitData()
74
+ }, [])
75
+
76
+
77
+ if (loading) {
78
+ return <LibLoading />
79
+ }
80
+
81
+ const sumValue = EventLogProperty.sumValuesPerCategory(logExit)
82
+
83
+ return (
84
+ <View style={{ flex: 1, backgroundColor: '#fff', margin: 17, marginTop: 0, paddingBottom: 10, marginBottom: 0, borderBottomRightRadius: 10, borderBottomLeftRadius: 10, ...LibStyle.elevation(2) }}>
85
+ <Item subtitle={esp.lang("event/exit_log", "ticket_scan_out")} text={esp.lang("event/exit_log", "scan_out")} value={sumValue?.out_scan} onPress={() => {
86
+ if (sumValue?.out_scan) {
87
+ props.onPress("out_scan", esp.lang("event/exit_log", "scan_out"))
88
+ }
89
+
90
+ }} />
91
+ <Item subtitle={esp.lang("event/exit_log", "qty_scanned_out")} text={esp.lang("event/exit_log", "qty_ticket_scan_out")} value={sumValue?.out_ticket} onPress={() => {
92
+ if (sumValue?.out_ticket) {
93
+ props.onPress("out_ticket", esp.lang("event/exit_log", "qty_ticket_scan_out"))
94
+ }
95
+
96
+ }} />
97
+ <Item subtitle={esp.lang("event/exit_log", "ticket_scanned_out")} text={esp.lang("event/exit_log", "opengate_out")} value={sumValue?.out_opengate} onPress={() => {
98
+ if (sumValue?.out_opengate) {
99
+ props.onPress("out_opengate", esp.lang("event/exit_log", "opengate_out"))
100
+ }
101
+
102
+ }} />
103
+ <Item subtitle={esp.lang("event/exit_log", "data_send_to_server")} text={esp.lang("event/exit_log", "data_send")} value={sumValue?.out_send} onPress={() => {
104
+ if (sumValue?.out_send) {
105
+ props.onPress("out_send", esp.lang("event/exit_log", "data_send"))
106
+ }
107
+
108
+ }} />
109
+ <Item subtitle={esp.lang("event/exit_log", "data_not_send_to_server")} text={esp.lang("event/exit_log", "data_not_send")} value={backupExit.length} valuecolor={LibStyle.colorRed} onPress={() => {
110
+
111
+ }} />
112
+
113
+ <View style={{ marginHorizontal: 15 }} >
114
+ <UseCondition
115
+ if={backupExit.length == 0}
116
+ fallback={
117
+ <Pressable onPress={() => {
118
+ setLoading(true)
119
+ forceSyncExitData()
120
+ }}>
121
+ <Text allowFontScaling={false} style={{ textAlign: 'center' }}>{esp.lang("event/exit_log", "waiting")}<Text style={{ color: LibStyle.colorBlue, textDecorationStyle: 'solid', textDecorationLine: 'underline' }}>{esp.lang("event/exit_log", "click")}</Text> {esp.lang("event/exit_log", "re_try")}</Text>
122
+ </Pressable>
123
+ } >
124
+ <LibTextstyle textStyle='callout'
125
+ style={{ textAlign: 'center', marginTop: 15 }}
126
+ text={esp.lang("event/exit_log", "all_data_send")} />
127
+ </UseCondition>
128
+ </View>
129
+ </View >
130
+ )
131
+ }
@@ -0,0 +1,143 @@
1
+ // withHooks
2
+ import { BigbangGate_infoProperty } from 'esoftplay/cache/bigbang/gate_info/import';
3
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
4
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
5
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
6
+ import { LibStatusbar } from 'esoftplay/cache/lib/statusbar/import';
7
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
8
+ import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
9
+ import { LinearGradient } from 'expo-linear-gradient';
10
+ import { useEffect, useRef } from 'react';
11
+
12
+ import esp from 'esoftplay/esp';
13
+ import useSafeState from 'esoftplay/state';
14
+ import React from 'react';
15
+ import { Animated, Easing, Pressable, Text, View } from 'react-native';
16
+
17
+
18
+ export interface EventExit_successArgs {
19
+
20
+ }
21
+ export interface EventExit_successProps {
22
+
23
+ }
24
+
25
+ const dataListTicketExit = useGlobalState<any[]>([], { persistKey: 'event_exit_tiket_sync', loadOnInit: true, inFastStorage: true })
26
+ export function syncTicketExit(): useGlobalReturn<any[]> {
27
+ return dataListTicketExit
28
+ }
29
+
30
+
31
+ export default function m(props: EventExit_successProps): any {
32
+ const { scan_type, data, url, post, url_ticket_update, url_ticket_detail, price_type, gate_type, event_id, selectGate, typeScanner, event_title, configPriority }: any = LibNavigation.getArgsAll<any>(props)
33
+
34
+ const [isPaused, setIsPaused] = useSafeState<boolean>(false)
35
+ const progress = useRef(new Animated.Value(0)).current;
36
+ const animation = useRef<Animated.CompositeAnimation | null>(null);
37
+ const [pausedValue, setPausedValue] = useSafeState(0);
38
+
39
+ function animateProgressBar() {
40
+ const duration = 1000; // Ubah durasi animasi sesuai kebutuhan Anda
41
+
42
+ if (!isPaused) {
43
+ animation.current = Animated.timing(progress, {
44
+ toValue: 1,
45
+ duration: duration - duration * pausedValue,
46
+ easing: Easing.linear,
47
+ useNativeDriver: false,
48
+ });
49
+
50
+ animation.current.start(({ finished }) => {
51
+ if (finished) {
52
+ setIsPaused(false);
53
+ setPausedValue(0);
54
+
55
+ // script next nya disini
56
+ LibNavigation.replace('component/scanner', {
57
+ selectGate: selectGate,
58
+ fromPage: 'bigbang/gate_info',
59
+ event_id: event_id,
60
+ event_title: event_title,
61
+ typeScanner: typeScanner,
62
+ gate_type: gate_type,
63
+ price_type: price_type,
64
+ url_ticket_detail: url_ticket_detail,
65
+ url_ticket_update: url_ticket_update,
66
+ configPriority: configPriority,
67
+ scan_type: scan_type
68
+ })
69
+ }
70
+ });
71
+ } else {
72
+ if (animation.current) {
73
+ animation.current.stop(); // Hentikan animasi
74
+ animation.current = null;
75
+ }
76
+ setPausedValue(progress._value);
77
+ }
78
+
79
+ setIsPaused(!isPaused);
80
+ }
81
+
82
+ useEffect(() => {
83
+ // sementara price_id tak jupuk index 0
84
+ BigbangGate_infoProperty.addCounterOutOpenGate(1, post?.price_id?.[0])
85
+ dataListTicketExit?.get()
86
+ createDataExit()
87
+ animateProgressBar()
88
+ }, [])
89
+
90
+ function createDataExit() {
91
+ dataListTicketExit.set(LibObject.push(dataListTicketExit.get(), [url, post])())
92
+ BigbangGate_infoProperty.subscribeSyncExit().trigger(dataListTicketExit.get())
93
+ }
94
+
95
+ let uniquePrices: any = {};
96
+
97
+ data?.list?.filter((entry: any) => {
98
+ return entry.checked == 1;
99
+ }).forEach((entry: any) => {
100
+ uniquePrices[entry.price_name] = true;
101
+ });
102
+
103
+ let uniquePriceNames = Object.keys(uniquePrices);
104
+
105
+ const widthInterpolate = progress.interpolate({
106
+ inputRange: [0, 1],
107
+ outputRange: ['0%', '100%'],
108
+ });
109
+
110
+ return (
111
+ <View style={{ flex: 1 }}>
112
+ <LibStatusbar style='light' />
113
+ <Pressable
114
+ onPressIn={animateProgressBar}
115
+ onPressOut={animateProgressBar}
116
+ style={{ backgroundColor: '#000', height: LibStyle.height }}>
117
+ <LibPicture source={{ uri: 'https://www.w3schools.com/howto/img_avatar.png' }} style={{ width: LibStyle.width, height: LibStyle.height - (LibStyle.height / 4) }} resizeMode={"cover"} />
118
+
119
+ <View style={{ marginTop: LibStyle.STATUSBAR_HEIGHT + 5, alignSelf: 'center', height: 5, width: LibStyle.width - 20, backgroundColor: 'rgba(255,255,255,0.3)', borderRadius: 10, position: 'absolute', top: 5, }}>
120
+ <Animated.View style={{ width: widthInterpolate, height: 5, backgroundColor: LibStyle.colorPrimary, borderRadius: 10, }} />
121
+ </View>
122
+
123
+ <LinearGradient
124
+ // Background Linear Gradient
125
+ style={{
126
+ height: LibStyle.height - (LibStyle.height / 3),
127
+ width: LibStyle.width,
128
+ position: 'absolute',
129
+ left: 0,
130
+ right: 0,
131
+ bottom: 0,
132
+ }}
133
+ colors={['rgba(255,255,255,0)', 'rgba(0,0,0,0.55)', 'rgba(0,0,0,1)', 'rgba(0,0,0,1)']}>
134
+ <View style={{ flex: 1, padding: 15, justifyContent: 'flex-end', paddingBottom: 100, alignContent: 'center', alignItems: 'center' }}>
135
+ <Text allowFontScaling={false} style={{ textAlign: 'center', flexWrap: 'wrap', fontSize: 35, letterSpacing: 2, fontWeight: '900', color: '#fff' }}>{uniquePriceNames.join(',')}</Text>
136
+ <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 26, marginTop: 20, color: LibStyle.colorRed }}>{esp.lang("event/exit_success", "exit")}</Text>
137
+ </View>
138
+
139
+ </LinearGradient>
140
+ </Pressable>
141
+ </View>
142
+ )
143
+ }
@@ -0,0 +1,226 @@
1
+ // withHooks
2
+ import { ComponentHeader } from 'esoftplay/cache/component/header/import';
3
+ import { EventScan_item } from 'esoftplay/cache/event/scan_item/import';
4
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
5
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
6
+ import { LibLoading } from 'esoftplay/cache/lib/loading/import';
7
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
8
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
9
+ import { LibProgress } from 'esoftplay/cache/lib/progress/import';
10
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
11
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
12
+
13
+ import { applyStyle } from 'esoftplay';
14
+ import { ComponentButton } from 'esoftplay/cache/component/button/import';
15
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
16
+ import esp from 'esoftplay/esp';
17
+ import useSafeState from 'esoftplay/state';
18
+ import React, { useEffect } from 'react';
19
+ import { ScrollView, Text, View } from 'react-native';
20
+
21
+
22
+ export interface EventExit_temporaryArgs {
23
+
24
+ }
25
+ export interface EventExit_temporaryProps {
26
+
27
+ }
28
+ export default function m(props: EventExit_temporaryProps): any {
29
+ const user_qr = LibNavigation.getArgs(props, 'qr_code')
30
+ const { scan_type, event_id, selectGate, typeScanner }: any = LibNavigation.getArgsAll(props)
31
+ const [result, setResult] = useSafeState<any>(undefined)
32
+
33
+ useEffect(() => {
34
+ loadData()
35
+ }, [])
36
+
37
+ function loadData() {
38
+ var post = {
39
+ event_id: event_id,
40
+ // event_id: "264",
41
+ user_qr: encodeURIComponent(user_qr),
42
+ gate_id: selectGate.id
43
+ // user_qr: encodeURIComponent("BBO-H6851"),
44
+ }
45
+ new LibCurl('event_tms_out_temporary', post, (res) => {
46
+ let a = res?.list?.length > 0 && res.list.map((item: any, i: number) => {
47
+ return ({
48
+ ...item,
49
+ checked: 0
50
+ })
51
+ })
52
+ let b = res?.staff?.length > 0 && res.staff.map((item: any, i: number) => {
53
+ return ({
54
+ ...item,
55
+ checked: 0
56
+ })
57
+ })
58
+
59
+ let c = {
60
+ ...res,
61
+ list: res?.list?.length == 0 ? [] : a,
62
+ staff: res?.staff?.length == 0 ? [] : b
63
+ }
64
+ esp.log({ res, c });
65
+ setResult(c)
66
+
67
+ }, (error) => {
68
+ LibDialog.warningConfirm(esp.lang("event/exit_temporary", "fault"), error?.message, esp.lang("event/exit_temporary", "back"), () => LibNavigation.back(), "", () => { })
69
+ }, 1)
70
+ }
71
+
72
+ function quitTemporary(): void {
73
+ let list = [...result?.list, ...result.staff]
74
+ let a = list.filter((item: any) => item.checked == 1).map((it: any) => it.id)
75
+
76
+ if (a.length == 0) {
77
+ LibToastProperty.show(esp.lang("event/exit_temporary", "select_ticket"))
78
+ return
79
+ }
80
+ var post = {
81
+ event_id: event_id,
82
+ ids: JSON.stringify(a),
83
+ gate_id: selectGate.id
84
+ }
85
+
86
+ LibProgress.show(esp.lang("event/exit_temporary", "wait"))
87
+ new LibCurl('event_tms_out_temporary_confirm', post, (result, msg) => {
88
+ LibProgress.hide()
89
+ LibDialog.confirm(esp.lang("event/exit_temporary", "info"), msg, esp.lang("event/exit_temporary", "ok"), () => {
90
+ LibNavigation.replace('component/scanner', {
91
+ fromPage: 'bigbang/gate_info',
92
+ isTemporaryExit: true,
93
+ event_id: event_id,
94
+ selectGate: selectGate,
95
+ typeScanner: typeScanner,
96
+ scan_type: scan_type
97
+ })
98
+ }, "", () => { })
99
+ }, (error) => {
100
+ LibDialog.warning(esp.lang("event/exit_temporary", "oops"), error?.message)
101
+ LibProgress.hide()
102
+ }, 1)
103
+ }
104
+
105
+ if (!result) return <LibLoading />
106
+
107
+ let lastStatusScanned = ''
108
+ function renderTicketTemporary(item: any, i: number) {
109
+ const showStatusScanned = lastStatusScanned != item?.status_label
110
+ lastStatusScanned = item?.status_label
111
+ return (
112
+ <View key={i}>
113
+ {
114
+ showStatusScanned &&
115
+ <View style={{ backgroundColor: item?.status == 1 ? '#fff' : "#c5c5c5", padding: 10, borderBottomWidth: 2, borderBottomColor: LibStyle.colorBgGrey }} >
116
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 16, fontWeight: "bold", fontStyle: "normal", letterSpacing: 1.5, color: item?.status == 1 ? item?.status_background : "#fff" }}>{(item?.status_label).toUpperCase()}</Text>
117
+ </View>
118
+ }
119
+ <EventScan_item
120
+ key={i}
121
+ item={item}
122
+ colorFont={"#fff"}
123
+ style={{ backgroundColor: item?.status == 1 ? "#fff" : "#c5c5c5" }}
124
+ event_image={result?.event_image}
125
+ event_name={result?.event_name}
126
+ event_ondate={result?.event_ondate}
127
+ colorText={item?.status == 1 ? "#000" : LibStyle.colorBgGrey}
128
+ label={
129
+ item.status == 0 ?
130
+ esp.lang("event/exit_temporary", "used") :
131
+ item.checked == 0 ?
132
+ esp.lang("event/exit_temporary", "use") :
133
+ esp.lang("event/exit_temporary", "cancel")
134
+ }
135
+ onPress={() => {
136
+ if (item?.status == 1 && item?.is_limit == 0) {
137
+ let a = LibObject.set(result, item.checked == 1 ? 0 : 1)('list', i, 'checked')
138
+ setResult(a)
139
+ }
140
+ }}
141
+ colorBackground={(item.status == 0 || item.is_limit == 1) ? LibStyle.colorLightGrey : (item.checked == 0) ? LibStyle.colorGreen : LibStyle.colorRed}
142
+ />
143
+ </View>
144
+ )
145
+ }
146
+
147
+ let lastStatusStaff = ''
148
+ function renderStaff(item: any, i: number) {
149
+ const showStatusScanned = lastStatusStaff != item?.status_label
150
+ lastStatusStaff = item?.status_label
151
+
152
+ return (
153
+ <View key={i}>
154
+ {
155
+ showStatusScanned &&
156
+ <View style={{ backgroundColor: item?.status == 1 ? '#fff' : "#c5c5c5", padding: 10, borderBottomWidth: 2, borderBottomColor: LibStyle.colorBgGrey }} >
157
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 16, fontWeight: "bold", fontStyle: "normal", letterSpacing: 1.5, color: item?.status == 1 ? item?.status_background : "#fff" }}>{(item?.status_label).toUpperCase()}</Text>
158
+ </View>
159
+ }
160
+ <View style={{ padding: 10, overflow: 'hidden', flex: 1, flexDirection: 'row', backgroundColor: '#fff', borderBottomColor: LibStyle.colorGrey, borderBottomWidth: 1.5 }}>
161
+ <LibPicture style={applyStyle({ borderRadius: 5, width: LibStyle.width / 4.5, height: LibStyle.width / 4.5, backgroundColor: LibStyle.colorBgGrey })} source={{ uri: item?.image }} />
162
+ <View style={{ marginLeft: 10, flex: 1 }}>
163
+ <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: "#000", marginBottom: 4, fontSize: 18, fontWeight: 'bold' })}>{item.name}</Text>
164
+ <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: "#000", marginBottom: 4, fontSize: 14 })}>{item.department_name}</Text>
165
+ <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: "#000", marginBottom: 4, fontSize: 16 })}>{item.exhibitor_name}</Text>
166
+ {
167
+ item.status == 1 &&
168
+ <ComponentButton style={applyStyle({ marginTop: 10, alignSelf: 'flex-end', width: LibStyle.width / 3, backgroundColor: (item.status == 0 || item.is_limit == 1) ? LibStyle.colorLightGrey : (item.checked == 0) ? LibStyle.colorGreen : LibStyle.colorRed })} label={
169
+ item.status == 0 ?
170
+ esp.lang("event/exit_temporary", "used") :
171
+ item.hasOwnProperty("checked") && item.checked == 0 ?
172
+ esp.lang("event/exit_temporary", "use") :
173
+ esp.lang("event/exit_temporary", "cancel")
174
+ } fontColor={"#fff"} onPress={() => {
175
+ let a = LibObject.set(result, item.checked == 1 ? 0 : 1)('staff', i, 'checked')
176
+ setResult(a)
177
+ }} />
178
+ }
179
+ </View>
180
+ <View pointerEvents='none' style={{ position: 'absolute', justifyContent: 'center', transform: [{ rotate: '45deg' }], margin: 1, ...LibStyle.elevation(2), height: 20, width: 170, backgroundColor: LibStyle.colorPrimary, right: -50, top: 25 }} >
181
+ <Text style={{ color: 'white', alignSelf: 'center', fontWeight: 'bold' }} >ID CARD</Text>
182
+ </View>
183
+ </View>
184
+ </View>
185
+ )
186
+ }
187
+
188
+ const sortedData = result?.list?.length > 0 && result?.list.sort((a: any, b: any) => {
189
+ if (a.is_limit == 0 && b.is_limit != 0) {
190
+ return -1; // a di atas b
191
+ } else if (a.is_limit != 0 && b.is_limit == 0) {
192
+ return 1; // b di atas a
193
+ } else {
194
+ return 0; // urutan relatif tidak berubah
195
+ }
196
+ });
197
+
198
+ return (
199
+ <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
200
+ <ComponentHeader title={esp.lang("event/exit_temporary", "temp_out")} />
201
+
202
+ <ScrollView>
203
+ <View style={{ margin: 15, marginBottom: 0, borderRadius: 7, overflow: 'hidden' }}>
204
+ {
205
+ result?.staff?.length > 0 && result?.staff?.map(renderStaff)
206
+ }
207
+ </View>
208
+ <View style={{ margin: 15, borderRadius: 7, overflow: 'hidden' }}>
209
+ {
210
+ sortedData?.length > 0 && sortedData?.map(renderTicketTemporary)
211
+ }
212
+ </View>
213
+ </ScrollView>
214
+ <View style={{ padding: 10, backgroundColor: '#fff' }}>
215
+ <ComponentButton
216
+ label={esp.lang("event/exit_temporary", "btn_exit")}
217
+ backgroundColor={LibStyle.colorRed}
218
+ onPress={() => {
219
+ quitTemporary()
220
+ }}
221
+ // style={{ marginTop: 20 }}
222
+ />
223
+ </View>
224
+ </View>
225
+ )
226
+ }