Browse Source

优化接口json=null或者""的情况下不显示报错文本问题;

下单页面优惠券ui优化调整;
优惠券页面,没有设置可用门店时新增提示,确定按钮适配更改,点击立即使用火锅店无需先扫码再跳转至店铺;
下单页面,微信支付失败ui处理;
dev
wurong 1 year ago
parent
commit
85be4f2f53
  1. 8
      lib/retrofit/min_api.g.dart
  2. 12
      lib/retrofit/retrofit_api.g.dart
  3. 6
      lib/settlement/settlement.dart
  4. 11
      lib/settlement/settlement_view/coupon.dart
  5. 2
      lib/union/union_list.dart
  6. 3
      lib/union/union_select_city.dart
  7. 57
      lib/view_widget/selector_store_dialog.dart

8
lib/retrofit/min_api.g.dart

@ -219,7 +219,7 @@ class _MinApiService implements MinApiService {
data: _data);
final value = BaseData<SettleOrderInfo>.fromJson(
_result.data,
(json) => json == "" ? null :SettleOrderInfo.fromJson(json),
(json) => ((json??"") == "")? null :SettleOrderInfo.fromJson(json),
);
return value;
}
@ -242,7 +242,7 @@ class _MinApiService implements MinApiService {
data: _data);
final value = BaseData<MinOrderInfo>.fromJson(
_result.data,
(json) => json==null?null:MinOrderInfo.fromJson(json),
(json) => ((json??"") == "")?null:MinOrderInfo.fromJson(json),
);
return value;
}
@ -331,7 +331,7 @@ class _MinApiService implements MinApiService {
data: _data);
final value = BaseData<WxPay>.fromJson(
_result.data,
(json) => json==null?null:(WxPay.fromJson(json)),
(json) => ((json??"") == "")?null:(WxPay.fromJson(json)),
);
return value;
}
@ -353,7 +353,7 @@ class _MinApiService implements MinApiService {
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json==null?null:(json as dynamic),
(json) => ((json??"") == "")?null:(json as dynamic),
);
return value;
}

12
lib/retrofit/retrofit_api.g.dart

@ -90,7 +90,7 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData.fromJson(
_result.data,
(json) => json == null ? null : json,
(json) => ((json??"") == "")? null : json,
);
return value;
}
@ -133,7 +133,7 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json == null ? null :json as dynamic,
(json) => ((json??"") == "")? null :json as dynamic,
);
return value;
}
@ -355,7 +355,7 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json == null ? null : json as dynamic,
(json) => ((json??"") == "")? null : json as dynamic,
);
return value;
}
@ -910,7 +910,7 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData<OrderInfo>.fromJson(
_result.data,
(json) => json == null ? null : OrderInfo.fromJson(json),
(json) => ((json??"") == "")? null : OrderInfo.fromJson(json),
);
return value;
}
@ -1312,7 +1312,7 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData<String>.fromJson(
_result.data,
(json) => json == null ? null : (json as String),
(json) => ((json??"") == "")? null : (json as String),
);
return value;
}
@ -1335,7 +1335,7 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData<bool>.fromJson(
_result.data,
(json) => (json ?? "") == "" ? null : (json as bool),
(json) => ((json??"") == "")? null : (json as bool),
);
return value;
}

6
lib/settlement/settlement.dart

@ -716,6 +716,12 @@ class _Settlement extends State<Settlement> {
timeStamp: int.tryParse(wxPay.timeStamp),
sign: wxPay.sign,
);
}else{
EasyLoading.dismiss();
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
Future.delayed(Duration(seconds:2), () {
toOrderDetails(placeOrderFirst.id);
});
}
} else {
BaseData baseData = await minService

11
lib/settlement/settlement_view/coupon.dart

@ -30,7 +30,7 @@ class _CouponWidget extends State<CouponWidget> {
@override
Widget build(BuildContext context) {
return Container(
height: 170,
height: 170.h,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
@ -102,12 +102,9 @@ class _CouponWidget extends State<CouponWidget> {
// flex: 1,
// ),
SizedBox(
width: 8,
),
couponListWidget(context),
SizedBox(
width: 5,
width: 8.w,
),
Expanded(child: couponListWidget(context)),
Expanded(
flex: 2,
child: Column(
@ -121,7 +118,7 @@ class _CouponWidget extends State<CouponWidget> {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
border: Border.all(
width: 1,
width: 1.w,
color: Color(0xFFFF7A1A),
style: BorderStyle.solid,
),

2
lib/union/union_list.dart

@ -104,7 +104,7 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
src: "assets/image/di_zhi.webp",
isShowBtn: false,
text: ((widget.city??"") != "武汉" && (widget.city??"") != "郑州" && (widget.city??"") != "北京") ?
" 当前回乡开放门店 仅包含 武汉/北京/郑州,您当前的位置无法获取,请手动更换城市" :"暂无店铺列表~",
" 当前海峡姐妹开放门店 仅包含 武汉/北京/郑州,您当前的位置无法获取,请手动更换城市" :"暂无店铺列表~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h,left:45.w,right:45.w),
)

3
lib/union/union_select_city.dart

@ -286,7 +286,8 @@ class _UnionSelectCity extends State<UnionSelectCity> {
},
):Padding(padding:EdgeInsets.only(top:12.h),
child: Text(
"抱歉,未找到相关位置,可尝试修改后重试",
// "抱歉,未找到相关位置,可尝试修改后重试",
"抱歉,该城市未开设门店,可尝试修改后重试",
style: TextStyle(
color: Color(0xFF4D4D4D),
fontWeight: MyFontWeight.medium,

57
lib/view_widget/selector_store_dialog.dart

@ -78,7 +78,7 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
size: 18,
),
),
SizedBox(width: 14),
SizedBox(width: 14.w),
],
),
Container(
@ -87,14 +87,15 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
color: Color(0xFFF2F2F2),
margin: EdgeInsets.only(bottom: 11.h),
),
Expanded(child:
Container(
Expanded(
child: Container(
height: (widget.stores != null
? (widget.stores.length > 4 ? 4 : widget.stores.length)
: 0) *
60.h,
child: (widget.stores == null || widget.stores.length == 0)
? Padding(padding:EdgeInsets.symmetric(horizontal: 16.w),
? Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Text(
"该优惠券未设置适用门店,适用情况请查看使用详情",
textAlign: TextAlign.center,
@ -103,7 +104,8 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
fontSize: 14.sp,
color: Colors.black,
),
),)
),
)
: ListView.builder(
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
@ -121,15 +123,19 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
)),
GestureDetector(
onTap: () {
if (widget.stores[selectIndex].posType.code ==
"NORMALSTORE") {
Scan.toScan(
context,
widget.stores[selectIndex].id,
widget.stores[selectIndex].tenantCode,
widget.stores[selectIndex].storeName,
);
} else {
if (widget.stores == null || widget.stores.length == 0) {
Navigator.of(context).pop();
}
// if (widget.stores[selectIndex].posType.code ==
// "NORMALSTORE") {
// Scan.toScan(
// context,
// widget.stores[selectIndex].id,
// widget.stores[selectIndex].tenantCode,
// widget.stores[selectIndex].storeName,
// );
// }
else {
Navigator.of(context).pushReplacementNamed(
'/router/store_order',
arguments: {
@ -148,7 +154,8 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
color: Color(0xFF32A060),
),
alignment: Alignment.center,
margin: EdgeInsets.only(top: 14.h,bottom: 30.h,left: 16.w,right: 16.w),
margin: EdgeInsets.only(
top: 14.h, bottom: 30.h, left: 16.w, right: 16.w),
child: Text(
S.of(context).queding,
style: TextStyle(
@ -227,8 +234,8 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
Widget storeItem(Store store, position) {
return Container(
height:52 ,
margin: EdgeInsets.only(bottom: 12,left: 14,right: 14),
height: 52.h,
margin: EdgeInsets.only(bottom: 12.h, left: 14.w, right: 14.w),
child: Stack(
alignment: Alignment.bottomRight,
children: [
@ -238,19 +245,27 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
decoration: BoxDecoration(
borderRadius: new BorderRadius.circular(6),
border: Border.all(
color: position == selectIndex ? Color(0xFF32A060):Color(0xFFF7F7F7),
color: position == selectIndex
? Color(0xFF32A060)
: Color(0xFFF7F7F7),
width: position == selectIndex ? 1 : 0,
),
color: position == selectIndex ? Color(0xFFF0FAF4) :Color(0xFFF7F7F7),
color: position == selectIndex
? Color(0xFFF0FAF4)
: Color(0xFFF7F7F7),
),
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 12,),
padding: EdgeInsets.only(
left: 12,
),
child: Text(
store.storeName,
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 15.sp,
color: position == selectIndex ?Color(0xFF32A060) : Color(0xFF0D0D0D),
color: position == selectIndex
? Color(0xFF32A060)
: Color(0xFF0D0D0D),
),
),
),

Loading…
Cancel
Save