Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gmalpha_flutter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile
gmalpha_flutter
Commits
e3dc62fe
Commit
e3dc62fe
authored
Aug 07, 2019
by
jinzhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
ce38e580
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
9 deletions
+15
-9
main.dart
lib/main.dart
+1
-1
message.dart
lib/model/message/message.dart
+3
-2
DioUtil.dart
lib/netWork/DioUtil.dart
+2
-2
message_home.dart
lib/pages/message/home/message_home.dart
+9
-4
No files found.
lib/main.dart
View file @
e3dc62fe
...
...
@@ -32,7 +32,7 @@ class _MyAppState extends State<MyApp> {
void
_init
()
{
BaseOptions
options
=
DioUtil
.
getDefOptions
();
Map
<
String
,
dynamic
>
cookie
=
{
'cookie'
:
'_gm_token=
4cabd51562739648; _gtid=fac513b6a2bf11e9acfd525400e5c7a38141; sessionid=7j7s902fmro0pvybwrp374khvva6l3xf
;'
};
Map
<
String
,
dynamic
>
cookie
=
{
'cookie'
:
'_gm_token=
1987651565078867; _gtid=7b19ca1cb4d511e9bf97525400e82fab4241; sessionid=d45sucgkl5frearp8qoezpjio65z8svh
;'
};
HttpConfig
config
=
new
HttpConfig
(
options:
options
,
nativeCookie:
cookie
);
DioUtil
().
setConfig
(
config
);
}
...
...
lib/model/message/message.dart
View file @
e3dc62fe
import
'package:flutter/material.dart'
;
import
'package:gmalpha_flutter/base/list_item.dart'
;
import
'package:gmalpha_flutter/model/message/replied_content.dart'
;
// The base class for the different types of items the list can contain.
abstract
class
ListItem
{}
//
abstract class ListItem {}
// https://javiercbk.github.io/json_to_dart/ json 在线转dart
class
Message
implements
ListItem
{
final
int
userId
;
final
String
name
;
...
...
lib/netWork/DioUtil.dart
View file @
e3dc62fe
...
...
@@ -445,8 +445,8 @@ class DioUtil {
options
.
connectTimeout
=
10
*
1000
;
options
.
receiveTimeout
=
20
*
1000
;
options
.
contentType
=
ContentType
.
parse
(
'application/x-www-form-urlencoded'
);
options
.
baseUrl
=
'https://earth.iyanzhi.com/'
;
//
options.baseUrl = 'http://earth.gmapp.env/';
//
options.baseUrl = 'https://earth.iyanzhi.com/';
options
.
baseUrl
=
'http://earth.gmapp.env/'
;
Map
<
String
,
dynamic
>
headers
=
Map
<
String
,
dynamic
>();
headers
[
'Accept'
]
=
'application/json'
;
return
options
;
...
...
lib/pages/message/home/message_home.dart
View file @
e3dc62fe
...
...
@@ -5,6 +5,7 @@ import 'message_item.dart';
import
'package:gmalpha_flutter/model/message/message.dart'
;
import
'package:gmalpha_flutter/netWork/DioUtil.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
import
'package:gmalpha_flutter/base/list_item.dart'
;
class
MessageHomePage
extends
StatefulWidget
{
...
...
@@ -69,19 +70,23 @@ class _MessageHomePageState extends State<MessageHomePage> {
BaseRespR
likeResp
=
await
DioUtil
().
requestR
(
Method
.
get
,
'api/v1/message/unread'
,
queryParameters:
{
'type'
:
0
});
print
(
likeResp
);
Map
likeData
=
likeResp
.
data
;
String
likeContent
=
'
还没有人给你Like哦~
'
;
String
likeContent
=
''
;
NotificationItem
likeItem
=
NotificationItem
(
'images/message_like.png'
,
likeContent
,
likeData
[
'count'
],
'Like'
);
if
(
likeItem
.
count
>
0
)
{
likeItem
.
content
=
'有
${likeItem.content}
个人Like了你'
;
likeItem
.
content
=
'有
${likeItem.count}
个人Like了你'
;
}
else
{
likeItem
.
content
=
'还没有人给你Like哦~'
;
}
notiData
.
add
(
likeItem
);
BaseRespR
attentionResp
=
await
DioUtil
().
requestR
(
Method
.
get
,
'api/v1/message/unread'
,
queryParameters:
{
'type'
:
1
});
Map
attData
=
attentionResp
.
data
;
String
attContent
=
'
还没有人给你关注哦~
'
;
String
attContent
=
''
;
NotificationItem
attItem
=
NotificationItem
(
'images/message_att.png'
,
attContent
,
attData
[
'count'
],
'关注'
);
if
(
attItem
.
count
>
0
)
{
attItem
.
content
=
'有
${attItem.content}
个人关注了你'
;
attItem
.
content
=
'有
${attItem.count}
个人关注了你'
;
}
else
{
attContent
=
'还没有人给你关注哦~'
;
}
notiData
.
add
(
attItem
);
// this.dataArr = dataArr;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment