# Conflicts: # lib/settlement/settlement_view/activity_coupon_remarks.dartnew_revision_app
After Width: | Height: | Size: 866 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 642 B |
After Width: | Height: | Size: 718 B |
After Width: | Height: | Size: 908 B |
After Width: | Height: | Size: 720 B |
After Width: | Height: | Size: 710 B |
After Width: | Height: | Size: 5.1 KiB |
@ -0,0 +1,301 @@
|
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.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 '../../retrofit/data/social_info.dart'; |
||||
import '../../retrofit/data/user_info.dart'; |
||||
|
||||
class MineNavbar extends StatefulWidget { |
||||
final String couponNum; |
||||
final UserInfo userInfo; |
||||
final SocialInfo infoNumber; |
||||
final GestureTapCallback toIntegralPage; |
||||
|
||||
MineNavbar(this.couponNum,this.userInfo,this.infoNumber,this.toIntegralPage); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _MineNavbar(); |
||||
} |
||||
} |
||||
|
||||
class _MineNavbar extends State<MineNavbar> { |
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Container( |
||||
margin: EdgeInsets.fromLTRB(13.5.w, 15.h, 13.5.w,30.h), |
||||
padding: EdgeInsets.only( |
||||
top: 26.h, |
||||
bottom: 24.h, |
||||
), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(6), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Color(0x08213303).withAlpha(12), |
||||
offset: Offset(0, 2), |
||||
blurRadius: 4, |
||||
spreadRadius: 0, |
||||
), |
||||
], |
||||
), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
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/order_history_page', |
||||
arguments: {"status": 0}); |
||||
}); |
||||
}, |
||||
child: mineTopItem( |
||||
S.of(context).dingdan, |
||||
"assets/image/mine_order.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: mineTopItem( |
||||
"钱包", |
||||
"assets/image/wallet.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/vip_pay_code'); |
||||
}); |
||||
}, |
||||
child: mineTopItem( |
||||
"会员码", |
||||
"assets/image/vip_code.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/setting_page'); |
||||
}); |
||||
}, |
||||
child: mineTopItem( |
||||
S.of(context).shezhi, |
||||
"assets/image/set.webp", |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
Container( |
||||
width: double.infinity, |
||||
margin: EdgeInsets.only(top:17.h,left: 16.w,right: 16.w,bottom: 27.h), |
||||
child: Flex( |
||||
children: List.generate(120, (_) { |
||||
return SizedBox( |
||||
width: 1, |
||||
height: 1, |
||||
child: DecoratedBox( |
||||
decoration: BoxDecoration(color: Color(0xFFEDEDED)), |
||||
), |
||||
); |
||||
}), |
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||
direction: Axis.horizontal, |
||||
), |
||||
), |
||||
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/coupon_page'); |
||||
}); |
||||
}, |
||||
child: mineBottomItem( |
||||
widget?.couponNum ?? "0", |
||||
S.of(context).youhuiquan, |
||||
), |
||||
), |
||||
), |
||||
///积分 |
||||
Expanded( |
||||
child: InkWell( |
||||
onTap: () { |
||||
SharedPreferences.getInstance().then((value) { |
||||
if (value.getString("token") == null || |
||||
value.getString("token") == "") { |
||||
LoginTipsDialog().show(context); |
||||
return; |
||||
} |
||||
widget.toIntegralPage(); |
||||
}); |
||||
}, |
||||
child: mineBottomItem( |
||||
widget?.userInfo?.points?? "0", |
||||
"积分", |
||||
), |
||||
), |
||||
), |
||||
///关注 |
||||
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/communityFollow',arguments: { |
||||
"status":0 |
||||
}); |
||||
});}, |
||||
child: mineBottomItem( |
||||
"${widget?.infoNumber?.follow ?? "0"}", |
||||
S.of(context).guanzhu, |
||||
), |
||||
), |
||||
), |
||||
///粉丝 |
||||
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/communityFollow',arguments: { |
||||
"status":1 |
||||
}); |
||||
}); |
||||
}, |
||||
child: mineBottomItem( |
||||
"${widget?.infoNumber?.fans ?? "0"}", |
||||
S.of(context).fensi, |
||||
), |
||||
), |
||||
), |
||||
], |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///导航栏条目 |
||||
Widget mineTopItem(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: 23, |
||||
height: 23, |
||||
), |
||||
SizedBox( |
||||
height: 5.h, |
||||
), |
||||
Text( |
||||
text, |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
fontSize: 12.sp, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///导航栏条目 |
||||
Widget mineBottomItem(textTop, text) { |
||||
return Container( |
||||
color: Colors.white, |
||||
margin: EdgeInsets.symmetric(vertical: 6.h), |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Text( |
||||
textTop, |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.medium, |
||||
fontSize: 18.sp, |
||||
color: Color(0xFF000000), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height:11.h, |
||||
), |
||||
Text( |
||||
text, |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.medium, |
||||
fontSize: 12.sp, |
||||
color: Color(0xFF4D4D4D), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,58 @@
|
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_easyloading/flutter_easyloading.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:webview_flutter/webview_flutter.dart'; |
||||
|
||||
class ScanWeb extends StatefulWidget { |
||||
final Map<String, dynamic> arguments; |
||||
|
||||
ScanWeb({this.arguments}); |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _ScanWeb(); |
||||
} |
||||
} |
||||
|
||||
class _ScanWeb extends State<ScanWeb> { |
||||
var controller = new ScrollController(); |
||||
WebViewController webViewController; |
||||
String result; |
||||
String title; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
result = widget.arguments["result"]; |
||||
title = widget.arguments["title"]; |
||||
EasyLoading.show(status: S.current.zhengzaijiazai); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
appBar: MyAppBar( |
||||
title:title ?? "", |
||||
titleColor: Colors.black, |
||||
background: Colors.transparent, |
||||
leadingColor: Colors.black, |
||||
), |
||||
body: |
||||
WebView( |
||||
initialUrl:result, |
||||
javascriptMode: JavascriptMode.unrestricted, |
||||
onWebViewCreated: (WebViewController controller){ |
||||
webViewController =controller; |
||||
}, |
||||
onProgress: (int progress) async { |
||||
if(widget.arguments["title"] != null) |
||||
return; |
||||
title = await webViewController?.getTitle(); |
||||
setState((){}); |
||||
EasyLoading.dismiss(); |
||||
}, |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,192 @@
|
||||
import 'dart:async'; |
||||
import 'dart:convert'; |
||||
|
||||
import 'package:barcode_widget/barcode_widget.dart'; |
||||
import 'package:dio/dio.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_bmflocation/flutter_bmflocation.dart'; |
||||
import 'package:flutter_easyloading/flutter_easyloading.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/retrofit/data/base_data.dart'; |
||||
import 'package:huixiang/retrofit/data/product.dart'; |
||||
import 'package:huixiang/retrofit/data/vip_card.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/store/scan.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/utils/location.dart'; |
||||
import 'package:huixiang/utils/painter_bg.dart'; |
||||
import 'package:huixiang/view_widget/custom_image.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:huixiang/view_widget/my_footer.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:qr_flutter/qr_flutter.dart'; |
||||
import 'package:shared_preferences/shared_preferences.dart'; |
||||
|
||||
import '../retrofit/data/user_info.dart'; |
||||
import '../view_widget/classic_header.dart'; |
||||
|
||||
class VipPayCode extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _VipPayCode(); |
||||
} |
||||
} |
||||
|
||||
class _VipPayCode extends State<VipPayCode> { |
||||
ApiService apiService; |
||||
|
||||
@override |
||||
void dispose() { |
||||
super.dispose(); |
||||
refreshController.dispose(); |
||||
} |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
queryUser(); |
||||
} |
||||
|
||||
UserInfo userInfo; |
||||
final RefreshController refreshController = RefreshController(); |
||||
bool vipCodeText = false; |
||||
Timer _timer; |
||||
bool isDispose = false; |
||||
|
||||
///查询用户信息 |
||||
queryUser() async { |
||||
try{ |
||||
SharedPreferences value = await SharedPreferences.getInstance(); |
||||
if (apiService == null) |
||||
apiService = ApiService( |
||||
Dio(), |
||||
context: context, |
||||
token: value.getString("token"), |
||||
); |
||||
BaseData<UserInfo> baseData = |
||||
await apiService.queryInfo().catchError((onError) { |
||||
refreshController.refreshFailed();}); |
||||
if (baseData != null && baseData.isSuccess) { |
||||
userInfo = baseData.data; |
||||
SharedPreferences.getInstance().then((value) => { |
||||
value.setString('user', jsonEncode(baseData.data)), |
||||
}); |
||||
setState(() {}); |
||||
refreshController.refreshCompleted(); |
||||
}else{ |
||||
refreshController.refreshFailed(); |
||||
} |
||||
}finally{ |
||||
refreshCode(); |
||||
} |
||||
} |
||||
|
||||
refreshCode(){ |
||||
if (_timer != null) return; |
||||
const oneSec = const Duration(minutes: 2); |
||||
var callback = ((timer) { |
||||
if (isDispose) return; |
||||
queryUser(); |
||||
}); |
||||
_timer = Timer.periodic(oneSec, callback); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
appBar: MyAppBar( |
||||
title: "会员码", |
||||
background: Color(0xFF32A060), |
||||
titleColor: Colors.white, |
||||
brightness: Brightness.dark, |
||||
leadingColor: Colors.white, |
||||
), |
||||
body: Container( |
||||
color: Color(0xFF32A060), |
||||
height: double.infinity, |
||||
padding: EdgeInsets.only(top: 45.h), |
||||
child: Stack( |
||||
alignment: Alignment.topCenter, |
||||
children: [ |
||||
Container( |
||||
color: Color(0xFF32A060), |
||||
// height: 485.h, |
||||
padding: EdgeInsets.only(top: 47.h), |
||||
child: Container( |
||||
height: 438.h, |
||||
width: double.infinity, |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Colors.black.withAlpha(12), |
||||
offset: Offset(0, 2), |
||||
blurRadius: 14, |
||||
spreadRadius: 0, |
||||
), |
||||
], |
||||
borderRadius: BorderRadius.circular(6), |
||||
), |
||||
margin: EdgeInsets.symmetric(horizontal: 16.w,), |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
SizedBox(height: 46.h,), |
||||
Text( |
||||
"请保持屏幕常亮,并对准扫码盒或枪口", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 12.sp, |
||||
color: Color(0xFF4D4D4D), |
||||
), |
||||
), |
||||
SizedBox(height: 30.h,), |
||||
QrImage( |
||||
data: userInfo != null |
||||
? (userInfo?.vipScanNo ?? "") |
||||
: "", |
||||
version: QrVersions.auto, |
||||
size: 200.w, |
||||
gapless: true, |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
Container( |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(56), |
||||
color: Color(0xFF32A060), |
||||
border: Border.all( |
||||
color: Color(0xFF32A060), |
||||
width: 8.w, |
||||
), |
||||
), |
||||
child: Container( |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(56), |
||||
color: Colors.white, |
||||
border: Border.all( |
||||
color: Colors.white, |
||||
width: 2.w, |
||||
), |
||||
), |
||||
child: MImage( |
||||
userInfo?.headimg ?? "", |
||||
width: 80, |
||||
height: 80, |
||||
radius: BorderRadius.circular(56), |
||||
fit: BoxFit.cover, |
||||
errorSrc: "assets/image/default_1.webp", |
||||
fadeSrc: "assets/image/default_1.webp", |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
); |
||||
} |
||||
} |