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), DiscountZone(coupons),
///- ///-

8
lib/home/home_view/top_selling_list.dart

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

2
lib/home/points_mall_view/points_goods_view.dart

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

43
lib/home/welfare_exchange.dart

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

13
lib/home/welfare_page.dart

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

8
lib/login/new_login_page.dart

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

2
lib/mine/mine_page.dart

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

101
lib/order/order_history_page.dart

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

2
lib/retrofit/min_api.g.dart

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

40
lib/settlement/settlement.dart

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

8
lib/union/union_list.dart

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

12
lib/union/union_page.dart

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

31
lib/view_widget/activity_poster.dart

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

Loading…
Cancel
Save