esoftplay-event 0.0.1-u → 0.0.1-w

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.
@@ -17,6 +17,7 @@ export interface EventCountdown_baseProps {
17
17
  onlyDay?: boolean
18
18
  onExpired?: () => void
19
19
  hideTimeUnit?: boolean
20
+ showDayUnit?: boolean
20
21
  }
21
22
 
22
23
  const fixSingleNumber = (number: number) => number < 10 ? '0' + number : number
@@ -63,6 +64,18 @@ export default function m(props: EventCountdown_baseProps): any {
63
64
  }
64
65
  }
65
66
  ref?.current?.setNativeProps({ text: text.filter((x, i) => !isNaN(Number(x))).map((d, id) => d + (props?.hideTimeUnit ? '' : ' ' + t[id])).join(" : ") })
67
+ } else if (props?.showDayUnit && props?.hideTimeUnit) {
68
+ const data = text
69
+ .filter((x, i) => !isNaN(Number(x)))
70
+ .map((d, id) => {
71
+ return (d + (id == 0 ? " " + t[0] + " " : ""))
72
+ })
73
+ const firstData = data[0]
74
+ data.splice(0, 1)
75
+
76
+ ref?.current?.setNativeProps({
77
+ text: firstData + " " + data.join(" : ")
78
+ })
66
79
  } else {
67
80
  ref?.current?.setNativeProps({ text: text.filter((x, i) => !isNaN(Number(x))).map((d, id) => d + (props?.hideTimeUnit ? '' : ' ' + t[id])).join(" : ") })
68
81
  }
@@ -0,0 +1,47 @@
1
+ // withHooks
2
+ // noPage
3
+
4
+ import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import';
5
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
6
+ import React, { useEffect } from 'react';
7
+ import { StyleProp, Text, TextStyle, View, ViewStyle } from 'react-native';
8
+ import Animated, { useAnimatedStyle, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
9
+
10
+
11
+ export interface EventCountdown_eventArgs {
12
+
13
+ }
14
+ export interface EventCountdown_eventProps {
15
+ date: string,
16
+ containerStyle?: StyleProp<ViewStyle>
17
+ bulletStyle?: StyleProp<ViewStyle>,
18
+ style?: StyleProp<TextStyle>
19
+ }
20
+ export default function m(props: EventCountdown_eventProps): any {
21
+ const opacity = useSharedValue(1)
22
+
23
+ useEffect(() => {
24
+ opacity.value = withRepeat(
25
+ withTiming(0.2, { duration: 500 }),
26
+ -1,
27
+ true
28
+ )
29
+ }, [])
30
+
31
+ const animatedStyle = useAnimatedStyle(() => ({
32
+ opacity: opacity.value
33
+ }))
34
+
35
+ return (
36
+ <View style={[{ flexDirection: 'row', alignItems: 'center' }, props?.containerStyle]}>
37
+ <Animated.View style={[{ marginRight: 5, width: 8, height: 8, borderRadius: 5, backgroundColor: LibStyle.colorGreen }, animatedStyle, props?.bulletStyle]} />
38
+ <Text allowFontScaling={false} style={[{ fontFamily: "Arial", fontSize: 11, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }, props?.style]}>{esp.lang("event/countdown_event", "ends")}</Text>
39
+ <EventCountdown_base
40
+ expired={props.date}
41
+ showDayUnit
42
+ hideTimeUnit
43
+ style={[{ fontFamily: "Arial", fontSize: 11, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }, props?.style]}
44
+ />
45
+ </View>
46
+ )
47
+ }
package/event/detail.tsx CHANGED
@@ -11,7 +11,7 @@ import { LibVideoProperty } from 'esoftplay/cache/lib/video/import';
11
11
  import { LibWebview } from 'esoftplay/cache/lib/webview/import';
12
12
 
13
13
  import { applyStyle } from 'esoftplay';
14
- import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import';
14
+ import { EventCountdown_event } from 'esoftplay/cache/event/countdown_event/import';
15
15
  import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
16
16
  import { EventHeader } from 'esoftplay/cache/event/header/import';
17
17
  import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
@@ -139,15 +139,13 @@ export default function m(props: EventDetailProps): any {
139
139
  <Text allowFontScaling={false} style={{ marginLeft: 10, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#f39c12" }} >{result.status == 4 ? esp.lang("event/detail", "evn_pending") : LibUtils.getDateRange(result.start_date, result.end_date, esp.lang("event/detail", "until"))}</Text>
140
140
  </View>
141
141
  {
142
- esp.isDebug("countdown") && result?.countdown_booking == 1 && result?.start_date != "0000-00-00" && result.end_date != '0000-00-00' &&
143
- <View style={{ flexDirection: 'row', marginBottom: 10, alignItems: 'center', marginHorizontal: 20 }} >
144
- <LibPicture source={esp.assets('icons/ic_calendar_grey.png')} style={{ width: 14, height: 14 }} />
145
- <Text allowFontScaling={false} style={{ marginLeft: 10, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }}>{"Berakhir dalam"} </Text>
146
- <EventCountdown_base
147
- expired={(result?.end_date + " " + result?.end_time)}
148
- style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }}
149
- />
150
- </View>
142
+ esp.isDebug("show_countdown") && result?.countdown_booking == 1 && result?.start_date != "0000-00-00" && result.end_date != '0000-00-00' &&
143
+ <EventCountdown_event
144
+ date={(result?.end_date + " " + result?.end_time)}
145
+ style={{ fontSize: 12 }}
146
+ bulletStyle={{ width: 14, height: 14, borderRadius: 7, marginRight: 10 }}
147
+ containerStyle={{ marginHorizontal: 20, marginBottom: 10 }}
148
+ />
151
149
  }
152
150
  <View style={{ flexDirection: 'row', marginBottom: 10, alignItems: 'center', marginHorizontal: 20 }} >
153
151
  <LibPicture source={esp.assets('icons/ic_tickets_grey.png')} style={{ width: 14, height: 14 }} />
@@ -1,6 +1,7 @@
1
1
  // withHooks
2
2
  import { EventExchange_ticketProperty } from 'esoftplay/cache/event/exchange_ticket/import';
3
3
  import { EventHeader } from 'esoftplay/cache/event/header/import';
4
+ import { EventOrder_itemProperty } from 'esoftplay/cache/event/order_item/import';
4
5
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
5
6
  import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
6
7
  import { LibLoading } from 'esoftplay/cache/lib/loading/import';
@@ -9,7 +10,6 @@ import { LibObject } from 'esoftplay/cache/lib/object/import';
9
10
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
10
11
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
11
12
  import { LibUtils } from 'esoftplay/cache/lib/utils/import';
12
- import { EventOrder_itemProperty } from 'esoftplay/cache/event/order_item/import';
13
13
  import esp from 'esoftplay/esp';
14
14
  import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
15
15
  import useSafeState from 'esoftplay/state';
@@ -529,14 +529,14 @@ export default function m(props: EventOrder_detailProps): any {
529
529
  })
530
530
  }}
531
531
  icon={'dice-multiple'}
532
- title={esp.lang("event/order_detail", "join_lucky_draw")}
533
- info={esp.lang("event/order_detail", "subtitle_lucky_draw")}
532
+ title={result?.config_luckydraw != null ? result?.config_luckydraw?.title : esp.lang("event/order_detail", "join_lucky_draw")}
533
+ info={result?.config_luckydraw != null ? result?.config_luckydraw?.subtitle : esp.lang("event/order_detail", "subtitle_lucky_draw")}
534
534
  />
535
535
  </UseCondition>
536
536
 
537
537
  <UseCondition if={result?.is_luckydraw && result?.is_luckydraw == 2}>
538
538
  <View style={{ margin: 15, padding: 10, marginBottom: 0, justifyContent: 'center', alignContent: 'center', alignItems: 'center', borderRadius: 7, backgroundColor: LibStyle.colorBgGrey, paddingBottom: 10, ...LibStyle.elevation(3) }}>
539
- <LibTextstyle textStyle='headline' text={esp.lang("event/order_detail", "already_join_lucky_draw")} style={{ color: '#c9c9c9', fontWeight: 'bold' }} />
539
+ <LibTextstyle textStyle='headline' text={result?.config_luckydraw != null ? esp.lang("event/order_detail", "already_follow") + result?.config_luckydraw?.title : esp.lang("event/order_detail", "already_join_lucky_draw")} style={{ color: '#c9c9c9', fontWeight: 'bold' }} />
540
540
  </View>
541
541
  </UseCondition>
542
542
 
@@ -44,10 +44,12 @@ export default function m(props: EventOrder_lotteryProps): any {
44
44
  })
45
45
  })
46
46
  let b = {
47
+ ...res,
47
48
  coupon: res?.coupon,
48
49
  list: a
49
50
  }
50
51
  setResult(b)
52
+ // esp.log(res);
51
53
  }, (error: any) => {
52
54
  esp.log(error);
53
55
  LibDialog.warning("Oops", error?.message)
@@ -143,7 +145,8 @@ export default function m(props: EventOrder_lotteryProps): any {
143
145
 
144
146
  return (
145
147
  <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey /* "#FFC523" */ }}>
146
- <EventHeader title={esp.lang("event/order_lottery", "follow_lucky_draw")} />
148
+ <EventHeader title={result?.config != null ? result?.config?.title : esp.lang("event/order_lottery", "follow_lucky_draw")}
149
+ subtitle={result?.config != null ? result?.config?.subtitle : ""} />
147
150
 
148
151
  <ScrollView>
149
152
  {
@@ -152,7 +155,7 @@ export default function m(props: EventOrder_lotteryProps): any {
152
155
 
153
156
  </ScrollView>
154
157
  <View style={{ backgroundColor: '#fff' }}>
155
- <Text style={{ margin: 10, marginBottom: 0 }} >{esp.lang("event/order_lottery", "u_have") + result?.coupon + esp.lang("event/order_lottery", "token_for_luckydraw")}</Text>
158
+ <Text style={{ margin: 10, marginBottom: 0 }} >{esp.lang("event/order_lottery", "you_have") + result?.coupon + esp.lang("event/order_lottery", "chance_for_exchange")}</Text>
156
159
 
157
160
  <EventButton
158
161
  label={esp.lang("event/order_lottery", "submit")}
@@ -20,6 +20,7 @@ import { applyStyle } from 'esoftplay';
20
20
  import { EventConfigProperty } from 'esoftplay/cache/event/config/import';
21
21
  import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
22
22
  import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import';
23
+ import { EventCountdown_event } from 'esoftplay/cache/event/countdown_event/import';
23
24
  import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
24
25
  import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
25
26
  import { EventLoading_pageProperty } from 'esoftplay/cache/event/loading_page/import';
@@ -55,6 +56,7 @@ export type Result = {
55
56
  "status": string,
56
57
  "quota_checkout": string,
57
58
  "show_price": string,
59
+ "countdown_booking": string,
58
60
  "config_queue": {
59
61
  "limit": number,
60
62
  "time": number,
@@ -346,6 +348,11 @@ export default function m(props: EventTicket_listProps): any {
346
348
  let colorBackground = item.status != 1 ? LibStyle.colorLightGrey : itemT.status != 1 ? LibStyle.colorLightGrey : colorDefault
347
349
  let textOpacity = /* item.status == 1 ? 1 : */itemT?.status == 1 ? 1 : 0.3
348
350
 
351
+ let showCountDown = esp.isDebug("show_countdown") && itemT.status != 0 && item?.date_start != "0000-00-00 00:00:00" && item?.date_end != "0000-00-00 00:00:00"
352
+ let dateShowed = item?.price_date == 1 ?
353
+ moment(item?.date_end).format("YYYY-MM-DD HH:mm:ss") > moment(itemT?.ondate).format("YYYY-MM-DD HH:mm:ss") ? moment(itemT?.ondate).add(1, "days").format("YYYY-MM-DD HH:mm:ss") : item?.date_end
354
+ : item?.date_end
355
+
349
356
  return (
350
357
  <TouchableOpacity key={iT} onPress={() => {
351
358
  let itemTicket = {
@@ -396,11 +403,22 @@ export default function m(props: EventTicket_listProps): any {
396
403
  </View>
397
404
  </View>
398
405
  }
399
- <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('dddd')}</Text>
400
- <View style={applyStyle({ flexDirection: 'row' })}>
401
- <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('MMMM')}</Text>
402
- <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, marginLeft: 7, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('YYYY')}</Text>
403
- </View>
406
+ {
407
+ showCountDown ?
408
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('dddd, MMMM YYYY')}</Text>
409
+ :
410
+ <>
411
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('dddd')}</Text>
412
+ <View style={applyStyle({ flexDirection: 'row', alignItems: "center" })}>
413
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('MMMM')}</Text>
414
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, marginLeft: 5, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('YYYY')}</Text>
415
+ </View>
416
+ </>
417
+ }
418
+ {
419
+ showCountDown &&
420
+ <EventCountdown_event date={dateShowed} containerStyle={{ marginVertical: -5 }} />
421
+ }
404
422
  </View>
405
423
  </View>
406
424
  :
@@ -419,7 +437,7 @@ export default function m(props: EventTicket_listProps): any {
419
437
  {/* <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }}>{item.type}</Text> */}
420
438
  {
421
439
  item.info != "" &&
422
- <Text allowFontScaling={false} numberOfLines={3} style={{ flexWrap: 'wrap', fontFamily: "Arial", fontSize: 11, fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }} >{item.info}</Text>
440
+ <EventHtmltext allowFontScaling={false} style={{ flexWrap: 'wrap', fontFamily: "Arial", fontSize: 11, fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }}>{item.info}</EventHtmltext>
423
441
  }
424
442
  </View>
425
443
  </View>
@@ -610,6 +628,10 @@ export default function m(props: EventTicket_listProps): any {
610
628
  <Text style={{ color: LibStyle.colorRed, fontSize: 10, fontWeight: 'normal' }}> {"(" + esp.lang("event/ticket_list", "min_order") + LibUtils.number(item.qty_min) + ")"}</Text>
611
629
  }
612
630
  </EventHtmltext>
631
+ {
632
+ availableResult?.countdown_booking == "1" && displayedData?.length == 1 && item?.date_start != "0000-00-00 00:00:00" && item?.date_end != "0000-00-00 00:00:00" &&
633
+ <EventCountdown_event date={item?.date_end} containerStyle={{ marginVertical: -5 }} />
634
+ }
613
635
  {
614
636
  deeplinkParams?.type == 'event-voucher' && deeplinkParams?.price_id == item.price_id ?
615
637
  <Text allowFontScaling={false} style={{ color: "coral", fontSize: 12, fontWeight: 'bold' }}>{esp.lang("event/ticket_list", "applied_code", deeplinkParams?.code)}</Text>
@@ -23,6 +23,7 @@ import { EventConfigProperty } from 'esoftplay/cache/event/config/import';
23
23
  import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
24
24
  import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import';
25
25
  import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
26
+ import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
26
27
  import { EventLoading_pageProperty } from 'esoftplay/cache/event/loading_page/import';
27
28
  import { EventQueue_pricingProperty } from 'esoftplay/cache/event/queue_pricing/import';
28
29
  import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
@@ -485,7 +486,7 @@ export default function m(props: EventTicket_list2Props): any {
485
486
  {<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }}>{item.type}</Text>}
486
487
  {
487
488
  item.info != "" &&
488
- <Text allowFontScaling={false} numberOfLines={3} style={{ flexWrap: 'wrap', fontFamily: "Arial", fontSize: 11, fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }} >{item.info}</Text>
489
+ <EventHtmltext allowFontScaling={false} style={{ flexWrap: 'wrap', fontFamily: "Arial", fontSize: 11, fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }}>{item.info}</EventHtmltext>
489
490
  }
490
491
  </View>
491
492
  </View>
@@ -640,12 +641,12 @@ export default function m(props: EventTicket_list2Props): any {
640
641
  <View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
641
642
  <View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
642
643
  <View>
643
- <Text allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}
644
+ <EventHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}
644
645
  {
645
646
  item.qty_min > 1 &&
646
647
  <Text style={{ color: LibStyle.colorRed, fontSize: 10, fontWeight: 'normal' }}> {"(" + esp.lang("event/ticket_list", "min_order") + LibUtils.number(item.qty_min) + ")"}</Text>
647
648
  }
648
- </Text>
649
+ </EventHtmltext>
649
650
  {
650
651
  deeplinkParams?.type == 'event-voucher' && deeplinkParams?.price_id == item.price_id ?
651
652
  <Text allowFontScaling={false} style={{ color: "coral", fontSize: 12, fontWeight: 'bold' }}>{esp.lang("event/ticket_list", "applied_code", deeplinkParams?.code)}</Text>
package/id.json CHANGED
@@ -65,6 +65,9 @@
65
65
  "visitor_email": "Email Pengunjung",
66
66
  "visitor_email_pl": "Email Pengujung"
67
67
  },
68
+ "event/countdown_event": {
69
+ "ends": "Berakhir dalam"
70
+ },
68
71
  "event/counter_cashier": {
69
72
  "add_cancel": "Tidak",
70
73
  "add_confirm": "Ya",
@@ -927,6 +930,7 @@
927
930
  "event/order_detail": {
928
931
  "Checked_within_10_minutes_after_payment_is_made": "Dicek dalam 10 menit setelah pembayaran dilakukan",
929
932
  "This_Event_Has_Changed_the_Event_Date_Please_Reschedule_or_Refund": "Event ini Mengalami Perubahan Tanggal Event, Silahkan Reschedule atau Melakukan Refund",
933
+ "already_follow": "Sudah mengikuti ",
930
934
  "already_join_lucky_draw": "Sudah mengikuti lucky draw",
931
935
  "back_err": "Oops",
932
936
  "back_to_homepage": "Kembali ke Halaman Utama",
@@ -1074,6 +1078,7 @@
1074
1078
  "used_once": "Bisa digunakan sekali selama acara berlangsung"
1075
1079
  },
1076
1080
  "event/order_lottery": {
1081
+ "chance_for_exchange": " kesempatan untuk ditukarkan",
1077
1082
  "confirm": "Konfirmasi",
1078
1083
  "confirm_point": "Apakah kupon yang anda masukkan sudah benar?",
1079
1084
  "follow_lucky_draw": "Ikuti Lucky Draw",
@@ -1085,6 +1090,7 @@
1085
1090
  "token_for_luckydraw": " kupon untuk mengikuti undian Lucky Draw",
1086
1091
  "u_have": "Anda mempunyai ",
1087
1092
  "yes": "Ya",
1093
+ "you_have": "Kamu punya ",
1088
1094
  "your_maks_token_is": "Maksimal kupon anda adalah "
1089
1095
  },
1090
1096
  "event/order_reschedule": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay-event",
3
- "version": "0.0.1-u",
3
+ "version": "0.0.1-w",
4
4
  "description": "event module on esoftplay framework",
5
5
  "main": "index.js",
6
6
  "scripts": {