Browse Source

订单详情更改;

平台余额更改;
社群列表更改;
订单优惠券选择更改;
社群评论列表点击事件更改;
remove_uniapp
w-R 3 years ago
parent
commit
dccf1f73dc
  1. BIN
      assets/image/2x/order_kf.webp
  2. BIN
      assets/image/3x/order_kf.webp
  3. BIN
      assets/image/order_kf.webp
  4. 39
      lib/community/community_child_page.dart
  5. 7
      lib/mine/personal_page.dart
  6. 14
      lib/order/order_detail_page.dart
  7. 2
      lib/order/order_view/order_address.dart
  8. 4
      lib/retrofit/min_api.g.dart
  9. 2
      lib/retrofit/retrofit_api.g.dart
  10. 40
      lib/settlement/settlement.dart
  11. 5
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  12. 2
      lib/settlement/settlement_view/coupon.dart
  13. 6
      lib/settlement/settlement_view/pay_method.dart
  14. 5
      lib/settlement/settlement_view/settlement_order_commodity.dart
  15. 3
      lib/store/store_order.dart
  16. 1
      lib/store/store_view/shop_goods.dart
  17. 1
      lib/view_widget/tips_dialog.dart
  18. 39
      lib/web/web_view/comment_list.dart

BIN
assets/image/2x/order_kf.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
assets/image/3x/order_kf.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
assets/image/order_kf.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

39
lib/community/community_child_page.dart

@ -59,6 +59,7 @@ class CommunityChildPageState extends State<CommunityChildPage> with AutomaticKe
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token"),
showLoading: false
); );
} }
if(isLoadMore){ if(isLoadMore){
@ -146,9 +147,9 @@ class CommunityChildPageState extends State<CommunityChildPage> with AutomaticKe
userId: userId, userId: userId,
isList: true, isList: true,
exitFull: () { exitFull: () {
setState(() { // setState(() {
onRefresh(); // onRefresh();
}); // });
}, },
), ),
onTap: () { onTap: () {
@ -159,10 +160,11 @@ class CommunityChildPageState extends State<CommunityChildPage> with AutomaticKe
"userId": userId, "userId": userId,
}, },
).then((value) { ).then((value) {
onRefresh(); queryDetails(articles[position].id);
setState(() {}); // onRefresh();
// setState(() {});
}); });
setState(() {}); // setState(() {});
}, },
); );
}, },
@ -173,6 +175,31 @@ class CommunityChildPageState extends State<CommunityChildPage> with AutomaticKe
); );
} }
///
queryDetails(id) async {
SharedPreferences value = await SharedPreferences.getInstance();
if (apiService == null)
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
BaseData<Article> 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 @override
bool get wantKeepAlive => true; bool get wantKeepAlive => true;
} }

7
lib/mine/personal_page.dart

@ -59,7 +59,8 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, token: value.getString('token')), context: context, token: value.getString('token'),
showLoading: true),
_onRefresh(), _onRefresh(),
}); });
} }
@ -147,6 +148,10 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
refreshController.loadNoData(); refreshController.loadNoData();
} }
} }
else{
refreshController.refreshFailed();
refreshController.loadFailed();
}
} }
/// ///

14
lib/order/order_detail_page.dart

@ -40,7 +40,6 @@ class _OrderDetailPage extends State<OrderDetailPage> {
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
showLoading: true,
context: context, context: context,
token: value.getString("token"), token: value.getString("token"),
); );
@ -67,7 +66,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
); );
minService = MinApiService( minService = MinApiService(
Dio(), Dio(),
showLoading:true, // showLoading:true,
context: context, context: context,
token: minToken, token: minToken,
tenant: tenant, tenant: tenant,
@ -85,6 +84,15 @@ class _OrderDetailPage extends State<OrderDetailPage> {
int refundStatus = 0; int refundStatus = 0;
queryDetails() async { queryDetails() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: true
);
}
BaseData<OrderInfo> baseData = await apiService BaseData<OrderInfo> baseData = await apiService
.orderDetail(widget.arguments["id"]) .orderDetail(widget.arguments["id"])
.catchError((error) {}); .catchError((error) {});
@ -214,7 +222,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
payResult(BaseData baseData) { payResult(BaseData baseData) {
queryDetails(); queryDetails();
SmartDialog.showToast("订单支付成功"); SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center);
} }
statusTitle() { statusTitle() {

2
lib/order/order_view/order_address.dart

@ -144,7 +144,7 @@ class _OrderAddress extends State<OrderAddress> {
} else if (widget.payStatus < 4) { } else if (widget.payStatus < 4) {
SmartDialog.show( SmartDialog.show(
widget: TextImageWidget( widget: TextImageWidget(
"assets/image/icon_empty.webp", "assets/image/order_kf.webp",
S.of(context).ruxutuikuanqingyumendianlianxi, S.of(context).ruxutuikuanqingyumendianlianxi,
"", "",
S.of(context).zhidianmendian, S.of(context).zhidianmendian,

4
lib/retrofit/min_api.g.dart

@ -100,7 +100,7 @@ class _MinApiService implements MinApiService {
data: _data); data: _data);
final value = BaseData<List<ShoppingCart>>.fromJson( final value = BaseData<List<ShoppingCart>>.fromJson(
_result.data, _result.data,
(json) => (json as List<dynamic>) (json) => json==null?null:(json as List<dynamic>)
.map<ShoppingCart>( .map<ShoppingCart>(
(i) => ShoppingCart.fromJson(i as Map<String, dynamic>)) (i) => ShoppingCart.fromJson(i as Map<String, dynamic>))
.toList()); .toList());
@ -241,7 +241,7 @@ class _MinApiService implements MinApiService {
data: _data); data: _data);
final value = BaseData<MinOrderInfo>.fromJson( final value = BaseData<MinOrderInfo>.fromJson(
_result.data, _result.data,
(json) => MinOrderInfo.fromJson(json), (json) => json==null?null:MinOrderInfo.fromJson(json),
); );
return value; return value;
} }

2
lib/retrofit/retrofit_api.g.dart

@ -887,7 +887,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<OrderInfo>.fromJson( final value = BaseData<OrderInfo>.fromJson(
_result.data, _result.data,
(json) => OrderInfo.fromJson(json), (json) => json==null?null:OrderInfo.fromJson(json),
); );
return value; return value;
} }

40
lib/settlement/settlement.dart

@ -133,7 +133,6 @@ class _Settlement extends State<Settlement> {
"orderId": orderId, "orderId": orderId,
"promotionId": promotionId, "promotionId": promotionId,
"payChannel": payChannel "payChannel": payChannel
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
@ -152,7 +151,9 @@ class _Settlement extends State<Settlement> {
print("ididididididid: $id"); print("ididididididid: $id");
BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({ BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({
"id": id, "id": id,
}).catchError((error) {}); }).catchError((error) {
print(error);
});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
minOrderInfo = baseData.data; minOrderInfo = baseData.data;
@ -263,11 +264,13 @@ class _Settlement extends State<Settlement> {
placeOrderFirst.promotionInfoDTO.promotionId = placeOrderFirst.promotionInfoDTO.promotionId =
(promotion != null && tableId <= 0) (promotion != null && tableId <= 0)
? promotion.id ? promotion.id
: widget.arguments["pid"] ?? ""; : "";
// : widget.arguments["pid"] ?? "";
placeOrderFirst.promotionInfoDTO.couponId = placeOrderFirst.promotionInfoDTO.couponId =
(couponListBean != null && tableId <= 0) (couponListBean != null && tableId <= 0)
? couponListBean.id ? couponListBean.id
: widget.arguments["cid"] ?? ""; : "";
// : widget.arguments["cid"] ?? "";
placeOrderFirst.recMobile = placeOrderFirst.recMobile =
(mobile == null || mobile == "") ? mobile : storeInfo.headMobile; (mobile == null || mobile == "") ? mobile : storeInfo.headMobile;
placeOrderFirst.shoppingCartSkuItemList = settleOrderInfo.orderProductList; placeOrderFirst.shoppingCartSkuItemList = settleOrderInfo.orderProductList;
@ -294,23 +297,18 @@ class _Settlement extends State<Settlement> {
} else { } else {
/// ///
BaseData<dynamic> baseData; BaseData<dynamic> baseData;
if (parentId == "") {
//
if (placeOrder) { if (placeOrder) {
// //
querySettlement(); querySettlement();
} else { }
else{
if (parentId == "") {
// //
baseData = await minService baseData = await minService
.placeOrderFirst(placeOrderFirst.toJson()) .placeOrderFirst(placeOrderFirst.toJson())
.catchError((error) { .catchError((error) {
print("error: $error"); print("error: $error");
}); });
}
} else {
if (placeOrder) {
//
querySettlement();
} else { } else {
// //
baseData = await minService baseData = await minService
@ -470,8 +468,8 @@ class _Settlement extends State<Settlement> {
couponCart, couponCart,
activityCart, activityCart,
settleOrderInfo, settleOrderInfo,
coupons, payChannel == 4 ? null : coupons,
promotions, payChannel == 4 ? null : promotions,
couponCount(), couponCount(),
placeOrder, placeOrder,
remakers, remakers,
@ -564,9 +562,9 @@ class _Settlement extends State<Settlement> {
queryOrderInfo( queryOrderInfo(
address?.id, address?.id,
selectedBtn, selectedBtn,
couponListBean?.id, payChannel == 4 ? null : couponListBean?.id,
0, 0,
promotion?.id, payChannel == 4 ? null : promotion?.id,
payChannel payChannel
); );
} }
@ -601,10 +599,11 @@ class _Settlement extends State<Settlement> {
couponBean: couponListBean); couponBean: couponListBean);
}, },
); );
// if (couponBean != null) { if (couponBean != null) {
this.couponListBean = couponBean; this.couponListBean = couponBean;
coupons = couponListBean?.promotionName ?? ""; coupons = couponListBean?.promotionName ?? "";
promotions = ""; promotions = "";
this.promotion = null;
queryOrderInfo( queryOrderInfo(
address?.id, address?.id,
selectedBtn, selectedBtn,
@ -613,7 +612,7 @@ class _Settlement extends State<Settlement> {
null, null,
payChannel payChannel
); );
// } }
} }
/// ///
@ -626,10 +625,11 @@ class _Settlement extends State<Settlement> {
return SettlementActivity(settleOrderInfo, storeInfo); return SettlementActivity(settleOrderInfo, storeInfo);
}, },
); );
// if (pro != null) { if (pro != null) {
this.promotion = pro; this.promotion = pro;
promotions = promotion?.name ?? ""; promotions = promotion?.name ?? "";
coupons = ""; coupons = "";
this.couponListBean = null;
queryOrderInfo( queryOrderInfo(
address?.id, address?.id,
selectedBtn, selectedBtn,
@ -638,6 +638,6 @@ class _Settlement extends State<Settlement> {
promotion?.id, promotion?.id,
payChannel payChannel
); );
// } }
} }
} }

5
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -46,8 +46,8 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Color(0x0D000000), color: Color(0x0D000000),
offset: Offset(0, 3), offset: Offset(0, 1),
blurRadius: 14, blurRadius: 8,
spreadRadius: 0, spreadRadius: 0,
), ),
], ],
@ -58,6 +58,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
left: 16, left: 16,
right: 16, right: 16,
top: 15, top: 15,
bottom: 14
), ),
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 16, left: 16,

2
lib/settlement/settlement_view/coupon.dart

@ -167,7 +167,7 @@ class _CouponWidget extends State<CouponWidget> {
margin: EdgeInsets.only(right: 23.w), margin: EdgeInsets.only(right: 23.w),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pop(widget.selected ? null : widget.couponList); Navigator.of(context).pop(widget.couponList);
}, },
child: Image.asset( child: Image.asset(
widget.selected widget.selected

6
lib/settlement/settlement_view/pay_method.dart

@ -41,7 +41,7 @@ class _PayMethod extends State<PayMethod> {
left: 16.w, left: 16.w,
right: 16.w, right: 16.w,
top: 12.h, top: 12.h,
bottom: 4.h, bottom: 16.h,
), ),
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 16.w, left: 16.w,
@ -53,8 +53,8 @@ class _PayMethod extends State<PayMethod> {
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Color(0x000000).withAlpha(25), color: Color(0x000000).withAlpha(25),
offset: Offset(0, 1), offset: Offset(0, 2),
blurRadius: 12.0, blurRadius: 3,
), ),
], ],
color: Colors.white, color: Colors.white,

5
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -125,6 +125,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
width: 44, width: 44,
height: 44, height: 44,
fit: BoxFit.cover, fit: BoxFit.cover,
radius: BorderRadius.circular(4),
errorSrc: "assets/image/default_1.webp", errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp",
), ),
@ -259,8 +260,8 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withAlpha(25), color: Colors.black.withAlpha(25),
offset: Offset(0, 1), offset: Offset(0, 2),
blurRadius: 12, blurRadius: 3,
spreadRadius: 0, spreadRadius: 0,
) )
], ],

3
lib/store/store_order.dart

@ -753,6 +753,9 @@ class _StoreOrderPage extends State<StoreOrderPage>
setState(() {}); setState(() {});
}); });
} }
else {
SmartDialog.showToast(baseDate?.msg, alignment: Alignment.center);
}
} }
} }

1
lib/store/store_view/shop_goods.dart

@ -57,6 +57,7 @@ class _ShopGoods extends State<ShopGoods> {
: ""), : ""),
width: 70, width: 70,
height: 70, height: 70,
radius: BorderRadius.circular(4),
fit: BoxFit.cover, fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp", errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp",

1
lib/view_widget/tips_dialog.dart

@ -57,6 +57,7 @@ class _Tips extends State<Tips> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
SmartDialog.dismiss(); SmartDialog.dismiss();
widget.tips();
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,

39
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'; import 'package:shared_preferences/shared_preferences.dart';
class CommentList extends StatefulWidget { class CommentList extends StatefulWidget {
final bool isKeyBoardShow; final bool isKeyBoardShow;
final Function reply; final Function reply;
final Function delCommentTips; final Function delCommentTips;
@ -26,8 +25,9 @@ class CommentList extends StatefulWidget {
final int like; final int like;
final Function requestApiFinish; final Function requestApiFinish;
CommentList(Key key, this.like, this.relationalId,this.relationalType, CommentList(Key key, this.like, this.relationalId, this.relationalType,
this.isKeyBoardShow, this.reply, this.delCommentTips, this.fontSize,{this.requestApiFinish}) this.isKeyBoardShow, this.reply, this.delCommentTips, this.fontSize,
{this.requestApiFinish})
: super(key: key); : super(key: key);
@override @override
@ -59,7 +59,6 @@ class CommentListState extends State<CommentList> {
} else { } else {
element.likes += 1; element.likes += 1;
element.liked = true; element.liked = true;
} }
} }
}); });
@ -129,8 +128,8 @@ class CommentListState extends State<CommentList> {
color: Colors.white, color: Colors.white,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
showPressMenu(memberList[position].createUser, // showPressMenu(memberList[position].createUser,
memberList[position]); // memberList[position]);
}, },
child: commentItem(memberList[position]), child: commentItem(memberList[position]),
), ),
@ -198,8 +197,7 @@ class CommentListState extends State<CommentList> {
// //
queryMemberCommentList() async { queryMemberCommentList() async {
if(widget?.relationalId == null || widget.relationalId.isEmpty) if (widget?.relationalId == null || widget.relationalId.isEmpty) return;
return;
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (apiService == null) if (apiService == null)
apiService = ApiService( apiService = ApiService(
@ -263,15 +261,27 @@ class CommentListState extends State<CommentList> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
MImage( GestureDetector(
onTap: () {
setState(() {
Navigator.of(context)
.pushNamed('/router/personal_page', arguments: {
"memberId": memberList.createUser,
});
});
},
behavior: HitTestBehavior.opaque,
child: MImage(
memberList.userAvatarUrl ?? "", memberList.userAvatarUrl ?? "",
fit: BoxFit.cover, fit: BoxFit.cover,
isCircle: true, isCircle: true,
width: 40, width: 40,
height: 40, height: 40,
radius: BorderRadius.circular(4),
fadeSrc: "assets/image/default_user.webp", fadeSrc: "assets/image/default_user.webp",
errorSrc: "assets/image/default_user.webp", errorSrc: "assets/image/default_user.webp",
), ),
),
SizedBox( SizedBox(
width: 12.w, width: 12.w,
), ),
@ -366,6 +376,15 @@ class CommentListState extends State<CommentList> {
], ],
), ),
), ),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
showPressMenu(memberList.createUser,
memberList);
});
},
child:
Container( Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 68.w, left: 68.w,
@ -383,7 +402,7 @@ class CommentListState extends State<CommentList> {
), ),
), ),
), ),
), )),
SizedBox( SizedBox(
height: 12.h, height: 12.h,
), ),

Loading…
Cancel
Save