Browse Source

1.新增更换手机号码绑定功能;(已完结)

2.在账号与安全板块,新增更换手机号码绑定选项;
3.订单详情页,新增:打包费显示;
4.结算信息页,打包堂食点击事件更改;
5.结算页,打包字段更改;(packagingFe——totalPackagingFe);
6.个人信息页,手机号码更改;
new_revision_app
wurong 2 years ago
parent
commit
2cb7314688
  1. 3
      lib/main.dart
  2. 2
      lib/mine/user_info_page.dart
  3. 12
      lib/order/order_view/order_commodity.dart
  4. 5
      lib/retrofit/data/order_info.dart
  5. 6
      lib/retrofit/data/settleOrderInfo.dart
  6. 44
      lib/retrofit/retrofit_api.g.dart
  7. 46
      lib/setting/account_security_page.dart
  8. 802
      lib/setting/binding_phone_page.dart
  9. 21
      lib/settlement/settlement.dart
  10. 4
      lib/settlement/settlement_view/settlement_order_commodity.dart

3
lib/main.dart

@ -47,6 +47,7 @@ import 'package:huixiang/qr/qr_share.dart';
import 'package:huixiang/retrofit/data/examine_instance.dart';
import 'package:huixiang/setting/about_page.dart';
import 'package:huixiang/setting/account_security_page.dart';
import 'package:huixiang/setting/binding_phone_page.dart';
import 'package:huixiang/setting/help_feedback_page.dart';
import 'package:huixiang/setting/logout_ing.dart';
import 'package:huixiang/setting/logout_page.dart';
@ -434,4 +435,6 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
StoreHtml(arguments:arguments),
'/router/login_store_select': (context, {arguments}) =>
LoginStoreSelect(arguments:arguments),
'/router/binding_phone_page': (context, {arguments}) =>
BindingPhonePage(arguments:arguments),
};

2
lib/mine/user_info_page.dart

@ -44,7 +44,7 @@ class _UserInfoPage extends State<UserInfoPage> {
SharedPreferences.getInstance().then((value) => {
print(value.getString('user')),
user = UserInfo.fromJson(jsonDecode(value.getString('user'))),
mobile = value.getString('mobile'),
mobile = user.phone,
modifyInfo["nickname"] = user.nickname,
modifyInfo["signature"] = user.signature,
modifyInfo["birth"] = user.birth,

12
lib/order/order_view/order_commodity.dart

@ -87,6 +87,18 @@ class _OrderCommodity extends State<OrderCommodity> {
);
}
if (widget.orderInfo.isTakeOut == 3) {
//
widgets.add(
discountItem(
Color(0xFFFF7A1A),
"打包费",
"",
"+ ${widget.orderInfo?.totalPackagingFee ?? "0"}",
),
);
}
if (widget.orderInfo.benefitDiscountAmount != "0.00") {
//
widgets.add(

5
lib/retrofit/data/order_info.dart

@ -122,6 +122,7 @@ class OrderInfo {
String activityDiscountPrice;
String vipDiscountPrice;
String totalDiscountPrice;
String totalPackagingFee;
int orderSource;
StoreVO storeVO;
OrderDetail orderDetail;
@ -186,6 +187,7 @@ class OrderInfo {
String activityDiscountPrice,
String vipDiscountPrice,
String totalDiscountPrice,
String totalPackagingFee,
int orderSource,
StoreVO storeVO,
OrderDetail orderDetail,
@ -248,6 +250,7 @@ class OrderInfo {
this.activityDiscountPrice = activityDiscountPrice;
this.vipDiscountPrice = vipDiscountPrice;
this.totalDiscountPrice = totalDiscountPrice;
this.totalPackagingFee = totalPackagingFee;
this.orderSource = orderSource;
this.storeVO = storeVO;
this.orderDetail = orderDetail;
@ -315,6 +318,7 @@ class OrderInfo {
this.activityDiscountPrice = json["activityDiscountPrice"];
this.vipDiscountPrice = json["vipDiscountPrice"];
this.totalDiscountPrice = json["totalDiscountPrice"];
this.totalPackagingFee =json["totalPackagingFee"];
this.orderSource = json["orderSource"];
this.storeVO =
json["storeVO"] != null ? StoreVO.fromJson(json["storeVO"]) : null;
@ -391,6 +395,7 @@ class OrderInfo {
map["activityDiscountPrice"] = this.activityDiscountPrice;
map["vipDiscountPrice"] = this.vipDiscountPrice;
map["totalDiscountPrice"] = this.totalDiscountPrice;
map["totalPackagingFee"] = this.totalPackagingFee;
map["orderSource"] = this.orderSource;
if (this.storeVO != null) {
map["storeVO"] = this.storeVO.toJson();

6
lib/retrofit/data/settleOrderInfo.dart

@ -25,7 +25,7 @@ class SettleOrderInfo {
String vipDiscountAmount;
String totalDiscountAmount;
String discountType;
String packagingFee;
String totalPackagingFee;
static SettleOrderInfo fromJson(Map<String, dynamic> map) {
@ -59,7 +59,7 @@ class SettleOrderInfo {
settleOrderInfoBean.vipDiscountAmount = map['vipDiscountAmount'];
settleOrderInfoBean.totalDiscountAmount = map['totalDiscountAmount'];
settleOrderInfoBean.discountType = map['discountType'];
settleOrderInfoBean.packagingFee = map['packagingFee'];
settleOrderInfoBean.totalPackagingFee = map['totalPackagingFee'];
return settleOrderInfoBean;
}
@ -86,7 +86,7 @@ class SettleOrderInfo {
"vipDiscountAmount":vipDiscountAmount,
"totalDiscountAmount": totalDiscountAmount,
"discountType":discountType,
"packagingFee" : packagingFee,
"packagingFee" : totalPackagingFee,
};

44
lib/retrofit/retrofit_api.g.dart

@ -2153,4 +2153,48 @@ class _ApiService implements ApiService {
.toList());
return value;
}
@override
Future<BaseData<dynamic>> changePhone(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>>('/auth/changePhone',
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;
}
@override
Future<BaseData<dynamic>> changeSendVerify(mobile) async {
ArgumentError.checkNotNull(mobile, 'mobile');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/auth/sendVerify//$mobile',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
}

46
lib/setting/account_security_page.dart

@ -27,7 +27,8 @@ class _AccountSecurityPage extends State<AccountSecurityPage> {
super.initState();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
context: context, token: value.getString("token")),
context: context, token: value.getString("token"),
showLoading: true),
queryUser(),
});
@ -83,6 +84,49 @@ class _AccountSecurityPage extends State<AccountSecurityPage> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/binding_phone_page',arguments:{"userInfo":userInfo}).then((value) => {
queryUser(),
});
},
child: Container(
padding: EdgeInsets.all(15),
margin: EdgeInsets.only(top: 14.h),
decoration: BoxDecoration(
color: Colors.white,
),
child: Row(
children: [
Expanded(
child: Text(
"绑定手机",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 15.sp,
color: Color(0xFF353535),
),
),
flex: 1,
),
Text(
"+86 ${userInfo?.phone ?? ""}",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF4D4D4D)),
),
SizedBox(
width:8.w,
),
Icon(
Icons.keyboard_arrow_right,
size: 20,
),
],
),
),
),
GestureDetector(
onTap: () {
Navigator.of(context).pushReplacementNamed('/router/platform_code_page',arguments:{"userInfo":userInfo});

802
lib/setting/binding_phone_page.dart

@ -0,0 +1,802 @@
import 'dart:async';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.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:shared_preferences/shared_preferences.dart';
import '../view_widget/border_text.dart';
class BindingPhonePage extends StatefulWidget {
final Map<String, dynamic> arguments;
BindingPhonePage({this.arguments});
@override
State<StatefulWidget> createState() {
return _BindingPhonePage();
}
}
class _BindingPhonePage extends State<BindingPhonePage> {
ApiService apiService;
String area = "+86";
var _controllerPhone = TextEditingController();
var _controllerNewPhone = TextEditingController();
var _controllerCode = TextEditingController();
var _controllerNewCode = TextEditingController();
Color statusCodeTextColor = Color(0xFF353535);
var verifyStatus = 0;
var mobileStatus = 0;
var btnText = "获取验证码";
var _sendCodeStatus = 0;
Timer _timer;
UserInfo userInfo;
int phoneState = 1;
@override
void initState() {
super.initState();
userInfo = widget.arguments['userInfo'];
}
@override
void dispose() {
if (_timer != null && _timer.isActive) _timer.cancel();
super.dispose();
}
///
modifyPhoneCode(int state) async {
var mobile = _controllerPhone.text;
if (mobile == ""&& phoneState == 1) {
SmartDialog.showToast(S.of(context).qingshurushoujihao, alignment: Alignment.center);
return;
}
var newMobile = _controllerNewPhone.text;
if (newMobile == ""&& phoneState == 2) {
SmartDialog.showToast(S.of(context).qingshurushoujihao, alignment: Alignment.center);
return;
}
var code = _controllerCode.text;
if (code == "" && phoneState == 1) {
SmartDialog.showToast(S.of(context).qingshuruyanzhengma, alignment: Alignment.center);
return;
}
var newCode = _controllerNewCode.text;
if (newCode == "" && phoneState == 2) {
SmartDialog.showToast(S.of(context).qingshuruyanzhengma, alignment: Alignment.center);
return;
}
if (code.length != 6 && phoneState==1) {
SmartDialog.showToast(S.of(context).code_error, alignment: Alignment.center);
return;
}
if (newCode.length != 6 && phoneState == 2) {
SmartDialog.showToast(S.of(context).code_error, alignment: Alignment.center);
return;
}
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(),
context: context, token: value.getString("token"), showLoading: false);
}
BaseData baseData = await apiService.changePhone({
"areaCode": area,
"capcha": phoneState == 1 ? code:newCode,
"mobile1": mobile,
"mobile2": newMobile,
"state": state,
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
if(state == 1){
_timer.cancel();
btnText = "获取验证码";
_sendCodeStatus = 0;
phoneState = 2;
}else if(state == 2){
phoneState = 3;}
setState(() {});
} else {
setState(() {});
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
///
verificationCode() async {
var mobile = _controllerPhone.text;
if (mobile == "" && phoneState == 1) {
SmartDialog.showToast(S.of(context).qingshurushoujihao, alignment: Alignment.center);
return;
}
var newMobile = _controllerNewPhone.text;
if (newMobile == "" && phoneState == 2) {
SmartDialog.showToast(S.of(context).qingshurushoujihao, alignment: Alignment.center);
return;
}
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(),
context: context, token: value.getString("token"), showLoading: false);
}
BaseData baseData = await apiService.changeSendVerify(mobile).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
_sendCodeStatus = 1;
countdown();
SmartDialog.showToast(baseData.data ?? false, alignment: Alignment.center);
} else {
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) {
btnText = "重新发送";
_sendCodeStatus = 0;
_timer.cancel();
} else {
btnText = "${countdown}s";
}
setState(() {});
});
}
bool isPhone(mobile) {
RegExp exp = RegExp(
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);
}
@override
Widget build(BuildContext context) {
return GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
backgroundColor: Colors.white,
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(
margin: EdgeInsets.only(top: 12.h),
padding: EdgeInsets.symmetric(horizontal:16.w),
color: Colors.white,
width: double.infinity,
child:Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
topSequence(),
if(phoneState != 3)
Align(alignment: Alignment.center,
child: Text(
phoneState == 1 ?"现手机号验证":"修改成新号码",
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 18.sp,
fontWeight: MyFontWeight.bold,
),)),
if(phoneState == 2)
Padding(padding:EdgeInsets.only(top: 14.h),
child: Text(
"当前手机号为${area + " ${userInfo?.phone ?? ""}"} ",
style: TextStyle(
color: Color(0xFFA29E9E),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),)),
if(phoneState == 1)
inputPhone(),
if(phoneState == 2)
newInputPhone(),
if(phoneState == 3)
bindingSuccess(),
],
),
),
));
}
///
Widget topSequence(){
return Container(
margin:EdgeInsets.only(top:35.h,bottom: 31.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
decoration:BoxDecoration(
borderRadius: BorderRadius.circular(100.w),
color: Color(0xFF34995E),
),
padding: EdgeInsets.symmetric(horizontal:8.5.w,vertical:5.h),
child: Text(
"1",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),),
),
Container(
height: 1.h,
width: 74.w,
color: Color(0xFF34995E),
margin: EdgeInsets.symmetric(horizontal:8.w),
),
Container(
decoration:BoxDecoration(
borderRadius: BorderRadius.circular(100.w),
color: phoneState == 1?Color(0xFFB7D3C3) : Color(0xFF34995E),
),
padding: EdgeInsets.symmetric(horizontal:8.5.w,vertical:5.h),
child: Text(
"2",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),),
),
Container(
height: 1.h,
width: 74.w,
color: Color(0xFF34995E),
margin: EdgeInsets.symmetric(horizontal:8.w),
),
Container(
decoration:BoxDecoration(
borderRadius: BorderRadius.circular(100.w),
color: (phoneState !=3)?Color(0xFFB7D3C3) : Color(0xFF34995E),
),
padding: EdgeInsets.symmetric(horizontal:8.5.w,vertical:5.h),
child: Text(
"3",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),),
)
],
),
);
}
///
Widget inputPhone(){
return Container(
margin:EdgeInsets.only(top:phoneState == 1?15.h:12.h,bottom:21.h,),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(padding:EdgeInsets.only(bottom: 10.h),
child: Text(
"手机号",
style: TextStyle(
color: Color(0xFF181818),
fontSize: 16.sp,
fontWeight: MyFontWeight.bold,
),)),
Row(
mainAxisAlignment: MainAxisAlignment.start,
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(
height: 30.h,
width: MediaQuery.of(context).size.width - 100.w,
margin: EdgeInsets.only(bottom:10.h),
child: TextField(
style: TextStyle(
height: 1.h,
fontSize: 16.sp,
color: Color(0xFF353535),
),
onChanged: (value) {
if (value != null && value.isNotEmpty) {
if (isPhone(value)) {
mobileStatus = 1;
} else {
mobileStatus = 2;
}
} else {
mobileStatus = 0;
}
setState(() {});
},
controller: _controllerPhone,
keyboardType: TextInputType.phone,
decoration: InputDecoration(
errorBorder: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
hintText: "",
// contentPadding: EdgeInsets.only(top: 12, bottom: 12, left: 12),
hintStyle: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
),
textInputAction: TextInputAction.next,
inputFormatters: [
LengthLimitingTextInputFormatter(11)
],
cursorColor: Colors.grey,
maxLines: 1,
),
),
],
),
Container(
height: 1.h,
width: MediaQuery.of(context).size.width - 80.h,
color: _controllerPhone.text == ""
? Color(0xFFE7E3E3)
: Color(0xFF32A060),
),
SizedBox(
height: 30.h,
),
Padding(padding:EdgeInsets.only(bottom: 10.h),
child: Text(
S.of(context).yanzhengma,
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 16.sp,
color: Color(0xFF181818),
),
)),
Container(
height: 30.h,
width: MediaQuery.of(context).size.width - 30.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: TextField(
style: TextStyle(
height: 1.h,
fontSize: 16.sp,
color: statusCodeTextColor,
),
onChanged: (value) {
if (value != null &&
value.isNotEmpty) {
if (value.length == 6) {
verifyStatus = 1;
} else {
verifyStatus = 2;
}
} else {
verifyStatus = 0;
}
setState(() {});
},
controller: _controllerCode,
keyboardType: TextInputType.phone,
decoration: InputDecoration(
errorBorder: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
hintText: "",
hintStyle: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
),
textInputAction: TextInputAction.next,
inputFormatters: [
LengthLimitingTextInputFormatter(6)
],
cursorColor: Colors.grey,
maxLines: 1,
),
flex: 4,
),
Expanded(
child: Container(
alignment: Alignment.bottomCenter,
child: InkWell(
onTap: (){
verificationCode();
},
child: BorderText(
text: btnText,
borderColor: Colors.transparent,
borderWidth: 1.w,
radius: 2,
padding: EdgeInsets.only(
left: 6.w,
right: 6.w,
),
fontSize: 14.sp,
fontWeight: MyFontWeight.bold,
textColor: _sendCodeStatus == 0
? Color(0xFF32A060)
: Color(0xFFA29E9E),
),
),
),
flex: 2,
)
],
),
),
Container(
height: 1.h,
width: MediaQuery.of(context).size.width - 10.h,
color: _controllerNewCode.text == ""
? Color(0xFFE7E3E3)
: Color(0xFF32A060),
margin: EdgeInsets.only(top: 10.h),
),
SizedBox(
height: 54.h,
),
Align(alignment: Alignment.center,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
modifyPhoneCode(1);
},
child: Container(
decoration:BoxDecoration(
borderRadius: BorderRadius.circular(23),
color: Color(0xFF34995E),
),
padding: EdgeInsets.symmetric(vertical: 12.h,horizontal:65.w),
child: Text(
S.of(context).queding,
style: TextStyle(
color: Color(0xFFFFFFFF),
fontSize: 16.sp,
fontWeight: MyFontWeight.regular,
),),
),
),),
],
),
);
}
///
Widget newInputPhone(){
return Container(
margin:EdgeInsets.only(top:15.h,bottom:21.h,),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
///
Padding(padding:EdgeInsets.only(bottom: 10.h),
child: Text(
"手机号",
style: TextStyle(
color: Color(0xFF181818),
fontSize: 16.sp,
fontWeight: MyFontWeight.bold,
),)),
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(
height: 30.h,
width: MediaQuery.of(context).size.width - 100.w,
margin: EdgeInsets.only(bottom:10.h),
child: TextField(
style: TextStyle(
height: 1.h,
fontSize: 16.sp,
color: Color(0xFF353535),
),
onChanged: (value) {
if (value != null && value.isNotEmpty) {
if (isPhone(value)) {
mobileStatus = 1;
} else {
mobileStatus = 2;
}
} else {
mobileStatus = 0;
}
setState(() {});
},
controller: _controllerNewPhone,
keyboardType: TextInputType.phone,
decoration: InputDecoration(
errorBorder: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
hintText: "",
// contentPadding: EdgeInsets.only(top: 12, bottom: 12, left: 12),
hintStyle: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
),
textInputAction: TextInputAction.next,
inputFormatters: [
LengthLimitingTextInputFormatter(11)
],
cursorColor: Colors.grey,
maxLines: 1,
),
),
],
),
Container(
height: 1.h,
width: MediaQuery.of(context).size.width - 10.h,
color: _controllerNewPhone.text == ""
? Color(0xFFE7E3E3)
: Color(0xFF32A060),
),
SizedBox(
height: 30.h,
),
///
Padding(padding:EdgeInsets.only(bottom: 10.h),
child: Text(
S.of(context).yanzhengma,
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 16.sp,
color: Color(0xFF181818),
),
)),
Container(
height: 30.h,
width: MediaQuery.of(context).size.width - 30.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: TextField(
style: TextStyle(
height: 1.h,
fontSize: 16.sp,
color: statusCodeTextColor,
),
onChanged: (value) {
if (value != null &&
value.isNotEmpty) {
if (value.length == 6) {
verifyStatus = 1;
} else {
verifyStatus = 2;
}
} else {
verifyStatus = 0;
}
setState(() {});
},
controller: _controllerNewCode,
keyboardType: TextInputType.phone,
decoration: InputDecoration(
errorBorder: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
hintText: "",
hintStyle: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
),
textInputAction: TextInputAction.next,
inputFormatters: [
LengthLimitingTextInputFormatter(6)
],
cursorColor: Colors.grey,
maxLines: 1,
),
flex: 4,
),
Expanded(
child: Container(
alignment: Alignment.bottomCenter,
child: InkWell(
onTap:(){
verificationCode();
},
child: BorderText(
text: btnText,
borderColor: Colors.transparent,
borderWidth: 1.w,
radius: 2,
padding: EdgeInsets.only(
left: 6.w,
right: 6.w,
),
fontSize: 14.sp,
fontWeight: MyFontWeight.bold,
textColor: _sendCodeStatus == 0
? Color(0xFF32A060)
: Color(0xFFA29E9E),
),
),
),
flex: 2,
)
],
),
),
Container(
height: 1.h,
width: MediaQuery.of(context).size.width - 10.h,
color: _controllerNewCode.text == ""
? Color(0xFFE7E3E3)
: Color(0xFF32A060),
margin: EdgeInsets.only(top: 10.h),
),
SizedBox(
height: 54.h,
),
Align(alignment: Alignment.center,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
modifyPhoneCode(2);
},
child: Container(
decoration:BoxDecoration(
borderRadius: BorderRadius.circular(23),
color: Color(0xFF34995E),
),
padding: EdgeInsets.symmetric(vertical: 12.h,horizontal:65.w),
child: Text(
"下一步",
style: TextStyle(
color: Color(0xFFFFFFFF),
fontSize: 16.sp,
fontWeight: MyFontWeight.regular,
),),
),
),),
],
),
);
}
Widget bindingSuccess(){
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: 18.sp,
color: Color(0xFF353535),
),
),
SizedBox(
height: 99.h,
),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Container(
decoration:BoxDecoration(
borderRadius: BorderRadius.circular(23),
color: Color(0xFF34995E),
),
padding: EdgeInsets.symmetric(vertical: 14.h,horizontal:65.w),
child: Text(
S.of(context).queren,
style: TextStyle(
color: Color(0xFFFFFFFF),
fontSize: 16.sp,
fontWeight: MyFontWeight.regular,
),),
),
)
],
),
);
}
}

21
lib/settlement/settlement.dart

@ -1095,6 +1095,23 @@ class _Settlement extends State<Settlement> {
onTap: () {
setState(() {
diningStatus = 4;
queryOrderInfo(
address?.id,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
? diningStatus
: selectedBtn,
0,
0,
productId ?? 0,
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
"AUTO",
// useVipPriceSelect,
// useBenefitSelect,
count1,
payChannel,
tableId);
});
},
child: Container(
@ -1162,7 +1179,9 @@ class _Settlement extends State<Settlement> {
diningStatus = 3;
queryOrderInfo(
address?.id,
3,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
? diningStatus
: selectedBtn,
0,
0,
productId ?? 0,

4
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -127,7 +127,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
"",
(widget.minOrderInfo != null)
? "+ ${widget.minOrderInfo?.totalPackagingFee ?? "0"}"
: "+ ${widget.settleOrderInfo?.packagingFee ?? "0"}",
: "+ ${widget.settleOrderInfo?.totalPackagingFee ?? "0"}",
),
);
}
@ -135,7 +135,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
if (widget.useVipPriceSelect &&
widget.settleOrderInfo.memberVO.isVip &&
(widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)) &&
(widget?.settleOrderInfo?.discountType == "VIP" && widget?.settleOrderInfo?.vipDiscountAmount != "0")) {
(widget?.settleOrderInfo?.discountType == "VIP" )) {
widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠",
(widget.minOrderInfo != null && widget.minOrderInfo.orderProductVOList != null) ? (widget.minOrderInfo?.discountAmount ?? ""):(widget?.settleOrderInfo?.vipDiscountAmount ?? "")));
}

Loading…
Cancel
Save