w-R 3 years ago
parent
commit
a913520b6d
  1. 2
      lib/home/home_page.dart
  2. 8
      lib/home/home_view/top_selling_list.dart
  3. 2
      lib/home/points_mall_view/points_goods_view.dart
  4. 43
      lib/home/welfare_exchange.dart
  5. 13
      lib/home/welfare_page.dart
  6. 8
      lib/login/new_login_page.dart
  7. 2
      lib/mine/mine_page.dart
  8. 101
      lib/order/order_history_page.dart
  9. 2
      lib/retrofit/min_api.g.dart
  10. 40
      lib/settlement/settlement.dart
  11. 8
      lib/union/union_list.dart
  12. 12
      lib/union/union_page.dart
  13. 31
      lib/view_widget/activity_poster.dart

2
lib/home/home_page.dart

@ -513,7 +513,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
// });
// }),
//
///
DiscountZone(coupons),
///-

8
lib/home/home_view/top_selling_list.dart

@ -32,7 +32,7 @@ class _TopSellingList extends State<TopSellingList> {
@override
Widget build(BuildContext context) {
return Container(
height: 388.h,
height: 347.h,
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
@ -55,7 +55,7 @@ class _TopSellingList extends State<TopSellingList> {
color: Color(0x33000000),
alignment: Alignment.center,
child:Text(
"4月热推榜",
"${DateTime.now().month}月热推榜",
style: TextStyle(
fontWeight: MyFontWeight.medium,
color: Color(0xFFFFFFFF),
@ -64,11 +64,11 @@ class _TopSellingList extends State<TopSellingList> {
),
),
Container(
height: 330.h,
height: 285.h,
child: ListView.builder(
scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(),
itemCount:widget.homeRank.commodityList.length ?? 0,
itemCount:widget?.homeRank?.commodityList?.length ?? 0,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {

2
lib/home/points_mall_view/points_goods_view.dart

@ -52,7 +52,7 @@ class _PointGoods extends State<PointGoods> {
mainAxisSpacing: 16.w,
//Widget宽高比例 0.59
childAspectRatio:
200 / (305 / 2 + (305 / 2) * AppUtils.textScale(context)),
200 / (295.w / 2 + (295.h / 2) * AppUtils.textScale(context)),
),
itemBuilder: (context, index) {
return GestureDetector(

43
lib/home/welfare_exchange.dart

@ -218,23 +218,30 @@ class _WelfareExchange extends State<WelfareExchange> {
///
pointUser(),
///Tab
PointsGoodsTitle(
gooodsCategorys,
(orderType, orderDesc) {
this.orderType = orderType;
this.orderDesc = orderDesc;
setState(() {});
},
(index) {
categoryId = gooodsCategorys[index].id;
pageNum = 1;
setState(() {});
},
),
Container(
color: Colors.white,
child: Column(
children: [
///Tab
PointsGoodsTitle(
gooodsCategorys,
(orderType, orderDesc) {
this.orderType = orderType;
this.orderDesc = orderDesc;
setState(() {});
},
(index) {
categoryId = gooodsCategorys[index].id;
pageNum = 1;
setState(() {});
},
),
///,
pointList()
///,
pointList()
],
),
)
],
);
},
@ -484,8 +491,8 @@ class _WelfareExchange extends State<WelfareExchange> {
right: 12.w,
top: 10.h,
),padding: EdgeInsets.only(
bottom: 8,
left: 8
bottom: 8.h,
left: 8.w
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,

13
lib/home/welfare_page.dart

@ -41,8 +41,8 @@ class _WelfarePage extends State<WelfarePage> {
bool orderDesc = true;
int orderType = 1;
int type = 1;
// int index = 0;
int couponIndex = 0;
int swiperIndex = 0;
@override
void initState() {
@ -262,6 +262,10 @@ class _WelfarePage extends State<WelfarePage> {
AspectRatio(
aspectRatio: 1.10,
child: Swiper(
onIndexChanged: (it){
swiperIndex = it;
},
index: couponIndex,
viewportFraction: 0.9,
scale: 0.7,
key: UniqueKey(),
@ -582,9 +586,7 @@ class _WelfarePage extends State<WelfarePage> {
alignment: Alignment.centerRight,
child: InkWell(
onTap: () {
setState(() {
receiveCoupon(cop.id);
});
receiveCoupon(cop.id);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 14,vertical: 2),
@ -645,6 +647,7 @@ class _WelfarePage extends State<WelfarePage> {
}
receiveCoupon(couponId) async {
couponIndex = swiperIndex;
BaseData baseData = await apiService.receiveCoupon(couponId);
if (baseData != null && baseData.isSuccess) {
queryCoupon();

8
lib/login/new_login_page.dart

@ -150,11 +150,11 @@ class _NewLoginPage extends State<NewLoginPage> {
bool statusPhoneVisible = false;
Color statusPhoneTextColor = Color(0xFF353535);
Color statusPhoneLineColor = Color(0xFFF4F4F4);
Color statusPhoneLineColor = Color(0xFFE7E3E3);
bool statusCodeVisible = false;
Color statusCodeTextColor = Color(0xFF353535);
Color statusCodeLineColor = Color(0xFFF4F4F4);
Color statusCodeLineColor = Color(0xFFE7E3E3);
countdown() {
if (_timer != null && _timer.isActive) return;
@ -338,7 +338,7 @@ class _NewLoginPage extends State<NewLoginPage> {
children: [
Container(
width: double.infinity,
padding: EdgeInsets.only(left: 16.w,top:60+ MediaQuery.of(context).padding.top,right: 12.w),
padding: EdgeInsets.only(left: 16.w,top:60.h+ MediaQuery.of(context).padding.top,right: 12.w),
child:Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@ -438,7 +438,7 @@ class _NewLoginPage extends State<NewLoginPage> {
),
Container(
height:30.h,
width: MediaQuery.of(context).size.width - 80.h,
width: MediaQuery.of(context).size.width - 30.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,

2
lib/mine/mine_page.dart

@ -245,7 +245,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
),
),
Container(
margin: EdgeInsets.only(top: 285.h),
margin: EdgeInsets.only(top: 265.h),
child: Column(
children: [
///

101
lib/order/order_history_page.dart

@ -258,55 +258,58 @@ class _OrderHistoryList extends State<OrderHistoryList>
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(orderInfo != null && orderInfo.orderType == 0)
? Container()
: Container(
width: 19,
height: 21,
margin: EdgeInsets.only(left: 12.w, top: 12.h),
alignment: Alignment.center,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(2),
border: Border.all(
width: 1,
color: Color(0xFF32A060),
style: BorderStyle.solid,
)),
child: Text(
(orderInfo != null && orderInfo.orderType == 1)
? ""
: ((orderInfo != null && orderInfo.orderType == 2)
? ""
: ""),
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF32A060),
),
),
),
// (orderInfo != null && orderInfo.orderType == 0)
// ? Container()
// : Container(
// width: 19,
// height: 21,
// margin: EdgeInsets.only(left: 12.w, top: 12.h),
// alignment: Alignment.center,
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(2),
// border: Border.all(
// width: 1,
// color: Color(0xFF32A060),
// style: BorderStyle.solid,
// )),
// child: Text(
// (orderInfo != null && orderInfo.orderType == 1)
// ? ""
// : ((orderInfo != null && orderInfo.orderType == 2)
// ? ""
// : ""),
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: FontWeight.bold,
// color: Color(0xFF32A060),
// ),
// ),
// ),
// Container(
// width: 19,
// height: 21,
// margin: EdgeInsets.only(left: 7.w, top: 12.h),
// alignment: Alignment.center,
// decoration: BoxDecoration(
// color: Color(0xff32A060),
// borderRadius: BorderRadius.circular(2),
// ),
// child: Text(
// (orderInfo != null && orderInfo.isTakeOut == 0)
// ? ""
// : ((orderInfo != null && orderInfo.isTakeOut == 1)
// ? ""
// : ""),
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: FontWeight.bold,
// color: Colors.white,
// ),
// ),
// ),
Container(
width: 19,
height: 21,
margin: EdgeInsets.only(left: 7.w, top: 12.h),
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xff32A060),
borderRadius: BorderRadius.circular(2),
),
child: Text(
(orderInfo != null && orderInfo.isTakeOut == 0)
? ""
: ((orderInfo != null && orderInfo.isTakeOut == 1)
? ""
: ""),
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
margin: EdgeInsets.only(left: 5.w, top: 12.h),
),
Expanded(
child: Container(
@ -355,7 +358,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
],
),
Container(
margin: EdgeInsets.only(left: 37.w),
margin: EdgeInsets.only(left: 12.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,

2
lib/retrofit/min_api.g.dart

@ -308,7 +308,7 @@ class _MinApiService implements MinApiService {
data: _data);
final value = BaseData<DownOrder>.fromJson(
_result.data,
(json) => DownOrder.fromJson(json),
(json) => json==null?null:DownOrder.fromJson(json),
);
return value;
}

40
lib/settlement/settlement.dart

@ -124,7 +124,8 @@ class _Settlement extends State<Settlement> {
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel);
payChannel,
tableId);
} else if (coupons != null && coupons != "" && tableId <= 0) {
queryOrderInfo(
address != null ? address.id : null,
@ -136,7 +137,8 @@ class _Settlement extends State<Settlement> {
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel);
payChannel,
tableId);
} else
queryOrderInfo(
null,
@ -148,7 +150,8 @@ class _Settlement extends State<Settlement> {
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel);
payChannel,
tableId);
});
weChatResponseEventHandler.listen((event) async {
@ -159,7 +162,7 @@ class _Settlement extends State<Settlement> {
///
queryOrderInfo(addressId, isTake, memberCouponId, orderId, promotionId,
productSkuId, actProductId, actProductSkuId, buyNum, payChannel) async {
productSkuId, actProductId, actProductSkuId, buyNum, payChannel,tableId) async {
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({
"addressId": addressId,
"isTake": isTake,
@ -170,7 +173,8 @@ class _Settlement extends State<Settlement> {
"actProductId": actProductId,
"actProductSkuId": actProductSkuId,
"buyNum": buyNum,
"payChannel": payChannel
"payChannel": payChannel,
"tableId":tableId
}).catchError((error) {});
this.promotion = null;
promotions = "";
@ -209,7 +213,7 @@ class _Settlement extends State<Settlement> {
queryOrderDetails(id) async {
print("ididididididid: $id");
BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({
"id": widget.arguments["orderId"],
"id": widget.arguments["orderId"] ?? parentId,
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
@ -235,7 +239,8 @@ class _Settlement extends State<Settlement> {
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel);
payChannel,
tableId);
return;
}
BaseData<List<Address>> baseDate =
@ -289,7 +294,8 @@ class _Settlement extends State<Settlement> {
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel);
payChannel,
tableId);
}
}
@ -315,7 +321,8 @@ class _Settlement extends State<Settlement> {
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel);
payChannel,
tableId);
}
}
@ -461,7 +468,7 @@ class _Settlement extends State<Settlement> {
}
if (baseData != null && baseData.isSuccess) {
placeOrder = true;
this.downOrder = DownOrder.fromJson(baseData.data);
this.downOrder = baseData.data;
queryOrderDetails(
(parentId == null || parentId == "") ? baseData.data.id : parentId);
setState(() {});
@ -515,6 +522,7 @@ class _Settlement extends State<Settlement> {
print(error);
});
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast(baseData?.msg == "ok" ? "订单支付成功":"", alignment: Alignment.center);
toOrderDetails(placeOrderFirst.id);
} else {
SmartDialog.show(
@ -660,7 +668,8 @@ class _Settlement extends State<Settlement> {
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel);
payChannel,
tableId ?? 0);
}, queryAddress, storeInfo, address,
selectedAddress, pageType),
@ -805,7 +814,8 @@ class _Settlement extends State<Settlement> {
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel);
payChannel,
tableId);
}
mobileChange(String mobile) {
@ -853,7 +863,8 @@ class _Settlement extends State<Settlement> {
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel);
payChannel,
tableId);
// }
}
@ -882,7 +893,8 @@ class _Settlement extends State<Settlement> {
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel);
payChannel,
tableId);
}
// }
}

8
lib/union/union_list.dart

@ -33,6 +33,7 @@ class _UnionList extends State<UnionList> {
Widget build(BuildContext context) {
return Column(
children: [
buildSearchItem(),
Container(
height: MediaQuery.of(context).size.height -
103.h -
@ -221,7 +222,7 @@ class _UnionList extends State<UnionList> {
SizedBox(
height: 5.h,
),
Text(
Expanded(child: Text(
"${S.of(context).dizhi}:${store.address}",
maxLines: 2,
overflow: TextOverflow.ellipsis,
@ -230,7 +231,8 @@ class _UnionList extends State<UnionList> {
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
),)
],
)),
Container(
@ -274,7 +276,7 @@ class _UnionList extends State<UnionList> {
builder: (context) {
return AlertDialog(
content: Container(
width: MediaQuery.of(context).size.width - 84,
width: MediaQuery.of(context).size.width - 84.w,
height: 130.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,

12
lib/union/union_page.dart

@ -618,7 +618,7 @@ class UnionPageState extends State<UnionPage>
)
]),
width: double.infinity,
height: 228,
height: 228.h,
child: Stack(
children: [
Positioned(
@ -629,7 +629,7 @@ class UnionPageState extends State<UnionPage>
child: MImage(
store.facade,
width: double.infinity,
height: 140,
height: 140.h,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
@ -646,11 +646,11 @@ class UnionPageState extends State<UnionPage>
child: Container(),
),
Positioned(
bottom: 16,
left: 12,
bottom: 16.h,
left: 12.w,
right: 0,
child: Container(
height: 100,
height: 100.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@ -740,7 +740,7 @@ class UnionPageState extends State<UnionPage>
builder: (context) {
return AlertDialog(
content: Container(
width: MediaQuery.of(context).size.width - 84,
width: MediaQuery.of(context).size.width - 84.w,
height: 130.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,

31
lib/view_widget/activity_poster.dart

@ -4,6 +4,7 @@ import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:huixiang/retrofit/data/activity_pos.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'custom_image.dart';
@ -23,13 +24,15 @@ class _ActivityPoster extends State<ActivityPoster> {
Widget build(BuildContext context) {
return Container(
width: double.infinity,
height: 289,
height: 332.h,
alignment: Alignment.center,
margin: EdgeInsets.only(
left:37,
right:37,
left:27.w,
right:27.w,
),
child: Stack(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
onTap: (){
@ -44,28 +47,26 @@ class _ActivityPoster extends State<ActivityPoster> {
widget?.activityPos?.showImage ?? "",
width: double.infinity,
height: MediaQuery.of(context).size.height / 2,
fit: BoxFit.cover,
fit: BoxFit.fill,
radius: BorderRadius.all(Radius.circular(12)),
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),),
),
Container(
padding: EdgeInsets.only(top: 8,right: 8,bottom:8),
margin: EdgeInsets.only(top:35.h,right: 8.w,bottom:8.w),
child:GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
Navigator.of(context).pop();
},
child: Row(children: [
Spacer(),
Image.asset(
"assets/image/cancel.webp",
width: 24,
height: 24,
color: Colors.white,
)
],)
child: Image.asset(
"assets/image/yq_qx.webp",
width: 40,
height: 40,
fit: BoxFit.cover,
color: Colors.white,
)
) )
],
),

Loading…
Cancel
Save