Browse Source

个人信息,去掉我的年龄改性别;

清除购物车接口,请求时增加storeId;
new_revision_app
wurong 2 years ago
parent
commit
6853a6928f
  1. 152
      lib/mine/user_info_page.dart
  2. 4
      lib/retrofit/min_api.dart
  3. 5
      lib/retrofit/min_api.g.dart
  4. 2
      lib/store/shop_details_page.dart
  5. 2
      lib/store/store_order.dart

152
lib/mine/user_info_page.dart

@ -61,6 +61,7 @@ class _UserInfoPage extends State<UserInfoPage> {
String mobile = ""; String mobile = "";
String locale = "zh"; String locale = "zh";
UserInfo user; UserInfo user;
int selectSexIndex = 0;
refresh() async { refresh() async {
setState(() {}); setState(() {});
@ -155,11 +156,13 @@ class _UserInfoPage extends State<UserInfoPage> {
height: 1, height: 1,
color: Color(0xFFF2F2F2), color: Color(0xFFF2F2F2),
), ),
avatarItem( InkWell(
5, onTap: () {
(age == null || age == "") showSexSelect(selectSexIndex);
? S.of(context).wanshanshengrixinxi_nl },
: S.of(context).sui(age)), child: avatarItem(
5, (modifyInfo["sex"] != null && modifyInfo["sex"] != "") ? modifyInfo["sex"]:"还未选择性别"),
),
], ],
), ),
); );
@ -192,9 +195,10 @@ class _UserInfoPage extends State<UserInfoPage> {
"个性签名", "个性签名",
S.current.wodeshengri, S.current.wodeshengri,
S.current.shoujihao, S.current.shoujihao,
S.current.wodenianling, "性别",
]; ];
///
showDateSelector() async { showDateSelector() async {
DateTime dateTime = await showModalBottomSheet( DateTime dateTime = await showModalBottomSheet(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
@ -211,6 +215,142 @@ class _UserInfoPage extends State<UserInfoPage> {
} }
} }
///
showSexSelect(index) {
showModalBottomSheet(
context: context,
builder: (context) {
return StatefulBuilder(builder: (
context,
state,
) {
return Container(
width: double.infinity,
height: 170.h,
padding: EdgeInsets.only(top: 12.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topRight: Radius.circular(6),
topLeft: Radius.circular(6),
)),
child: Column(
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 14.w),
child: Row(
children: [
Expanded(
child:GestureDetector(
behavior:HitTestBehavior.opaque,
onTap: (){
Navigator.of(context).pop();
},
child: Text(
S.of(context).quxiao,
style: TextStyle(
color: Colors.black,
fontSize: 16.sp,
fontWeight: MyFontWeight.black,
),
),
)),
GestureDetector(
behavior:HitTestBehavior.opaque,
onTap: (){
state((){
modifyInfo["sex"] = (selectSexIndex == 0)?"":"";
modifyInfos();
Navigator.of(context).pop();
});},
child: Text(
S.of(context).queding,
style: TextStyle(
color: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: MyFontWeight.black,
),
),
)
],
),
),
Container(
margin: EdgeInsets.only(top: 12.h, bottom: 13.h),
height: 1.h,
color: Color(0xFFF2F2F2)),
GestureDetector(
behavior:HitTestBehavior.opaque,
onTap: () {
state((){
selectSexIndex = 0;
});
},
child: Container(
width: double.infinity,
alignment: Alignment.center,
padding:
EdgeInsets.only(top:12.h, bottom:12.h, left: 12.w),
margin: EdgeInsets.symmetric(horizontal: 14.w),
decoration: BoxDecoration(
borderRadius:BorderRadius.circular(6),
border: Border.all(
color: selectSexIndex == 0 ? Color(0xFF32A060):Color(0xFFF7F7F7),
width: selectSexIndex == 0 ? 1 :0,
),
color: selectSexIndex == 0 ? Color(0xFFF0FAF4) :Color(0xFFF7F7F7),
),
child: Text(
"",
style: TextStyle(
color: selectSexIndex == 0? Color(0xFF32A060):Color(0xFF4D4D4D),
fontSize: 18.sp,
fontWeight: MyFontWeight.regular,
),
),
),
),
SizedBox(
height: 13.h,
),
GestureDetector(
behavior:HitTestBehavior.opaque,
onTap: () {
state((){
selectSexIndex = 1;
});
},
child: Container(
width: double.infinity,
alignment: Alignment.center,
padding:
EdgeInsets.only(top: 12.h, bottom: 12.h, left: 12.w),
margin: EdgeInsets.symmetric(horizontal: 14.w),
decoration: BoxDecoration(
borderRadius:BorderRadius.circular(6),
border: Border.all(
color: selectSexIndex == 1 ? Color(0xFF32A060):Color(0xFFF7F7F7),
width: selectSexIndex == 1 ? 1 :0,
),
color: selectSexIndex == 1 ? Color(0xFFF0FAF4) :Color(0xFFF7F7F7),
),
child: Text(
"",
style: TextStyle(
color: selectSexIndex == 1 ?Color(0xFF32A060):Color(0xFF4D4D4D),
fontSize: 18.sp,
fontWeight: MyFontWeight.regular,
),
)),
)
],
),
);
});
},
);
}
/// ///
showImagePicker() { showImagePicker() {
showCupertinoModalPopup( showCupertinoModalPopup(

4
lib/retrofit/min_api.dart

@ -150,8 +150,8 @@ abstract class MinApiService {
Future<BaseData<List<ShoppingCart>>> getShoppingCart(@Query("tableId") int tableId); Future<BaseData<List<ShoppingCart>>> getShoppingCart(@Query("tableId") int tableId);
/// ///
@GET("shoppingcart/delCart") @GET("shoppingcart/delCart?storeId={storeId}")
Future<BaseData<bool>> clearShoppingCart(); Future<BaseData<bool>> clearShoppingCart(@Query("storeId") String storeId);
/// ///
@PUT("shoppingcart") @PUT("shoppingcart")

5
lib/retrofit/min_api.g.dart

@ -131,12 +131,13 @@ class _MinApiService implements MinApiService {
} }
@override @override
Future<BaseData<bool>> clearShoppingCart() async { Future<BaseData<bool>> clearShoppingCart(storeId) async {
ArgumentError.checkNotNull(storeId, 'storeId');
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>>(
'shoppingcart/delCart', 'shoppingcart/delCart?storeId=$storeId',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'GET', method: 'GET',

2
lib/store/shop_details_page.dart

@ -302,7 +302,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
/// ///
clearShopCar() async { clearShopCar() async {
BaseData<bool> baseData = await minService.clearShoppingCart(); BaseData<bool> baseData = await minService.clearShoppingCart(storeId);
if (baseData.isSuccess) { if (baseData.isSuccess) {
shopCarGoods = null; shopCarGoods = null;
setState(() {}); setState(() {});

2
lib/store/store_order.dart

@ -727,7 +727,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
/// ///
clearShopCar() async { clearShopCar() async {
BaseData<bool> baseData = await minService.clearShoppingCart(); BaseData<bool> baseData = await minService.clearShoppingCart(storeId);
if (baseData.isSuccess) { if (baseData.isSuccess) {
shopCarGoods = null; shopCarGoods = null;
setState(() {}); setState(() {});

Loading…
Cancel
Save