|
|
@ -1,9 +1,11 @@ |
|
|
|
|
|
|
|
import 'package:flutter/cupertino.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:huixiang/generated/l10n.dart'; |
|
|
|
import 'package:huixiang/generated/l10n.dart'; |
|
|
|
import 'package:huixiang/utils/font_weight.dart'; |
|
|
|
import 'package:huixiang/utils/font_weight.dart'; |
|
|
|
import 'package:huixiang/view_widget/login_tips_dialog.dart'; |
|
|
|
import 'package:huixiang/view_widget/login_tips_dialog.dart'; |
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
|
|
|
|
import 'package:url_launcher/url_launcher.dart'; |
|
|
|
|
|
|
|
|
|
|
|
class MineItem extends StatefulWidget { |
|
|
|
class MineItem extends StatefulWidget { |
|
|
|
@override |
|
|
|
@override |
|
|
@ -33,22 +35,6 @@ class _MineItem extends State<MineItem> { |
|
|
|
child: Column( |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
// InkWell( |
|
|
|
|
|
|
|
// onTap: () { |
|
|
|
|
|
|
|
// SharedPreferences.getInstance().then((value) { |
|
|
|
|
|
|
|
// if (value.getString("token") == null || |
|
|
|
|
|
|
|
// value.getString("token") == "") { |
|
|
|
|
|
|
|
// LoginTipsDialog().show(context); |
|
|
|
|
|
|
|
// return; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// Navigator.of(context).pushNamed('/router/mine_wallet'); |
|
|
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
// child: mineItem( |
|
|
|
|
|
|
|
// S.of(context).wodeqianbao, |
|
|
|
|
|
|
|
// "assets/image/icon_mine_wallet.png", |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
Container( |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.only(left: 16,top:16,bottom:4), |
|
|
|
padding: EdgeInsets.only(left: 16,top:16,bottom:4), |
|
|
|
child: Text( |
|
|
|
child: Text( |
|
|
@ -83,6 +69,8 @@ class _MineItem extends State<MineItem> { |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///兑换历史 |
|
|
|
Expanded(child: InkWell( |
|
|
|
Expanded(child: InkWell( |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
@ -100,6 +88,7 @@ class _MineItem extends State<MineItem> { |
|
|
|
"assets/image/icon_mine_records_of_consumption.png", |
|
|
|
"assets/image/icon_mine_records_of_consumption.png", |
|
|
|
), |
|
|
|
), |
|
|
|
),), |
|
|
|
),), |
|
|
|
|
|
|
|
///我的卡券 |
|
|
|
Expanded(child: InkWell( |
|
|
|
Expanded(child: InkWell( |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
@ -116,6 +105,7 @@ class _MineItem extends State<MineItem> { |
|
|
|
"assets/image/icon_mine_card.png", |
|
|
|
"assets/image/icon_mine_card.png", |
|
|
|
), |
|
|
|
), |
|
|
|
),), |
|
|
|
),), |
|
|
|
|
|
|
|
///管理地址 |
|
|
|
Expanded(child: InkWell( |
|
|
|
Expanded(child: InkWell( |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
@ -132,6 +122,16 @@ class _MineItem extends State<MineItem> { |
|
|
|
"assets/image/icon_location_address.png", |
|
|
|
"assets/image/icon_location_address.png", |
|
|
|
), |
|
|
|
), |
|
|
|
),), |
|
|
|
),), |
|
|
|
|
|
|
|
///联系客服 |
|
|
|
|
|
|
|
Expanded(child: InkWell( |
|
|
|
|
|
|
|
onTap: () { |
|
|
|
|
|
|
|
showCallMobile(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
child: mineItem( |
|
|
|
|
|
|
|
"联系客服", |
|
|
|
|
|
|
|
"assets/image/icon_mine_online_service.png", |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
),), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(height: 10.h,), |
|
|
|
SizedBox(height: 10.h,), |
|
|
@ -168,20 +168,6 @@ class _MineItem extends State<MineItem> { |
|
|
|
"assets/image/pin_tuan.png", |
|
|
|
"assets/image/pin_tuan.png", |
|
|
|
), |
|
|
|
), |
|
|
|
),), |
|
|
|
),), |
|
|
|
Expanded(child: Text("")), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Expanded(child:InkWell( |
|
|
|
|
|
|
|
onTap: () { |
|
|
|
|
|
|
|
Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
child: mineItem( |
|
|
|
|
|
|
|
S.of(context).tuiguangma, |
|
|
|
|
|
|
|
"assets/image/icon_mine_promotion_code.png", |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
),), |
|
|
|
|
|
|
|
Row( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Expanded(child:InkWell( |
|
|
|
Expanded(child:InkWell( |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
Navigator.of(context).pushNamed('/router/invitation_record', arguments: {}); |
|
|
|
Navigator.of(context).pushNamed('/router/invitation_record', arguments: {}); |
|
|
@ -191,17 +177,11 @@ class _MineItem extends State<MineItem> { |
|
|
|
"assets/image/yao_q.png", |
|
|
|
"assets/image/yao_q.png", |
|
|
|
), |
|
|
|
), |
|
|
|
),), |
|
|
|
),), |
|
|
|
Expanded(child:Container()), |
|
|
|
|
|
|
|
Expanded(child:Container()), |
|
|
|
|
|
|
|
Expanded(child:Container()) |
|
|
|
|
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
SizedBox(height: 10.h,), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
// mineItem( |
|
|
|
|
|
|
|
// S.of(context).bangzhuyufankui, |
|
|
|
|
|
|
|
// "assets/image/icon_mine_feedback.png", |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -235,5 +215,41 @@ class _MineItem extends State<MineItem> { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showCallMobile() { |
|
|
|
|
|
|
|
showCupertinoModalPopup( |
|
|
|
|
|
|
|
context: context, |
|
|
|
|
|
|
|
builder: (context) { |
|
|
|
|
|
|
|
return CupertinoActionSheet( |
|
|
|
|
|
|
|
title: Text(S.of(context).bodadianhua), |
|
|
|
|
|
|
|
actions: [ |
|
|
|
|
|
|
|
CupertinoActionSheetAction( |
|
|
|
|
|
|
|
child: Text("15392949097"), |
|
|
|
|
|
|
|
onPressed: () { |
|
|
|
|
|
|
|
callMobile("15392949097"); |
|
|
|
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
isDefaultAction: true, |
|
|
|
|
|
|
|
isDestructiveAction: false, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
cancelButton: CupertinoActionSheetAction( |
|
|
|
|
|
|
|
onPressed: () { |
|
|
|
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
child: Text(S.of(context).quxiao), |
|
|
|
|
|
|
|
isDestructiveAction: true, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
callMobile(mobile) async { |
|
|
|
|
|
|
|
String url = "tel:$mobile"; |
|
|
|
|
|
|
|
if (await canLaunch(url)) { |
|
|
|
|
|
|
|
await launch(url); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
throw 'Could not launch $url'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|