diff --git a/assets/image/2x/order_kf.webp b/assets/image/2x/order_kf.webp new file mode 100644 index 00000000..4b742e17 Binary files /dev/null and b/assets/image/2x/order_kf.webp differ diff --git a/assets/image/3x/order_kf.webp b/assets/image/3x/order_kf.webp new file mode 100644 index 00000000..a05cad0a Binary files /dev/null and b/assets/image/3x/order_kf.webp differ diff --git a/assets/image/order_kf.webp b/assets/image/order_kf.webp new file mode 100644 index 00000000..d29feb96 Binary files /dev/null and b/assets/image/order_kf.webp differ diff --git a/lib/community/community_child_page.dart b/lib/community/community_child_page.dart index 7eee6f2b..4a7db4d9 100644 --- a/lib/community/community_child_page.dart +++ b/lib/community/community_child_page.dart @@ -59,6 +59,7 @@ class CommunityChildPageState extends State with AutomaticKe Dio(), context: context, token: value.getString("token"), + showLoading: false ); } if(isLoadMore){ @@ -146,9 +147,9 @@ class CommunityChildPageState extends State with AutomaticKe userId: userId, isList: true, exitFull: () { - setState(() { - onRefresh(); - }); + // setState(() { + // onRefresh(); + // }); }, ), onTap: () { @@ -159,10 +160,11 @@ class CommunityChildPageState extends State with AutomaticKe "userId": userId, }, ).then((value) { - onRefresh(); - setState(() {}); + queryDetails(articles[position].id); + // onRefresh(); + // setState(() {}); }); - setState(() {}); + // setState(() {}); }, ); }, @@ -173,6 +175,31 @@ class CommunityChildPageState extends State with AutomaticKe ); } + ///详情接口 + queryDetails(id) async { + SharedPreferences value = await SharedPreferences.getInstance(); + if (apiService == null) + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + BaseData
baseData = await apiService.informationInfo(id) + .catchError((onError) { + debugPrint(onError.toString()); + }); + if (baseData != null && baseData.isSuccess) { + this.articles.forEach((element) { + if(element.id == id){ + setState(() { + element.likes = baseData.data.likes; + element.viewers = baseData.data.viewers; + }); + } + }); + } + } + @override bool get wantKeepAlive => true; } diff --git a/lib/mine/personal_page.dart b/lib/mine/personal_page.dart index 78348136..8084782d 100644 --- a/lib/mine/personal_page.dart +++ b/lib/mine/personal_page.dart @@ -59,7 +59,8 @@ class _PersonalPage extends State with WidgetsBindingObserver { WidgetsBinding.instance.addObserver(this); SharedPreferences.getInstance().then((value) => { apiService = ApiService(Dio(), - context: context, token: value.getString('token')), + context: context, token: value.getString('token'), + showLoading: true), _onRefresh(), }); } @@ -147,6 +148,10 @@ class _PersonalPage extends State with WidgetsBindingObserver { refreshController.loadNoData(); } } + else{ + refreshController.refreshFailed(); + refreshController.loadFailed(); + } } ///去编辑个人资料 diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index beebb515..b6d6d933 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -40,7 +40,6 @@ class _OrderDetailPage extends State { SharedPreferences.getInstance().then((value) { apiService = ApiService( Dio(), - showLoading: true, context: context, token: value.getString("token"), ); @@ -67,7 +66,7 @@ class _OrderDetailPage extends State { ); minService = MinApiService( Dio(), - showLoading:true, + // showLoading:true, context: context, token: minToken, tenant: tenant, @@ -85,6 +84,15 @@ class _OrderDetailPage extends State { int refundStatus = 0; queryDetails() async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + showLoading: true + ); + } BaseData baseData = await apiService .orderDetail(widget.arguments["id"]) .catchError((error) {}); @@ -214,7 +222,7 @@ class _OrderDetailPage extends State { payResult(BaseData baseData) { queryDetails(); - SmartDialog.showToast("订单支付成功"); + SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center); } statusTitle() { diff --git a/lib/order/order_view/order_address.dart b/lib/order/order_view/order_address.dart index 1be9afcd..37990ce6 100644 --- a/lib/order/order_view/order_address.dart +++ b/lib/order/order_view/order_address.dart @@ -144,7 +144,7 @@ class _OrderAddress extends State { } else if (widget.payStatus < 4) { SmartDialog.show( widget: TextImageWidget( - "assets/image/icon_empty.webp", + "assets/image/order_kf.webp", S.of(context).ruxutuikuanqingyumendianlianxi, "", S.of(context).zhidianmendian, diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index 0e6494d9..f94274f0 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -100,7 +100,7 @@ class _MinApiService implements MinApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) + (json) => json==null?null:(json as List) .map( (i) => ShoppingCart.fromJson(i as Map)) .toList()); @@ -241,7 +241,7 @@ class _MinApiService implements MinApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => MinOrderInfo.fromJson(json), + (json) => json==null?null:MinOrderInfo.fromJson(json), ); return value; } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 68536369..8d41ae6c 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -887,7 +887,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => OrderInfo.fromJson(json), + (json) => json==null?null:OrderInfo.fromJson(json), ); return value; } diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 7b27e760..6e0626cf 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -133,7 +133,6 @@ class _Settlement extends State { "orderId": orderId, "promotionId": promotionId, "payChannel": payChannel - }).catchError((error) {}); if (baseData != null && baseData.isSuccess) { setState(() { @@ -152,7 +151,9 @@ class _Settlement extends State { print("ididididididid: $id"); BaseData baseData = await minService.getOrderDetails({ "id": id, - }).catchError((error) {}); + }).catchError((error) { + print(error); + }); if (baseData != null && baseData.isSuccess) { setState(() { minOrderInfo = baseData.data; @@ -263,11 +264,13 @@ class _Settlement extends State { placeOrderFirst.promotionInfoDTO.promotionId = (promotion != null && tableId <= 0) ? promotion.id - : widget.arguments["pid"] ?? ""; + : ""; + // : widget.arguments["pid"] ?? ""; placeOrderFirst.promotionInfoDTO.couponId = (couponListBean != null && tableId <= 0) ? couponListBean.id - : widget.arguments["cid"] ?? ""; + : ""; + // : widget.arguments["cid"] ?? ""; placeOrderFirst.recMobile = (mobile == null || mobile == "") ? mobile : storeInfo.headMobile; placeOrderFirst.shoppingCartSkuItemList = settleOrderInfo.orderProductList; @@ -294,23 +297,18 @@ class _Settlement extends State { } else { ///火锅店下单, 等待结算 BaseData baseData; - if (parentId == "") { - // 下单 - if (placeOrder) { - // 结算 - querySettlement(); - } else { + if (placeOrder) { + // 结算 + querySettlement(); + } + else{ + if (parentId == "") { // 下单 baseData = await minService .placeOrderFirst(placeOrderFirst.toJson()) .catchError((error) { print("error: $error"); }); - } - } else { - if (placeOrder) { - // 结算 - querySettlement(); } else { //加菜 baseData = await minService @@ -470,8 +468,8 @@ class _Settlement extends State { couponCart, activityCart, settleOrderInfo, - coupons, - promotions, + payChannel == 4 ? null : coupons, + payChannel == 4 ? null : promotions, couponCount(), placeOrder, remakers, @@ -564,9 +562,9 @@ class _Settlement extends State { queryOrderInfo( address?.id, selectedBtn, - couponListBean?.id, + payChannel == 4 ? null : couponListBean?.id, 0, - promotion?.id, + payChannel == 4 ? null : promotion?.id, payChannel ); } @@ -601,10 +599,11 @@ class _Settlement extends State { couponBean: couponListBean); }, ); - // if (couponBean != null) { + if (couponBean != null) { this.couponListBean = couponBean; coupons = couponListBean?.promotionName ?? ""; promotions = ""; + this.promotion = null; queryOrderInfo( address?.id, selectedBtn, @@ -613,7 +612,7 @@ class _Settlement extends State { null, payChannel ); - // } + } } ///活动弹窗 @@ -626,10 +625,11 @@ class _Settlement extends State { return SettlementActivity(settleOrderInfo, storeInfo); }, ); - // if (pro != null) { + if (pro != null) { this.promotion = pro; promotions = promotion?.name ?? ""; coupons = ""; + this.couponListBean = null; queryOrderInfo( address?.id, selectedBtn, @@ -638,6 +638,6 @@ class _Settlement extends State { promotion?.id, payChannel ); - // } + } } } diff --git a/lib/settlement/settlement_view/activity_coupon_remarks.dart b/lib/settlement/settlement_view/activity_coupon_remarks.dart index 1d112d39..345b7649 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -46,8 +46,8 @@ class _ActivityCouponRemarks extends State { boxShadow: [ BoxShadow( color: Color(0x0D000000), - offset: Offset(0, 3), - blurRadius: 14, + offset: Offset(0, 1), + blurRadius: 8, spreadRadius: 0, ), ], @@ -58,6 +58,7 @@ class _ActivityCouponRemarks extends State { left: 16, right: 16, top: 15, + bottom: 14 ), padding: EdgeInsets.only( left: 16, diff --git a/lib/settlement/settlement_view/coupon.dart b/lib/settlement/settlement_view/coupon.dart index c920d3e3..f8998f46 100644 --- a/lib/settlement/settlement_view/coupon.dart +++ b/lib/settlement/settlement_view/coupon.dart @@ -167,7 +167,7 @@ class _CouponWidget extends State { margin: EdgeInsets.only(right: 23.w), child: GestureDetector( onTap: () { - Navigator.of(context).pop(widget.selected ? null : widget.couponList); + Navigator.of(context).pop(widget.couponList); }, child: Image.asset( widget.selected diff --git a/lib/settlement/settlement_view/pay_method.dart b/lib/settlement/settlement_view/pay_method.dart index 13b874f7..4770543d 100644 --- a/lib/settlement/settlement_view/pay_method.dart +++ b/lib/settlement/settlement_view/pay_method.dart @@ -41,7 +41,7 @@ class _PayMethod extends State { left: 16.w, right: 16.w, top: 12.h, - bottom: 4.h, + bottom: 16.h, ), padding: EdgeInsets.only( left: 16.w, @@ -53,8 +53,8 @@ class _PayMethod extends State { boxShadow: [ BoxShadow( color: Color(0x000000).withAlpha(25), - offset: Offset(0, 1), - blurRadius: 12.0, + offset: Offset(0, 2), + blurRadius: 3, ), ], color: Colors.white, diff --git a/lib/settlement/settlement_view/settlement_order_commodity.dart b/lib/settlement/settlement_view/settlement_order_commodity.dart index 97933282..d5c05e1e 100644 --- a/lib/settlement/settlement_view/settlement_order_commodity.dart +++ b/lib/settlement/settlement_view/settlement_order_commodity.dart @@ -125,6 +125,7 @@ class _SettlementOrderCommodity extends State { width: 44, height: 44, fit: BoxFit.cover, + radius: BorderRadius.circular(4), errorSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp", ), @@ -259,8 +260,8 @@ class _SettlementOrderCommodity extends State { boxShadow: [ BoxShadow( color: Colors.black.withAlpha(25), - offset: Offset(0, 1), - blurRadius: 12, + offset: Offset(0, 2), + blurRadius: 3, spreadRadius: 0, ) ], diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 57f22673..9523df4c 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -753,6 +753,9 @@ class _StoreOrderPage extends State setState(() {}); }); } + else { + SmartDialog.showToast(baseDate?.msg, alignment: Alignment.center); + } } } diff --git a/lib/store/store_view/shop_goods.dart b/lib/store/store_view/shop_goods.dart index 682e941d..f0213ce0 100644 --- a/lib/store/store_view/shop_goods.dart +++ b/lib/store/store_view/shop_goods.dart @@ -57,6 +57,7 @@ class _ShopGoods extends State { : ""), width: 70, height: 70, + radius: BorderRadius.circular(4), fit: BoxFit.cover, errorSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp", diff --git a/lib/view_widget/tips_dialog.dart b/lib/view_widget/tips_dialog.dart index 0c2df306..35bda7fd 100644 --- a/lib/view_widget/tips_dialog.dart +++ b/lib/view_widget/tips_dialog.dart @@ -57,6 +57,7 @@ class _Tips extends State { child: InkWell( onTap: () { SmartDialog.dismiss(); + widget.tips(); }, child: Container( width: double.infinity, diff --git a/lib/web/web_view/comment_list.dart b/lib/web/web_view/comment_list.dart index 0a9d3130..bcf2cc41 100644 --- a/lib/web/web_view/comment_list.dart +++ b/lib/web/web_view/comment_list.dart @@ -16,7 +16,6 @@ import 'package:like_button/like_button.dart'; import 'package:shared_preferences/shared_preferences.dart'; class CommentList extends StatefulWidget { - final bool isKeyBoardShow; final Function reply; final Function delCommentTips; @@ -26,8 +25,9 @@ class CommentList extends StatefulWidget { final int like; final Function requestApiFinish; - CommentList(Key key, this.like, this.relationalId,this.relationalType, - this.isKeyBoardShow, this.reply, this.delCommentTips, this.fontSize,{this.requestApiFinish}) + CommentList(Key key, this.like, this.relationalId, this.relationalType, + this.isKeyBoardShow, this.reply, this.delCommentTips, this.fontSize, + {this.requestApiFinish}) : super(key: key); @override @@ -59,7 +59,6 @@ class CommentListState extends State { } else { element.likes += 1; element.liked = true; - } } }); @@ -129,8 +128,8 @@ class CommentListState extends State { color: Colors.white, child: InkWell( onTap: () { - showPressMenu(memberList[position].createUser, - memberList[position]); + // showPressMenu(memberList[position].createUser, + // memberList[position]); }, child: commentItem(memberList[position]), ), @@ -198,8 +197,7 @@ class CommentListState extends State { //评论列表 queryMemberCommentList() async { - if(widget?.relationalId == null || widget.relationalId.isEmpty) - return; + if (widget?.relationalId == null || widget.relationalId.isEmpty) return; SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); if (apiService == null) apiService = ApiService( @@ -263,14 +261,26 @@ class CommentListState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - MImage( - memberList.userAvatarUrl ?? "", - fit: BoxFit.cover, - isCircle: true, - width: 40, - height: 40, - fadeSrc: "assets/image/default_user.webp", - errorSrc: "assets/image/default_user.webp", + GestureDetector( + onTap: () { + setState(() { + Navigator.of(context) + .pushNamed('/router/personal_page', arguments: { + "memberId": memberList.createUser, + }); + }); + }, + behavior: HitTestBehavior.opaque, + child: MImage( + memberList.userAvatarUrl ?? "", + fit: BoxFit.cover, + isCircle: true, + width: 40, + height: 40, + radius: BorderRadius.circular(4), + fadeSrc: "assets/image/default_user.webp", + errorSrc: "assets/image/default_user.webp", + ), ), SizedBox( width: 12.w, @@ -366,24 +376,33 @@ class CommentListState extends State { ], ), ), - Container( - padding: EdgeInsets.only( - left: 68.w, - right: 16.w, - top: 16.h, - bottom: 16.h, - ), - child: Align( - alignment: Alignment.centerLeft, - child: Text( - memberList.content, - style: TextStyle( - fontSize: widget.fontSize + 2, - color: Color(0xff1A1A1A), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + showPressMenu(memberList.createUser, + memberList); + }); + }, + child: + Container( + padding: EdgeInsets.only( + left: 68.w, + right: 16.w, + top: 16.h, + bottom: 16.h, ), - ), - ), - ), + child: Align( + alignment: Alignment.centerLeft, + child: Text( + memberList.content, + style: TextStyle( + fontSize: widget.fontSize + 2, + color: Color(0xff1A1A1A), + ), + ), + ), + )), SizedBox( height: 12.h, ),