|
@@ -26,12 +26,30 @@ class UserPage extends StatefulWidget {
|
|
|
|
|
|
|
|
class _UserPageState extends State<UserPage> with WidgetsBindingObserver {
|
|
class _UserPageState extends State<UserPage> with WidgetsBindingObserver {
|
|
|
CustomerService customerService;
|
|
CustomerService customerService;
|
|
|
|
|
+ bool isManage=false;
|
|
|
|
|
|
|
|
Future<void> getUserInfo() async {
|
|
Future<void> getUserInfo() async {
|
|
|
Result res = await HttpManager.get('userInfo/getUserInfo');
|
|
Result res = await HttpManager.get('userInfo/getUserInfo');
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
print(res.data);
|
|
print(res.data);
|
|
|
StoreProvider.of<AppState>(context).dispatch(UpdateUserAction(UserInfo.fromJson(res.data)));
|
|
StoreProvider.of<AppState>(context).dispatch(UpdateUserAction(UserInfo.fromJson(res.data)));
|
|
|
|
|
+
|
|
|
|
|
+ if (res.data['channel'] != null) {
|
|
|
|
|
+ Result res2 = await HttpManager.get('channelInfo/getChannelInfo', data: {"id": res.data['channel']});
|
|
|
|
|
+ print(res2.data);
|
|
|
|
|
+ if (res2.success) {
|
|
|
|
|
+ if (res2.data['channelManager'] != null && res2.data['channelManager'] == res.data['id']) {
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ isManage=true;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ isManage=false;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
} else {}
|
|
} else {}
|
|
|
|
|
|
|
|
Result res2 = await HttpManager.get('customerService/random');
|
|
Result res2 = await HttpManager.get('customerService/random');
|
|
@@ -84,7 +102,7 @@ class _UserPageState extends State<UserPage> with WidgetsBindingObserver {
|
|
|
height: 2,
|
|
height: 2,
|
|
|
),
|
|
),
|
|
|
Text(
|
|
Text(
|
|
|
- userInfo.nickname,
|
|
|
|
|
|
|
+ userInfo.nickname+(isManage?'(代理)':''),
|
|
|
style: TextStyle(fontSize: 20, color: Colors.white, fontWeight: FontWeight.w700),
|
|
style: TextStyle(fontSize: 20, color: Colors.white, fontWeight: FontWeight.w700),
|
|
|
),
|
|
),
|
|
|
Container(
|
|
Container(
|
|
@@ -108,10 +126,12 @@ class _UserPageState extends State<UserPage> with WidgetsBindingObserver {
|
|
|
Container(
|
|
Container(
|
|
|
width: 10,
|
|
width: 10,
|
|
|
),
|
|
),
|
|
|
- customerService!=null?Text(
|
|
|
|
|
- '客服QQ:${customerService.qq}',
|
|
|
|
|
- style: TextStyle(fontSize: 14, color: Colors.white, fontWeight: FontWeight.w600),
|
|
|
|
|
- ):Container(),
|
|
|
|
|
|
|
+ customerService != null
|
|
|
|
|
+ ? Text(
|
|
|
|
|
+ '客服QQ:${customerService.qq}',
|
|
|
|
|
+ style: TextStyle(fontSize: 14, color: Colors.white, fontWeight: FontWeight.w600),
|
|
|
|
|
+ )
|
|
|
|
|
+ : Container(),
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
Container(
|
|
Container(
|