Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gm_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
林生雨
gm_flutter
Commits
54917347
Commit
54917347
authored
Jul 04, 2020
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
0bf3f8ad
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
348 additions
and
81 deletions
+348
-81
DiscussLowPriceModel.dart
lib/ClueModel/page/DiscussLowPrice/DiscussLowPriceModel.dart
+6
-6
DiscussLowPricePopView.dart
...lueModel/page/DiscussLowPrice/DiscussLowPricePopView.dart
+57
-62
LevelOnePage.dart
lib/ClueModel/page/levelOne/LevelOnePage.dart
+5
-5
TopModel.dart
lib/ClueModel/page/top/TopModel.dart
+3
-1
TopPage.dart
lib/ClueModel/page/top/TopPage.dart
+27
-6
ClueApi.dart
lib/ClueModel/server/api/ClueApi.dart
+4
-0
ClueApi.serv.dart
lib/ClueModel/server/api/ClueApi.serv.dart
+19
-0
PlanOverViewBean.dart
lib/ClueModel/server/entity/PlanOverViewBean.dart
+217
-0
BaseComponent.dart
lib/commonModel/base/BaseComponent.dart
+10
-1
No files found.
lib/ClueModel/page/DiscussLowPrice/DiscussLowPriceModel.dart
View file @
54917347
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
* @Last Modified by: zx
* @Last Modified by: zx
* @Last Modified time: 2020-07-04 12:20:45
* @Last Modified time: 2020-07-04 12:20:45
*/
*/
import
'package:dio/dio.dart'
;
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
import
'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart'
;
import
'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart'
;
...
@@ -16,8 +17,6 @@ import 'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceAuthBean.dart'
...
@@ -16,8 +17,6 @@ import 'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceAuthBean.dart'
class
DiscussLowPriceModel
extends
BaseModel
{
class
DiscussLowPriceModel
extends
BaseModel
{
LiveData
<
Pair
<
int
,
DiscussLowPriceModelBean
>>
popViewLive
=
LiveData
();
LiveData
<
Pair
<
int
,
DiscussLowPriceModelBean
>>
popViewLive
=
LiveData
();
LiveData
<
bool
>
phoneAuthLive
=
LiveData
();
RxDispose
rxDispose
=
RxDispose
();
RxDispose
rxDispose
=
RxDispose
();
fetchPopviewData
(
String
planId
,
String
hospitalId
,
String
doctorId
)
{
fetchPopviewData
(
String
planId
,
String
hospitalId
,
String
doctorId
)
{
...
@@ -43,26 +42,27 @@ class DiscussLowPriceModel extends BaseModel {
...
@@ -43,26 +42,27 @@ class DiscussLowPriceModel extends BaseModel {
});
});
}
}
givePhoneAuth
(
int
leadPhoneRequestId
)
{
givePhoneAuth
(
int
leadPhoneRequestId
,
VoidCallback
callback
)
{
popViewLive
.
notifyView
(
Pair
(
ENDLOADING
,
null
));
ClueApiImpl
.
getInstance
()
ClueApiImpl
.
getInstance
()
.
givePhoneAuth
(
DioUtil
.
getInstance
().
getDio
(),
leadPhoneRequestId
)
.
givePhoneAuth
(
DioUtil
.
getInstance
().
getDio
(),
leadPhoneRequestId
)
.
listen
((
event
)
{
.
listen
((
event
)
{
if
(
event
.
error
==
0
)
{
if
(
event
.
error
==
0
)
{
phoneAuthLive
.
notifyView
(
event
.
data
.
success
);
}
else
{
}
else
{
NativeToast
.
showNativeToast
(
event
.
message
);
NativeToast
.
showNativeToast
(
event
.
message
);
phoneAuthLive
.
notifyView
(
false
);
}
}
callback
();
})
})
.
addToDispose
(
rxDispose
)
.
addToDispose
(
rxDispose
)
.
onError
((
err
)
{
.
onError
((
err
)
{
phoneAuthLive
.
notifyView
(
false
);
NativeToast
.
showNativeToast
(
err
.
message
);
NativeToast
.
showNativeToast
(
err
.
message
);
callback
();
});
});
}
}
@override
@override
void
dispose
()
{
void
dispose
()
{
popViewLive
.
dispost
();
popViewLive
.
dispost
();
rxDispose
.
dispose
();
}
}
}
}
lib/ClueModel/page/DiscussLowPrice/DiscussLowPricePopView.dart
View file @
54917347
...
@@ -6,9 +6,11 @@
...
@@ -6,9 +6,11 @@
*/
*/
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_common/commonModel/picker/base/BaseCenterPicker.dart'
;
import
'package:flutter_common/commonModel/picker/base/BaseCenterPicker.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceModelBean.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gm_flutter/ClueModel/page/DiscussLowPrice/DiscussLowPriceModel.dart'
;
import
'package:gm_flutter/ClueModel/page/DiscussLowPrice/DiscussLowPriceModel.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
class
DiscussLowPricePopView
{
class
DiscussLowPricePopView
{
static
void
showPopView
(
BuildContext
content
)
{
static
void
showPopView
(
BuildContext
content
)
{
...
@@ -22,101 +24,98 @@ class _PopView implements ICenterPicker {
...
@@ -22,101 +24,98 @@ class _PopView implements ICenterPicker {
VoidCallback
dismissCallback
;
VoidCallback
dismissCallback
;
double
contentWidth
;
double
contentWidth
;
DiscussLowPriceModel
_model
=
new
DiscussLowPriceModel
();
DiscussLowPriceModel
_model
=
new
DiscussLowPriceModel
();
@override
@override
Widget
build
(
BuildContext
context
,
int
alp
)
{
Widget
build
(
BuildContext
context
,
int
alp
)
{
contentWidth
=
MediaQuery
.
of
(
context
).
size
.
width
-
72
;
contentWidth
=
MediaQuery
.
of
(
context
).
size
.
width
-
72
;
return
StreamBuilder
(
return
StreamBuilder
<
Pair
<
int
,
DiscussLowPriceModelBean
>>
(
stream:
_model
.
popViewLive
.
stream
,
stream:
_model
.
popViewLive
.
stream
,
initialData:
_model
.
popViewLive
??
Pair
(
LOADING
,
null
),
initialData:
_model
.
popViewLive
.
data
??
Pair
(
LOADING
,
null
),
builder:
(
c
,
data
)
{
builder:
(
c
,
data
)
{
if
(
data
.
data
.
first
==
LOADING
)
{
return
loadingItem
();
}
if
(
data
.
data
.
second
==
null
||
data
.
data
.
first
==
FAIL
)
{
if
(
data
.
data
.
second
==
null
||
data
.
data
.
first
==
FAIL
)
{
return
Container
(
return
errorItem
(
contentWidth
,
308.5
,
()
{});
height:
0
,
width:
0
,
);
}
}
return
Container
(
return
Opacity
(
width:
contentWidth
,
opacity:
alp
/
255.0
,
alignment:
AlignmentDirectional
.
center
,
child:
Container
(
child:
Container
(
child:
Container
(
width:
contentWidth
,
margin:
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
0
)
,
height:
308.5
,
child:
Stack
(
child:
Stack
(
alignment:
AlignmentDirectional
.
topCenter
,
alignment:
AlignmentDirectional
.
topCenter
,
children:
<
Widget
>[
children:
<
Widget
>[
Column
(
Positioned
(
mainAxisSize:
MainAxisSize
.
min
,
top:
42.5
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Container
(
height:
42.5
,
width:
contentWidth
,
),
Container
(
margin:
EdgeInsets
.
only
(
bottom:
0
),
child:
Stack
(
children:
<
Widget
>[
Container
(
child:
setupBodyView
(),
child:
setupBodyView
(),
),
),
Positioned
(
Positioned
(
top:
20
,
top:
62.5
,
right:
20
,
right:
20
,
width:
16
,
width:
13.5
,
height:
16
,
height:
13.5
,
child:
GestureDetector
(
child:
GestureDetector
(
onTap:
()
{
onTap:
()
{
dismissCallback
();
dismissCallback
();
},
},
child:
Image
.
asset
(
child:
Image
.
asset
(
'assets/discuss_loe_price_cancel.png'
,
'assets/discuss_loe_price_cancel.png'
),
fit:
BoxFit
.
cover
),
)),
))
]))
]),
Container
(
Container
(
margin:
EdgeInsets
.
only
(
top:
0
),
width:
85
,
width:
85
,
height:
85
,
height:
85
,
decoration:
BoxDecoration
(
boxShadow:
[
BoxShadow
(
color:
Colors
.
black12
,
offset:
Offset
(
0.0
,
15.0
),
blurRadius:
15.0
,
spreadRadius:
1.0
)
],
shape:
BoxShape
.
circle
),
child:
ClipOval
(
child:
Image
.
network
(
child:
Image
.
network
(
_model
.
popViewLive
.
data
.
second
.
icon
,
_model
.
popViewLive
.
data
.
second
.
icon
,
fit:
BoxFit
.
cover
),
fit:
BoxFit
.
cover
),
),
)
)
]),
]),
))
)
;
));
});
});
}
}
setupBodyView
()
{
setupBodyView
()
{
return
Container
(
return
Container
(
height:
266
,
width:
contentWidth
,
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
7
),
borderRadius:
BorderRadius
.
circular
(
7
),
color:
Colors
.
white
,
color:
Colors
.
white
,
),
),
child:
Container
(
child:
Container
(
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
only
(
bottom:
0
,
top:
4
2.5
),
margin:
EdgeInsets
.
only
(
bottom:
0
,
top:
4
4
),
child:
detailView
(),
child:
detailView
(),
),
),
);
);
}
}
detailView
()
{
detailView
()
{
return
Container
(
return
Column
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
mainAxisSize:
MainAxisSize
.
min
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
children:
<
Widget
>[
Container
(
Container
(
height:
19
,
margin:
EdgeInsets
.
only
(
bottom:
13.5
),
margin:
EdgeInsets
.
only
(
bottom:
14
),
alignment:
AlignmentDirectional
.
center
,
alignment:
AlignmentDirectional
.
center
,
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
<
Widget
>[
Container
(
Container
(
width:
16
,
width:
16
,
height:
16
,
height:
16
,
child:
Image
.
asset
(
child:
Image
.
asset
(
'assets/discuss_loe_price_like.png'
,
'assets/discuss_loe_price_like.png'
,
fit:
BoxFit
.
cover
,
)),
)),
Container
(
Container
(
margin:
EdgeInsets
.
only
(
left:
4
),
margin:
EdgeInsets
.
only
(
left:
4
),
...
@@ -126,8 +125,6 @@ class _PopView implements ICenterPicker {
...
@@ -126,8 +125,6 @@ class _PopView implements ICenterPicker {
]),
]),
),
),
Container
(
Container
(
alignment:
AlignmentDirectional
.
center
,
width:
contentWidth
-
70
,
margin:
EdgeInsets
.
only
(
bottom:
25
),
margin:
EdgeInsets
.
only
(
bottom:
25
),
child:
baseText
(
child:
baseText
(
_model
.
popViewLive
.
data
.
second
.
title
,
18
,
Color
(
0xff464646
),
_model
.
popViewLive
.
data
.
second
.
title
,
18
,
Color
(
0xff464646
),
...
@@ -141,32 +138,30 @@ class _PopView implements ICenterPicker {
...
@@ -141,32 +138,30 @@ class _PopView implements ICenterPicker {
margin:
EdgeInsets
.
only
(
bottom:
12
),
margin:
EdgeInsets
.
only
(
bottom:
12
),
width:
contentWidth
-
70
,
width:
contentWidth
-
70
,
height:
37
,
height:
37
,
child:
baseText
(
_model
.
popViewLive
.
data
.
second
.
authorizePhone
,
child:
baseText
(
_model
.
popViewLive
.
data
.
second
.
authorizePhone
,
16
,
16
,
Color
(
0xff484848
))),
Color
(
0xff484848
))),
Container
(
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
7
),
),
child:
GestureDetector
(
onTap:
()
{
// 一键授权
_model
.
givePhoneAuth
(
111
);
dismissCallback
();
},
child:
Container
(
margin:
EdgeInsets
.
only
(
bottom:
14
),
margin:
EdgeInsets
.
only
(
bottom:
14
),
width:
contentWidth
-
70
,
width:
contentWidth
-
70
,
height:
37
,
height:
37
,
child:
Image
.
asset
(
'assets/discuss_loe_price_auth.png'
,
// decoration: BoxDecoration(
fit:
BoxFit
.
cover
)))),
// borderRadius: BorderRadius.circular(7),
// color: Color.fromARGB(alp, 58, 195, 189)
// ),
child:
Image
.
asset
(
"assets/discuss_loe_price_auth.png"
,
),
).
gestureDetector
(()
{
// 一键授权
_model
.
givePhoneAuth
(
111
,
()
{
dismissCallback
();
});
}),
Container
(
Container
(
width:
contentWidth
-
70
,
width:
contentWidth
-
70
,
margin:
EdgeInsets
.
only
(
bottom:
25
),
margin:
EdgeInsets
.
only
(
bottom:
23.5
),
alignment:
AlignmentDirectional
.
center
,
child:
baseText
(
'授权后,您的手机将以“虚拟号”方式提供给机构'
,
11
,
Color
(
0xff999999
))),
child:
]);
baseText
(
'授权后,您的手机将以“虚拟号”方式提供给机构'
,
11
,
Color
(
0xff999999
))),
]),
);
}
}
@override
@override
...
...
lib/ClueModel/page/levelOne/LevelOnePage.dart
View file @
54917347
...
@@ -41,10 +41,10 @@ class LevelOneState extends BaseState<LevelOnePage>
...
@@ -41,10 +41,10 @@ class LevelOneState extends BaseState<LevelOnePage>
@override
@override
void
initState
()
{
void
initState
()
{
super
.
initState
();
super
.
initState
();
//
Future.delayed(Duration(seconds: 3), () {
Future
.
delayed
(
Duration
(
seconds:
3
),
()
{
//
_model.loadingLive.notifyView(false);
_model
.
loadingLive
.
notifyView
(
false
);
//
_model.refreshView(true);
_model
.
refreshView
(
true
);
//
});
});
pageController
.
addListener
(()
{
pageController
.
addListener
(()
{
if
(
screenWidth
!=
null
)
{
if
(
screenWidth
!=
null
)
{
_model
.
topScrollLive
.
notifyView
(
_model
.
topScrollLive
.
notifyView
(
...
@@ -501,8 +501,8 @@ class LevelOneState extends BaseState<LevelOnePage>
...
@@ -501,8 +501,8 @@ class LevelOneState extends BaseState<LevelOnePage>
controller:
pageController
,
controller:
pageController
,
itemCount:
4
,
itemCount:
4
,
onPageChanged:
(
index
)
{
onPageChanged:
(
index
)
{
setState
(()
{
_refreshController
.
resetNoData
();
_refreshController
.
resetNoData
();
setState
(()
{
});
});
_model
.
topIndexLive
.
notifyView
(
index
);
_model
.
topIndexLive
.
notifyView
(
index
);
_model
.
selectPage
(
index
);
_model
.
selectPage
(
index
);
...
...
lib/ClueModel/page/top/TopModel.dart
View file @
54917347
...
@@ -18,6 +18,7 @@ class TopModel extends BaseModel {
...
@@ -18,6 +18,7 @@ class TopModel extends BaseModel {
LiveData
<
String
>
titleLive
=
new
LiveData
();
LiveData
<
String
>
titleLive
=
new
LiveData
();
LiveData
<
String
>
imageLive
=
LiveData
();
LiveData
<
String
>
imageLive
=
LiveData
();
LiveData
<
double
>
textLive
=
LiveData
();
LiveData
<
int
>
stateLive
=
LiveData
();
LiveData
<
int
>
stateLive
=
LiveData
();
RxDispose
rxDispose
=
RxDispose
();
RxDispose
rxDispose
=
RxDispose
();
String
rank_type
;
String
rank_type
;
...
@@ -29,6 +30,7 @@ class TopModel extends BaseModel {
...
@@ -29,6 +30,7 @@ class TopModel extends BaseModel {
titleLive
.
dispost
();
titleLive
.
dispost
();
imageLive
.
dispost
();
imageLive
.
dispost
();
stateLive
.
dispost
();
stateLive
.
dispost
();
textLive
.
dispost
();
}
}
void
selectTab
(
int
index
)
{
void
selectTab
(
int
index
)
{
...
@@ -44,7 +46,7 @@ class TopModel extends BaseModel {
...
@@ -44,7 +46,7 @@ class TopModel extends BaseModel {
.
listen
((
event
)
{
.
listen
((
event
)
{
if
(
event
.
error
==
0
)
{
if
(
event
.
error
==
0
)
{
stateLive
.
notifyView
(
ENDLOADING
);
stateLive
.
notifyView
(
ENDLOADING
);
imageUrl
=
event
.
data
.
bannerImage
;
imageUrl
=
event
.
data
.
bannerImage
;
tabs
=
event
.
data
.
tabs
;
tabs
=
event
.
data
.
tabs
;
back
(
tabs
.
length
);
back
(
tabs
.
length
);
}
else
{
}
else
{
...
...
lib/ClueModel/page/top/TopPage.dart
View file @
54917347
...
@@ -9,6 +9,7 @@ import 'package:flutter/cupertino.dart';
...
@@ -9,6 +9,7 @@ import 'package:flutter/cupertino.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:gm_flutter/ClueModel/page/levelTwo/LevelTwoPage.dart'
;
import
'package:gm_flutter/ClueModel/page/levelTwo/LevelTwoPage.dart'
;
import
'package:gm_flutter/ClueModel/page/top/TopModel.dart'
;
import
'package:gm_flutter/ClueModel/page/top/TopModel.dart'
;
import
'package:gm_flutter/ClueModel/util/PosUtil.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gm_flutter/commonModel/base/BaseState.dart'
;
import
'package:gm_flutter/commonModel/base/BaseState.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
...
@@ -23,8 +24,8 @@ class TopPage extends StatefulWidget {
...
@@ -23,8 +24,8 @@ class TopPage extends StatefulWidget {
class
TopPageState
extends
BaseState
<
TopPage
>
with
TickerProviderStateMixin
{
class
TopPageState
extends
BaseState
<
TopPage
>
with
TickerProviderStateMixin
{
RefreshController
refreshController
=
RefreshController
();
RefreshController
refreshController
=
RefreshController
();
TabController
tabController
;
TopModel
_model
=
TopModel
();
TopModel
_model
=
TopModel
();
GlobalKey
globalKey
=
GlobalKey
();
@override
@override
void
initState
()
{
void
initState
()
{
...
@@ -34,7 +35,6 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
...
@@ -34,7 +35,6 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
void
init
()
{
void
init
()
{
_model
.
init
((
i
)
{
_model
.
init
((
i
)
{
tabController
=
TabController
(
length:
i
,
vsync:
this
);
setState
(()
{});
setState
(()
{});
});
});
}
}
...
@@ -60,9 +60,29 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
...
@@ -60,9 +60,29 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
height:
MediaQuery
.
of
(
context
).
size
.
height
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
child:
NotificationListener
(
child:
NotificationListener
(
onNotification:
(
scrollNotification
)
{
onNotification:
(
scrollNotification
)
{
if
(
scrollNotification
is
KeepAliveNotification
||
scrollNotification
is
OverscrollIndicatorNotification
)
{
return
false
;
}
if
(
scrollNotification
is
ScrollUpdateNotification
&&
if
(
scrollNotification
is
ScrollUpdateNotification
&&
scrollNotification
.
metrics
.
axisDirection
.
index
==
2
)
{
scrollNotification
.
metrics
.
axisDirection
.
index
==
2
)
{}
print
(
"
${scrollNotification}
"
);
print
(
"NOT
${scrollNotification}
${scrollNotification is KeepAliveNotification}
"
);
if
(
scrollNotification
.
depth
==
0
)
{
if
(
scrollNotification
.
metrics
.
pixels
>
80
)
{
_model
.
textLive
.
notifyView
(
(
scrollNotification
.
metrics
.
pixels
-
80
)
/
40
>
1.0
?
1.0
:
(
scrollNotification
.
metrics
.
pixels
-
80
)
/
40
);
}
else
{
_model
.
textLive
.
notifyView
(
0.0
);
}
}
else
if
(
scrollNotification
.
depth
==
2
)
{
if
(
scrollNotification
.
metrics
.
pixels
<
50
&&
scrollNotification
.
metrics
.
pixels
>
0
)
{
_model
.
textLive
.
notifyView
(
1.0
);
}
}
}
return
false
;
return
false
;
},
},
...
@@ -72,7 +92,8 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
...
@@ -72,7 +92,8 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
baseSliverBack
(()
{
baseSliverBack
(()
{
Navigator
.
of
(
context
).
pop
();
Navigator
.
of
(
context
).
pop
();
}),
}),
baseSliverTitle
(
"title"
,
MediaQuery
.
of
(
context
).
size
.
width
),
baseSliverTitle
(
"title"
,
MediaQuery
.
of
(
context
).
size
.
width
,
_model
.
textLive
)
],
],
),
()
{
),
()
{
init
();
init
();
...
@@ -84,7 +105,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
...
@@ -84,7 +105,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
List
<
Widget
>
list
=
[];
List
<
Widget
>
list
=
[];
var
d
=
MediaQueryData
.
fromWindow
(
window
).
padding
.
top
;
var
d
=
MediaQueryData
.
fromWindow
(
window
).
padding
.
top
;
for
(
int
i
=
0
;
i
<
_model
.
tabs
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
_model
.
tabs
.
length
;
i
++)
{
list
.
add
(
TopList
(
_model
.
tabs
[
i
].
id
,
48
+
d
).
toActive
());
list
.
add
(
TopList
(
_model
.
tabs
[
i
].
id
,
48
+
d
).
toActive
());
}
}
return
DefaultTabController
(
return
DefaultTabController
(
length:
_model
.
tabs
.
length
,
length:
_model
.
tabs
.
length
,
...
...
lib/ClueModel/server/api/ClueApi.dart
View file @
54917347
...
@@ -8,6 +8,7 @@ import 'package:flutter_common/Annotations/anno/ServiceCenter.dart';
...
@@ -8,6 +8,7 @@ import 'package:flutter_common/Annotations/anno/ServiceCenter.dart';
import
'package:gm_flutter/ClueModel/server/entity/LevelOneFeedList.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/LevelOneFeedList.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanBarBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanBarBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanCompareDetail.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanCompareDetail.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanOverViewBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlansCompareFeed.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlansCompareFeed.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/ProjectDetailsItem.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/ProjectDetailsItem.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanBean.dart'
;
...
@@ -58,4 +59,7 @@ abstract class ClueApi {
...
@@ -58,4 +59,7 @@ abstract class ClueApi {
@Get
(
"api/janus/plans/agree_phone_authorize"
)
@Get
(
"api/janus/plans/agree_phone_authorize"
)
DiscussLowPriceAuthBean
givePhoneAuth
(
DiscussLowPriceAuthBean
givePhoneAuth
(
@Query
(
"lead_phone_request_id"
)
int
leadPhoneRequestId
);
@Query
(
"lead_phone_request_id"
)
int
leadPhoneRequestId
);
@Get
(
"api/janus/plans/plan_overview"
)
PlanOverViewBean
getPlanOverView
(
@Query
(
"plan_id"
)
int
plan_id
);
}
}
lib/ClueModel/server/api/ClueApi.serv.dart
View file @
54917347
...
@@ -23,6 +23,7 @@ import 'package:gm_flutter/ClueModel/server/entity/PlanFeedBean.dart';
...
@@ -23,6 +23,7 @@ import 'package:gm_flutter/ClueModel/server/entity/PlanFeedBean.dart';
import
'package:gm_flutter/ClueModel/server/entity/PlanBarBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanBarBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceModelBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceModelBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceAuthBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceAuthBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanOverViewBean.dart'
;
const
bool
inProduction
=
const
bool
.
fromEnvironment
(
"dart.vm.product"
);
const
bool
inProduction
=
const
bool
.
fromEnvironment
(
"dart.vm.product"
);
...
@@ -189,6 +190,20 @@ class ClueApiImpl {
...
@@ -189,6 +190,20 @@ class ClueApiImpl {
});
});
}
}
Stream
<
PlanOverViewBean
>
getPlanOverView
(
Dio
_dio
,
int
plan_id
)
{
return
Stream
.
fromFuture
(
get
(
_dio
,
'api/janus/plans/plan_overview'
,
data:
{
'plan_id'
:
plan_id
,
})).
flatMap
((
value
)
{
if
(
value
!=
null
&&
(
value
.
statusCode
>=
200
&&
value
.
statusCode
<
300
))
{
return
Stream
.
fromFuture
(
compute
(
parsePlanOverViewBean
,
value
.
toString
()));
}
else
{
throw
Exception
(
"--未知网络错误--"
);
}
});
}
///==================base method==================
///==================base method==================
Future
<
Response
>
get
(
Dio
_dio
,
url
,
{
data
,
options
,
cancelToken
})
async
{
Future
<
Response
>
get
(
Dio
_dio
,
url
,
{
data
,
options
,
cancelToken
})
async
{
...
@@ -361,3 +376,7 @@ DiscussLowPriceModelBean parseDiscussLowPriceModelBean(String value) {
...
@@ -361,3 +376,7 @@ DiscussLowPriceModelBean parseDiscussLowPriceModelBean(String value) {
DiscussLowPriceAuthBean
parseDiscussLowPriceAuthBean
(
String
value
)
{
DiscussLowPriceAuthBean
parseDiscussLowPriceAuthBean
(
String
value
)
{
return
DiscussLowPriceAuthBean
.
fromJson
(
json
.
decode
(
value
));
return
DiscussLowPriceAuthBean
.
fromJson
(
json
.
decode
(
value
));
}
}
PlanOverViewBean
parsePlanOverViewBean
(
String
value
)
{
return
PlanOverViewBean
.
fromJson
(
json
.
decode
(
value
));
}
lib/ClueModel/server/entity/PlanOverViewBean.dart
0 → 100644
View file @
54917347
/*
* @author lsy
* @date 2020/7/3
**/
class
PlanOverViewBean
{
int
error
;
String
message
;
Null
extra
;
Null
errorExtra
;
UserType
userType
;
Data
data
;
PlanOverViewBean
(
{
this
.
error
,
this
.
message
,
this
.
extra
,
this
.
errorExtra
,
this
.
userType
,
this
.
data
});
PlanOverViewBean
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
error
=
json
[
'error'
];
message
=
json
[
'message'
];
extra
=
json
[
'extra'
];
errorExtra
=
json
[
'error_extra'
];
userType
=
json
[
'user_type'
]
!=
null
?
new
UserType
.
fromJson
(
json
[
'user_type'
])
:
null
;
data
=
json
[
'data'
]
!=
null
?
new
Data
.
fromJson
(
json
[
'data'
])
:
null
;
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'error'
]
=
this
.
error
;
data
[
'message'
]
=
this
.
message
;
data
[
'extra'
]
=
this
.
extra
;
data
[
'error_extra'
]
=
this
.
errorExtra
;
if
(
this
.
userType
!=
null
)
{
data
[
'user_type'
]
=
this
.
userType
.
toJson
();
}
if
(
this
.
data
!=
null
)
{
data
[
'data'
]
=
this
.
data
.
toJson
();
}
return
data
;
}
}
class
UserType
{
UserType
();
UserType
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
return
data
;
}
}
class
Data
{
Banner
banner
;
String
name
;
String
positiveRate
;
String
salesCount
;
String
planDescription
;
String
guidePrice
;
List
<
OverviewAttrs
>
overviewAttrs
;
List
<
ExplanationAttrs
>
explanationAttrs
;
List
<
Tabs
>
tabs
;
Data
(
{
this
.
banner
,
this
.
name
,
this
.
positiveRate
,
this
.
salesCount
,
this
.
planDescription
,
this
.
guidePrice
,
this
.
overviewAttrs
,
this
.
explanationAttrs
,
this
.
tabs
});
Data
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
banner
=
json
[
'banner'
]
!=
null
?
new
Banner
.
fromJson
(
json
[
'banner'
])
:
null
;
name
=
json
[
'name'
];
positiveRate
=
json
[
'positive_rate'
];
salesCount
=
json
[
'sales_count'
];
planDescription
=
json
[
'plan_description'
];
guidePrice
=
json
[
'guide_price'
];
if
(
json
[
'overview_attrs'
]
!=
null
)
{
overviewAttrs
=
new
List
<
OverviewAttrs
>();
json
[
'overview_attrs'
].
forEach
((
v
)
{
overviewAttrs
.
add
(
new
OverviewAttrs
.
fromJson
(
v
));
});
}
if
(
json
[
'explanation_attrs'
]
!=
null
)
{
explanationAttrs
=
new
List
<
ExplanationAttrs
>();
json
[
'explanation_attrs'
].
forEach
((
v
)
{
explanationAttrs
.
add
(
new
ExplanationAttrs
.
fromJson
(
v
));
});
}
if
(
json
[
'tabs'
]
!=
null
)
{
tabs
=
new
List
<
Tabs
>();
json
[
'tabs'
].
forEach
((
v
)
{
tabs
.
add
(
new
Tabs
.
fromJson
(
v
));
});
}
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
if
(
this
.
banner
!=
null
)
{
data
[
'banner'
]
=
this
.
banner
.
toJson
();
}
data
[
'name'
]
=
this
.
name
;
data
[
'positive_rate'
]
=
this
.
positiveRate
;
data
[
'sales_count'
]
=
this
.
salesCount
;
data
[
'plan_description'
]
=
this
.
planDescription
;
data
[
'guide_price'
]
=
this
.
guidePrice
;
if
(
this
.
overviewAttrs
!=
null
)
{
data
[
'overview_attrs'
]
=
this
.
overviewAttrs
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
if
(
this
.
explanationAttrs
!=
null
)
{
data
[
'explanation_attrs'
]
=
this
.
explanationAttrs
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
if
(
this
.
tabs
!=
null
)
{
data
[
'tabs'
]
=
this
.
tabs
.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
return
data
;
}
}
class
Banner
{
String
type
;
String
imageUrl
;
String
videoUrl
;
Banner
({
this
.
type
,
this
.
imageUrl
,
this
.
videoUrl
});
Banner
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
type
=
json
[
'type'
];
imageUrl
=
json
[
'image_url'
];
videoUrl
=
json
[
'video_url'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'type'
]
=
this
.
type
;
data
[
'image_url'
]
=
this
.
imageUrl
;
data
[
'video_url'
]
=
this
.
videoUrl
;
return
data
;
}
}
class
OverviewAttrs
{
int
attrId
;
String
attrName
;
String
attrValue
;
OverviewAttrs
({
this
.
attrId
,
this
.
attrName
,
this
.
attrValue
});
OverviewAttrs
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
attrId
=
json
[
'attr_id'
];
attrName
=
json
[
'attr_name'
];
attrValue
=
json
[
'attr_value'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'attr_id'
]
=
this
.
attrId
;
data
[
'attr_name'
]
=
this
.
attrName
;
data
[
'attr_value'
]
=
this
.
attrValue
;
return
data
;
}
}
class
Tabs
{
String
tabType
;
String
name
;
Tabs
({
this
.
tabType
,
this
.
name
});
Tabs
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
tabType
=
json
[
'tab_type'
];
name
=
json
[
'name'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'tab_type'
]
=
this
.
tabType
;
data
[
'name'
]
=
this
.
name
;
return
data
;
}
}
class
ExplanationAttrs
{
int
attrId
;
String
attrName
;
String
attrValue
;
ExplanationAttrs
({
this
.
attrId
,
this
.
attrName
,
this
.
attrValue
});
ExplanationAttrs
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
attrId
=
json
[
'attr_id'
];
attrName
=
json
[
'attr_name'
];
attrValue
=
json
[
'attr_value'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'attr_id'
]
=
this
.
attrId
;
data
[
'attr_name'
]
=
this
.
attrName
;
data
[
'attr_value'
]
=
this
.
attrValue
;
return
data
;
}
}
lib/commonModel/base/BaseComponent.dart
View file @
54917347
...
@@ -470,15 +470,24 @@ Widget baseSliverBack(VoidCallback tap) {
...
@@ -470,15 +470,24 @@ Widget baseSliverBack(VoidCallback tap) {
);
);
}
}
Widget
baseSliverTitle
(
String
text
,
double
width
)
{
Widget
baseSliverTitle
(
String
text
,
double
width
,
LiveData
liveData
)
{
return
Positioned
(
return
Positioned
(
top:
57
,
top:
57
,
child:
StreamBuilder
(
stream:
liveData
.
stream
,
initialData:
liveData
.
data
??
0.0
,
builder:
(
c
,
data
)
{
return
Opacity
(
opacity:
data
.
data
,
child:
Container
(
child:
Container
(
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
width:
width
,
width:
width
,
child:
baseText
(
text
,
18
,
Color
(
0xff333333
)),
child:
baseText
(
text
,
18
,
Color
(
0xff333333
)),
),
),
);
);
},
),
);
}
}
Widget
baseStateView
(
double
width
,
double
height
,
LiveData
<
int
>
stateLive
,
Widget
baseStateView
(
double
width
,
double
height
,
LiveData
<
int
>
stateLive
,
...
...
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