|
|
@ -52,8 +52,7 @@ class _QuickOrder extends State<QuickOrder> { |
|
|
|
"latitude": latitude, |
|
|
|
"latitude": latitude, |
|
|
|
"longitude": longitude, |
|
|
|
"longitude": longitude, |
|
|
|
"searchKey": searchKey |
|
|
|
"searchKey": searchKey |
|
|
|
}).catchError((error) { |
|
|
|
}).catchError((error) {}); |
|
|
|
}); |
|
|
|
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
storeList = baseData.data; |
|
|
|
storeList = baseData.data; |
|
|
|
} |
|
|
|
} |
|
|
@ -62,7 +61,7 @@ class _QuickOrder extends State<QuickOrder> { |
|
|
|
|
|
|
|
|
|
|
|
getLatLng() async { |
|
|
|
getLatLng() async { |
|
|
|
SharedPreferences.getInstance().then( |
|
|
|
SharedPreferences.getInstance().then( |
|
|
|
(value) => { |
|
|
|
(value) => { |
|
|
|
apiService = ApiService(Dio(), |
|
|
|
apiService = ApiService(Dio(), |
|
|
|
context: context, |
|
|
|
context: context, |
|
|
|
token: value.getString('token'), |
|
|
|
token: value.getString('token'), |
|
|
@ -116,9 +115,9 @@ class _QuickOrder extends State<QuickOrder> { |
|
|
|
latLng = BMFCoordinate(event["latitude"], event["longitude"]); |
|
|
|
latLng = BMFCoordinate(event["latitude"], event["longitude"]); |
|
|
|
} |
|
|
|
} |
|
|
|
BMFCalculateUtils.coordConvert( |
|
|
|
BMFCalculateUtils.coordConvert( |
|
|
|
coordinate: latLng, |
|
|
|
coordinate: latLng, |
|
|
|
fromType: BMF_COORD_TYPE.BD09LL, |
|
|
|
fromType: BMF_COORD_TYPE.BD09LL, |
|
|
|
toType: BMF_COORD_TYPE.COMMON) |
|
|
|
toType: BMF_COORD_TYPE.COMMON) |
|
|
|
.then((value) { |
|
|
|
.then((value) { |
|
|
|
this.latLng = value; |
|
|
|
this.latLng = value; |
|
|
|
saveLatLng( |
|
|
|
saveLatLng( |
|
|
@ -143,8 +142,7 @@ class _QuickOrder extends State<QuickOrder> { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
Location.getInstance().prepareLoc(); |
|
|
|
Location.getInstance().prepareLoc(); |
|
|
|
Location.getInstance().startLocation(context).then((value) { |
|
|
|
Location.getInstance().startLocation(context).then((value) {}); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
saveLatLng(BMFCoordinate latLng, province, city, district) async { |
|
|
|
saveLatLng(BMFCoordinate latLng, province, city, district) async { |
|
|
@ -171,7 +169,7 @@ class _QuickOrder extends State<QuickOrder> { |
|
|
|
scrollDirection: Axis.horizontal, |
|
|
|
scrollDirection: Axis.horizontal, |
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 10), |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 10), |
|
|
|
itemCount:storeList == null ? 0 : storeList.length, |
|
|
|
itemCount: storeList == null ? 0 : storeList.length, |
|
|
|
itemBuilder: (context, position) { |
|
|
|
itemBuilder: (context, position) { |
|
|
|
return GestureDetector( |
|
|
|
return GestureDetector( |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
@ -188,7 +186,7 @@ class _QuickOrder extends State<QuickOrder> { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
child: storeItem(storeList[position],position), |
|
|
|
child: storeItem(storeList[position], position), |
|
|
|
); |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
@ -197,7 +195,7 @@ class _QuickOrder extends State<QuickOrder> { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Widget storeItem(Store store,position) { |
|
|
|
Widget storeItem(Store store, position) { |
|
|
|
return Container( |
|
|
|
return Container( |
|
|
|
width: 160, |
|
|
|
width: 160, |
|
|
|
height: 160, |
|
|
|
height: 160, |
|
|
@ -226,7 +224,7 @@ class _QuickOrder extends State<QuickOrder> { |
|
|
|
child: MImage( |
|
|
|
child: MImage( |
|
|
|
store.facade, |
|
|
|
store.facade, |
|
|
|
width: double.infinity, |
|
|
|
width: double.infinity, |
|
|
|
height: 95, |
|
|
|
height: 100, |
|
|
|
fit: BoxFit.cover, |
|
|
|
fit: BoxFit.cover, |
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
@ -243,7 +241,7 @@ class _QuickOrder extends State<QuickOrder> { |
|
|
|
child: SvgPicture.asset( |
|
|
|
child: SvgPicture.asset( |
|
|
|
"assets/svg/kuaijiexiadan_bg.svg", |
|
|
|
"assets/svg/kuaijiexiadan_bg.svg", |
|
|
|
width: double.infinity, |
|
|
|
width: double.infinity, |
|
|
|
height: 95, |
|
|
|
height: 85, |
|
|
|
fit: BoxFit.fill, |
|
|
|
fit: BoxFit.fill, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
@ -265,15 +263,18 @@ class _QuickOrder extends State<QuickOrder> { |
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
), |
|
|
|
), |
|
|
|
Padding(padding: EdgeInsets.only(left: 10,right: 10),child:Text( |
|
|
|
Padding( |
|
|
|
store.storeName, |
|
|
|
padding: EdgeInsets.only(left: 10, right: 10), |
|
|
|
textAlign: TextAlign.center, |
|
|
|
child: Text( |
|
|
|
style: TextStyle( |
|
|
|
store.storeName, |
|
|
|
fontSize: 13.sp, |
|
|
|
textAlign: TextAlign.center, |
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
style: TextStyle( |
|
|
|
color: Colors.black, |
|
|
|
fontSize: 13.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
|
|
|
color: Colors.black, |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
),), |
|
|
|
), |
|
|
|
// Text( |
|
|
|
// Text( |
|
|
|
// store?.remark ??"", |
|
|
|
// store?.remark ??"", |
|
|
|
// style: TextStyle( |
|
|
|
// style: TextStyle( |
|
|
@ -380,7 +381,7 @@ class _QuickOrder extends State<QuickOrder> { |
|
|
|
S.of(context).ninxiangjiquanxianweikaiqi, |
|
|
|
S.of(context).ninxiangjiquanxianweikaiqi, |
|
|
|
S.of(context).weilekaipaizhaoxuanzhetouxiang, |
|
|
|
S.of(context).weilekaipaizhaoxuanzhetouxiang, |
|
|
|
S.of(context).kaiqiquanxian, |
|
|
|
S.of(context).kaiqiquanxian, |
|
|
|
(result) async { |
|
|
|
(result) async { |
|
|
|
if (result) { |
|
|
|
if (result) { |
|
|
|
await openAppSettings(); |
|
|
|
await openAppSettings(); |
|
|
|
} |
|
|
|
} |
|
|
@ -396,7 +397,12 @@ class _QuickOrder extends State<QuickOrder> { |
|
|
|
String tableId = uri.queryParameters["tableId"]; |
|
|
|
String tableId = uri.queryParameters["tableId"]; |
|
|
|
String tenantCode = uri.queryParameters["tenantCode"]; |
|
|
|
String tenantCode = uri.queryParameters["tenantCode"]; |
|
|
|
String shopId = uri.queryParameters["shopId"]; |
|
|
|
String shopId = uri.queryParameters["shopId"]; |
|
|
|
if (tableId != null && tableId != "" && tenantCode != null && tenantCode != "" && shopId != null && shopId != "") { |
|
|
|
if (tableId != null && |
|
|
|
|
|
|
|
tableId != "" && |
|
|
|
|
|
|
|
tenantCode != null && |
|
|
|
|
|
|
|
tenantCode != "" && |
|
|
|
|
|
|
|
shopId != null && |
|
|
|
|
|
|
|
shopId != "") { |
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
'/router/store_order', |
|
|
|
'/router/store_order', |
|
|
|
arguments: { |
|
|
|
arguments: { |
|
|
|