Browse Source

优惠选择优化;

后台停留7分钟后重启应用页面更改;
商品详情优化,增加正在加载;
部分优化;
new_revision_app
wurong 2 years ago
parent
commit
60844c080f
  1. 17
      lib/home/start_page.dart
  2. 2
      lib/main.dart
  3. 2
      lib/main_page.dart
  4. 2
      lib/settlement/settlement.dart
  5. 4
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  6. 339
      lib/store/shop_details_page.dart

17
lib/home/start_page.dart

@ -1,15 +1,10 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/border_text.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class StartPage extends StatefulWidget {
final bool isFirst;
StartPage(this.isFirst);
// final bool isFirst;
//
// StartPage(this.isFirst);
@override
State<StatefulWidget> createState() {
return _StartPage();
@ -36,8 +31,10 @@ class _StartPage extends State<StartPage> {
@override
void initState() {
super.initState();
Future.delayed(Duration(seconds:3), () {
Navigator.of(context).popAndPushNamed((widget.isFirst ?? true) ? '/router/guide_Page' : '/router/new_login_page');
Future.delayed(Duration(seconds:2), () {
// Navigator.of(context).popAndPushNamed((widget.isFirst ?? true) ?
// '/router/guide_Page' : '/router/new_login_page');
Navigator.of(context).popAndPushNamed('/router/main_page');
});
}
}

2
lib/main.dart

@ -93,6 +93,7 @@ import 'community/report/report_success.dart';
import 'home/guide_page.dart';
import 'home/help_farmers/help_farmers_page.dart';
import 'home/home_view/activity_list.dart';
import 'home/start_page.dart';
import 'home/welfare_exchange.dart';
import 'home/welfare_page.dart';
import 'login/login_store_select.dart';
@ -352,6 +353,7 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/about_page': (context, {arguments}) => AboutPage(),
'/router/qr_share': (context, {arguments}) => QrSharePage(),
'/router/main_page': (context, {arguments}) => MainPage(arguments: arguments),
'/router/start_page': (context, {arguments}) => StartPage(),
'/router/test_page': (context, {arguments}) => TestPage(),
'/router/communityFollow': (context, {arguments}) => CommunityFollow(arguments:arguments),
'/router/releasePage': (context, {arguments}) => ReleasePage(),

2
lib/main_page.dart

@ -74,7 +74,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
case AppLifecycleState.resumed: //
pushRoute();
if(DateTime.now().millisecondsSinceEpoch - lastTime > 420000)
Navigator.of(context).popAndPushNamed('/router/main_page');
Navigator.of(context).popAndPushNamed('/router/start_page');
break;
case AppLifecycleState.paused: //
lastTime = DateTime.now().millisecondsSinceEpoch;

2
lib/settlement/settlement.dart

@ -184,7 +184,7 @@ class _Settlement extends State<Settlement> {
? ((vipLevelName == "黄金会员" && placeOrder)
? "MEMBER_RANK"
: "NONE")
: "VIP",
: "AUTO",
// useVipPriceSelect,
// (useVipPriceSelect == true && isVips) ? false:useBenefitSelect,
count1,

4
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -122,7 +122,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
(widget.coupons != null && widget.coupons != "" ||
widget.promotions != null &&
widget.promotions != "" ||
widget.payChannell == 5 || widget.payChannell == 7)
widget.payChannell == 5 || widget.payChannell == 7 ||(widget?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK" ||(widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0))
? false
: vipSelect,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
@ -179,7 +179,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
widget.promotions != null &&
widget.promotions != "" ||
widget.payChannell == 5 ||
widget.payChannell == 7 || (widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0))
widget.payChannell == 7 ||(widget?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK"|| (widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0))
? false
: vipSelect)
? "assets/image/vip_price.webp"

339
lib/store/shop_details_page.dart

@ -92,6 +92,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
///
queryStoreInfo() async {
EasyLoading.show(status: S.current.zhengzaijiazai);
SharedPreferences value = await SharedPreferences.getInstance();
if (apiService == null)
apiService = ApiService(
@ -113,7 +114,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
}
minLogin();
}
EasyLoading.dismiss();
// EasyLoading.dismiss();
}
///
@ -145,7 +146,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
this.shopCarGoods = value;
setState(() {});
});
EasyLoading.dismiss();
// EasyLoading.dismiss();
}
});
}
@ -163,6 +164,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
selectSkus.add(element.attrValueList[0].attrValue);
});
});
EasyLoading.dismiss();
refreshController.refreshCompleted();
} else {
refreshController.refreshFailed();
@ -601,190 +603,187 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: Column(
children: [
Expanded(
child: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {
setState(() {
_onRefresh();
});
body: Column(
children: [
Expanded(
child: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
physics: BouncingScrollPhysics(),
scrollController: scrollController,
child: Container(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
buildProduct(),
SizedBox(
height: 16.h,
),
Container(
width: double.infinity,
// padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 16.h),
color: Colors.white,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 14.w, top: 16.h),
child: Text(
"商品详情",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF000000),
),
),
onRefresh: () {
setState(() {
_onRefresh();
});
},
physics: BouncingScrollPhysics(),
scrollController: scrollController,
child: Container(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
buildProduct(),
SizedBox(
height: 16.h,
),
Container(
width: double.infinity,
color: Colors.white,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 14.w, top: 16.h),
child: Text(
"商品详情",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF000000),
),
),
SizedBox(
height: 14.h,
),
Container(
color: Colors.white,
child: Html(
data: miNiDetail?.details ?? "",
style: {
'body': Style(
backgroundColor: Colors.white,
padding: EdgeInsets.all(0),
margin: EdgeInsets.all(0)),
'p': Style(
margin: EdgeInsets.all(0),
),
SizedBox(
height: 14.h,
),
Container(
color: Colors.white,
child: Html(
data: miNiDetail?.details ?? "",
style: {
'body': Style(
backgroundColor: Colors.white,
padding: EdgeInsets.all(0),
),
},
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),
margin: EdgeInsets.all(0)),
'p': Style(
margin: EdgeInsets.all(0),
padding: EdgeInsets.all(0),
),
},
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),
],
),
)
],
),
),
],
),
)
],
),
),
),
flex: 1,
),
if (count() != 0)
Stack(
alignment: Alignment.bottomLeft,
children: [
Container(
margin: EdgeInsets.symmetric(horizontal: 14),
height: 45.h,
// color: Color(0xFFFAFAFA),
decoration: BoxDecoration(
color: Color(0xFF383A38),
borderRadius: BorderRadius.circular(100),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 45.w,
),
Text.rich(
TextSpan(children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFFFFFFFF),
fontWeight: MyFontWeight.bold),
),
TextSpan(
text: shopCarGoods != null
? shopCarGoods.cartSum
: "0.0",
style: TextStyle(
fontSize: 20.sp,
color: Color(0xFFFFFFFF),
fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.medium),
),
]),
),
Spacer(),
GestureDetector(
onTap: () {
toDownOrder();
},
child: RoundButton(
width: 103.w,
height: 54.h,
text: S.current.jiesuan,
textColor: Colors.white,
fontWeight: MyFontWeight.bold,
backgroup: Color(0xFF32A060),
radius: 100,
fontSize: 16.sp,
padding: EdgeInsets.symmetric(vertical: 5.h),
),
),
],
),
flex: 1,
),
if (count() != 0)
Stack(
alignment: Alignment.bottomLeft,
children: [
Container(
margin: EdgeInsets.symmetric(horizontal: 14),
height: 45.h,
// color: Color(0xFFFAFAFA),
decoration: BoxDecoration(
color: Color(0xFF383A38),
borderRadius: BorderRadius.circular(100),
),
Stack(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
InkWell(
SizedBox(
width: 45.w,
),
Text.rich(
TextSpan(children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFFFFFFFF),
fontWeight: MyFontWeight.bold),
),
TextSpan(
text: shopCarGoods != null
? shopCarGoods.cartSum
: "0.0",
style: TextStyle(
fontSize: 20.sp,
color: Color(0xFFFFFFFF),
fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.medium),
),
]),
),
Spacer(),
GestureDetector(
onTap: () {
if (count() != 0) showShoppingCart();
toDownOrder();
},
child: Image.asset(
"assets/image/shopping_bag.webp",
width: 66,
height: 66,
fit: BoxFit.fitWidth,
child: RoundButton(
width: 103.w,
height: 54.h,
text: S.current.jiesuan,
textColor: Colors.white,
fontWeight: MyFontWeight.bold,
backgroup: Color(0xFF32A060),
radius: 100,
fontSize: 16.sp,
padding: EdgeInsets.symmetric(vertical: 5.h),
),
),
if (count() != 0)
Positioned(
right: 5,
// top: 14,
child: RoundButton(
width: 17.w,
height: 17.h,
text: "${count()}",
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFF65720),
fontSize: 12.sp,
radius: 100,
),
),
],
),
],
),
SizedBox(
height: 30.h,
)
],
),
),
Stack(
children: [
InkWell(
onTap: () {
if (count() != 0) showShoppingCart();
},
child: Image.asset(
"assets/image/shopping_bag.webp",
width: 66,
height: 66,
fit: BoxFit.fitWidth,
),
),
if (count() != 0)
Positioned(
right: 5,
// top: 14,
child: RoundButton(
width: 17.w,
height: 17.h,
text: "${count()}",
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFF65720),
fontSize: 12.sp,
radius: 100,
),
),
],
),
],
),
SizedBox(
height: 30.h,
)
],
),
);
}
@ -828,7 +827,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
),
),
SizedBox(
width: 2,
width: 2.w,
),
Expanded(
child: Text(

Loading…
Cancel
Save