Commit f825c3fd authored by Jasa Digital's avatar Jasa Digital

fixed bug

parent e92aa2ba
...@@ -102,7 +102,7 @@ class Api { ...@@ -102,7 +102,7 @@ class Api {
"session_id": sessionId, "session_id": sessionId,
"from": fromByod, "from": fromByod,
"url_lookup": (debug) "url_lookup": (debug)
? 'https://www.ravintola.web.id/' ? 'https://byod-neo.ravku.com'
: (urlType == typeUrlTiga) : (urlType == typeUrlTiga)
? getUrlLookUp() ? getUrlLookUp()
: '', : '',
......
...@@ -25,12 +25,13 @@ class BranchExist extends Cubit<String> { ...@@ -25,12 +25,13 @@ class BranchExist extends Cubit<String> {
BuildContext context, { BuildContext context, {
bool getMenu = false, bool getMenu = false,
bool getBrancList = false, bool getBrancList = false,
String token = '',
}) { }) {
getBranch(branchCode, brandCode, role, cashierName, orderId).then((value) { getBranch(branchCode, brandCode, role, cashierName, orderId).then((value) {
if (getMenu) { if (getMenu) {
context context
.read<FilterMenuBloc>() .read<FilterMenuBloc>()
.catAndMenu(branchCode, brandCode, role, cashierName, orderId); .catAndMenu(branchCode, brandCode, role, cashierName, token);
} }
if (getBrancList) { if (getBrancList) {
context.read<BranchList>().getBranchList(); context.read<BranchList>().getBranchList();
......
...@@ -56,6 +56,7 @@ class _SplashState extends State<Splash> { ...@@ -56,6 +56,7 @@ class _SplashState extends State<Splash> {
loadBaseUrl().then((baseUrl) { loadBaseUrl().then((baseUrl) {
setBaseUrl(baseUrl); setBaseUrl(baseUrl);
if (widget.pathSegmentString.isEmpty) { if (widget.pathSegmentString.isEmpty) {
// contoh url http://localhost/
Geolocator.requestPermission().then((permission) { Geolocator.requestPermission().then((permission) {
if (permission != LocationPermission.denied && if (permission != LocationPermission.denied &&
permission != LocationPermission.deniedForever) { permission != LocationPermission.deniedForever) {
...@@ -90,14 +91,15 @@ class _SplashState extends State<Splash> { ...@@ -90,14 +91,15 @@ class _SplashState extends State<Splash> {
widget.context, widget.context,
// getBrancList: true, // getBrancList: true,
); );
Future.delayed(Duration(milliseconds: durationDelayBeforToMenu), () async { Future.delayed(Duration(milliseconds: durationDelayBeforToMenu),
() async {
// if (getStatusOrderCreated()) { // if (getStatusOrderCreated()) {
context.read<FilterMenuBloc>().catAndMenu( context.read<FilterMenuBloc>().catAndMenu(
getBranchPref(), getBranchPref(),
getBrand(), getBrand(),
getRole(), getRole(),
getCashierName(), getCashierName(),
getOrderId(), '',
); );
context context
.read<ChangeDeliveryPickupBloc>() .read<ChangeDeliveryPickupBloc>()
...@@ -131,6 +133,7 @@ class _SplashState extends State<Splash> { ...@@ -131,6 +133,7 @@ class _SplashState extends State<Splash> {
}); });
} else if (widget.pathSegmentString.length == 1) { } else if (widget.pathSegmentString.length == 1) {
if (widget.pathSegmentString[0] == 'go') { if (widget.pathSegmentString[0] == 'go') {
// contoh url http://localhost/go
Geolocator.requestPermission().then((permission) { Geolocator.requestPermission().then((permission) {
if (permission != LocationPermission.denied && if (permission != LocationPermission.denied &&
permission != LocationPermission.deniedForever) { permission != LocationPermission.deniedForever) {
...@@ -165,14 +168,15 @@ class _SplashState extends State<Splash> { ...@@ -165,14 +168,15 @@ class _SplashState extends State<Splash> {
widget.context, widget.context,
getBrancList: true, getBrancList: true,
); );
Future.delayed(Duration(milliseconds: durationDelayBeforToMenu), () async { Future.delayed(Duration(milliseconds: durationDelayBeforToMenu),
() async {
// if (getStatusOrderCreated()) { // if (getStatusOrderCreated()) {
context.read<FilterMenuBloc>().catAndMenu( context.read<FilterMenuBloc>().catAndMenu(
getBranchPref(), getBranchPref(),
getBrand(), getBrand(),
getRole(), getRole(),
getCashierName(), getCashierName(),
getOrderId(), '',
); );
context context
.read<ChangeDeliveryPickupBloc>() .read<ChangeDeliveryPickupBloc>()
...@@ -205,6 +209,7 @@ class _SplashState extends State<Splash> { ...@@ -205,6 +209,7 @@ class _SplashState extends State<Splash> {
} }
}); });
} else { } else {
// contoh url http://localhost/asalaja <-- ini tidak di allow
setPaymentMode(closebill); setPaymentMode(closebill);
setIsDeliveryPickup(false); setIsDeliveryPickup(false);
setUrlLookUp(''); setUrlLookUp('');
...@@ -222,6 +227,7 @@ class _SplashState extends State<Splash> { ...@@ -222,6 +227,7 @@ class _SplashState extends State<Splash> {
setIsDeliveryPickup(false); setIsDeliveryPickup(false);
setUrlLookUp(''); setUrlLookUp('');
if (widget.pathSegmentString[0] == 'o') { if (widget.pathSegmentString[0] == 'o') {
// contoh url http://localhost/o/uuid <--- ini untuk QR dynamic
if (widget.pathSegmentString[1] != '') { if (widget.pathSegmentString[1] != '') {
setOrderId(widget.pathSegmentString[1]); setOrderId(widget.pathSegmentString[1]);
setUrlType(typeUrlSatu); setUrlType(typeUrlSatu);
...@@ -277,6 +283,7 @@ class _SplashState extends State<Splash> { ...@@ -277,6 +283,7 @@ class _SplashState extends State<Splash> {
setIsDeliveryPickup(false); setIsDeliveryPickup(false);
setUrlLookUp(''); setUrlLookUp('');
if (widget.pathSegmentString[0] == 'o') { if (widget.pathSegmentString[0] == 'o') {
// contoh url http://localhost/o/uuid/go <--- ini untuk QR dynamic direct go bill
if (widget.pathSegmentString[1] != '') { if (widget.pathSegmentString[1] != '') {
setOrderId(widget.pathSegmentString[1]); setOrderId(widget.pathSegmentString[1]);
setUrlType(typeUrlSatu); setUrlType(typeUrlSatu);
...@@ -305,14 +312,15 @@ class _SplashState extends State<Splash> { ...@@ -305,14 +312,15 @@ class _SplashState extends State<Splash> {
widget.context, widget.context,
getMenu: true, getMenu: true,
); );
Future.delayed(Duration(milliseconds: durationDelayBeforToMenu), () async { Future.delayed(Duration(milliseconds: durationDelayBeforToMenu),
() async {
// if (getStatusOrderCreated()) { // if (getStatusOrderCreated()) {
context.read<FilterMenuBloc>().catAndMenu( context.read<FilterMenuBloc>().catAndMenu(
getBranchPref(), getBranchPref(),
getBrand(), getBrand(),
getRole(), getRole(),
getCashierName(), getCashierName(),
getOrderId(), '',
); );
Navigator.pushReplacement( Navigator.pushReplacement(
widget.context, widget.context,
...@@ -340,6 +348,7 @@ class _SplashState extends State<Splash> { ...@@ -340,6 +348,7 @@ class _SplashState extends State<Splash> {
); );
} }
} else { } else {
// contoh url http://localhost/as/uuiasasd/goasasasas <--- ini ketika tidak valid url
Navigator.pushReplacement( Navigator.pushReplacement(
widget.context, widget.context,
MaterialPageRoute( MaterialPageRoute(
...@@ -350,6 +359,7 @@ class _SplashState extends State<Splash> { ...@@ -350,6 +359,7 @@ class _SplashState extends State<Splash> {
); );
} }
} else { } else {
// contoh url http://localhost/EXC/RVN2/D-12 <--- ini untuk QR static
setPaymentMode(closebill); setPaymentMode(closebill);
setIsDeliveryPickup(false); setIsDeliveryPickup(false);
setUrlLookUp(''); setUrlLookUp('');
...@@ -385,6 +395,7 @@ class _SplashState extends State<Splash> { ...@@ -385,6 +395,7 @@ class _SplashState extends State<Splash> {
} }
} else if (widget.pathSegmentString.length == 4) { } else if (widget.pathSegmentString.length == 4) {
if (widget.pathSegmentString[3] == 'go') { if (widget.pathSegmentString[3] == 'go') {
// contoh url http://localhost/EXC/RVN2/D-12/go <--- ini untuk QR static direct ke bill
setPaymentMode(closebill); setPaymentMode(closebill);
setIsDeliveryPickup(false); setIsDeliveryPickup(false);
setUrlLookUp(''); setUrlLookUp('');
...@@ -416,15 +427,11 @@ class _SplashState extends State<Splash> { ...@@ -416,15 +427,11 @@ class _SplashState extends State<Splash> {
widget.context, widget.context,
getMenu: true, getMenu: true,
); );
Future.delayed(Duration(milliseconds: durationDelayBeforToMenu), () async { Future.delayed(Duration(milliseconds: durationDelayBeforToMenu),
() async {
// if (getStatusOrderCreated()) { // if (getStatusOrderCreated()) {
context.read<FilterMenuBloc>().catAndMenu( context.read<FilterMenuBloc>().catAndMenu(
getBranchPref(), getBranchPref(), getBrand(), getRole(), getCashierName(), '');
getBrand(),
getRole(),
getCashierName(),
getOrderId(),
);
Navigator.pushReplacement( Navigator.pushReplacement(
widget.context, widget.context,
MaterialPageRoute( MaterialPageRoute(
...@@ -433,6 +440,7 @@ class _SplashState extends State<Splash> { ...@@ -433,6 +440,7 @@ class _SplashState extends State<Splash> {
); );
}); });
} else { } else {
// contoh url http://localhost/EXC/RVN2/D-12/UUID <--- ini untuk QR static dengan securetoken
setPaymentMode(closebill); setPaymentMode(closebill);
setIsDeliveryPickup(false); setIsDeliveryPickup(false);
setUrlLookUp(''); setUrlLookUp('');
...@@ -466,11 +474,13 @@ class _SplashState extends State<Splash> { ...@@ -466,11 +474,13 @@ class _SplashState extends State<Splash> {
getOrderId(), // ini orderId dari path URL getOrderId(), // ini orderId dari path URL
widget.context, widget.context,
getMenu: true, getMenu: true,
token: widget.pathSegmentString[3],
); );
goToMenu(widget.context); goToMenu(widget.context);
} }
} else if (widget.pathSegmentString.length == 5) { } else if (widget.pathSegmentString.length == 5) {
if (widget.pathSegmentString[4] == 'go') { if (widget.pathSegmentString[4] == 'go') {
// contoh url http://localhost/EXC/RVN2/D-12/UUID/go <--- ini untuk QR static dengan securetoken dan direct bill
setPaymentMode(closebill); setPaymentMode(closebill);
setIsDeliveryPickup(false); setIsDeliveryPickup(false);
setUrlLookUp(''); setUrlLookUp('');
...@@ -505,14 +515,15 @@ class _SplashState extends State<Splash> { ...@@ -505,14 +515,15 @@ class _SplashState extends State<Splash> {
widget.context, widget.context,
getMenu: true, getMenu: true,
); );
Future.delayed(Duration(milliseconds: durationDelayBeforToMenu), () async { Future.delayed(Duration(milliseconds: durationDelayBeforToMenu),
() async {
// if (getStatusOrderCreated()) { // if (getStatusOrderCreated()) {
context.read<FilterMenuBloc>().catAndMenu( context.read<FilterMenuBloc>().catAndMenu(
getBranchPref(), getBranchPref(),
getBrand(), getBrand(),
getRole(), getRole(),
getCashierName(), getCashierName(),
getOrderId(), '',
); );
Navigator.pushReplacement( Navigator.pushReplacement(
widget.context, widget.context,
......
...@@ -1687,8 +1687,13 @@ class OutletDetail extends StatelessWidget { ...@@ -1687,8 +1687,13 @@ class OutletDetail extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
List<String> listHistoryOrder = getListHistory(); List<String> listHistoryOrder = getListHistory();
int indexListhIstory = listHistoryOrder.indexWhere((listHistoryOrders) =>
int indexListhIstory = -1;
if (isHistory) {
indexListhIstory = listHistoryOrder.indexWhere((listHistoryOrders) =>
jsonDecode(listHistoryOrders)['order_id'] == dataBill[0].id); jsonDecode(listHistoryOrders)['order_id'] == dataBill[0].id);
}
String openHours = "${timeHm(getOpenTime())} - ${timeHm(getCloseTime())}"; String openHours = "${timeHm(getOpenTime())} - ${timeHm(getCloseTime())}";
String phoneOutlet = getPhoneOutlet(); String phoneOutlet = getPhoneOutlet();
bool isDeliveryCustomer = getIsCustomerDelivery(); bool isDeliveryCustomer = getIsCustomerDelivery();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment