This commit is contained in:
2024-02-27 16:19:55 +08:00
commit feebeffcd9
141 changed files with 25124 additions and 0 deletions

3
app/config/README.md Executable file
View File

@@ -0,0 +1,3 @@
# config file
Notice: please copy *.js.example to *.js first before starting your application

View File

@@ -0,0 +1,45 @@
import {AsyncStorage} from 'react-native'
import React, { Component } from 'react';
export default class AsyncStorageHelper extends Component{
async saveData(key, value) {
try {
await AsyncStorage.setItem(key, JSON.stringify(value));
} catch (error) {
console.error('save error'+ error.message);
}
}
async saveString(key, value) {
try {
await AsyncStorage.setItem(key, value);
} catch (error) {
console.error('save error'+ error.message);
}
}
async getData(key, callback) {
try {
var value = await AsyncStorage.getItem(key).then(
(values) => {
callback(values);
}
)
} catch (error) {
// console.error('get error');
}
}
async removeItemValue(key) {
try {
await AsyncStorage.removeItem(key);
return true;
}
catch (exception) {
console.log(exception)
return false;
}
}
}

12
app/config/colors.js Executable file
View File

@@ -0,0 +1,12 @@
const theme = {
mainColor : 'rgb(255, 184, 25)',
searchMapInputColor: '#FFCE6B',
menuPriceBoxBackgroundColor: 'rgba(255,255,255,0.8)',
menuPriceBoxTextColor:'#585858',
foodNameColor:'#6D6E70',
coolGrey :'#53565A',
inputBgc:'#E6E7E8',
forgetTextColor:'#A6A8AB'
}
export default theme

29
app/config/connectFail.js Executable file
View File

@@ -0,0 +1,29 @@
import React, { Component } from "react";
import {
Platform,
StyleSheet,
View,
Alert,
NetInfo,
Geolocation,
TouchableOpacity,
SafeAreaView,
StatusBar,
Image,
TouchableHighlight
} from "react-native";
export default class ConnectFail {
fail(){
Alert.alert(
'',
'Connect failed',
[
{ text: 'Cancel', onPress: () => console.log('Cancel') },
{ text: 'ok', onPress: () => console.log('ok') },
],
)
}
}

5
app/config/fonts.js Executable file
View File

@@ -0,0 +1,5 @@
export const Fonts = {
century : 'CenturyGothic',
cgb: 'GOTHICB',
}

4
app/config/index.js Executable file
View File

@@ -0,0 +1,4 @@
export default {
// required: API base url
apiBaseURL: 'http://localhost:4567/',
}

4
app/config/index.js.example Executable file
View File

@@ -0,0 +1,4 @@
export default {
// required: API base url
apiBaseURL: 'http://example.com',
}

59
app/config/language.js Executable file
View File

@@ -0,0 +1,59 @@
export default {
en:{
confirm:'confirm',
menu:'Menu',
myOrder:'My Order',
profile:'Profile',
setting:'Setting',
slectLang: 'Choose your language',
referYourFriends: 'Refer Your Friends',
coupon:'Coupon',
myCoupons:'My Coupons',
used: 'Uesd',
cannotuse:'Unavailable',
canuse: 'Can use',
expired:'Expired',
expireDate:'Expire Date',
termandconditions:'Term & Conditions',
privacy:'Privacy',
contactUs:'Contact us',
language:'Language',
notification:'Notification',
howtouse:'How to use',
logout:'Logout',
googleSearch:'Input Your Address',
// referFriendContent:"Share the WARMTH this chilling season. Dont leave yourself HANGRY Input the promo code \"Hangry\" to enjoy 10% OFF their first purchase order. \n Download Link: \n"
referFriendContent:""
},
zh:{
confirm:'確認',
menu:'菜單',
myOrder:'訂單',
profile:'帳戶',
setting:'設置',
slectLang: '選擇你的語言',
referYourFriends:'推薦你的朋友',
coupon:'優惠券',
myCoupons:'我的優惠券',
used: '已使用',
canuse:'可使用',
cannotuse:'不可使用',
expired:'已過期',
expireDate:'過期日子',
termandconditions:'條款和條件',
privacy:'隱私',
contactUs:'聯繫我們',
language:'語言',
notification:'通知',
howtouse:'如何使用',
logout:'登出',
googleSearch:'輸入你的地址',
//referFriendContent:"在這個寒冷的季節分享溫暖輸入此推薦碼\"可亨\"首次訂單九折優惠 \n 立即下載: \n"
referFriendContent:""
}
}

9
app/config/log.js Executable file
View File

@@ -0,0 +1,9 @@
import firebase from 'react-native-firebase'
export default class Log {
firebaseLog(logName,param){
firebase.analytics().logEvent(logName,param);
}
firebaseClass(page){
firebase.analytics().setCurrentScreen(page);
}
}

4
app/config/screen.js Executable file
View File

@@ -0,0 +1,4 @@
import {Dimensions} from 'react-native'
export const width = Dimensions.get('window').width;
export const height = Dimensions.get('window').height;

49
app/config/size.js Executable file
View File

@@ -0,0 +1,49 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Dimensions, Text, StyleSheet } from 'react-native';
const { width, height } = Dimensions.get('window');
const flattenStyle = StyleSheet.flatten;
const realWidth = height > width ? width : height;
export default class Size{
getSize(size){
return Math.round(size * realWidth / 375);
}
status(value){
switch(value){
case 'A':
return 'Not pay yet'
break;
case 'V':
return 'Cancelled'
break;
case 'I':
return 'Cancel by unpaid'
break;
case 'E':
return 'Expired by unpaid'
break;
case 'P':
return 'Preparing'
break;
case 'D':
return 'ready'
break;
case 'F':
return 'Completed'
break;
default:
return 'Undefind'
break
}
}
}