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/cupertino.dart';
import 'package:flutter/material.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 { class StartPage extends StatefulWidget {
final bool isFirst; // final bool isFirst;
//
StartPage(this.isFirst); // StartPage(this.isFirst);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _StartPage(); return _StartPage();
@ -36,8 +31,10 @@ class _StartPage extends State<StartPage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
Future.delayed(Duration(seconds:3), () { Future.delayed(Duration(seconds:2), () {
Navigator.of(context).popAndPushNamed((widget.isFirst ?? true) ? '/router/guide_Page' : '/router/new_login_page'); // 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/guide_page.dart';
import 'home/help_farmers/help_farmers_page.dart'; import 'home/help_farmers/help_farmers_page.dart';
import 'home/home_view/activity_list.dart'; import 'home/home_view/activity_list.dart';
import 'home/start_page.dart';
import 'home/welfare_exchange.dart'; import 'home/welfare_exchange.dart';
import 'home/welfare_page.dart'; import 'home/welfare_page.dart';
import 'login/login_store_select.dart'; import 'login/login_store_select.dart';
@ -352,6 +353,7 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/about_page': (context, {arguments}) => AboutPage(), '/router/about_page': (context, {arguments}) => AboutPage(),
'/router/qr_share': (context, {arguments}) => QrSharePage(), '/router/qr_share': (context, {arguments}) => QrSharePage(),
'/router/main_page': (context, {arguments}) => MainPage(arguments: arguments), '/router/main_page': (context, {arguments}) => MainPage(arguments: arguments),
'/router/start_page': (context, {arguments}) => StartPage(),
'/router/test_page': (context, {arguments}) => TestPage(), '/router/test_page': (context, {arguments}) => TestPage(),
'/router/communityFollow': (context, {arguments}) => CommunityFollow(arguments:arguments), '/router/communityFollow': (context, {arguments}) => CommunityFollow(arguments:arguments),
'/router/releasePage': (context, {arguments}) => ReleasePage(), '/router/releasePage': (context, {arguments}) => ReleasePage(),

2
lib/main_page.dart

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

2
lib/settlement/settlement.dart

@ -184,7 +184,7 @@ class _Settlement extends State<Settlement> {
? ((vipLevelName == "黄金会员" && placeOrder) ? ((vipLevelName == "黄金会员" && placeOrder)
? "MEMBER_RANK" ? "MEMBER_RANK"
: "NONE") : "NONE")
: "VIP", : "AUTO",
// useVipPriceSelect, // useVipPriceSelect,
// (useVipPriceSelect == true && isVips) ? false:useBenefitSelect, // (useVipPriceSelect == true && isVips) ? false:useBenefitSelect,
count1, 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.coupons != null && widget.coupons != "" ||
widget.promotions != null && widget.promotions != null &&
widget.promotions != "" || 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 ? false
: vipSelect, : vipSelect,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
@ -179,7 +179,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
widget.promotions != null && widget.promotions != null &&
widget.promotions != "" || widget.promotions != "" ||
widget.payChannell == 5 || 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 ? false
: vipSelect) : vipSelect)
? "assets/image/vip_price.webp" ? "assets/image/vip_price.webp"

339
lib/store/shop_details_page.dart

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

Loading…
Cancel
Save