|
|
|
@ -21,6 +21,7 @@ import 'package:huixiang/view_widget/request_permission.dart';
|
|
|
|
|
import 'package:huixiang/view_widget/round_button.dart'; |
|
|
|
|
import 'package:permission_handler/permission_handler.dart'; |
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
|
import 'package:webview_flutter/webview_flutter.dart'; |
|
|
|
|
// import 'package:qrscan/qrscan.dart' as scanner; |
|
|
|
|
|
|
|
|
|
class MineView extends StatefulWidget { |
|
|
|
@ -29,9 +30,10 @@ class MineView extends StatefulWidget {
|
|
|
|
|
final GestureTapCallback toIntegralPage; |
|
|
|
|
final Function messageZero; |
|
|
|
|
final int totalMsg; |
|
|
|
|
final SocialInfo infoNumber; |
|
|
|
|
final SocialInfo infoNumber; |
|
|
|
|
|
|
|
|
|
MineView(this.userInfo, this.toUserInfo, this.toIntegralPage,this.messageZero,this.totalMsg,this.infoNumber); |
|
|
|
|
MineView(this.userInfo, this.toUserInfo, this.toIntegralPage, |
|
|
|
|
this.messageZero, this.totalMsg, this.infoNumber); |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
State<StatefulWidget> createState() { |
|
|
|
@ -60,8 +62,6 @@ class _MineView extends State<MineView> {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
return Column( |
|
|
|
@ -77,28 +77,30 @@ class _MineView extends State<MineView> {
|
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context).pushNamed('/router/system_msg_page').then((value) { |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/system_msg_page') |
|
|
|
|
.then((value) { |
|
|
|
|
widget.messageZero(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
height: 24.h, |
|
|
|
|
alignment:Alignment.center, |
|
|
|
|
child:Stack( |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: Stack( |
|
|
|
|
children: [ |
|
|
|
|
Image.asset( |
|
|
|
|
"assets/image/icon_notices.webp", |
|
|
|
|
width:32, |
|
|
|
|
width: 32, |
|
|
|
|
height: 32, |
|
|
|
|
color: Colors.white, |
|
|
|
|
), |
|
|
|
|
if(widget.totalMsg != 0) |
|
|
|
|
if (widget.totalMsg != 0) |
|
|
|
|
Container( |
|
|
|
|
width:36.w, |
|
|
|
|
width: 36.w, |
|
|
|
|
alignment: Alignment.topRight, |
|
|
|
|
child:Container( |
|
|
|
|
width:22.w, |
|
|
|
|
height:14.h, |
|
|
|
|
child: Container( |
|
|
|
|
width: 22.w, |
|
|
|
|
height: 14.h, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
borderRadius: BorderRadius.circular(100), |
|
|
|
|
border: Border.all( |
|
|
|
@ -106,23 +108,20 @@ class _MineView extends State<MineView> {
|
|
|
|
|
color: Colors.white, |
|
|
|
|
style: BorderStyle.solid, |
|
|
|
|
), |
|
|
|
|
color:Color(0xFFFF441A), |
|
|
|
|
color: Color(0xFFFF441A), |
|
|
|
|
), |
|
|
|
|
child:RoundButton( |
|
|
|
|
text:widget.totalMsg.toString(), |
|
|
|
|
child: RoundButton( |
|
|
|
|
text: widget.totalMsg.toString(), |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
backgroup: Color(0xFFFF441A), |
|
|
|
|
fontSize:8.sp, |
|
|
|
|
fontSize: 8.sp, |
|
|
|
|
radius: 100, |
|
|
|
|
) |
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
), |
|
|
|
|
))), |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
toScan(); |
|
|
|
@ -131,7 +130,7 @@ class _MineView extends State<MineView> {
|
|
|
|
|
padding: EdgeInsets.all(8.h), |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/icon_scan_qr_code.webp", |
|
|
|
|
width:32, |
|
|
|
|
width: 32, |
|
|
|
|
height: 32, |
|
|
|
|
color: Colors.white, |
|
|
|
|
), |
|
|
|
@ -184,11 +183,12 @@ class _MineView extends State<MineView> {
|
|
|
|
|
} else if (await Permission.camera.isGranted) { |
|
|
|
|
// http://pos.app.gznl.top/placeorder/?tableId=1315903669597634560&tenantCode=1166&shopId=1300372027722432512 |
|
|
|
|
var result = await Navigator.of(context).pushNamed('/router/qr_scan'); |
|
|
|
|
if(result.toString().contains("type\":\"coupon")){ |
|
|
|
|
if (result.toString().contains("type\":\"coupon")) { |
|
|
|
|
///活动优惠券赠送弹窗 |
|
|
|
|
activityShowAlertDialog(result.toString()); |
|
|
|
|
return; |
|
|
|
|
}if(result.toString().contains("type\":\"wiped")){ |
|
|
|
|
} |
|
|
|
|
if (result.toString().contains("type\":\"wiped")) { |
|
|
|
|
///核销券 |
|
|
|
|
queryWiped(jsonDecode(result.toString())["memberCouponId"]); |
|
|
|
|
return; |
|
|
|
@ -213,6 +213,17 @@ class _MineView extends State<MineView> {
|
|
|
|
|
"tableId": int.tryParse(tableId), |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (result.toString().contains("http:") || |
|
|
|
|
result.toString().contains("https:")) { |
|
|
|
|
///扫码跳转任意网页 |
|
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
|
'/router/scan_web', |
|
|
|
|
arguments: { |
|
|
|
|
"result": result, |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
await Permission.camera.request(); |
|
|
|
@ -300,7 +311,7 @@ class _MineView extends State<MineView> {
|
|
|
|
|
child: Text( |
|
|
|
|
widget.userInfo == null |
|
|
|
|
? S.of(context).denglu |
|
|
|
|
: "${widget.userInfo.nickname==""?"回乡":widget.userInfo.nickname}", |
|
|
|
|
: "${widget.userInfo.nickname == "" ? "回乡" : widget.userInfo.nickname}", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
@ -308,12 +319,12 @@ class _MineView extends State<MineView> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
if(widget.userInfo.level != 1) |
|
|
|
|
Image.asset( |
|
|
|
|
"assets/image/icon_user.webp", |
|
|
|
|
width: 18.w, |
|
|
|
|
height: 18.h, |
|
|
|
|
), |
|
|
|
|
if (widget.userInfo.level != 1) |
|
|
|
|
Image.asset( |
|
|
|
|
"assets/image/icon_user.webp", |
|
|
|
|
width: 18.w, |
|
|
|
|
height: 18.h, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
widget.userInfo == null |
|
|
|
@ -326,33 +337,33 @@ class _MineView extends State<MineView> {
|
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
: Row( |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
"${S.of(context).guanzhu} ${widget?.infoNumber?.follow ?? "0"}", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
fontFamily: 'JDZhengHT', |
|
|
|
|
color: Color(0xFFFFFFFF), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
width: 1.w, |
|
|
|
|
height: 12.h, |
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 3.w), |
|
|
|
|
color: Color(0xFFFFFFFF), |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
"${S.of(context).fensi} ${widget?.infoNumber?.fans ?? "0"}", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontFamily: 'JDZhengHT', |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
color: Color(0xFFFFFFFF), |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
"${S.of(context).guanzhu} ${widget?.infoNumber?.follow ?? "0"}", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
fontFamily: 'JDZhengHT', |
|
|
|
|
color: Color(0xFFFFFFFF), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
width: 1.w, |
|
|
|
|
height: 12.h, |
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 3.w), |
|
|
|
|
color: Color(0xFFFFFFFF), |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
"${S.of(context).fensi} ${widget?.infoNumber?.fans ?? "0"}", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontFamily: 'JDZhengHT', |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
color: Color(0xFFFFFFFF), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
@ -375,12 +386,12 @@ class _MineView extends State<MineView> {
|
|
|
|
|
widget.toIntegralPage(); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
padding: EdgeInsets.only(top: 4.h, bottom: 4.h, right: 16.w,left: 7.w), |
|
|
|
|
padding: EdgeInsets.only( |
|
|
|
|
top: 4.h, bottom: 4.h, right: 16.w, left: 7.w), |
|
|
|
|
margin: EdgeInsets.only(right: 14.w), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
borderRadius: BorderRadius.circular(12), |
|
|
|
|
color: Colors.white |
|
|
|
|
), |
|
|
|
|
borderRadius: BorderRadius.circular(12), |
|
|
|
|
color: Colors.white), |
|
|
|
|
child: Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end, |
|
|
|
|
children: [ |
|
|
|
|