Browse Source

Merge remote-tracking branch 'origin/new_revision_app' into new_revision_app

zyh
fmk 3 years ago
parent
commit
32902265dd
  1. 794
      assets/area_code/area_code_full.json
  2. BIN
      assets/image/2x/lose.webp
  3. BIN
      assets/image/2x/pop_background.webp
  4. BIN
      assets/image/3x/lose.webp
  5. BIN
      assets/image/3x/pop_background.webp
  6. BIN
      assets/image/lose.webp
  7. BIN
      assets/image/pop_background.webp
  8. 5
      lib/community/community_view/class_details_video.dart
  9. 2
      lib/community/community_view/community_dynamic.dart
  10. 5
      lib/integral_store/integral_store_details_page.dart
  11. 3
      lib/login/login_page.dart
  12. 141
      lib/login/new_login_page.dart
  13. 155
      lib/login/phone_address_page.dart
  14. 18
      lib/main.dart
  15. 6
      lib/mine/manage_address_page.dart
  16. 18
      lib/mine/recharge_page.dart
  17. 82
      lib/order/exchange_order_page.dart
  18. 7
      lib/retrofit/retrofit_api.dart
  19. 27
      lib/retrofit/retrofit_api.g.dart
  20. 6
      lib/setting/help_feedback_page.dart
  21. 49
      lib/setting/logout_ing.dart
  22. 4
      lib/setting/logout_page.dart
  23. 323
      lib/setting/platform_code_page.dart
  24. 156
      lib/setting/platform_pay_code.dart
  25. 255
      lib/setting/platform_pay_code_success.dart
  26. 19
      lib/setting/setting_page.dart
  27. 1
      lib/store/shop__details_page.dart
  28. 14
      lib/store/store_order.dart
  29. 79
      lib/view_widget/receive_success.dart
  30. 64
      lib/view_widget/sign_in_widget.dart
  31. 3
      pubspec.yaml

794
assets/area_code/area_code_full.json

@ -0,0 +1,794 @@
{
"热门":[
{
"area": "中国",
"area_code": "+86"
},
{
"area": "中国(香港)",
"area_code": "+852"
},
{
"area": "中国(澳门)",
"area_code": "+853"
},
{
"area": "中国(台湾)",
"area_code": "+886"
}
],
"A": [
{
"area": "阿尔巴尼亚",
"area_code": "+355"
},
{
"area": "阿尔及利亚",
"area_code": "+213"
},
{
"area": "阿富汗",
"area_code": "+93"
},
{
"area": "阿根廷",
"area_code": "+54"
},
{
"area": "阿拉斯加",
"area_code": "+1907"
},
{
"area": "阿鲁巴岛",
"area_code": "+297"
},
{
"area": "阿曼",
"area_code": "+968"
},
{
"area": "阿森松",
"area_code": "+247"
},
{
"area": "埃及",
"area_code": "+20"
},
{
"area": "埃塞俄比亚",
"area_code": "+251"
},
{
"area": "爱尔兰",
"area_code": "+353"
},
{
"area": "安哥拉",
"area_code": "+244"
},
{
"area": "安圭拉岛",
"area_code": "+1809"
},
{
"area": "奥地利",
"area_code": "+43"
},
{
"area": "澳大利亚",
"area_code": "+61"
},
{
"area": "澳门",
"area_code": "+853"
}
],
"B": [
{
"area": "巴巴多斯",
"area_code": "+1809"
},
{
"area": "巴哈马",
"area_code": "+1809"
},
{
"area": "巴基斯坦",
"area_code": "+92"
},
{
"area": "巴拉圭",
"area_code": "+595"
},
{
"area": "巴林",
"area_code": "+973"
},
{
"area": "巴拿马",
"area_code": "+507"
},
{
"area": "巴西",
"area_code": "+55"
},
{
"area": "保加利亚",
"area_code": "+359"
},
{
"area": "贝宁",
"area_code": "+229"
},
{
"area": "比利时",
"area_code": "+32"
},
{
"area": "冰岛",
"area_code": "+354"
},
{
"area": "波多黎各",
"area_code": "+1809"
},
{
"area": "波兰",
"area_code": "+48"
},
{
"area": "玻利维亚",
"area_code": "+591"
},
{
"area": "伯利兹",
"area_code": "+501"
},
{
"area": "博茨瓦纳",
"area_code": "+267"
},
{
"area": "不丹",
"area_code": "+975"
},
{
"area": "布基拉法索",
"area_code": "+226"
},
{
"area": "布隆迪",
"area_code": "+257"
}
],
"C": [
{
"area": "朝鲜",
"area_code": "+850"
},
{
"area": "赤道几内亚",
"area_code": "+240"
}
],
"D": [
{
"area": "丹麦",
"area_code": "+45"
},
{
"area": "德国",
"area_code": "+349"
},
{
"area": "东萨摩亚",
"area_code": "+684"
},
{
"area": "多哥",
"area_code": "+228"
}
],
"E": [
{
"area": "俄罗斯",
"area_code": "+7"
},
{
"area": "厄瓜多尔",
"area_code": "+593"
}
],
"F": [
{
"area": "法国",
"area_code": "+33"
},
{
"area": "法罗群岛",
"area_code": "+298"
},
{
"area": "法属圭亚那",
"area_code": "+594"
},
{
"area": "梵蒂冈",
"area_code": "+396"
},
{
"area": "菲律宾",
"area_code": "+63"
},
{
"area": "斐济",
"area_code": "+679"
},
{
"area": "芬兰",
"area_code": "+358"
},
{
"area": "佛得角",
"area_code": "+238"
},
{
"area": "福克兰群岛",
"area_code": "+500"
}
],
"G": [
{
"area": "冈比亚",
"area_code": "+220"
},
{
"area": "刚果",
"area_code": "+242"
},
{
"area": "哥伦比亚",
"area_code": "+57"
},
{
"area": "哥斯达黎加",
"area_code": "+506"
},
{
"area": "格陵兰岛",
"area_code": "+299"
},
{
"area": "古巴",
"area_code": "+53"
},
{
"area": "关岛",
"area_code": "+671"
},
{
"area": "圭亚那",
"area_code": "+592"
}
],
"H": [
{
"area": "海地",
"area_code": "+509"
},
{
"area": "韩国",
"area_code": "+82"
},
{
"area": "荷兰",
"area_code": "+31"
},
{
"area": "洪都拉斯",
"area_code": "+504"
}
],
"J": [
{
"area": "基里巴斯",
"area_code": "+686"
},
{
"area": "吉布提",
"area_code": "+253"
},
{
"area": "几内亚",
"area_code": "+224"
},
{
"area": "几内亚比绍",
"area_code": "+245"
},
{
"area": "加拿大",
"area_code": "+1"
},
{
"area": "加纳",
"area_code": "+233"
},
{
"area": "加蓬",
"area_code": "+241"
},
{
"area": "柬埔寨",
"area_code": "+855"
},
{
"area": "津巴布韦",
"area_code": "+263"
}
],
"K": [
{
"area": "喀麦隆",
"area_code": "+237"
},
{
"area": "卡塔尔",
"area_code": "+974"
},
{
"area": "科科斯岛",
"area_code": "+6722"
},
{
"area": "科克群岛",
"area_code": "+682"
},
{
"area": "科摩罗",
"area_code": "+269"
},
{
"area": "科特迪瓦",
"area_code": "+225"
},
{
"area": "科威特",
"area_code": "+965"
},
{
"area": "肯尼亚",
"area_code": "+254"
}
],
"L": [
{
"area": "莱索托",
"area_code": "+266"
},
{
"area": "老挝",
"area_code": "+856"
},
{
"area": "黎巴嫩",
"area_code": "+961"
},
{
"area": "利比里亚",
"area_code": "+231"
},
{
"area": "利比亚",
"area_code": "+218"
},
{
"area": "列支敦士登",
"area_code": "+4175"
},
{
"area": "留尼旺岛",
"area_code": "+262"
},
{
"area": "卢森堡",
"area_code": "+352"
},
{
"area": "卢旺达",
"area_code": "+250"
},
{
"area": "罗马尼亚",
"area_code": "+40"
}
],
"M": [
{
"area": "马达加斯加",
"area_code": "+261"
},
{
"area": "马尔代夫",
"area_code": "+960"
},
{
"area": "马耳他",
"area_code": "+356"
},
{
"area": "马拉维",
"area_code": "+265"
},
{
"area": "马来西亚",
"area_code": "+60"
},
{
"area": "马里",
"area_code": "+223"
},
{
"area": "马提尼克",
"area_code": "+596"
},
{
"area": "毛里求斯",
"area_code": "+230"
},
{
"area": "毛里塔尼亚",
"area_code": "+222"
},
{
"area": "美国",
"area_code": "+1"
},
{
"area": "蒙古",
"area_code": "+976"
},
{
"area": "孟加拉国",
"area_code": "+880"
},
{
"area": "秘鲁",
"area_code": "+51"
},
{
"area": "缅甸",
"area_code": "+95"
},
{
"area": "摩洛哥",
"area_code": "+210"
},
{
"area": "莫桑比克",
"area_code": "+258"
},
{
"area": "墨西哥",
"area_code": "+52"
}
],
"N": [
{
"area": "纳米比亚",
"area_code": "+264"
},
{
"area": "南非",
"area_code": "+27"
},
{
"area": "南斯拉夫",
"area_code": "+338"
},
{
"area": "瑙鲁",
"area_code": "+674"
},
{
"area": "尼加拉瓜",
"area_code": "+505"
},
{
"area": "尼泊尔",
"area_code": "+977"
},
{
"area": "尼日尔",
"area_code": "+227"
},
{
"area": "尼日利亚",
"area_code": "+234"
},
{
"area": "纽埃岛",
"area_code": "+683"
},
{
"area": "挪威",
"area_code": "+47"
},
{
"area": "诺福克岛",
"area_code": "+6723"
}
],
"P": [
{
"area": "葡萄牙",
"area_code": "+351"
},
{
"area": "普林西比",
"area_code": "+239"
}
],
"R": [
{
"area": "日本",
"area_code": "+81"
},
{
"area": "瑞典",
"area_code": "+46"
},
{
"area": "瑞士",
"area_code": "+41"
}
],
"S": [
{
"area": "萨尔瓦多",
"area_code": "+503"
},
{
"area": "塞拉利昂",
"area_code": "+232"
},
{
"area": "塞内加尔",
"area_code": "+221"
},
{
"area": "塞浦路斯",
"area_code": "+357"
},
{
"area": "塞舌尔",
"area_code": "+248"
},
{
"area": "沙特阿拉伯",
"area_code": "+966"
},
{
"area": "圣诞岛",
"area_code": "+6724"
},
{
"area": "圣多美",
"area_code": "+239"
},
{
"area": "圣赫勒拿",
"area_code": "+290"
},
{
"area": "圣卢西亚",
"area_code": "+1809"
},
{
"area": "圣马力诺",
"area_code": "+223"
},
{
"area": "斯里兰卡",
"area_code": "+94"
},
{
"area": "斯威士兰",
"area_code": "+268"
},
{
"area": "苏丹",
"area_code": "+249"
},
{
"area": "苏里南",
"area_code": "+597"
},
{
"area": "所罗门群岛",
"area_code": "+677"
},
{
"area": "索马里",
"area_code": "+252"
}
],
"T": [
{
"area": "台湾",
"area_code": "+886"
},
{
"area": "泰国",
"area_code": "+66"
},
{
"area": "坦桑尼亚",
"area_code": "+255"
},
{
"area": "汤加",
"area_code": "+676"
},
{
"area": "突尼斯",
"area_code": "+216"
},
{
"area": "图瓦卢",
"area_code": "+688"
},
{
"area": "土耳其",
"area_code": "+90"
}
],
"W": [
{
"area": "瓦努阿图",
"area_code": "+678"
},
{
"area": "危地马拉",
"area_code": "+502"
},
{
"area": "威克岛",
"area_code": "+1808"
},
{
"area": "维尔京群岛",
"area_code": "+1809"
},
{
"area": "委内瑞拉",
"area_code": "+58"
},
{
"area": "文莱",
"area_code": "+673"
},
{
"area": "乌干达",
"area_code": "+256"
},
{
"area": "乌拉圭",
"area_code": "+598"
}
],
"X": [
{
"area": "希腊",
"area_code": "+30"
},
{
"area": "西班牙",
"area_code": "+34"
},
{
"area": "西萨摩亚",
"area_code": "+685"
},
{
"area": "夏威夷",
"area_code": "+1808"
},
{
"area": "香港",
"area_code": "+852"
},
{
"area": "新加坡",
"area_code": "+65"
},
{
"area": "新西兰",
"area_code": "+64"
},
{
"area": "匈牙利",
"area_code": "+336"
},
{
"area": "叙利亚",
"area_code": "+963"
}
],
"Y": [
{
"area": "牙买加",
"area_code": "+1809"
},
{
"area": "伊拉克",
"area_code": "+964"
},
{
"area": "伊朗",
"area_code": "+98"
},
{
"area": "以色列",
"area_code": "+972"
},
{
"area": "意大利",
"area_code": "+39"
},
{
"area": "印度",
"area_code": "+91"
},
{
"area": "印度尼西亚",
"area_code": "+62"
},
{
"area": "英国",
"area_code": "+44"
},
{
"area": "约旦",
"area_code": "+962"
},
{
"area": "越南",
"area_code": "+84"
}
],
"Z": [
{
"area": "赞比亚",
"area_code": "+260"
},
{
"area": "扎伊尔",
"area_code": "+243"
},
{
"area": "乍得",
"area_code": "+235"
},
{
"area": "直布罗陀",
"area_code": "+350"
},
{
"area": "智利",
"area_code": "+56"
},
{
"area": "中非",
"area_code": "+236"
},
{
"area": "中国",
"area_code": "+86"
},
{
"area": "中途岛",
"area_code": "+1808"
}
]
}

BIN
assets/image/2x/lose.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
assets/image/2x/pop_background.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

BIN
assets/image/3x/lose.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
assets/image/3x/pop_background.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

BIN
assets/image/lose.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/pop_background.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

5
lib/community/community_view/class_details_video.dart

@ -78,14 +78,15 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
// //
looping: false, looping: false,
// //
allowFullScreen: true, allowFullScreen: false,
// //
materialProgressColors: chewie.ChewieProgressColors( materialProgressColors: chewie.ChewieProgressColors(
playedColor: Colors.white, playedColor: Colors.white,
handleColor: Colors.white, handleColor: Colors.white,
backgroundColor: Colors.grey, backgroundColor: Colors.grey,
bufferedColor: Colors.transparent, bufferedColor: Colors.transparent,
), ),
//
autoInitialize: true, autoInitialize: true,
); );
chewieAudioController.addListener(_fullScreenListener); chewieAudioController.addListener(_fullScreenListener);

2
lib/community/community_view/community_dynamic.dart

@ -89,7 +89,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
// //
autoPlay: false, autoPlay: false,
// //
looping: false, looping: true,
// //
allowFullScreen: true, allowFullScreen: true,
// //

5
lib/integral_store/integral_store_details_page.dart

@ -167,12 +167,13 @@ class _IntegralStoreDetailsPage extends State<IntegralStoreDetailsPage> {
}, },
child: Container( child: Container(
padding: EdgeInsets.only(top: 16.h, bottom: 16.h), padding: EdgeInsets.only(top: 16.h, bottom: 16.h),
margin: EdgeInsets.only(bottom:25.h,left:20,right: 20),
decoration: BoxDecoration( decoration: BoxDecoration(
color: (payType > 0) color: (payType > 0)
? Color(0xFF32A060) ? Color(0xFF32A060)
: Color(0xFFD8D8D8), : Color(0xFFD8D8D8),
borderRadius: BorderRadius.vertical( borderRadius: BorderRadius.circular(
top: Radius.circular(4), 45
), ),
), ),
alignment: Alignment.center, alignment: Alignment.center,

3
lib/login/login_page.dart

@ -61,6 +61,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
Animation<Alignment> animation; Animation<Alignment> animation;
Animation<double> doubleAnimation; Animation<double> doubleAnimation;
bool invitationCode = true; bool invitationCode = true;
String areaCode;
isLogin() async { isLogin() async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
@ -227,7 +228,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
} }
if (_sendCodeStatus == 0) { if (_sendCodeStatus == 0) {
client client
.sendVerify(mobile) .sendVerify(areaCode,mobile)
.then((value) => { .then((value) => {
if (value.isSuccess) if (value.isSuccess)
{_sendCodeStatus = 1, countdown()} {_sendCodeStatus = 1, countdown()}

141
lib/login/new_login_page.dart

@ -59,6 +59,7 @@ class _NewLoginPage extends State<NewLoginPage> {
var checkStatus = false; var checkStatus = false;
Timer _timer; Timer _timer;
bool isShowLogin = false; bool isShowLogin = false;
String area = "+86";
@override @override
void initState() { void initState() {
@ -129,7 +130,7 @@ class _NewLoginPage extends State<NewLoginPage> {
} }
if (_sendCodeStatus == 0) { if (_sendCodeStatus == 0) {
apiService apiService
.sendVerify(mobile) .sendVerify(area,mobile)
.then((value) => { .then((value) => {
if (value.isSuccess) if (value.isSuccess)
{_sendCodeStatus = 1, countdown()} {_sendCodeStatus = 1, countdown()}
@ -191,12 +192,12 @@ class _NewLoginPage extends State<NewLoginPage> {
setState(() {}); setState(() {});
return; return;
} }
if (mobile.length != 11) { // if (mobile.length != 11) {
mobileStatus = 2; // mobileStatus = 2;
mobileErrorText = S.of(context).phone_error; // mobileErrorText = S.of(context).phone_error;
setState(() {}); // setState(() {});
return; // return;
} // }
var code = _controllerCode.text; var code = _controllerCode.text;
if (code == "") { if (code == "") {
@ -212,15 +213,12 @@ class _NewLoginPage extends State<NewLoginPage> {
return; return;
} }
var invite = _controllerInviteCode.text; var invite = _controllerInviteCode.text;
var param = { var param = {"capcha": code, "mobile": mobile, "invite": invite,"areaCode":area};
"capcha": code,
"mobile": mobile,
"invite":invite
};
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai);
BaseData value = await apiService.memberLogin(param).catchError((error) { BaseData value = await apiService.memberLogin(param).catchError((error) {
print(error.message); print(error.message);
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), alignment: Alignment.center); SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
}); });
// EasyLoading.show(status: S.of(context).zhengzaijiazai); // EasyLoading.show(status: S.of(context).zhengzaijiazai);
if (value != null && value.isSuccess) { if (value != null && value.isSuccess) {
@ -229,11 +227,13 @@ class _NewLoginPage extends State<NewLoginPage> {
eventBus.fire(EventType(3)); eventBus.fire(EventType(3));
Navigator.of(context).pushNamedAndRemoveUntil( Navigator.of(context).pushNamedAndRemoveUntil(
'/router/main_page', '/router/main_page', (route) => false,
(route) => false,arguments:{"invite":invite,"interviewCouponList":userInfo.interviewCouponList, arguments: {
"firstLoginCouponList":userInfo.firstLoginCouponList}); "invite": invite,
"interviewCouponList": userInfo.interviewCouponList,
"firstLoginCouponList": userInfo.firstLoginCouponList
});
EasyLoading.dismiss(); EasyLoading.dismiss();
} else { } else {
if (value.msg != null) if (value.msg != null)
SmartDialog.showToast(value?.msg, alignment: Alignment.center); SmartDialog.showToast(value?.msg, alignment: Alignment.center);
@ -263,7 +263,8 @@ class _NewLoginPage extends State<NewLoginPage> {
sharedPreferences.getString("token") != null && sharedPreferences.getString("token") != null &&
sharedPreferences.getString("token") != "") { sharedPreferences.getString("token") != "") {
Navigator.of(context).popAndPushNamed('/router/main_page'); Navigator.of(context).popAndPushNamed('/router/main_page');
} else {initController(); } else {
initController();
apiService = ApiService(Dio(), context: context); apiService = ApiService(Dio(), context: context);
isShowLogin = true; isShowLogin = true;
@ -323,8 +324,7 @@ class _NewLoginPage extends State<NewLoginPage> {
isShowLogin ? CrossFadeState.showSecond : CrossFadeState.showFirst, isShowLogin ? CrossFadeState.showSecond : CrossFadeState.showFirst,
duration: Duration(milliseconds: Platform.isIOS ? 1000 : 1000), duration: Duration(milliseconds: Platform.isIOS ? 1000 : 1000),
), ),
) ));
);
} }
void refresh() { void refresh() {
@ -344,7 +344,10 @@ class _NewLoginPage extends State<NewLoginPage> {
children: [ children: [
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(left: 16.w,top:60.h+ MediaQuery.of(context).padding.top,right: 12.w), padding: EdgeInsets.only(
left: 16.w,
top: 60.h + MediaQuery.of(context).padding.top,
right: 12.w),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -357,7 +360,9 @@ class _NewLoginPage extends State<NewLoginPage> {
color: Color(0xFF000000), color: Color(0xFF000000),
), ),
), ),
SizedBox(height:20.h,), SizedBox(
height: 20.h,
),
Text( Text(
"欢迎来到一心回乡", "欢迎来到一心回乡",
style: TextStyle( style: TextStyle(
@ -366,7 +371,9 @@ class _NewLoginPage extends State<NewLoginPage> {
color: Color(0xFF000000), color: Color(0xFF000000),
), ),
), ),
SizedBox(height:50.h,), SizedBox(
height: 50.h,
),
Text( Text(
S.of(context).shoujihao, S.of(context).shoujihao,
style: TextStyle( style: TextStyle(
@ -375,15 +382,42 @@ class _NewLoginPage extends State<NewLoginPage> {
color: Color(0xFF181818), color: Color(0xFF181818),
), ),
), ),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
onTap: (){
Navigator.of(context).pushNamed('/router/phone_address_page').then((value) {
if(value != null)
setState(() {
area = value;
});
});
},
child: Text(
area,
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 16.sp,
color: Color(0xFF1A1A1A),
),
)),
Icon(
Icons.keyboard_arrow_right,
size: 18,
color: Color(0xFF1A1A1A),
),
Container( Container(
height: 30.h, height: 30.h,
width: MediaQuery.of(context).size.width - 80.h, width: MediaQuery.of(context).size.width - 100.w,
// margin: EdgeInsets.only(top: 12.h), margin: EdgeInsets.only(bottom: 10.h),
child: TextField( child: TextField(
style: TextStyle( style: TextStyle(
height: 1.h, height: 1.h,
fontSize: 16.sp, fontSize: 16.sp,
color: statusPhoneTextColor, // color: statusPhoneTextColor,
color: Color(0xFF353535),
), ),
onChanged: (value) { onChanged: (value) {
if (value != null && value.isNotEmpty) { if (value != null && value.isNotEmpty) {
@ -411,28 +445,33 @@ class _NewLoginPage extends State<NewLoginPage> {
), ),
), ),
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
inputFormatters: [LengthLimitingTextInputFormatter(11)], inputFormatters: [
LengthLimitingTextInputFormatter(11)
],
cursorColor: Colors.grey, cursorColor: Colors.grey,
maxLines: 1, maxLines: 1,
), ),
), ),
],
),
Container( Container(
height: 1.h, height: 1.h,
width: MediaQuery.of(context).size.width - 80.h, width: MediaQuery.of(context).size.width - 80.h,
color: statusPhoneLineColor, // color: statusPhoneLineColor,
color: _controllerPhone.text== "" ? Color(0xFFE7E3E3):Color(0xFF32A060),
), ),
SizedBox( SizedBox(
height: 30.h, height: 30.h,
child: Visibility( // child: Visibility(
visible: statusPhoneVisible, // visible: statusPhoneVisible,
child: Text( // child: Text(
S.of(context).phone_error, // S.of(context).phone_error,
style: TextStyle( // style: TextStyle(
color: Color(0xFFF72626), // color: Color(0xFFF72626),
fontSize: 12.sp, // fontSize: 12.sp,
), // ),
), // ),
), // ),
), ),
Text( Text(
S.of(context).yanzhengma, S.of(context).yanzhengma,
@ -463,7 +502,8 @@ class _NewLoginPage extends State<NewLoginPage> {
color: statusCodeTextColor, color: statusCodeTextColor,
), ),
onChanged: (value) { onChanged: (value) {
if (value != null && value.isNotEmpty) { if (value != null &&
value.isNotEmpty) {
if (value.length == 6) { if (value.length == 6) {
verifyStatus = 1; verifyStatus = 1;
} else { } else {
@ -543,7 +583,9 @@ class _NewLoginPage extends State<NewLoginPage> {
), ),
), ),
), ),
SizedBox(height: 51.h,), SizedBox(
height: 51.h,
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -556,10 +598,11 @@ class _NewLoginPage extends State<NewLoginPage> {
}); });
}, },
checkColor: Color(0xFFFFFFFF), checkColor: Color(0xFFFFFFFF),
fillColor: MaterialStateProperty.all(Color(0xFF32A060)), fillColor:
MaterialStateProperty.all(Color(0xFF32A060)),
), ),
Expanded(child: Expanded(
Text.rich( child: Text.rich(
TextSpan(children: [ TextSpan(children: [
TextSpan( TextSpan(
text: S.of(context).privacy_policy1, text: S.of(context).privacy_policy1,
@ -573,8 +616,8 @@ class _NewLoginPage extends State<NewLoginPage> {
text: "《一心回乡用户协议》", text: "《一心回乡用户协议》",
recognizer: TapGestureRecognizer() recognizer: TapGestureRecognizer()
..onTap = () { ..onTap = () {
Navigator.of(context) Navigator.of(context).pushNamed(
.pushNamed('/router/user_service_page'); '/router/user_service_page');
}, },
style: TextStyle( style: TextStyle(
fontSize: 11.sp, fontSize: 11.sp,
@ -606,7 +649,9 @@ class _NewLoginPage extends State<NewLoginPage> {
), ),
]), ]),
)), )),
SizedBox(width: 30,) SizedBox(
width: 30,
)
], ],
), ),
GestureDetector( GestureDetector(
@ -638,7 +683,8 @@ class _NewLoginPage extends State<NewLoginPage> {
if (widget.arguments != null) { if (widget.arguments != null) {
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
Navigator.of(context).popAndPushNamed('/router/main_page'); Navigator.of(context)
.popAndPushNamed('/router/main_page');
} }
}, },
child: Container( child: Container(
@ -843,5 +889,4 @@ class _NewLoginPage extends State<NewLoginPage> {
r'^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\d{8}$'); r'^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\d{8}$');
return exp.hasMatch(mobile); return exp.hasMatch(mobile);
} }
} }

155
lib/login/phone_address_page.dart

@ -0,0 +1,155 @@
import 'dart:convert';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
class PhoneAddressPage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _PhoneAddressPage();
}
}
class _PhoneAddressPage extends State<PhoneAddressPage> {
RefreshController refreshController = RefreshController();
Map<String, dynamic> areaMap;
List<String> areaList = [];
@override
void initState() {
super.initState();
areaCode();
}
void areaCode() async {
var value =
await rootBundle.loadString('assets/area_code/area_code_full.json');
areaMap = jsonDecode(value);
areaMap.forEach((key, value) {
areaList.add(key);
});
setState(() {});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Color(0xFFF0F0F0),
leading: GestureDetector(
child: Icon(
Icons.arrow_back_ios,
color: Colors.black,
),
onTap: () {
Navigator.of(context).pop();
}),
title: Text(
"选择手机号归属地",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 17.sp,
color: Color(0xFF0D0D0D),
),
),
centerTitle: true,
elevation: 0.0,
),
body: Container(
color: Color(0xFFF0F0F0),
child: sortList(),
),
);
}
Widget sortList() {
return ListView.builder(
padding: EdgeInsets.zero,
itemCount: areaList.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: sortItem(position),
);
},
);
}
Widget sortItem(int position) {
return Column(
children: [
Container(
width: double.infinity,
color: Colors.white,
padding: EdgeInsets.only(top: 2.h, bottom: 2.h, left: 16.w),
margin: EdgeInsets.only(bottom: 12.h),
child: Text(
areaList[position],
style: TextStyle(
color: Color(0xFF000000),
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
),
),
),
Column(
children: (areaMap[areaList[position]] as List).map((e) {
return globalRoamingItem(e);
}).toList(),
)
],
);
}
Widget globalRoamingItem(data) {
return GestureDetector(
child: Container(
margin: EdgeInsets.only(left: 16.w, right: 22.w),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Text(
data["area"],
style: TextStyle(
color: Color(0xFF000000),
fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
),
),
),
Text(
data["area_code"],
style: TextStyle(
color: Color(0xFFA29E9E),
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
),
),
],
),
Container(
margin: EdgeInsets.symmetric(vertical: 12.h),
width: double.infinity,
height: 1.h,
color: Color(0xFFDCDCDC),
)
],
),
),
onTap: () {
Navigator.of(context).pop(data["area_code"]);
},
);
}
}

18
lib/main.dart

@ -5,7 +5,6 @@ import 'package:event_bus/event_bus.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
@ -54,6 +53,8 @@ import 'package:huixiang/setting/logout_ing.dart';
import 'package:huixiang/setting/logout_page.dart'; import 'package:huixiang/setting/logout_page.dart';
import 'package:huixiang/setting/permission_setting_page.dart'; import 'package:huixiang/setting/permission_setting_page.dart';
import 'package:huixiang/setting/platform_code_page.dart'; import 'package:huixiang/setting/platform_code_page.dart';
import 'package:huixiang/setting/platform_pay_code.dart';
import 'package:huixiang/setting/platform_pay_code_success.dart';
import 'package:huixiang/setting/setting_page.dart'; import 'package:huixiang/setting/setting_page.dart';
import 'package:huixiang/setting/treaty_page.dart'; import 'package:huixiang/setting/treaty_page.dart';
import 'package:huixiang/store/report_assess%20.dart'; import 'package:huixiang/store/report_assess%20.dart';
@ -71,7 +72,6 @@ import 'package:huixiang/settlement/settlement.dart';
import 'package:huixiang/test_page.dart'; import 'package:huixiang/test_page.dart';
import 'package:huixiang/union/location_map_page.dart'; import 'package:huixiang/union/location_map_page.dart';
import 'package:huixiang/utils/ImgCachePath.dart'; import 'package:huixiang/utils/ImgCachePath.dart';
import 'package:huixiang/view_widget/activity_poster.dart';
import 'package:huixiang/web/web_page.dart'; import 'package:huixiang/web/web_page.dart';
import 'package:huixiang/union/union_details_page.dart'; import 'package:huixiang/union/union_details_page.dart';
@ -80,11 +80,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/web/web_turntable_activity.dart'; import 'package:huixiang/web/web_turntable_activity.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:sharesdk_plugin/sharesdk_interface.dart';
import 'package:sharesdk_plugin/sharesdk_register.dart';
import 'package:tpns_flutter_plugin/android/xg_android_api.dart';
import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'community/community_view/class_details.dart'; import 'community/community_view/class_details.dart';
import 'community/headlines/headlines_column_details.dart'; import 'community/headlines/headlines_column_details.dart';
@ -95,10 +90,10 @@ import 'community/report/report_page.dart';
import 'community/report/report_success.dart'; import 'community/report/report_success.dart';
import 'home/guide_page.dart'; import 'home/guide_page.dart';
import 'home/home_view/activity_list.dart'; import 'home/home_view/activity_list.dart';
import 'home/start_page.dart';
import 'home/welfare_exchange.dart'; import 'home/welfare_exchange.dart';
import 'home/welfare_page.dart'; import 'home/welfare_page.dart';
import 'login/new_login_page.dart'; import 'login/new_login_page.dart';
import 'login/phone_address_page.dart';
import 'main_page.dart'; import 'main_page.dart';
import 'message/system_details.dart'; import 'message/system_details.dart';
import 'mine/coupon_page.dart'; import 'mine/coupon_page.dart';
@ -108,7 +103,6 @@ import 'mine/manage_address_page.dart';
import 'mine/mine_greenery.dart'; import 'mine/mine_greenery.dart';
import 'mine/mine_shop_details.dart'; import 'mine/mine_shop_details.dart';
import 'mine/mine_shop_page.dart'; import 'mine/mine_shop_page.dart';
import 'mine/mine_view/calendar_page.dart';
import 'mine/mine_view/community_follow.dart'; import 'mine/mine_view/community_follow.dart';
import 'mine/mine_vip/binding_assistant_card.dart'; import 'mine/mine_vip/binding_assistant_card.dart';
import 'mine/mine_vip/legal_right_details.dart'; import 'mine/mine_vip/legal_right_details.dart';
@ -401,4 +395,10 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
AccountSecurityPage(), AccountSecurityPage(),
'/router/platform_code_page': (context, {arguments}) => '/router/platform_code_page': (context, {arguments}) =>
PlatformCodePage(arguments:arguments), PlatformCodePage(arguments:arguments),
'/router/platform_pay_code': (context, {arguments}) =>
PlatformPayCode(arguments:arguments),
'/router/platform_pay_code_success': (context, {arguments}) =>
PlatformPayCodeSuccess(arguments:arguments),
'/router/phone_address_page': (context, {arguments}) =>
PhoneAddressPage(),
}; };

6
lib/mine/manage_address_page.dart

@ -97,10 +97,14 @@ class _ManageAddressPage extends State<ManageAddressPage> {
addAddress(); addAddress();
}, },
child: Container( child: Container(
color: Color(0xFF32A060),
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),
margin:EdgeInsets.symmetric(horizontal: 16.w,vertical:25.h),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(45),
),
child: Text( child: Text(
"新增地址", "新增地址",
style: TextStyle( style: TextStyle(

18
lib/mine/recharge_page.dart

@ -43,6 +43,7 @@ class _RechargePage extends State<RechargePage> {
int selectIndex = 0; int selectIndex = 0;
UserInfo userInfo; UserInfo userInfo;
String mBalance = "0"; String mBalance = "0";
dynamic payListen;
@override @override
void initState() { void initState() {
@ -56,19 +57,26 @@ class _RechargePage extends State<RechargePage> {
queryRechargeList(); queryRechargeList();
queryUserBalance(); queryUserBalance();
}); });
weChatResponseEventHandler.listen((event) async { payListen = weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}"); print("payCallback: ${event.errCode}");
if (event.errCode == 0) { if (event.errCode == 0) {
queryUserBalance(); queryUserBalance();
SmartDialog.showToast("充值成功", alignment: Alignment.center); SmartDialog.showToast("充值成功", alignment: Alignment.center);
} }
// else{ else{
// SmartDialog.showToast("充值失败", alignment: Alignment.center); SmartDialog.showToast("充值失败", alignment: Alignment.center);
// return; return;
// } }
}); });
} }
@override
void dispose() {
super.dispose();
if(payListen!=null)
payListen.cancel();
}
/// ///
queryBenefitList() async { queryBenefitList() async {
BaseData<List<VipBenefitList>> baseData = BaseData<List<VipBenefitList>> baseData =

82
lib/order/exchange_order_page.dart

@ -1,4 +1,6 @@
import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'dart:io';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -12,6 +14,7 @@ import 'package:huixiang/retrofit/data/wx_pay.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/min.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/receiving_method_dialog.dart'; import 'package:huixiang/view_widget/receiving_method_dialog.dart';
@ -34,8 +37,9 @@ class ExchangeOrderPage extends StatefulWidget {
class _ExchangeOrderPage extends State<ExchangeOrderPage> { class _ExchangeOrderPage extends State<ExchangeOrderPage> {
ApiService apiService; ApiService apiService;
int buyNum = 1; int buyNum = 1;
var checkIndex = 1; var checkIndex = 3;
UserInfo userInfo; UserInfo userInfo;
dynamic payListen;
dynamic mBalance = 0; dynamic mBalance = 0;
@override @override
@ -49,6 +53,34 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
UserInfo.fromJson(jsonDecode(value.getString('user'))).points, UserInfo.fromJson(jsonDecode(value.getString('user'))).points,
queryUserBalance(), queryUserBalance(),
}); });
payListen = weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}");
if (event.errCode == 0) {
String realPay = handleNeedPay();
Navigator.of(context).popAndPushNamed(
'/router/exchange_order_success_page',
arguments: {
"id": widget.arguments["goodsId"],
"price": realPay.contains("积分") ? realPay.substring(0,realPay.indexOf("积分")) : "0",
"points": points,
"realPay": realPay,
"payChannel": widget.arguments["payChannel"],
},
);
} else {
SmartDialog.showToast("支付失败", alignment: Alignment.center);
return;
}
});
}
@override
void dispose() {
super.dispose();
if(payListen!=null)
payListen.cancel();
} }
queryUserBalance() async { queryUserBalance() async {
@ -926,14 +958,20 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
], ],
), ),
), ),
SizedBox(height: 40) SizedBox(height:100.h)
], ],
)), )),
Align( Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: Container( child: Container(
height: 54.h, height: 54.h,
decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(
45
),
),
margin: EdgeInsets.only(bottom:20.h,left: 16.w,right: 16.w),
child: Row( child: Row(
children: [ children: [
Spacer(), Spacer(),
@ -965,21 +1003,29 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
if (!storeIsSelected) return; if (!storeIsSelected) return;
creditOrder(); creditOrder();
}, },
child: RoundButton( child: Container(
width: 103.w, width: 103.w,
height: 54.h, height: 54.h,
text: widget.arguments["payType"] == 3 || alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(45),
topRight: Radius.circular(45),
),
),
child: Text(
widget.arguments["payType"] == 3 ||
(widget.arguments["payType"] == 2 && (widget.arguments["payType"] == 2 &&
widget.arguments["money"] != "0.00") widget.arguments["money"] != "0.00")
? S.current.jiesuan ? S.current.jiesuan
: S.current.duihuan, : S.current.duihuan,
textColor: Colors.white, style: TextStyle(
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060),
radius: 0,
fontSize: 16.sp, fontSize: 16.sp,
padding: EdgeInsets.symmetric(vertical: 5.h), fontWeight: MyFontWeight.regular,
color: Colors.white,
), ),
),),
), ),
], ],
), ),
@ -1111,24 +1157,6 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
timeStamp: int.tryParse(wxPay.timeStamp), timeStamp: int.tryParse(wxPay.timeStamp),
sign: wxPay.sign, sign: wxPay.sign,
); );
weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}");
if (event.errCode == 0) {
Navigator.of(context).popAndPushNamed(
'/router/exchange_order_success_page',
arguments: {
"id": widget.arguments["goodsId"],
"price": realPay.contains("积分") ? realPay.substring(0,realPay.indexOf("积分")) : "0",
"points": points,
"realPay": realPay,
"payChannel": widget.arguments["payChannel"],
},
);
} else {
SmartDialog.showToast("支付失败", alignment: Alignment.center);
return;
}
});
return; return;
} }
await Navigator.of(context) await Navigator.of(context)

7
lib/retrofit/retrofit_api.dart

@ -181,8 +181,8 @@ abstract class ApiService {
Future<BaseData> memberLogin(@Body() Map<String, dynamic> param); Future<BaseData> memberLogin(@Body() Map<String, dynamic> param);
/// ///
@GET("/auth/sendVerify/{mobile}") @GET("/auth/sendVerify/{areaCode}/{mobile}")
Future<BaseData> sendVerify(@Path("mobile") String mobile); Future<BaseData> sendVerify(@Path("areaCode") String areaCode, @Path("mobile") String mobile);
/// ///
@POST("/creditGoods/list") @POST("/creditGoods/list")
@ -536,4 +536,7 @@ abstract class ApiService {
@POST("/member/updatePayPwd") @POST("/member/updatePayPwd")
Future<BaseData> updatePayPwd(@Body() Map<String, dynamic> param); Future<BaseData> updatePayPwd(@Body() Map<String, dynamic> param);
///
@POST("/member/verifyByUpdatePayPwd")
Future<BaseData> verifyByUpdatePayPwd(@Body() Map<String, dynamic> param);
} }

27
lib/retrofit/retrofit_api.g.dart

@ -99,13 +99,14 @@ class _ApiService implements ApiService {
} }
@override @override
Future<BaseData<dynamic>> sendVerify(mobile) async { Future<BaseData<dynamic>> sendVerify(areaCode,mobile) async {
ArgumentError.checkNotNull(mobile, 'mobile'); ArgumentError.checkNotNull(mobile, 'mobile');
ArgumentError.checkNotNull(areaCode, 'areaCode');
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>( final _result = await _dio.request<Map<String, dynamic>>(
'/auth/sendVerify/$mobile', '/auth/sendVerify/$areaCode/$mobile',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'GET', method: 'GET',
@ -2045,4 +2046,26 @@ class _ApiService implements ApiService {
); );
return value; return value;
} }
@override
Future<BaseData<dynamic>> verifyByUpdatePayPwd(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/member/verifyByUpdatePayPwd',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
} }

6
lib/setting/help_feedback_page.dart

@ -149,12 +149,16 @@ class _HelpFeedbackPage extends State<HelpFeedbackPage> {
child: Container( child: Container(
height: 54.h, height: 54.h,
alignment: Alignment.center, alignment: Alignment.center,
color: Color(0xFF32A060), margin:EdgeInsets.symmetric(horizontal: 16.w,vertical:25.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(45),
),
child: RoundButton( child: RoundButton(
text: S.of(context).tijiao, text: S.of(context).tijiao,
backgroup: Color(0xFF32A060), backgroup: Color(0xFF32A060),
textColor: Colors.white, textColor: Colors.white,
fontSize: 16.sp, fontSize: 16.sp,
radius: 45,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
), ),
), ),

49
lib/setting/logout_ing.dart

@ -38,6 +38,7 @@ class _LogoutIng extends State<LogoutIng> {
var _sendCodeStatus = 0; var _sendCodeStatus = 0;
Timer _timer; Timer _timer;
UserInfo userInfo; UserInfo userInfo;
String area = "+86";
@override @override
void initState() { void initState() {
@ -81,7 +82,7 @@ class _LogoutIng extends State<LogoutIng> {
showLoading: true showLoading: true
); );
} }
BaseData baseData = await apiService.sendVerify(mobile).catchError((onError) {}); BaseData baseData = await apiService.sendVerify("+86",mobile).catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
countdown(); countdown();
SmartDialog.showToast(baseData.data, SmartDialog.showToast(baseData.data,
@ -150,7 +151,12 @@ class _LogoutIng extends State<LogoutIng> {
background: Colors.transparent, background: Colors.transparent,
leadingColor: Colors.black, leadingColor: Colors.black,
), ),
body: Stack( body: GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: Stack(
children: [ children: [
Container( Container(
width: double.infinity, width: double.infinity,
@ -199,11 +205,39 @@ class _LogoutIng extends State<LogoutIng> {
), ),
), ),
), ),
Row(
children: [
GestureDetector(
onTap: (){
Navigator.of(context).pushNamed('/router/phone_address_page').then((value) {
if(value != null)
setState(() {
area = value;
});
});
},
child: Text(
area,
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 16.sp,
color: Color(0xFF1A1A1A),
),
)),
Icon(
Icons.keyboard_arrow_right,
size: 18,
color: Color(0xFF1A1A1A),
),
Expanded(child:
Container( Container(
margin: EdgeInsets.fromLTRB(0.w, 0, 20.w, 0), margin: EdgeInsets.fromLTRB(0.w, 0, 20.w, 0),
alignment: Alignment.topLeft, // alignment: Alignment.topLeft,
height: 30.h,
// width: MediaQuery.of(context).size.width - 100.w,
child: TextField( child: TextField(
controller: phoneController, controller: phoneController,
keyboardType: TextInputType.phone,
inputFormatters: [LengthLimitingTextInputFormatter(11)], inputFormatters: [LengthLimitingTextInputFormatter(11)],
decoration: InputDecoration( decoration: InputDecoration(
border: InputBorder.none, border: InputBorder.none,
@ -215,6 +249,8 @@ class _LogoutIng extends State<LogoutIng> {
), ),
), ),
), ),
)),
],
), ),
Container( Container(
height: 1.h, height: 1.h,
@ -243,6 +279,7 @@ class _LogoutIng extends State<LogoutIng> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: TextField( child: TextField(
controller: provingController, controller: provingController,
keyboardType: TextInputType.phone,
inputFormatters: [ inputFormatters: [
LengthLimitingTextInputFormatter(6) LengthLimitingTextInputFormatter(6)
], ],
@ -310,10 +347,14 @@ class _LogoutIng extends State<LogoutIng> {
width: double.infinity, width: double.infinity,
height: 54.h, height: 54.h,
alignment: Alignment.center, alignment: Alignment.center,
margin:EdgeInsets.symmetric(horizontal: 16.w,vertical:25.h),
decoration: BoxDecoration(
color: (phoneController.text == "" && color: (phoneController.text == "" &&
provingController.text == "") provingController.text == "")
? Color(0xFFD8D8D8) ? Color(0xFFD8D8D8)
: Color(0xFF32A060), : Color(0xFF32A060),
borderRadius: BorderRadius.circular(45),
),
child: Text( child: Text(
S.of(context).querenzhuxiao, S.of(context).querenzhuxiao,
style: TextStyle( style: TextStyle(
@ -324,7 +365,7 @@ class _LogoutIng extends State<LogoutIng> {
)), )),
)) ))
], ],
), )),
); );
} }

4
lib/setting/logout_page.dart

@ -183,7 +183,11 @@ class _LogoutPage extends State<LogoutPage> {
width: double.infinity, width: double.infinity,
height: 54.h, height: 54.h,
alignment: Alignment.center, alignment: Alignment.center,
margin:EdgeInsets.only(left:20.w,right:20.w,bottom: 25.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(45),
color: checkStatus ? Color(0xFF32A060) : Color(0xFFD8D8D8), color: checkStatus ? Color(0xFF32A060) : Color(0xFFD8D8D8),
),
child: Text( child: Text(
"注销", "注销",
style: TextStyle( style: TextStyle(

323
lib/setting/platform_code_page.dart

@ -1,3 +1,5 @@
import 'dart:async';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -15,6 +17,7 @@ import 'package:shared_preferences/shared_preferences.dart';
class PlatformCodePage extends StatefulWidget { class PlatformCodePage extends StatefulWidget {
final Map<String, dynamic> arguments; final Map<String, dynamic> arguments;
PlatformCodePage({this.arguments}); PlatformCodePage({this.arguments});
@override @override
@ -27,22 +30,35 @@ class _PlatformCodePage extends State<PlatformCodePage> {
ApiService apiService; ApiService apiService;
int codeType = 0; int codeType = 0;
UserInfo userInfo; UserInfo userInfo;
String inputText = "";
Timer _timer;
int sendCodeStatus = 0;
var codeText = "重新发送";
@override @override
void initState() { void initState() {
super.initState(); super.initState();
} }
@override
void dispose() {
if (_timer != null && _timer.isActive) _timer.cancel();
super.dispose();
}
/// ///
sendCode() async { sendCode() async {
if (apiService == null) { if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, token: value.getString("token"), showLoading: true); context: context,
token: value.getString("token"),
showLoading: false);
} }
BaseData baseData = BaseData baseData =
await apiService.sendVerifyByUpdatePayPwd().catchError((onError) {}); await apiService.sendVerifyByUpdatePayPwd().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
countdown();
codeType = 1; codeType = 1;
SmartDialog.showToast(baseData.data, alignment: Alignment.center); SmartDialog.showToast(baseData.data, alignment: Alignment.center);
} else { } else {
@ -50,27 +66,48 @@ class _PlatformCodePage extends State<PlatformCodePage> {
} }
} }
/// ///
modifyPayCode(String payCode,String code) async { verificationCode(String smsCode) async {
if (apiService == null) { if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, token: value.getString("token"), showLoading: true); context: context, token: value.getString("token"), showLoading: false);
} }
BaseData baseData = await apiService.updatePayPwd({ BaseData baseData = await apiService.verifyByUpdatePayPwd({
"newPayPwd": payCode, "smsCode": smsCode,
"smsCode": code,
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { Navigator.of(context).popAndPushNamed(
codeType=4; '/router/platform_pay_code',
arguments: {
"inputText": inputText,
}); });
SmartDialog.showToast(baseData.data, alignment: Alignment.center); SmartDialog.showToast(baseData.data ?? false, alignment: Alignment.center);
} else { } else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
} }
} }
countdown() {
if (_timer != null && _timer.isActive) return;
int countdown = 60;
_timer = Timer.periodic(Duration(seconds: 1), (timer) {
countdown--;
if (countdown == 0) {
codeText = "重新发送";
sendCodeStatus = 0;
_timer.cancel();
} else {
codeText = S.of(context).resend_in_seconds(countdown);
}
refresh();
});
}
void refresh() {
setState(() {});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GestureDetector( return GestureDetector(
@ -79,6 +116,7 @@ class _PlatformCodePage extends State<PlatformCodePage> {
FocusScope.of(context).requestFocus(FocusNode()); FocusScope.of(context).requestFocus(FocusNode());
}, },
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.white, backgroundColor: Colors.white,
leading: GestureDetector( leading: GestureDetector(
@ -102,168 +140,13 @@ class _PlatformCodePage extends State<PlatformCodePage> {
), ),
body: Column( body: Column(
children: [ children: [
if(codeType == 0) if (codeType == 0) verification(),
verification(), if (codeType == 1) verificationIssued(),
if(codeType ==1)
verificationIssued(),
if(codeType == 2 || codeType ==3)
settingCode(),
// if(codeType == 3)
// againSettingCode(),
if(codeType == 4)
codeSuccess(),
], ],
), ),
)); ));
} }
///
Widget settingCode() {
return Container(
alignment: Alignment.center,
margin: EdgeInsets.only(top: 28.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
codeType== 3?"请再次输入6位数字密码":"请输入6位数字密码",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 18.sp,
color: Color(0xFF353535),
),
),
SizedBox(
height: 12.h,
),
Text(
"将用于一心回乡APP下单时平台余额消费",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
color: Color(0xFFA29E9E),
),
),
Container(
margin: EdgeInsets.only(top: 24.h, bottom: 31.h),
padding: EdgeInsets.only(left: 48.w, right: 48.w),
height: 45.h,
child: PinInputTextField(
decoration: BoxLooseDecoration(
strokeColorBuilder: FixedColorBuilder(Color(0xFFEBEAEA)),
textStyle: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 18.sp,
color: Color(0xFF353535),
),
radius: Radius.circular(4.r)),
),
),
GestureDetector(
onTap: (){
setState(() {
codeType = 3;
if(codeType == 3)
modifyPayCode("123656", "5394");
});
},
child: Container(
width: 163.w,
height: 46.h,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFBBE7CC),
borderRadius: BorderRadius.circular(23.r),
),
child: Text(
codeType== 3?"确认":"下一步",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 18.sp,
color: Color(0xFFFFFFFF),
),
),
),
)
],
),
);
}
///
Widget againSettingCode() {
return Container(
alignment: Alignment.center,
margin: EdgeInsets.only(top: 28.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"请再次输入6位数字密码",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 18.sp,
color: Color(0xFF353535),
),
),
SizedBox(
height: 12.h,
),
Text(
"将用于一心回乡APP下单时平台余额消费",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
color: Color(0xFFA29E9E),
),
),
Container(
margin: EdgeInsets.only(top: 24.h, bottom: 31.h),
padding: EdgeInsets.only(left: 48.w, right: 48.w),
height: 45.h,
child: PinInputTextField(
decoration: BoxLooseDecoration(
strokeColorBuilder: FixedColorBuilder(Color(0xFFEBEAEA)),
textStyle: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 18.sp,
color: Color(0xFF353535),
),
radius: Radius.circular(4.r)),
keyboardType: TextInputType.text,
),
),
GestureDetector(
onTap: (){
setState(() {
codeType = 4;
});
},
child: Container(
width: 163.w,
height: 46.h,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFBBE7CC),
borderRadius: BorderRadius.circular(23.r),
),
child: Text(
"确认",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 18.sp,
color: Color(0xFFFFFFFF),
),
),
),
)
],
),
);
}
///- ///-
Widget verification() { Widget verification() {
return Container( return Container(
@ -305,9 +188,8 @@ class _PlatformCodePage extends State<PlatformCodePage> {
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
// sendCode();
setState(() { setState(() {
codeType = 1; sendCode();
}); });
}, },
child: Container( child: Container(
@ -344,7 +226,7 @@ class _PlatformCodePage extends State<PlatformCodePage> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( Text(
"验证码已发至 176****998", "验证码已发至 ${AppUtils.phoneEncode(widget.arguments["userInfo"]?.phone ?? "")}",
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 18.sp, fontSize: 18.sp,
@ -354,23 +236,34 @@ class _PlatformCodePage extends State<PlatformCodePage> {
SizedBox( SizedBox(
height: 14.h, height: 14.h,
), ),
Text( GestureDetector(
"55S后可重发", onTap: () {
sendCode();
},
child: Text(
codeText,
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFFA29E9E), color: Color(0xFF32A060),
),
), ),
), ),
SizedBox( SizedBox(
height: 14.h, height: 14.h,
), ),
Container( Container(
margin: EdgeInsets.only(top: 24.h, bottom: 31.h), margin: EdgeInsets.only(top: 24.h, bottom: 31.h,right: 48.w,left: 48.w),
padding: EdgeInsets.only(left: 48.w, right: 48.w), // padding: EdgeInsets.only(left: 48.w, right: 48.w),
height: 55.h, height: 55.h,
child: PinInputTextField( child: PinInputTextField(
pinLength: 4, pinLength: 4,
onChanged: (txt) {
print(txt);
setState(() {
inputText = txt;
});
},
decoration: BoxLooseDecoration( decoration: BoxLooseDecoration(
strokeColorBuilder: FixedColorBuilder(Color(0xFFEBEAEA)), strokeColorBuilder: FixedColorBuilder(Color(0xFFEBEAEA)),
textStyle: TextStyle( textStyle: TextStyle(
@ -385,7 +278,12 @@ class _PlatformCodePage extends State<PlatformCodePage> {
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
codeType = 2; if (inputText.length == 4) {
verificationCode(inputText);
} else {
SmartDialog.showToast("请输入验证码",
alignment: Alignment.center);
}
}); });
}, },
child: Container( child: Container(
@ -393,7 +291,9 @@ class _PlatformCodePage extends State<PlatformCodePage> {
height: 46.h, height: 46.h,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFBBE7CC), color: inputText.length == 4
? Color(0xFF32A060)
: Color(0xFFBBE7CC),
borderRadius: BorderRadius.circular(23.r), borderRadius: BorderRadius.circular(23.r),
), ),
child: Text( child: Text(
@ -409,73 +309,4 @@ class _PlatformCodePage extends State<PlatformCodePage> {
), ),
); );
} }
///
Widget codeSuccess() {
return Container(
alignment: Alignment.center,
margin: EdgeInsets.only(top: 31.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/icon_order_success.webp",
fit: BoxFit.cover,
width: 76,
height: 76,
),
SizedBox(
height: 16.h,
),
Text(
"设置密码成功",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 21.sp,
color: Color(0xFF353535),
),
),
SizedBox(
height: 69.h,
),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Container(
width: double.infinity,
height: 46.h,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(4.r),
),
margin: EdgeInsets.symmetric(horizontal: 16.w),
child: Text(
S.of(context).queren,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 18.sp,
color: Color(0xFFFFFFFF),
),
),
),
)
],
),
);
}
///
assessShowBottomSheet() {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
isScrollControlled: true,
builder: (context) {
return PaySelectedDialog();
},
);
}
} }

156
lib/setting/platform_pay_code.dart

@ -0,0 +1,156 @@
import 'package:dio/dio.dart';
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/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/pay_selected_dialog.dart';
import 'package:pin_input_text_field/pin_input_text_field.dart';
import 'package:shared_preferences/shared_preferences.dart';
class PlatformPayCode extends StatefulWidget {
final Map<String, dynamic> arguments;
PlatformPayCode({this.arguments});
@override
State<StatefulWidget> createState() {
return _PlatformPayCode();
}
}
class _PlatformPayCode extends State<PlatformPayCode> {
String inputCode = "";
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: Scaffold(
appBar: AppBar(
backgroundColor: Colors.white,
leading: GestureDetector(
child: Icon(
Icons.arrow_back_ios,
color: Colors.black,
),
onTap: () {
Navigator.of(context).pop();
}),
title: Text(
S.of(context).pingtaizhifumima,
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 17.sp,
color: Color(0xFF0D0D0D),
),
),
centerTitle: true,
elevation: 0.0,
),
body: Column(
children: [
settingCode(),
],
),
));
}
///
Widget settingCode(){
return Container(
alignment: Alignment.center,
margin: EdgeInsets.only(top: 28.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"请输入6位数字密码",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 18.sp,
color: Color(0xFF353535),
),
),
SizedBox(
height: 12.h,
),
Text(
"将用于一心回乡APP下单时平台余额消费",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
color: Color(0xFFA29E9E),
),
),
Container(
margin: EdgeInsets.only(top: 24.h, bottom: 31.h),
padding: EdgeInsets.only(left: 48.w, right: 48.w),
height: 45.h,
child: PinInputTextField(
onChanged: (txtCode){
print(txtCode);
setState(() {
inputCode = txtCode;
});
},
decoration: BoxLooseDecoration(
strokeColorBuilder: FixedColorBuilder(Color(0xFFEBEAEA)),
textStyle: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 18.sp,
color: Color(0xFF353535),
),
radius: Radius.circular(4.r)),
),
),
GestureDetector(
onTap: (){
setState(() {
if(inputCode.length == 6){
Navigator.of(context).popAndPushNamed('/router/platform_pay_code_success',arguments:{
"inputCode":inputCode,
"inputText":widget.arguments["inputText"]
});
}else{
SmartDialog.showToast("请输入6位数字密码", alignment: Alignment.center);
}
});
},
child: Container(
width: 163.w,
height: 46.h,
alignment: Alignment.center,
decoration: BoxDecoration(
color: inputCode.length == 6 ? Color(0xFF32A060):Color(0xFFBBE7CC),
borderRadius: BorderRadius.circular(23.r),
),
child: Text(
"下一步",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 18.sp,
color: Color(0xFFFFFFFF),
),
),
),
)
],
),
);
}
}

255
lib/setting/platform_pay_code_success.dart

@ -0,0 +1,255 @@
import 'package:dio/dio.dart';
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/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/pay_selected_dialog.dart';
import 'package:pin_input_text_field/pin_input_text_field.dart';
import 'package:shared_preferences/shared_preferences.dart';
class PlatformPayCodeSuccess extends StatefulWidget {
final Map<String, dynamic> arguments;
PlatformPayCodeSuccess({this.arguments});
@override
State<StatefulWidget> createState() {
return _PlatformPayCodeSuccess();
}
}
class _PlatformPayCodeSuccess extends State<PlatformPayCodeSuccess> {
ApiService apiService;
int codeType = 0;
UserInfo userInfo;
String againInputCode = "";
@override
void initState() {
super.initState();
}
///
modifyPayCode(String payCode,String code) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(),
context: context, token: value.getString("token"), showLoading: false);
}
BaseData baseData = await apiService.updatePayPwd({
"newPayPwd": payCode,
"smsCode": code,
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
codeType=4;
});
SmartDialog.showToast(baseData.data ?? false, alignment: Alignment.center);
} else {
setState(() {
codeType = 5;
});
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@override
Widget build(BuildContext context) {
return GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: Scaffold(
appBar: AppBar(
backgroundColor: Colors.white,
leading: GestureDetector(
child: Icon(
Icons.arrow_back_ios,
color: Colors.black,
),
onTap: () {
Navigator.of(context).pop();
}),
title: Text(
S.of(context).pingtaizhifumima,
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 17.sp,
color: Color(0xFF0D0D0D),
),
),
centerTitle: true,
elevation: 0.0,
),
body: Column(
children: [
if(codeType!=4 && codeType != 5)
againSettingCode(),
if(codeType == 4 || codeType == 5)
codeSuccess(),
],
),
));
}
///
Widget againSettingCode() {
return Container(
alignment: Alignment.center,
margin: EdgeInsets.only(top: 28.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"请再次输入6位数字密码",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 18.sp,
color: Color(0xFF353535),
),
),
SizedBox(
height: 12.h,
),
Text(
"将用于一心回乡APP下单时平台余额消费",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
color: Color(0xFFA29E9E),
),
),
Container(
margin: EdgeInsets.only(top: 24.h, bottom: 31.h),
padding: EdgeInsets.only(left: 48.w, right: 48.w),
height: 45.h,
child: PinInputTextField(
onChanged: (txtCode){
print(txtCode);
setState(() {
againInputCode = txtCode;
});
},
decoration: BoxLooseDecoration(
strokeColorBuilder: FixedColorBuilder(Color(0xFFEBEAEA)),
textStyle: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 18.sp,
color: Color(0xFF353535),
),
radius: Radius.circular(4.r)),
),
),
GestureDetector(
onTap: (){
setState(() {
if(againInputCode.length == 6 && (widget.arguments["inputCode"] == againInputCode)){
modifyPayCode(againInputCode,widget.arguments["inputText"]);
}else{
if(widget.arguments["inputCode"] != againInputCode){
SmartDialog.showToast("请输入与上次一致的6位数字密码", alignment: Alignment.center);
}else{
SmartDialog.showToast("请再次输入6位数字密码", alignment: Alignment.center);
}
}
});
},
child: Container(
width: 163.w,
height: 46.h,
alignment: Alignment.center,
decoration: BoxDecoration(
color: againInputCode.length == 6 ? Color(0xFF32A060):Color(0xFFBBE7CC),
borderRadius: BorderRadius.circular(23.r),
),
child: Text(
"确认",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 18.sp,
color: Color(0xFFFFFFFF),
),
),
),
)
],
),
);
}
///
Widget codeSuccess() {
return Container(
alignment: Alignment.center,
margin: EdgeInsets.only(top: 31.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
codeType == 5 ? "assets/image/lose.webp":"assets/image/icon_order_success.webp",
fit: BoxFit.cover,
width: 76,
height: 76,
),
SizedBox(
height: 16.h,
),
Text(
codeType == 5 ? "设置密码失败":"设置密码成功",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 21.sp,
color: Color(0xFF353535),
),
),
SizedBox(
height: 69.h,
),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Container(
width: double.infinity,
height: 46.h,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(4.r),
),
margin: EdgeInsets.symmetric(horizontal: 16.w),
child: Text(
S.of(context).queren,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 18.sp,
color: Color(0xFFFFFFFF),
),
),
),
)
],
),
);
}
///
assessShowBottomSheet() {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
isScrollControlled: true,
builder: (context) {
return PaySelectedDialog();
},
);
}
}

19
lib/setting/setting_page.dart

@ -47,6 +47,7 @@ class _SettingPage extends State<SettingPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.white, backgroundColor: Colors.white,
leading: GestureDetector( leading: GestureDetector(
@ -97,12 +98,12 @@ class _SettingPage extends State<SettingPage> {
SizedBox( SizedBox(
height: 16.h, height: 16.h,
), ),
// GestureDetector( GestureDetector(
// child: settingSingleItem(S.of(context).zhanghaoyuanquan), child: settingSingleItem(S.of(context).zhanghaoyuanquan),
// onTap: () { onTap: () {
// Navigator.of(context).pushNamed('/router/account_security_page'); Navigator.of(context).pushNamed('/router/account_security_page');
// }, },
// ), ),
SizedBox( SizedBox(
height: 16.h, height: 16.h,
), ),
@ -199,12 +200,16 @@ class _SettingPage extends State<SettingPage> {
child: Container( child: Container(
height: 54.h, height: 54.h,
alignment: Alignment.center, alignment: Alignment.center,
color: Color(0xFF32A060), margin:EdgeInsets.symmetric(horizontal: 16.w,vertical:25.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(45),
),
child: RoundButton( child: RoundButton(
text: S.of(context).tuichudenglu, text: S.of(context).tuichudenglu,
backgroup: Color(0xFF32A060), backgroup: Color(0xFF32A060),
textColor: Colors.white, textColor: Colors.white,
fontSize: 16.sp, fontSize: 16.sp,
radius:45,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
), ),
), ),

1
lib/store/shop__details_page.dart

@ -702,6 +702,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
), ),
], ],
), ),
SizedBox(height: 30.h,)
], ],
), ),
), ),

14
lib/store/store_order.dart

@ -207,7 +207,17 @@ class _StoreOrderPage extends State<StoreOrderPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return WillPopScope(
onWillPop: () async {
if (dialogShowing) {
debugPrint("ssssasdadsasdadasd");
SmartDialog.dismiss();
return false;
} else {
return true;
}
},
child:Container(
color: Colors.white, color: Colors.white,
child: Stack( child: Stack(
children: [ children: [
@ -540,7 +550,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
), ),
), ),
], ],
)); )));
} }
/// ///

79
lib/view_widget/receive_success.dart

@ -1,9 +1,9 @@
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/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class ReceiveSuccess extends StatelessWidget { class ReceiveSuccess extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -22,17 +22,28 @@ class ReceiveSuccess extends StatelessWidget {
margin: EdgeInsets.only(top: 40.h), margin: EdgeInsets.only(top: 40.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(8),), borderRadius: BorderRadius.circular(8),
width: 218.w, image: DecorationImage(
height: 250.h, fit: BoxFit.fill,
image: AssetImage("assets/image/pop_background.webp"),
),
),
width: 269.w,
height: 300.h,
padding: EdgeInsets.only(bottom: 13.h),
child: Column( child: Column(
children: [ children: [
SizedBox(height: 8.h,),
Image.asset(
"assets/image/icon_order_success.webp",
fit: BoxFit.cover,
width: 56,
height: 56,
),
Padding( Padding(
padding: EdgeInsets.only(top: 50.h, bottom: 19.h), padding: EdgeInsets.only(top:7.h, bottom: 19.h),
child: Text( child: Text(
S S.of(context).lingquchenggong,
.of(context)
.lingquchenggong,
style: TextStyle( style: TextStyle(
color: Color(0xff353535), color: Color(0xff353535),
fontSize: 16.sp, fontSize: 16.sp,
@ -47,6 +58,7 @@ class ReceiveSuccess extends StatelessWidget {
fontSize: 14.sp, fontSize: 14.sp,
), ),
), ),
SizedBox(height:8.h,),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@ -59,9 +71,7 @@ class ReceiveSuccess extends StatelessWidget {
), ),
GestureDetector( GestureDetector(
child: Text( child: Text(
"${S "${S.of(context).youhuiquan}",
.of(context)
.youhuiquan}",
style: TextStyle( style: TextStyle(
color: Color(0xFFFF7A1A), color: Color(0xFFFF7A1A),
fontSize: 14.sp, fontSize: 14.sp,
@ -69,13 +79,12 @@ class ReceiveSuccess extends StatelessWidget {
), ),
), ),
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/coupon_page'); Navigator.of(context)
.pushNamed('/router/coupon_page');
}, },
), ),
Text( Text(
S S.of(context).zhongchakan,
.of(context)
.zhongchakan,
style: TextStyle( style: TextStyle(
color: Color(0xff353535), color: Color(0xff353535),
fontSize: 14.sp, fontSize: 14.sp,
@ -83,42 +92,32 @@ class ReceiveSuccess extends StatelessWidget {
), ),
], ],
), ),
Padding( Spacer(),
padding: EdgeInsets.only(top: 30.h), RoundButton(
child: RoundButton( width: 229.w,
width: 130.w,
height: 34.h, height: 34.h,
text: S text: S.of(context).queren,
.of(context) textColor: Color(0xFF188451),
.queren, fontWeight: MyFontWeight.medium,
textColor: Colors.white, fontSize: 16.sp,
fontSize: 12.sp, radius: 17.w,
callback: () { callback: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
padding: EdgeInsets.only( backgroup: Color(0xFFFFFFFF),
top: 2.h,
bottom: 2.h,
left: 8.w,
right: 8.w,
), ),
backgroup: Color(0xff32A060),
),
)
], ],
), ),
), ),
Image.asset( // Image.asset(
"assets/image/icon_order_success.webp", // "assets/image/icon_order_success.webp",
fit: BoxFit.cover, // fit: BoxFit.cover,
width: 80, // width: 80,
height: 80, // height: 80,
), // ),
], ],
) )
], ],
); );
} }
} }

64
lib/view_widget/sign_in_widget.dart

@ -24,8 +24,8 @@ class _SignInWidget extends State<SignInWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: 222.w, width: 269.w,
height:320.h * AppUtils.textScale(context), height:370.h * AppUtils.textScale(context),
child: Stack( child: Stack(
children: [ children: [
Positioned( Positioned(
@ -39,12 +39,16 @@ class _SignInWidget extends State<SignInWidget> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(8.w), borderRadius: BorderRadius.circular(8.w),
image: DecorationImage(
fit: BoxFit.fill,
image: AssetImage("assets/image/pop_background.webp"),
), ),
padding: EdgeInsets.only(top:20.h), ),
// padding: EdgeInsets.only(top:8.h),
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 10.h), padding: EdgeInsets.symmetric(vertical: 13.h),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Image.asset( Image.asset(
@ -52,61 +56,41 @@ class _SignInWidget extends State<SignInWidget> {
width: 80, width: 80,
height: 80, height: 80,
), ),
Text( Padding(padding:EdgeInsets.only(top:8.h,bottom:12.h),
child: Text(
S.of(context).qiandaowancheng, S.of(context).qiandaowancheng,
style: TextStyle( style: TextStyle(
color: Color(0xFF353535), color: Color(0xFF353535),
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
), ),
), ),),
Text( Padding(padding:EdgeInsets.only(bottom:12.h),
child: Text(
S.of(context).ninyilianxuqiandaotian(widget.day), S.of(context).ninyilianxuqiandaotian(widget.day),
style: TextStyle( style: TextStyle(
color: Color(0xFF353535), color: Color(0xFF353535),
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
), ),
), ),),
Row( Expanded(child: Text(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/icon_gold_coin.webp",
width: 16,
height: 16,
),
SizedBox(
width: 4.h,
),
Text(
S.of(context).jiajifen(widget.integral), S.of(context).jiajifen(widget.integral),
style: TextStyle( style: TextStyle(
color: Color(0xFFEE9905), color: Color(0xFFFF7A1A),
fontSize: 14.sp, fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
), ),
), )),
],
),
// Text(
// S.of(context).jiajifen(widget.integral),
// style: TextStyle(
// color: Color(0xFFFF7A1A),
// fontSize: 14.sp,
// fontWeight: MyFontWeight.semi_bold,
// ),
// ),
RoundButton( RoundButton(
text: S.of(context).queren, text: S.of(context).queren,
textColor: Colors.white, textColor: Color(0xFF188451),
width: 130.w, width:220.w,
padding: EdgeInsets.symmetric(vertical: 6.h), padding: EdgeInsets.symmetric(vertical:8.h),
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
backgroup: Color(0xFF32A060), backgroup: Color(0xFFFFFFFF),
radius: 4.w, radius: 17.w,
callback: () { callback: () {
SmartDialog.dismiss(); SmartDialog.dismiss();
}, },

3
pubspec.yaml

@ -3,7 +3,7 @@ description: 一心回乡.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 2.0.25+13 version: 2.0.26+14
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"
@ -111,6 +111,7 @@ flutter:
- assets/image/2x/ - assets/image/2x/
- assets/image/3x/ - assets/image/3x/
- assets/map_style/ - assets/map_style/
- asstes/area_code/
- assets/riv/ - assets/riv/
- assets/svg/ - assets/svg/
# - assets/fonts/ # - assets/fonts/

Loading…
Cancel
Save