Browse Source

1.账号与安全页面,增加正在加载‘

2.结算会员更改,新增优惠类型:SURPRISE;
3.discountType = “MEMBER_RANK”跟SURPRISE一样的意思,在多处会员优惠显示处新增SURPRISE类型一起判断;
4.绑定手机号码页面,输入框内容文字,间距优化更改;
5.动态详情优化,列表滑动时如若键盘弹出,则收起;
6.登录页手机号码输入框间距调整;
7.订单详情页,新增单件商品折后价格;
8.VIP价格暂时废弃,经协商已从商品列表暂时去掉该段代码;
new_revision_app
wurong 2 years ago
parent
commit
5a7f7f6203
  1. 165
      lib/community/community_details.dart
  2. 2
      lib/login/new_login_page.dart
  3. 114
      lib/order/order_view/order_commodity.dart
  4. 8
      lib/retrofit/retrofit_api.dart
  5. 6
      lib/setting/account_security_page.dart
  6. 27
      lib/setting/binding_phone_page.dart
  7. 6
      lib/settlement/settlement.dart
  8. 7
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  9. 6
      lib/settlement/settlement_view/settlement_order_commodity.dart
  10. 61
      lib/store/store_view/shop_goods.dart

165
lib/community/community_details.dart

@ -2,6 +2,7 @@ import 'dart:ui';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/community/community_view/community_dynamic.dart';
import 'package:huixiang/generated/l10n.dart';
@ -15,8 +16,12 @@ import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/tips_dialog.dart';
import 'package:huixiang/web/web_view/comment_list.dart';
import 'package:huixiang/web/web_view/input_comment.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../view_widget/classic_header.dart';
import '../view_widget/my_footer.dart';
class CommunityDetails extends StatefulWidget {
final Map<String, dynamic> arguments;
@ -54,6 +59,7 @@ class _CommunityDetails extends State<CommunityDetails>
double keyboard = -1;
bool needShowSmiley = false;
bool needHideSmiley = false;
final RefreshController refreshController = RefreshController();
void didChangeMetrics() {
WidgetsBinding.instance.addPostFrameCallback((_) {
@ -94,11 +100,21 @@ class _CommunityDetails extends State<CommunityDetails>
void initState() {
super.initState();
// comunity = widget.arguments["comment"];
EasyLoading.show(status: S.current.zhengzaijiazai);
businessId = widget.arguments["businessId"];
WidgetsBinding.instance.addObserver(this);
commentFocus.addListener(_focusNodeListener);
_queryMemberCommentList();
scrollController.addListener(() {
//
if(MediaQuery.of(context).viewInsets.bottom > 0)
FocusScope.of(context).requestFocus(FocusNode());
if(needShowSmiley && window.viewInsets.bottom > 0.1)
needHideSmiley = false;
setState(() {
emojiShowing = false;
});
});
_queryMemberCommentList(true);
queryDetails(businessId);
}
@ -130,9 +146,10 @@ class _CommunityDetails extends State<CommunityDetails>
@override
void dispose(){
super.dispose();
WidgetsBinding.instance.removeObserver(this);
commentFocus.removeListener(_focusNodeListener);
super.dispose();
refreshController.dispose();
}
///
@ -147,14 +164,24 @@ class _CommunityDetails extends State<CommunityDetails>
BaseData<Article> baseData =
await apiService.informationInfo(id).catchError((onError) {
debugPrint(onError.toString());
refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
setState(() {
article = baseData.data;
EasyLoading.dismiss();
refreshController.refreshCompleted();
});
}else {
refreshController.refreshFailed();
}
}
_onRefresh() {
queryDetails(businessId);
_queryMemberCommentList(true);
}
@override
Widget build(BuildContext context) {
double h = MediaQuery.of(context).viewInsets.bottom;
@ -186,61 +213,81 @@ class _CommunityDetails extends State<CommunityDetails>
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
if (article != null)
CommunityDynamic(
article,
0,
exitFull: () {
setState(() {});
},
userId: widget.arguments != null
? widget.arguments["userId"]
: widget.arguments["mid"],
itemCount: 3,
isDetails: true,
heightFun: (height) {
this.height = height +
MediaQuery.of(context).padding.top +
kToolbarHeight +
24;
if (mounted) setState(() {});
child: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {
setState(() {
emojiShowing = false;
isKeyBoardShow = emojiShowing;
FocusScope.of(context).requestFocus(FocusNode());
_onRefresh();
});
},
scrollController:scrollController,
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
if (article != null)
CommunityDynamic(
article,
0,
exitFull: () {
setState(() {});
},
userId: widget.arguments != null
? widget.arguments["userId"]
: widget.arguments["mid"],
itemCount: 3,
isDetails: true,
heightFun: (height) {
this.height = height +
MediaQuery.of(context).padding.top +
kToolbarHeight +
24;
if (mounted) setState(() {});
},
),
CommentList(
commentKey,
article?.likes ?? 0,
businessId,
4,
isKeyBoardShow,
_reply,
_delCommentTips,
12.sp,
requestApiFinish: (total) {
setState(() {
commentTotal = total;
});
},
),
CommentList(
commentKey,
article?.likes ?? 0,
businessId,
4,
isKeyBoardShow,
_reply,
_delCommentTips,
12.sp,
requestApiFinish: (total) {
setState(() {
commentTotal = total;
});
},
),
if (memberList == null || memberList.length == 0)
Container(
width: double.infinity,
alignment: Alignment.topCenter,
margin: EdgeInsets.only(top: 40),
padding: EdgeInsets.all(22.h),
child: Text(
S.of(context).zanwupinglun,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Color(0xFFA0A0A0),
if (memberList == null || memberList.length == 0)
Container(
width: double.infinity,
alignment: Alignment.topCenter,
margin: EdgeInsets.only(top: 40),
padding: EdgeInsets.all(22.h),
child: Text(
S.of(context).zanwupinglun,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Color(0xFFA0A0A0),
),
),
),
),
],
],
),
),
),
flex: 1,
@ -299,7 +346,7 @@ class _CommunityDetails extends State<CommunityDetails>
state.queryMemberCommentList();
commentTextController.text = "";
FocusScope.of(context).unfocus();
_queryMemberCommentList();
_queryMemberCommentList(false);
}
}
@ -351,14 +398,15 @@ class _CommunityDetails extends State<CommunityDetails>
}
///
_queryMemberCommentList() async {
_queryMemberCommentList(bool isOnRefresh) async {
if (!isOnRefresh) EasyLoading.show(status: S.current.zhengzaijiazai);
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (apiService == null)
apiService = ApiService(
Dio(),
context: context,
token: sharedPreferences.getString("token"),
showLoading: true,
// showLoading: true,
);
BaseData<PageInfo<MemberCommentList>> baseData =
await apiService.memberCommentList({
@ -372,6 +420,9 @@ class _CommunityDetails extends State<CommunityDetails>
memberList = baseData.data.list;
contentHeight();
if (mounted) setState(() {});
EasyLoading.dismiss();
}else {
refreshController.refreshFailed();
}
}
}

2
lib/login/new_login_page.dart

@ -445,7 +445,7 @@ class _NewLoginPage extends State<NewLoginPage> {
Container(
height: 30.h,
width: MediaQuery.of(context).size.width - 100.w,
margin: EdgeInsets.only(bottom:10.h),
margin: EdgeInsets.only(bottom:Platform.isIOS ? 10.h:0),
child: TextField(
style: TextStyle(
height: 1.h,

114
lib/order/order_view/order_commodity.dart

@ -9,6 +9,8 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/separator.dart';
import '../../utils/flutter_utils.dart';
class OrderCommodity extends StatefulWidget {
final OrderInfo orderInfo;
@ -181,12 +183,14 @@ class _OrderCommodity extends State<OrderCommodity> {
return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
MImage(
productList.skuImg,
width: 44.w,
height: 44,
width: 49,
height: 49,
fit: BoxFit.cover,
radius: BorderRadius.circular(2),
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
@ -194,68 +198,74 @@ class _OrderCommodity extends State<OrderCommodity> {
flex: 1,
child: Container(
margin: EdgeInsets.only(
left: 16.w,
left: 8.w,
),
// height: 44.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(child:Text(
productList.productName,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.sp,
color: Color(0xFF353535),
),
)),
Text(
"x${productList.buyNum}",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF727272),
),
),
],
Text(
productList.productName,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
SizedBox(
height: 4.h,
),
Text(
productList.skuNameStr != null
? "${productList.skuNameStr ?? ""}"
: "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Text(
productList.skuNameStr != null
? "${productList.skuNameStr}"
: "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFFA29E9E),
),
),
),
Text(
S.of(context).yuan_(productList.sellPrice),
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 12.sp,
fontFamily: 'JDZhengHT',
color: Color(0xFF4C4C4C),
),
)
],
Text(
"x${productList.buyNum}",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF727272),
),
),
],
),
),
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
productList.buyNum > 1
? S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - AppUtils.stringAsFixedDouble2((double.tryParse(productList.discountAmount ?? "0") / productList.buyNum))))
: S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - double.tryParse(productList.discountAmount ?? "0"))),
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
color: Color(0xFF4C4C4C),
),
),
if (productList.discountAmount != null && productList.discountAmount != "0")
Text(
S.of(context).yuan_(productList.sellPrice),
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
fontFamily: 'JDZhengHT',
decoration: TextDecoration.lineThrough,
color: Color(0xFFA29E9E),
),
)
],
),
],
),
);

8
lib/retrofit/retrofit_api.dart

@ -553,4 +553,12 @@ abstract class ApiService {
///code获取设置/
@GET("/raise/products")
Future<BaseData<List<FarmersList>>> getConfig();
///
@POST("/auth/changePhone")
Future<BaseData> changePhone(@Body() Map<String, dynamic> param);
///-
@GET("/auth/sendVerify/{mobile}")
Future<BaseData> changeSendVerify(@Path("mobile") String mobile);
}

6
lib/setting/account_security_page.dart

@ -3,6 +3,7 @@ import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
@ -25,10 +26,10 @@ class _AccountSecurityPage extends State<AccountSecurityPage> {
@override
void initState() {
super.initState();
EasyLoading.show(status: S.current.zhengzaijiazai);
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
context: context, token: value.getString("token"),
showLoading: true),
context: context, token: value.getString("token"),),
queryUser(),
});
@ -46,6 +47,7 @@ class _AccountSecurityPage extends State<AccountSecurityPage> {
value.setString('user', jsonEncode(baseDate.data)),
},
);
EasyLoading.dismiss();
}
}

27
lib/setting/binding_phone_page.dart

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
@ -209,6 +210,7 @@ class _BindingPhonePage extends State<BindingPhonePage> {
style: TextStyle(
color: Color(0xFF353535),
fontSize: 18.sp,
letterSpacing:1,
fontWeight: MyFontWeight.bold,
),)),
if(phoneState == 2)
@ -218,7 +220,8 @@ class _BindingPhonePage extends State<BindingPhonePage> {
style: TextStyle(
color: Color(0xFFA29E9E),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
letterSpacing:0.5,
fontWeight: MyFontWeight.medium,
),)),
if(phoneState == 1)
inputPhone(),
@ -349,7 +352,7 @@ class _BindingPhonePage extends State<BindingPhonePage> {
Container(
height: 30.h,
width: MediaQuery.of(context).size.width - 100.w,
margin: EdgeInsets.only(bottom:10.h),
margin: EdgeInsets.only(bottom:Platform.isIOS ? 10.h:0),
child: TextField(
style: TextStyle(
height: 1.h,
@ -374,10 +377,10 @@ class _BindingPhonePage extends State<BindingPhonePage> {
errorBorder: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
hintText: "",
hintText: S.of(context).qingshurushoujihao,
// contentPadding: EdgeInsets.only(top: 12, bottom: 12, left: 12),
hintStyle: TextStyle(
fontSize: 10.sp,
fontSize: 14.sp,
color: Color(0xFFA29E9E),
),
),
@ -397,6 +400,7 @@ class _BindingPhonePage extends State<BindingPhonePage> {
color: _controllerPhone.text == ""
? Color(0xFFE7E3E3)
: Color(0xFF32A060),
margin: EdgeInsets.only(top: 10.h),
),
SizedBox(
height: 30.h,
@ -443,9 +447,9 @@ class _BindingPhonePage extends State<BindingPhonePage> {
errorBorder: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
hintText: "",
hintText:S.of(context).input_code_hide,
hintStyle: TextStyle(
fontSize: 10.sp,
fontSize: 14.sp,
color: Color(0xFFA29E9E),
),
),
@ -572,7 +576,7 @@ class _BindingPhonePage extends State<BindingPhonePage> {
Container(
height: 30.h,
width: MediaQuery.of(context).size.width - 100.w,
margin: EdgeInsets.only(bottom:10.h),
margin: EdgeInsets.only(bottom:Platform.isIOS ? 10.h:0),
child: TextField(
style: TextStyle(
height: 1.h,
@ -597,10 +601,10 @@ class _BindingPhonePage extends State<BindingPhonePage> {
errorBorder: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
hintText: "",
hintText: S.of(context).qingshurushoujihao,
// contentPadding: EdgeInsets.only(top: 12, bottom: 12, left: 12),
hintStyle: TextStyle(
fontSize: 10.sp,
fontSize: 14.sp,
color: Color(0xFFA29E9E),
),
),
@ -620,6 +624,7 @@ class _BindingPhonePage extends State<BindingPhonePage> {
color: _controllerNewPhone.text == ""
? Color(0xFFE7E3E3)
: Color(0xFF32A060),
margin: EdgeInsets.only(top: 10.h),
),
SizedBox(
height: 30.h,
@ -667,9 +672,9 @@ class _BindingPhonePage extends State<BindingPhonePage> {
errorBorder: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
hintText: "",
hintText:S.of(context).input_code_hide,
hintStyle: TextStyle(
fontSize: 10.sp,
fontSize: 14.sp,
color: Color(0xFFA29E9E),
),
),

6
lib/settlement/settlement.dart

@ -186,10 +186,8 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
(isVips == false || !placeOrder)
? ((vipLevelName == "黄金会员" && placeOrder)
? "MEMBER_RANK"
: "NONE")
(!placeOrder)
? "NONE"
: "AUTO",
// useVipPriceSelect,
// (useVipPriceSelect == true && isVips) ? false:useBenefitSelect,

7
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?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK" )
widget.payChannell == 5 || widget.payChannell == 7 || ((widget?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK" || (widget?.settleOrderInfo?.discountType ?? "") == "SURPRISE") )
? false
: vipSelect,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
@ -179,7 +179,8 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
widget.promotions != null &&
widget.promotions != "" ||
widget.payChannell == 5 ||
widget.payChannell == 7 ||(widget?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK"|| (widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0))
widget.payChannell == 7 ||((widget?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK" || (widget?.settleOrderInfo?.discountType ?? "") == "SURPRISE")
|| (widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0))
? false
: vipSelect)
? "assets/image/vip_price.webp"
@ -278,7 +279,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
// ),
// ),
if (widget.placeOrder &&
(widget?.settleOrderInfo?.discountType == "MEMBER_RANK" && widget?.settleOrderInfo?.benefitDiscountAmount != null &&
((widget?.settleOrderInfo?.discountType == "MEMBER_RANK" || widget?.settleOrderInfo?.discountType == "SURPRISE") && widget?.settleOrderInfo?.benefitDiscountAmount != null &&
widget?.settleOrderInfo?.benefitDiscountAmount != "0"))
Container(
margin: EdgeInsets.only(bottom: 13),

6
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -141,10 +141,12 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
}
if (widget.useBenefitSelect &&
(widget?.settleOrderInfo?.discountType == "MEMBER_RANK" && widget?.settleOrderInfo?.benefitDiscountAmount != "0") && ((widget.tableId > 0
((widget?.settleOrderInfo?.discountType == "MEMBER_RANK" || widget?.settleOrderInfo?.discountType == "SURPRISE")
&& widget?.settleOrderInfo?.benefitDiscountAmount != "0") && ((widget.tableId > 0
? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)))) {
widgets.add(vipItem(Color(0xFFFF7A1A), "会员优惠金额",
(widget.minOrderInfo != null && widget.minOrderInfo.orderProductVOList != null) ? (widget.minOrderInfo?.benefitDiscountAmount ?? "") :(widget?.settleOrderInfo?.benefitDiscountAmount ?? "")));
(widget.minOrderInfo != null && widget.minOrderInfo.orderProductVOList != null) ? (widget.minOrderInfo?.benefitDiscountAmount ?? "")
:(widget?.settleOrderInfo?.benefitDiscountAmount ?? "")));
}
if (widget.showVipTips) {

61
lib/store/store_view/shop_goods.dart

@ -494,36 +494,37 @@ class _ShopGoods extends State<ShopGoods> {
SizedBox(
height: 4.h,
),
if (widget.productListBean.vipPrice != null)
Row(
children: [
Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(horizontal: 2.w),
margin: EdgeInsets.only(right: 4.w),
decoration: new BoxDecoration(
color: Color(0xff32A060),
borderRadius: BorderRadius.circular(4)),
child: Text(
"VIP",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFFFFFFFF),
),
),
),
Text(
"${AppUtils.calculateDouble(double.tryParse(widget.productListBean.vipPrice ?? "0") ?? 0)}",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
fontFamily: 'JDZhengHT',
color: Color(0xff32A060),
),
),
],
),
///VIP价格
// if (widget.productListBean.vipPrice != null)
// Row(
// children: [
// Container(
// alignment: Alignment.center,
// padding: EdgeInsets.symmetric(horizontal: 2.w),
// margin: EdgeInsets.only(right: 4.w),
// decoration: new BoxDecoration(
// color: Color(0xff32A060),
// borderRadius: BorderRadius.circular(4)),
// child: Text(
// "VIP",
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.medium,
// color: Color(0xFFFFFFFF),
// ),
// ),
// ),
// Text(
// "${AppUtils.calculateDouble(double.tryParse(widget.productListBean.vipPrice ?? "0") ?? 0)}",
// style: TextStyle(
// fontSize: 14.sp,
// fontWeight: MyFontWeight.medium,
// fontFamily: 'JDZhengHT',
// color: Color(0xff32A060),
// ),
// ),
// ],
// ),
// Text(
// "${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.applyPrice) ?? 0)}",
// style: TextStyle(

Loading…
Cancel
Save