update for user group

This commit is contained in:
Mohamed Nouffer
2022-09-05 19:12:25 +05:30
parent 09ac737de5
commit 6802083a0a
5 changed files with 88 additions and 51 deletions

View File

@ -166,6 +166,7 @@ List<LatLng> getLocationsList(){
void login(String email, String password, BuildContext context){ void login(String email, String password, BuildContext context){
AuthService.login(email, password).then((value){ AuthService.login(email, password).then((value){
print("------- logged in user details ######## ${value} ###### --------");
if(value.isNotEmpty){ if(value.isNotEmpty){
currentUser.clear(); currentUser.clear();
currentUser.add(value); currentUser.add(value);
@ -303,7 +304,7 @@ void login(String email, String password, BuildContext context){
if(currentUser.length > 0){ if(currentUser.length > 0){
int user_id = currentUser[0]["user"]["id"] as int; int user_id = currentUser[0]["user"]["id"] as int;
AuthService.UserDetails(user_id).then((value){ AuthService.UserDetails(user_id).then((value){
//print("--------- user details ----- ${value}"); print("--------- user details ----- ${value}");
bool paid = value![0]["paid"] as bool; bool paid = value![0]["paid"] as bool;
if(paid){ if(paid){
loadCustomAreas(); loadCustomAreas();

View File

@ -41,7 +41,8 @@ class LocationService{
if(cat.isNotEmpty){ if(cat.isNotEmpty){
if(indexController.currentUser.length > 0){ if(indexController.currentUser.length > 0){
url = '${server_url}/api/inperf/?rog=True&perf=' + perfecture + '&cat=' + cat; var grp = indexController.currentUser[0]["group"];
url = '${server_url}/api/inperf/?rog=True&perf=' + perfecture + '&cat=' + cat + "&grp=${grp}";
} }
else { else {
url = '${server_url}/api/inperf/?perf=' + perfecture + '&cat=' + cat; url = '${server_url}/api/inperf/?perf=' + perfecture + '&cat=' + cat;
@ -49,7 +50,8 @@ class LocationService{
} }
else{ else{
if(indexController.currentUser.length > 0){ if(indexController.currentUser.length > 0){
url = '${server_url}/api/inperf/?rog=True&perf=' + perfecture; var grp = indexController.currentUser[0]["group"];
url = '${server_url}/api/inperf/?rog=True&perf=' + perfecture + "&grp=${grp}";
} }
else { else {
url = '${server_url}/api/inperf/?perf=' + perfecture; url = '${server_url}/api/inperf/?perf=' + perfecture;
@ -77,7 +79,8 @@ class LocationService{
String server_url = ConstValues.currentServer(); String server_url = ConstValues.currentServer();
if(cat.isNotEmpty){ if(cat.isNotEmpty){
if(indexController.currentUser.length > 0){ if(indexController.currentUser.length > 0){
url = '${server_url}/api/insubperf?rog=True&subperf=' + subperfecture + '&cat=' + cat; var grp = indexController.currentUser[0]["group"];
url = '${server_url}/api/insubperf?rog=True&subperf=' + subperfecture + '&cat=' + cat + "&grp=${grp}";
} }
else{ else{
url = '${server_url}/api/insubperf?subperf=' + subperfecture + '&cat=' + cat; url = '${server_url}/api/insubperf?subperf=' + subperfecture + '&cat=' + cat;
@ -85,7 +88,8 @@ class LocationService{
} }
else{ else{
if(indexController.currentUser.length > 0){ if(indexController.currentUser.length > 0){
url = '${server_url}/api/insubperf?rog=True&subperf=' + subperfecture; var grp = indexController.currentUser[0]["group"];
url = '${server_url}/api/insubperf?rog=True&subperf=' + subperfecture + "&grp=${grp}";
} }
else{ else{
url = '${server_url}/api/insubperf?subperf=' + subperfecture; url = '${server_url}/api/insubperf?subperf=' + subperfecture;
@ -113,7 +117,8 @@ class LocationService{
String server_url = ConstValues.currentServer(); String server_url = ConstValues.currentServer();
if(cat.isNotEmpty){ if(cat.isNotEmpty){
if(indexController.currentUser.length > 0){ if(indexController.currentUser.length > 0){
url = '${server_url}/api/inbound?rog=True&ln1=${lon1}&la1=${lat1}&ln2=${lon2}&la2=${lat2}&ln3=${lon3}&la3=${lat3}&ln4=${lon4}&la4=${lat4}' + '&cat=' + cat; var grp = indexController.currentUser[0]["group"];
url = '${server_url}/api/inbound?rog=True&ln1=${lon1}&la1=${lat1}&ln2=${lon2}&la2=${lat2}&ln3=${lon3}&la3=${lat3}&ln4=${lon4}&la4=${lat4}' + '&cat=' + cat + "&grp=${grp}";
} }
else{ else{
url = '${server_url}/api/inbound?ln1=${lon1}&la1=${lat1}&ln2=${lon2}&la2=${lat2}&ln3=${lon3}&la3=${lat3}&ln4=${lon4}&la4=${lat4}' + '&cat=' + cat; url = '${server_url}/api/inbound?ln1=${lon1}&la1=${lat1}&ln2=${lon2}&la2=${lat2}&ln3=${lon3}&la3=${lat3}&ln4=${lon4}&la4=${lat4}' + '&cat=' + cat;
@ -121,7 +126,8 @@ class LocationService{
} }
else{ else{
if(indexController.currentUser.length > 0){ if(indexController.currentUser.length > 0){
url = '${server_url}/api/inbound?rog=True&ln1=${lon1}&la1=${lat1}&ln2=${lon2}&la2=${lat2}&ln3=${lon3}&la3=${lat3}&ln4=${lon4}&la4=${lat4}'; var grp = indexController.currentUser[0]["group"];
url = '${server_url}/api/inbound?rog=True&ln1=${lon1}&la1=${lat1}&ln2=${lon2}&la2=${lat2}&ln3=${lon3}&la3=${lat3}&ln4=${lon4}&la4=${lat4}' + '&grp=${grp}';
} }
else{ else{
url = '${server_url}/api/inbound?ln1=${lon1}&la1=${lat1}&ln2=${lon2}&la2=${lat2}&ln3=${lon3}&la3=${lat3}&ln4=${lon4}&la4=${lat4}'; url = '${server_url}/api/inbound?ln1=${lon1}&la1=${lat1}&ln2=${lon2}&la2=${lat2}&ln3=${lon3}&la3=${lat3}&ln4=${lon4}&la4=${lat4}';
@ -161,7 +167,8 @@ class LocationService{
print("loadCustomLocations url is ----- ${cat}"); print("loadCustomLocations url is ----- ${cat}");
if(cat.isNotEmpty){ if(cat.isNotEmpty){
if(indexController.currentUser.length > 0){ if(indexController.currentUser.length > 0){
url = '${server_url}/api/custom_area/?rog=True&&cat=' + cat; var grp = indexController.currentUser[0]["group"];
url = '${server_url}/api/custom_area/?rog=True&&cat=' + cat + "&grp=${grp}";
} }
else{ else{
url = '${server_url}/api/custom_area/?&cat=' + cat; url = '${server_url}/api/custom_area/?&cat=' + cat;
@ -169,10 +176,11 @@ class LocationService{
} }
else{ else{
if(indexController.currentUser.length > 0){ if(indexController.currentUser.length > 0){
url = '${server_url}/api/customarea?rog=True&name=${name}&'; var grp = indexController.currentUser[0]["group"];
url = '${server_url}/api/customarea?rog=True&name=${name}' + "&grp=${grp}";
} }
else{ else{
url = '${server_url}/api/customarea?name=${name}&'; url = '${server_url}/api/customarea?name=${name}';
} }
} }
print("----loadCustomLocations url --- ${url}"); print("----loadCustomLocations url --- ${url}");

View File

@ -4,7 +4,7 @@
class ConstValues{ class ConstValues{
static const server_uri = "http://container.intranet.sumasen.net:8100"; static const server_uri = "http://container.intranet.sumasen.net:8100";
static const dev_server = "http://localhost:8100"; static const dev_server = "http://localhost:8100";
static const dev_ip_server = "http://192.168.8.103:8100"; static const dev_ip_server = "http://192.168.8.100:8100";
static String currentServer(){ static String currentServer(){
return server_uri; return server_uri;

View File

@ -279,7 +279,8 @@ class BottomSheetNew extends GetView<BottomSheetController> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Icon(Icons.thumb_up_alt_sharp), Icon(Icons.thumb_up_alt_sharp, color: Colors.blue,),
SizedBox(width: 10.0,),
Text("Like"), Text("Like"),
], ],
), ),
@ -363,34 +364,58 @@ class BottomSheetNew extends GetView<BottomSheetController> {
children: [ children: [
indexController.rog_mode == 0 ? indexController.rog_mode == 0 ?
IconButton( IconButton(
icon: Icon(Icons.pin_drop_sharp, size: 32,), icon: Icon(Icons.pin_drop_sharp, size: 32, color: Colors.blue,),
onPressed: (){ onPressed: (){
GeoJsonMultiPoint mp = indexController.currentFeature[0].geometry as GeoJsonMultiPoint;
LatLng pt = LatLng(mp.geoSerie!.geoPoints[0].latitude, mp.geoSerie!.geoPoints[0].longitude);
Destination dest = Destination( Get.defaultDialog(
name: indexController.currentFeature[0].properties!["location_name"], title: "この場所を登録してもよろしいですか",
address: indexController.currentFeature[0].properties!["address"], middleText: "ロケーションがロガニング リストに追加されます",
phone: indexController.currentFeature[0].properties!["phone"], backgroundColor: Colors.blue.shade300,
email: indexController.currentFeature[0].properties!["email"], titleStyle: TextStyle(color: Colors.white),
webcontents: indexController.currentFeature[0].properties!["webcontents"], middleTextStyle: TextStyle(color: Colors.white),
videos: indexController.currentFeature[0].properties!["videos"], textConfirm: "確認",
category: indexController.currentFeature[0].properties!["category"], textCancel: "キャンセル",
series: 1, cancelTextColor: Colors.white,
lat: pt.latitude, confirmTextColor: Colors.blue,
lon: pt.longitude, buttonColor: Colors.white,
location_id: indexController.currentFeature[0].properties!["location_id"], barrierDismissible: false,
list_order: 1, radius: 10,
photos: indexController.currentFeature[0].properties!["photos"], content: Column(
checkin_radious: indexController.currentFeature[0].properties!["checkin_radious"], children: [
auto_checkin: indexController.currentFeature[0].properties!["auto_checkin"] == true ? 1 : 0, ],
cp: indexController.currentFeature[0].properties!["cp"], ),
checkin_point: indexController.currentFeature[0].properties!["checkin_point"], onConfirm: (){
buy_point: indexController.currentFeature[0].properties!["buy_point"], GeoJsonMultiPoint mp = indexController.currentFeature[0].geometry as GeoJsonMultiPoint;
selected: false, LatLng pt = LatLng(mp.geoSerie!.geoPoints[0].latitude, mp.geoSerie!.geoPoints[0].longitude);
checkedin: false
Destination dest = Destination(
name: indexController.currentFeature[0].properties!["location_name"],
address: indexController.currentFeature[0].properties!["address"],
phone: indexController.currentFeature[0].properties!["phone"],
email: indexController.currentFeature[0].properties!["email"],
webcontents: indexController.currentFeature[0].properties!["webcontents"],
videos: indexController.currentFeature[0].properties!["videos"],
category: indexController.currentFeature[0].properties!["category"],
series: 1,
lat: pt.latitude,
lon: pt.longitude,
location_id: indexController.currentFeature[0].properties!["location_id"],
list_order: 1,
photos: indexController.currentFeature[0].properties!["photos"],
checkin_radious: indexController.currentFeature[0].properties!["checkin_radious"],
auto_checkin: indexController.currentFeature[0].properties!["auto_checkin"] == true ? 1 : 0,
cp: indexController.currentFeature[0].properties!["cp"],
checkin_point: indexController.currentFeature[0].properties!["checkin_point"],
buy_point: indexController.currentFeature[0].properties!["buy_point"],
selected: false,
checkedin: false
);
destinationController.addDestinations(dest);
Get.back();
Get.snackbar("追加した", "場所が追加されました");
}
); );
destinationController.addDestinations(dest);
}, },
): ):
Container(), Container(),

View File

@ -140,20 +140,23 @@ class MapWidget extends StatelessWidget {
// ) // )
// : Icon(Icons.pin_drop), // : Icon(Icons.pin_drop),
builder: (ctx){ builder: (ctx){
return Container( return Row(
width: 7, children: [
height: 7, Container(
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: Colors.transparent, color: Colors.transparent,
border: Border.all( border: Border.all(
color: Colors.red, color: Colors.red,
width: 3, width: 3,
style: BorderStyle.solid style: BorderStyle.solid
) )
), ),
child: Icon(Icons.circle,size: 10.0,) child: Icon(Icons.circle,size: 14.0,)
); ),
Text(i.properties!['cp'] > 0 ? i.properties!['cp'].toString() : "", style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color:Colors.red,)),
],
);
}, },
); );
}).toList(), }).toList(),