esoftplay-event 0.0.2-b → 0.0.2-d

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.
@@ -1,6 +1,5 @@
1
1
  // withHooks
2
2
 
3
- import { EventButton } from 'esoftplay/cache/event/button/import';
4
3
  import { EventHeader } from 'esoftplay/cache/event/header/import';
5
4
  import { EventSheet } from 'esoftplay/cache/event/sheet/import';
6
5
  import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
@@ -12,11 +11,12 @@ import { LibObject } from 'esoftplay/cache/lib/object/import';
12
11
  import { LibPicture } from 'esoftplay/cache/lib/picture/import';
13
12
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
14
13
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
14
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
15
15
  import { UserClass } from 'esoftplay/cache/user/class/import';
16
16
  import esp from 'esoftplay/esp';
17
17
  import useSafeState from 'esoftplay/state';
18
18
  import React, { useEffect, useRef } from 'react';
19
- import { Text, View } from 'react-native';
19
+ import { Text, TouchableOpacity, View } from 'react-native';
20
20
 
21
21
 
22
22
  export interface EventTms_idcardArgs {
@@ -28,7 +28,7 @@ export interface EventTms_idcardProps {
28
28
  export default function m(props: EventTms_idcardProps): any {
29
29
  const width = LibStyle.width
30
30
  const height = 12 / 9 * width
31
- const marginTop = 2.7 / 9 * width
31
+ const marginTop = 3 / 9 * width
32
32
  const photoHeight = 4 / 9 * width
33
33
  const photoWidth = 3 / 9 * width
34
34
  const photoMarginBot = 0.46 / 9 * width
@@ -51,6 +51,7 @@ export default function m(props: EventTms_idcardProps): any {
51
51
  } = LibNavigation.getArgsAll(props)
52
52
 
53
53
  const [result, setResult] = useSafeState<any>()
54
+ const [useToken, TokenLeft] = selectedTicket?.token?.split("-")
54
55
 
55
56
  function loadData() {
56
57
  // load data untuk ngambil background id card
@@ -119,6 +120,7 @@ export default function m(props: EventTms_idcardProps): any {
119
120
  }, 1)
120
121
  }
121
122
 
123
+ // esp.log({ result });
122
124
 
123
125
  return (
124
126
  <View style={{ flex: 1 }}>
@@ -128,12 +130,13 @@ export default function m(props: EventTms_idcardProps): any {
128
130
  onPressMore={() => menuRef.current?.show()}
129
131
  more
130
132
  />
133
+
131
134
  <View style={{ backgroundColor: '#000', height: LibStyle.height, alignItems: 'center' }}>
132
135
  {/* ini id_card nya */}
133
136
  <LibPicture source={result?.event?.image_idcard == "" ? esp.assets('white_idcard.png') : { uri: result?.event?.image_idcard }} style={{ width: width, height: height, resizeMode: 'contain' }} />
134
137
  <View style={{ position: 'absolute' }}>
135
138
  <LibPicture source={{ uri: selectedTicket?.user_image != '' ? decodeURIComponent(selectedTicket?.user_image) : 'https://www.w3schools.com/howto/img_avatar.png' }} style={{ marginBottom: photoMarginBot, marginTop: marginTop, height: photoHeight, width: photoWidth, alignSelf: 'center', resizeMode: 'cover', }} />
136
- <View style={{ padding: 10, marginTop: 5 }} >
139
+ <View style={{ padding: 10, marginTop: -10 }} >
137
140
  {/* view nama */}
138
141
  <View style={{ flexDirection: 'row' }} >
139
142
  <Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a", flex: 3 }} >{esp.lang("event/tms_idcard", "name")}</Text>
@@ -150,13 +153,17 @@ export default function m(props: EventTms_idcardProps): any {
150
153
  <View style={{ width: width - 20, alignSelf: 'center', backgroundColor: '#4a4a4a', height: 4, marginVertical: 4 }} />
151
154
  <Text allowFontScaling={false} style={{ marginTop: -5, fontSize: 20, fontWeight: "bold", fontStyle: "normal", lineHeight: 32, textAlign: 'center', letterSpacing: 0, color: "#4a4a4a" }} >{selectedTicket?.exhibitor_name?.split('-')[0]}</Text>
152
155
  </View>
153
-
154
156
  </View>
155
- <EventButton
156
- label={esp.lang("event/tms_idcard", "btn_back")}
157
- backgroundColor={LibStyle.colorPrimary}
158
- onPress={() => {
159
- // LibNavigation.back()
157
+
158
+ <View style={{ padding: 5, flexDirection: 'row', backgroundColor: LibStyle.colorPrimary, margin: 10, borderRadius: 10 }}>
159
+ {
160
+ useToken == 1 &&
161
+ <View style={{ padding: 5, paddingHorizontal: 35, alignContent: 'center', alignItems: 'center', borderRadius: 10, backgroundColor: '#fff' }}>
162
+ <Text allowFontScaling={false} style={{ fontSize: 12, color: '#000', fontWeight: 'bold' }}>{esp.lang("event/tms_idcard", "token")}</Text>
163
+ <Text allowFontScaling={false} style={{ fontSize: 35, color: '#000', lineHeight: 35, fontWeight: 'bold' }} >{LibUtils.number(TokenLeft)}</Text>
164
+ </View>
165
+ }
166
+ <TouchableOpacity onPress={() => {
160
167
  LibNavigation.replace('component/scanner', {
161
168
  selectGate: selectGate,
162
169
  fromPage: 'event/tms_home',
@@ -170,21 +177,24 @@ export default function m(props: EventTms_idcardProps): any {
170
177
  configPriority: configPriority,
171
178
  scan_type: scan_type
172
179
  })
173
- }}
174
- style={{ marginTop: 20, marginHorizontal: 15 }}
175
- />
180
+ }} style={{ flex: 1, marginLeft: 10, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
181
+ <Text allowFontScaling={false} style={{ fontSize: 25, fontWeight: 'bold', color: '#fff' }}>{esp.lang("event/tms_idcard", "backk")}</Text>
182
+ </TouchableOpacity>
183
+
184
+ </View>
185
+
176
186
  </View>
177
187
  <EventSheet
178
188
  _ref={menuRef}
179
189
  title={"ID CARD"}
180
190
  options={[
181
191
  {
182
- text: "Tahan ID CARD",
192
+ text: esp.lang("event/tms_idcard", "hold_idcard"),
183
193
  textStyle: { color: "red" },
184
194
  onPress: () => {
185
195
  LibDialog.warningConfirm(esp.lang("event/tms_dashboard", "block_idcard_title"), esp.lang("event/tms_dashboard", "block_idcard_message"), esp.lang("event/tms_dashboard", "block_idcard_ok"), () => {
186
196
  new LibCurl("event_tms_staff_hold", { qr: encodeURIComponent(selectedTicket?.key) }, (result, message) => {
187
- LibDialog.info("Berhasil!", message)
197
+ LibDialog.info(esp.lang("event/tms_idcard", "success"), message)
188
198
  }, (error) => {
189
199
  LibDialog.warning("Oops!", error?.message)
190
200
  })
package/event/tms_in.tsx CHANGED
@@ -131,7 +131,8 @@ export default function m(props: EventTms_inProps): any {
131
131
  qty: item[0],
132
132
  qty_used: item[2],
133
133
  qty_left: Number(item[0]) - (Number(item[2]) || 0),
134
- text: item[6] || "",
134
+ token: item[6],
135
+ text: item[7] || "",
135
136
  }
136
137
  tikets.push(x)
137
138
  })
@@ -162,7 +162,7 @@ export default function m(props: EventTms_in_failedProps): any {
162
162
  }
163
163
  {
164
164
  error &&
165
- <View style={{ width: LibStyle.width - 40, justifyContent: 'center', alignItems: 'center', padding: 15, borderRadius: 10, marginTop: 100 }}>
165
+ <View style={{ width: LibStyle.width - 40, alignSelf: 'center', justifyContent: 'center', alignItems: 'center', padding: 15, borderRadius: 10, marginTop: 100 }}>
166
166
  <Text allowFontScaling={false} style={{ flexWrap: 'wrap', fontSize: 14, lineHeight: 20, fontWeight: "bold", marginBottom: 5, color: "#fff", textAlign: "center" }}>{error?.message}</Text>
167
167
  </View>
168
168
  }
@@ -195,7 +195,7 @@ export default function m(props: EventTms_in_hall_failedProps): any {
195
195
  <View style={{ flex: 2 }}>
196
196
  <Text allowFontScaling={false} style={{ marginBottom: 5, fontWeight: 'bold', textAlign: 'center', fontSize: 14 }}>{esp.lang("event/tms_in_hall_failed", "time")}</Text>
197
197
  {
198
- item?.hall_scanned != "0000-00-00 00:00:00" &&
198
+ item.hasOwnProperty("hall_scanned") && item?.hall_scanned != "0000-00-00 00:00:00" &&
199
199
  <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 12 }}>{LibUtils.moment(item?.hall_scanned).localeFormat("DD MMM H:mm:ss ")}</Text>
200
200
  }
201
201
  </View>
@@ -101,7 +101,7 @@ export default function m(props: EventTms_out_hall_failedProps): any {
101
101
  </View>
102
102
  <View style={{ flex: 1, justifyContent: 'center', paddingVertical: 5 }}>
103
103
  {
104
- item?.scanned != "0000-00-00 00:00:00" &&
104
+ item?.hasOwnProperty("scanned") && item?.scanned != "0000-00-00 00:00:00" &&
105
105
  <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 12 }}>{LibUtils.moment(item.hall_scanned).localeFormat("DD MMM H:mm:ss ")}</Text>
106
106
  }
107
107
  </View>
@@ -12,12 +12,11 @@ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
12
12
  import { applyStyle } from 'esoftplay';
13
13
  import { EventButton } from 'esoftplay/cache/event/button/import';
14
14
  import { EventHeader } from 'esoftplay/cache/event/header/import';
15
- import { LibIcon } from 'esoftplay/cache/lib/icon/import';
16
15
  import { LibPicture } from 'esoftplay/cache/lib/picture/import';
17
16
  import esp from 'esoftplay/esp';
18
17
  import useSafeState from 'esoftplay/state';
19
18
  import React, { useEffect } from 'react';
20
- import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
19
+ import { ScrollView, Text, View } from 'react-native';
21
20
 
22
21
 
23
22
  export interface EventTms_out_temporaryArgs {
@@ -231,7 +230,7 @@ export default function m(props: EventTms_out_temporaryProps): any {
231
230
  </View>
232
231
  </ScrollView>
233
232
  <View style={{ padding: 10, backgroundColor: '#fff' }}>
234
- <View style={{ flexDirection: 'row', justifyContent: 'space-between', marginBottom: 10, alignContent: 'center', alignItems: 'center' }}>
233
+ {/* <View style={{ flexDirection: 'row', justifyContent: 'space-between', marginBottom: 10, alignContent: 'center', alignItems: 'center' }}>
235
234
  <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode={'tail'} style={{ flex: 1, fontWeight: 'bold', fontSize: 14, letterSpacing: 1 }}>{esp.lang("event/tms_in_list", "total_ticket_use", result?.list?.filter((it: any) => it.checked == 1).length)}</Text>
236
235
  <TouchableOpacity onPress={() => {
237
236
  toggleCheckedAll()
@@ -239,7 +238,7 @@ export default function m(props: EventTms_out_temporaryProps): any {
239
238
  <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: '#fff', marginRight: 15 })} >{useAll ? esp.lang("event/tms_in_list", "cancel_use") : esp.lang("event/tms_in_list", "use_all")}</Text>
240
239
  <LibIcon.Ionicons size={18} color="#fff" name={useAll ? "close" : "checkmark-done"} />
241
240
  </TouchableOpacity>
242
- </View>
241
+ </View> */}
243
242
 
244
243
  <EventButton
245
244
  label={esp.lang("event/tms_out_temporary", "btn_exit")}
@@ -0,0 +1,39 @@
1
+ // withHooks
2
+ import { EventHeader } from 'esoftplay/cache/event/header/import';
3
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
4
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
5
+ import esp from 'esoftplay/esp';
6
+
7
+ import React from 'react';
8
+ import { Pressable, ScrollView, Text, View } from 'react-native';
9
+
10
+
11
+ export interface EventToken_orderArgs {
12
+
13
+ }
14
+ export interface EventToken_orderProps {
15
+
16
+ }
17
+ export default function m(props: EventToken_orderProps): any {
18
+ return (
19
+ <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
20
+ <EventHeader title='Riwayar Transaksi Token' />
21
+ <ScrollView>
22
+ <Pressable onPress={() => {
23
+
24
+ }} style={{ padding: 7, margin: 15, backgroundColor: '#fff', marginBottom: 0, borderRadius: 5, borderWidth: 1, borderColor: LibStyle.colorPrimary, flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
25
+ <Text allowFontScaling={false} style={{ marginLeft: 8 }}>{esp.lang("event/order", "wawit")}</Text>
26
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
27
+ {/* {
28
+ badge != 0 &&
29
+ <View style={{ backgroundColor: LibStyle.colorRed, height: 17, padding: 5, paddingVertical: 2, borderRadius: 10, alignContent: 'center', alignItems: 'center' }}>
30
+ <Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, letterSpacing: 0, color: "#ffffff" }}>{badge > 99 ? "99+" : LibUtils.number(badge)}</Text>
31
+ </View>
32
+ } */}
33
+ <LibIcon name='chevron-right' />
34
+ </View>
35
+ </Pressable>
36
+ </ScrollView>
37
+ </View>
38
+ )
39
+ }
@@ -0,0 +1,79 @@
1
+ // withHooks
2
+ import { BigbangPayment_list } from 'esoftplay/cache/bigbang/payment_list/import';
3
+ import { EventHeader } from 'esoftplay/cache/event/header/import';
4
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
5
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
6
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
7
+
8
+ import React from 'react';
9
+ import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
10
+
11
+
12
+ export interface EventToken_paymentArgs {
13
+
14
+ }
15
+ export interface EventToken_paymentProps {
16
+
17
+ }
18
+ export default function m(props: EventToken_paymentProps): any {
19
+
20
+ let items = [
21
+ {
22
+ id: 1,
23
+ title: 'ID Card + Token',
24
+ price: 20000,
25
+ qty: 1
26
+ },
27
+ {
28
+ id: 2,
29
+ title: 'Token',
30
+ price: 7500,
31
+ qty: 1
32
+ }
33
+ ]
34
+
35
+ return (
36
+ <View style={{ flex: 1 }}>
37
+ <EventHeader title='Beli IDCard/Token' />
38
+ <ScrollView>
39
+
40
+ {
41
+ items?.map((item: any, i: number) => {
42
+ return (
43
+ <View key={i} style={{ ...LibStyle.elevation(3), backgroundColor: '#fff', margin: 15, paddingHorizontal: 10, borderRadius: 5, marginBottom: 0, flex: 1, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
44
+ <View style={{ flex: 2 }}>
45
+ <Text allowFontScaling={false}>{item?.title}</Text>
46
+ <Text allowFontScaling={false}>{LibUtils.money(item?.price)}</Text>
47
+ </View>
48
+ <View style={{ flex: 1 }}>
49
+ <View style={{ flexDirection: 'row', marginVertical: 10, alignContent: 'center', alignItems: 'center', alignSelf: 'center' }}>
50
+ <TouchableOpacity onPress={() => { /* min() */ }}>
51
+ <View style={{ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' }}>
52
+ <LibIcon name="minus" color="#e74c3c" />
53
+ </View>
54
+ </TouchableOpacity>
55
+ <Text style={{ fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", marginLeft: 15, marginRight: 15 }}>{item?.qty}</Text>
56
+ <TouchableOpacity onPress={() => { /* add(item?.quota, item?.quota_used) */ }}>
57
+ <View style={{ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' }}>
58
+ <LibIcon name="plus" color="#16a085" />
59
+ </View>
60
+ </TouchableOpacity>
61
+ </View>
62
+ </View>
63
+ </View>
64
+ )
65
+ })
66
+ }
67
+
68
+ <BigbangPayment_list
69
+ priceTotal={100000}
70
+ order_type={1}
71
+ paymentId={2}
72
+ onPressPayment={() => {
73
+
74
+ }}
75
+ />
76
+ </ScrollView>
77
+ </View>
78
+ )
79
+ }