修改登陆页面
parent
5526ab2d6a
commit
cf54ddc9fc
|
|
@ -26,7 +26,7 @@ class _AppState extends State<App> {
|
|||
icon: Icon(IconData(0xe607,fontFamily: 'appIconFonts')), title: Text('我的')),
|
||||
];
|
||||
|
||||
final List tabBodies = [
|
||||
final List<Widget> tabBodies = [
|
||||
ChattingPage(),
|
||||
ChattinFriendPage(),
|
||||
DiscoverPage(),
|
||||
|
|
@ -41,7 +41,6 @@ class _AppState extends State<App> {
|
|||
void initState() {
|
||||
currentPage = tabBodies[currentIndex];
|
||||
super.initState();
|
||||
chattingApi.getChattingList();
|
||||
}
|
||||
|
||||
@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,
|
||||
});
|
||||
var result = await dio.post(
|
||||
'http://customer.dsd361.com/login',
|
||||
'http://192.168.55.141/login',
|
||||
data: formData,
|
||||
options: options
|
||||
);
|
||||
|
|
@ -36,7 +36,7 @@ class ChattingApi {
|
|||
token=result.data['token'];
|
||||
time=result.data['loginTime'];
|
||||
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);
|
||||
return chattingApiResult ;
|
||||
}
|
||||
|
|
@ -52,7 +52,7 @@ class ChattingApi {
|
|||
FormData formData = new FormData.from({
|
||||
'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 = new List();
|
||||
result.forEach((item) {
|
||||
|
|
@ -69,8 +69,11 @@ class ChattingApi {
|
|||
}
|
||||
|
||||
//获取当前用户信息
|
||||
getCurrentUserInfo(String id) async {
|
||||
var result = await dio.get('');
|
||||
getCurrentUserInfo() async {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
|
||||
class ChattingApiResult extends Object{
|
||||
|
||||
Uesr user;
|
||||
|
||||
String token;
|
||||
|
||||
int time;
|
||||
|
|
@ -13,10 +15,29 @@ class ChattingApiResult extends Object{
|
|||
|
||||
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
|
||||
String toString() {
|
||||
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) {
|
||||
//传入 messageData 返回 表项
|
||||
return new ChattingItemPage(messageData[index]);
|
||||
},
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,11 @@ class PersonalPage extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _PersonalPageState extends State<PersonalPage> {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
|
|
|
|||
Loading…
Reference in New Issue