修改登陆页面
parent
5526ab2d6a
commit
cf54ddc9fc
|
|
@ -26,7 +26,7 @@ class _AppState extends State<App> {
|
||||||
icon: Icon(IconData(0xe607,fontFamily: 'appIconFonts')), title: Text('我的')),
|
icon: Icon(IconData(0xe607,fontFamily: 'appIconFonts')), title: Text('我的')),
|
||||||
];
|
];
|
||||||
|
|
||||||
final List tabBodies = [
|
final List<Widget> tabBodies = [
|
||||||
ChattingPage(),
|
ChattingPage(),
|
||||||
ChattinFriendPage(),
|
ChattinFriendPage(),
|
||||||
DiscoverPage(),
|
DiscoverPage(),
|
||||||
|
|
@ -41,7 +41,6 @@ class _AppState extends State<App> {
|
||||||
void initState() {
|
void initState() {
|
||||||
currentPage = tabBodies[currentIndex];
|
currentPage = tabBodies[currentIndex];
|
||||||
super.initState();
|
super.initState();
|
||||||
chattingApi.getChattingList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -59,7 +58,11 @@ class _AppState extends State<App> {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
body: currentPage,
|
//body: currentPage,
|
||||||
|
body: IndexedStack(
|
||||||
|
index: currentIndex,
|
||||||
|
children: tabBodies,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -28,7 +28,7 @@ class ChattingApi {
|
||||||
'password':password,
|
'password':password,
|
||||||
});
|
});
|
||||||
var result = await dio.post(
|
var result = await dio.post(
|
||||||
'http://customer.dsd361.com/login',
|
'http://192.168.55.141/login',
|
||||||
data: formData,
|
data: formData,
|
||||||
options: options
|
options: options
|
||||||
);
|
);
|
||||||
|
|
@ -36,7 +36,7 @@ class ChattingApi {
|
||||||
token=result.data['token'];
|
token=result.data['token'];
|
||||||
time=result.data['loginTime'];
|
time=result.data['loginTime'];
|
||||||
message=result.data['message'];
|
message=result.data['message'];
|
||||||
chattingApiResult= new ChattingApiResult(token,time,message,null,null,null);
|
chattingApiResult= new ChattingApiResult(null,token,time,message,null,null,null);
|
||||||
print(chattingApiResult.runtimeType);
|
print(chattingApiResult.runtimeType);
|
||||||
return chattingApiResult ;
|
return chattingApiResult ;
|
||||||
}
|
}
|
||||||
|
|
@ -52,7 +52,7 @@ class ChattingApi {
|
||||||
FormData formData = new FormData.from({
|
FormData formData = new FormData.from({
|
||||||
'token':token
|
'token':token
|
||||||
});
|
});
|
||||||
var response = await dio.post('http://customer.dsd361.com/newchattings/selectChattingeFriebdList',data: formData);
|
var response = await dio.post('http://192.168.55.141/newchattings/selectChattingeFriebdList',data: formData);
|
||||||
List result=response.data;
|
List result=response.data;
|
||||||
list = new List();
|
list = new List();
|
||||||
result.forEach((item) {
|
result.forEach((item) {
|
||||||
|
|
@ -69,8 +69,11 @@ class ChattingApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取当前用户信息
|
//获取当前用户信息
|
||||||
getCurrentUserInfo(String id) async {
|
getCurrentUserInfo() async {
|
||||||
var result = await dio.get('');
|
token = await dataManipulation_get('token');
|
||||||
|
var response = await dio.get('http://192.168.55.141/iUsers/getuser?token='+token+'&source=app');
|
||||||
|
var result=response.data;
|
||||||
|
print(result);
|
||||||
return result.data;
|
return result.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
|
|
||||||
class ChattingApiResult extends Object{
|
class ChattingApiResult extends Object{
|
||||||
|
|
||||||
|
Uesr user;
|
||||||
|
|
||||||
String token;
|
String token;
|
||||||
|
|
||||||
int time;
|
int time;
|
||||||
|
|
@ -13,10 +15,29 @@ class ChattingApiResult extends Object{
|
||||||
|
|
||||||
String content;
|
String content;
|
||||||
|
|
||||||
ChattingApiResult(this.token, this.time, this.message, this.sendId, this.receiveId, this.content);
|
|
||||||
|
ChattingApiResult(this.user, this.token, this.time, this.message, this.sendId, this.receiveId, this.content);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'ChattingApiResult{token: $token, time: $time, message: $message, sendId: $sendId, receiveId: $receiveId, content: $content}';
|
return 'ChattingApiResult{token: $token, time: $time, message: $message, sendId: $sendId, receiveId: $receiveId, content: $content}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Uesr{
|
||||||
|
|
||||||
|
int id ;
|
||||||
|
|
||||||
|
String photo;
|
||||||
|
|
||||||
|
String username;
|
||||||
|
|
||||||
|
String telephone;
|
||||||
|
|
||||||
|
Uesr(this.id, this.photo, this.username, this.telephone);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'Uesr{id: $id, photo: $photo, username: $username, telephone: $telephone}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -42,8 +42,9 @@ class _ChattingDetailsPageState extends State<ChattingBuildPage> {
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
//传入 messageData 返回 表项
|
//传入 messageData 返回 表项
|
||||||
return new ChattingItemPage(messageData[index]);
|
return new ChattingItemPage(messageData[index]);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,11 @@ class PersonalPage extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _PersonalPageState extends State<PersonalPage> {
|
class _PersonalPageState extends State<PersonalPage> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue