|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|
|
|
import 'package:huixiang/generated/l10n.dart';
|
|
|
|
import 'package:huixiang/utils/font_weight.dart';
|
|
|
|
import 'package:huixiang/view_widget/login_tips_dialog.dart';
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
class MineItem extends StatefulWidget {
|
|
|
|
@override
|
|
|
|
State<StatefulWidget> createState() {
|
|
|
|
return _MineItem();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class _MineItem extends State<MineItem> {
|
|
|
|
var isShowMore = false;
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Container(
|
|
|
|
margin: EdgeInsets.fromLTRB(16.w,0.h, 16.w,30.h),
|
|
|
|
// padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: Colors.white,
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
color: Color(0x08213303).withAlpha(12),
|
|
|
|
offset: Offset(0, 2),
|
|
|
|
blurRadius: 4,
|
|
|
|
spreadRadius: 0,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.only(left: 16,top:16,bottom:13,right: 16),
|
|
|
|
child:Text(
|
|
|
|
S.of(context).qita,
|
|
|
|
style: TextStyle(
|
|
|
|
color: Color(0xFF353535),
|
|
|
|
fontWeight: MyFontWeight.semi_bold,
|
|
|
|
fontSize: 15.sp,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
// ///我的动态
|
|
|
|
// Expanded(child:
|
|
|
|
// InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// SharedPreferences.getInstance().then((value) {
|
|
|
|
// if (value.getString("token") == null ||
|
|
|
|
// value.getString("token") == "") {
|
|
|
|
// LoginTipsDialog().show(context);
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// Navigator.of(context)
|
|
|
|
// .pushNamed('/router/releasePage',
|
|
|
|
// arguments: {});
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: mineItem(
|
|
|
|
// S.of(context).wodedongtai,
|
|
|
|
// "assets/image/dynamic.webp",
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ///兑换历史
|
|
|
|
// Expanded(child: InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// SharedPreferences.getInstance().then((value) {
|
|
|
|
// if (value.getString("token") == null ||
|
|
|
|
// value.getString("token") == "") {
|
|
|
|
// LoginTipsDialog().show(context);
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// Navigator.of(context)
|
|
|
|
// .pushNamed('/router/exchange_history_page');
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: mineItem(
|
|
|
|
// S.of(context).duihuanlishi,
|
|
|
|
// "assets/image/icon_mine_records_of_consumption.webp",
|
|
|
|
// ),
|
|
|
|
// ),),
|
|
|
|
// ///我的卡券
|
|
|
|
// Expanded(child: InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// SharedPreferences.getInstance().then((value) {
|
|
|
|
// if (value.getString("token") == null ||
|
|
|
|
// value.getString("token") == "") {
|
|
|
|
// LoginTipsDialog().show(context);
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// Navigator.of(context).pushNamed('/router/mine_card');
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: mineItem(
|
|
|
|
// S.of(context).wodekaquan,
|
|
|
|
// "assets/image/icon_mine_card.webp",
|
|
|
|
// ),
|
|
|
|
// ),),
|
|
|
|
// ///管理地址
|
|
|
|
// Expanded(child: InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// SharedPreferences.getInstance().then((value) {
|
|
|
|
// if (value.getString("token") == null ||
|
|
|
|
// value.getString("token") == "") {
|
|
|
|
// LoginTipsDialog().show(context);
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// Navigator.of(context).pushNamed('/router/manage_address_page');
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: mineItem(
|
|
|
|
// S.of(context).guanlidizhi,
|
|
|
|
// "assets/image/icon_location_address.webp",
|
|
|
|
// ),
|
|
|
|
// ),),
|
|
|
|
// ///
|
|
|
|
// Expanded(child: InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// showCallMobile();
|
|
|
|
// },
|
|
|
|
// child: mineItem(
|
|
|
|
// "联系客服",
|
|
|
|
// "assets/image/icon_mine_online_service.webp",
|
|
|
|
// ),
|
|
|
|
// ),),
|
|
|
|
///优惠券
|
|
|
|
Expanded(child:
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
SharedPreferences.getInstance().then((value) {
|
|
|
|
if (value.getString("token") == null ||
|
|
|
|
value.getString("token") == "") {
|
|
|
|
LoginTipsDialog().show(context);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Navigator.of(context).pushNamed('/router/coupon_page');
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: mineItem(
|
|
|
|
S.of(context).youhuiquan,
|
|
|
|
"assets/image/coupon.webp",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
///平台余额
|
|
|
|
Expanded(child: 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).huixiangqianbao,
|
|
|
|
"assets/image/platform_yue.webp",
|
|
|
|
),
|
|
|
|
),),
|
|
|
|
///店铺余额
|
|
|
|
Expanded(child: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
SharedPreferences.getInstance().then((value) {
|
|
|
|
if (value.getString("token") == null ||
|
|
|
|
value.getString("token") == "") {
|
|
|
|
LoginTipsDialog().show(context);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Navigator.of(context).pushNamed('/router/mine_shop_page');
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: mineItem(
|
|
|
|
"店铺充值",
|
|
|
|
"assets/image/shop_yue.webp",
|
|
|
|
),
|
|
|
|
),),
|
|
|
|
///兑换历史
|
|
|
|
Expanded(child: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
SharedPreferences.getInstance().then((value) {
|
|
|
|
if (value.getString("token") == null ||
|
|
|
|
value.getString("token") == "") {
|
|
|
|
LoginTipsDialog().show(context);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Navigator.of(context)
|
|
|
|
.pushNamed('/router/exchange_history_page');
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: mineItem(
|
|
|
|
S.of(context).duihuanlishi,
|
|
|
|
"assets/image/icon_mine_records_of_consumption.webp",
|
|
|
|
),
|
|
|
|
),),
|
|
|
|
////我的评价
|
|
|
|
// Expanded(child: InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// SharedPreferences.getInstance().then((value) {
|
|
|
|
// if (value.getString("token") == null ||
|
|
|
|
// value.getString("token") == "") {
|
|
|
|
// LoginTipsDialog().show(context);
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// Navigator.of(context).pushNamed('/router/mine_shop_page');
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: mineItem(
|
|
|
|
// "我的评价",
|
|
|
|
// "assets/image/mine_evaluation.webp",
|
|
|
|
// ),
|
|
|
|
// ),),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
SizedBox(height: 12.h,),
|
|
|
|
// if(isShowMore)
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
///我的砍价
|
|
|
|
// Expanded(child:
|
|
|
|
// InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// Navigator.of(context)
|
|
|
|
// .pushNamed('/router/bargain_group_order',
|
|
|
|
// arguments: {"type":3});
|
|
|
|
// },
|
|
|
|
// child: mineItem(
|
|
|
|
// S.of(context).wodekanjia,
|
|
|
|
// "assets/image/bargain.webp",
|
|
|
|
// ),
|
|
|
|
// ),),
|
|
|
|
// ///我的拼团
|
|
|
|
// Expanded(child: InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// Navigator.of(context).pushNamed('/router/bargain_group_order',
|
|
|
|
// arguments: {"type":1});
|
|
|
|
// },
|
|
|
|
// child: mineItem(
|
|
|
|
// S.of(context).wodepintuan,
|
|
|
|
// "assets/image/collage.webp",
|
|
|
|
// ),
|
|
|
|
// ),),
|
|
|
|
///商户入驻
|
|
|
|
// Expanded(child: InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// SmartDialog.showToast("该功能暂未开放!",
|
|
|
|
// alignment: Alignment.center);
|
|
|
|
// },
|
|
|
|
// child: mineItem(
|
|
|
|
// S.of(context).shanghuruzhu,
|
|
|
|
// "assets/image/settled.webp",
|
|
|
|
// ),
|
|
|
|
// ),),
|
|
|
|
///帮助反馈
|
|
|
|
Expanded(child: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
Navigator.of(context).pushNamed('/router/help_feedback_page');
|
|
|
|
},
|
|
|
|
child: mineItem(
|
|
|
|
S.of(context).bangzhuyufankui,
|
|
|
|
"assets/image/fan_kui.webp",
|
|
|
|
),
|
|
|
|
),),
|
|
|
|
///联系客服
|
|
|
|
Expanded(child: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
showCallMobile();
|
|
|
|
},
|
|
|
|
child: mineItem(
|
|
|
|
S.of(context).lianxikefu,
|
|
|
|
"assets/image/icon_mine_online_service.webp",
|
|
|
|
),
|
|
|
|
),),
|
|
|
|
Expanded(child:Container(),),
|
|
|
|
Expanded(child:Container(),),
|
|
|
|
// ///帮助反馈
|
|
|
|
// Expanded(child: InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// Navigator.of(context).pushNamed('/router/help_feedback_page');
|
|
|
|
// },
|
|
|
|
// child: mineItem(
|
|
|
|
// S.of(context).bangzhuyufankui,
|
|
|
|
// "assets/image/fan_kui.webp",
|
|
|
|
// ),
|
|
|
|
// ),),
|
|
|
|
// Expanded(child: InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// Navigator.of(context).pushNamed('/router/qr_share', arguments: {});
|
|
|
|
// },
|
|
|
|
// child: mineItem(
|
|
|
|
// S.of(context).tuiguangma,
|
|
|
|
// "assets/image/pin_tuan.webp",
|
|
|
|
// ),
|
|
|
|
// ),),
|
|
|
|
// Expanded(child:InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// Navigator.of(context).pushNamed('/router/invitation_record', arguments: {});
|
|
|
|
// },
|
|
|
|
// child: mineItem(
|
|
|
|
// "邀请记录",
|
|
|
|
// "assets/image/yao_q.webp",
|
|
|
|
// ),
|
|
|
|
// ),),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
// if(isShowMore)
|
|
|
|
SizedBox(height: 12.h,),
|
|
|
|
// if(isShowMore)
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
////发票管理
|
|
|
|
// Expanded(child: InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// Navigator.of(context).pushNamed('/router/bargain_group_order',
|
|
|
|
// arguments: {"type":1});
|
|
|
|
// },
|
|
|
|
// child: mineItem(
|
|
|
|
// "发票管理",
|
|
|
|
// "assets/image/bill_gl.webp",
|
|
|
|
// ),
|
|
|
|
// ),),
|
|
|
|
// ///联系客服
|
|
|
|
// Expanded(child: InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// showCallMobile();
|
|
|
|
// },
|
|
|
|
// child: mineItem(
|
|
|
|
// "联系客服",
|
|
|
|
// "assets/image/icon_mine_online_service.webp",
|
|
|
|
// ),
|
|
|
|
// ),),
|
|
|
|
Expanded(child:Container(),),
|
|
|
|
Expanded(child:Container(),),
|
|
|
|
Expanded(child:Container(),),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
///收起展开
|
|
|
|
// GestureDetector(
|
|
|
|
// behavior: HitTestBehavior.opaque,
|
|
|
|
// onTap: () {
|
|
|
|
// setState(() {
|
|
|
|
// isShowMore = !isShowMore;
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: Container(
|
|
|
|
// margin: EdgeInsets.symmetric(vertical: 10),
|
|
|
|
// child: Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
// mainAxisSize: MainAxisSize.max,
|
|
|
|
// children: [
|
|
|
|
// Text(
|
|
|
|
// (isShowMore != null && !isShowMore)?S.of(context).zhankai: S.of(context).shouqi,
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: 12.sp,
|
|
|
|
// fontWeight: MyFontWeight.regular,
|
|
|
|
// color: Color(0xFF32A060),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// Icon(
|
|
|
|
// (isShowMore != null && !isShowMore)
|
|
|
|
// ? Icons.keyboard_arrow_down
|
|
|
|
// : Icons.keyboard_arrow_up,
|
|
|
|
// color: Color(0xFF32A060),
|
|
|
|
// size: 18,
|
|
|
|
// ),
|
|
|
|
// ],
|
|
|
|
// ),),
|
|
|
|
// )
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///我的页面下面条目
|
|
|
|
Widget mineItem(text, icon) {
|
|
|
|
return Container(
|
|
|
|
color: Colors.white,
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 6.h),
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
icon,
|
|
|
|
width: 32.w,
|
|
|
|
height: 32.w,
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
height: 2.h,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
text,
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: MyFontWeight.medium,
|
|
|
|
fontSize: 12.sp,
|
|
|
|
color: Color(0xFF353535),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
showCallMobile() {
|
|
|
|
showCupertinoModalPopup(
|
|
|
|
context: context,
|
|
|
|
builder: (context) {
|
|
|
|
return CupertinoActionSheet(
|
|
|
|
title: Text(S.of(context).bodadianhua),
|
|
|
|
actions: [
|
|
|
|
CupertinoActionSheetAction(
|
|
|
|
child: Text("19947603193"),
|
|
|
|
onPressed: () {
|
|
|
|
callMobile("19947603193");
|
|
|
|
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';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|