Browse Source

Merge remote-tracking branch 'origin/dev' into dev

new_revision_app
fmk 2 years ago
parent
commit
1137a4545b
  1. 3
      lib/community/community_view/class_details.dart
  2. 4
      lib/home/home_view/welfare_core.dart
  3. 1
      lib/home/huixiang_view/origin_info.dart
  4. 2
      lib/home/welfare_exchange.dart
  5. 2
      lib/mine/mine_view/mine_navbar.dart
  6. 3
      lib/mine/mine_vip/mine_vip_core.dart
  7. 4
      lib/order/order_detail_page.dart
  8. 210
      lib/order/order_view/order_commodity.dart
  9. 46
      lib/settlement/settlement.dart
  10. 2
      lib/settlement/settlement_view/settlement_order_commodity.dart
  11. 66
      lib/view_widget/no_data_view.dart

3
lib/community/community_view/class_details.dart

@ -412,7 +412,8 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
color: Colors.black, color: Colors.black,
), ),
), ),
SizedBox(height: 3.h), SizedBox(height: 5.h),
if((course?.introduce ?? "").length > 50)
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {

4
lib/home/home_view/welfare_core.dart

@ -105,7 +105,7 @@ class _WelfareCore extends State<WelfareCore> {
SizedBox(width: 10.w,), SizedBox(width: 10.w,),
Expanded(child: GestureDetector( Expanded(child: GestureDetector(
onTap: (){ onTap: (){
Navigator.of(context).pushNamed('/router/welfare_page'); Navigator.of(context).pushNamed('/router/invite_friends');
}, },
child:Container( child:Container(
width: double.infinity, width: double.infinity,
@ -144,7 +144,7 @@ class _WelfareCore extends State<WelfareCore> {
SizedBox(width: 10.w,), SizedBox(width: 10.w,),
Expanded(child: GestureDetector( Expanded(child: GestureDetector(
onTap: (){ onTap: (){
Navigator.of(context).pushNamed('/router/welfare_page'); Navigator.of(context).pushNamed('/router/welfare_exchange');
}, },
child:Container( child:Container(
width: double.infinity, width: double.infinity,

1
lib/home/huixiang_view/origin_info.dart

@ -108,6 +108,7 @@ class _OriginInfo extends State<OriginInfo> {
), ),
), ),
SizedBox(height: 3.h), SizedBox(height: 3.h),
if((widget?.founder?.description ?? "").length > 35)
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {

2
lib/home/welfare_exchange.dart

@ -62,10 +62,12 @@ class _WelfareExchange extends State<WelfareExchange>
} }
queryUser() async { queryUser() async {
EasyLoading.show(status: S.current.zhengzaijiazai);
BaseData<UserInfo> baseData = BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {}); await apiService.queryInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data; userInfo = baseData.data;
EasyLoading.dismiss();
setState(() {}); setState(() {});
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
value.setString('user', jsonEncode(baseData.data)), value.setString('user', jsonEncode(baseData.data)),

2
lib/mine/mine_view/mine_navbar.dart

@ -246,7 +246,7 @@ class _MineNavbar extends State<MineNavbar> {
}, },
child: mineBottomItem( child: mineBottomItem(
widget?.userInfo?.happyBean?? "0", widget?.userInfo?.happyBean?? "0",
"印章卡", S.of(context).jihuanka,
), ),
), ),
), ),

3
lib/mine/mine_vip/mine_vip_core.dart

@ -72,7 +72,7 @@ class _MineVipCore extends State<MineVipCore> {
// value.setBool("FirstGongC", true); // value.setBool("FirstGongC", true);
// } // }
apiService = apiService =
ApiService(Dio(), context: context, token: value.getString("token")); ApiService(Dio(), context: context, showLoading: false,token: value.getString("token"));
queryVipLevel(); queryVipLevel();
queryBenefitList(); queryBenefitList();
queryRuleDetails(); queryRuleDetails();
@ -204,7 +204,6 @@ class _MineVipCore extends State<MineVipCore> {
await queryRuleDetails(); await queryRuleDetails();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(

4
lib/order/order_detail_page.dart

@ -44,12 +44,12 @@ class _OrderDetailPage extends State<OrderDetailPage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
jumpState = widget.arguments["jumpState"];
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, token: value.getString("token"), showLoading: true); context: context, token: value.getString("token"), showLoading: jumpState == 2? true:false);
queryDetails(); queryDetails();
}); });
jumpState = widget.arguments["jumpState"];
} }
/// ///

210
lib/order/order_view/order_commodity.dart

@ -9,6 +9,7 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/separator.dart'; import 'package:huixiang/view_widget/separator.dart';
import '../../retrofit/data/shoppingCart.dart';
import '../../utils/flutter_utils.dart'; import '../../utils/flutter_utils.dart';
class OrderCommodity extends StatefulWidget { class OrderCommodity extends StatefulWidget {
@ -182,95 +183,160 @@ class _OrderCommodity extends State<OrderCommodity> {
Widget commodityItem(OrderProductVOList productList) { Widget commodityItem(OrderProductVOList productList) {
return Container( return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: Row( child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
MImage( Row(
productList.skuImg, crossAxisAlignment: CrossAxisAlignment.center,
width: 49, children: [
height: 49, MImage(
fit: BoxFit.cover, productList.skuImg,
radius: BorderRadius.circular(2), width: 49,
errorSrc: "assets/image/default_1.webp", height: 49,
fadeSrc: "assets/image/default_1.webp", fit: BoxFit.cover,
), radius: BorderRadius.circular(2),
Expanded( errorSrc: "assets/image/default_1.webp",
flex: 1, fadeSrc: "assets/image/default_1.webp",
child: Container(
margin: EdgeInsets.only(
left: 8.w,
), ),
// height: 44.h, Expanded(
child: Column( flex: 1,
mainAxisAlignment: MainAxisAlignment.spaceAround, child: Container(
crossAxisAlignment: CrossAxisAlignment.start, margin: EdgeInsets.only(
children: [ left: 8.w,
Text(
productList.productName,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
SizedBox(
height: 4.h,
), ),
Text( // height: 44.h,
productList.skuNameStr != null child: Column(
? "${productList.skuNameStr ?? ""}" mainAxisAlignment: MainAxisAlignment.spaceAround,
: "", crossAxisAlignment: CrossAxisAlignment.start,
overflow: TextOverflow.ellipsis, children: [
style: TextStyle( Text(
fontSize: 10.sp, productList.productName,
color: Color(0xFFA29E9E), 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),
),
),
Text(
"x${productList.buyNum}",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF727272),
),
),
],
), ),
),
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text( Text(
"x${productList.buyNum}", 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( style: TextStyle(
fontSize: 12.sp, fontWeight: MyFontWeight.medium,
color: Color(0xFF727272), 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),
),
)
], ],
), ),
),
),
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),
),
)
], ],
), ),
if (productList.setMealDataList.length != 0)
ListView.builder(
itemCount: productList.setMealDataList.length,
scrollDirection: Axis.vertical,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.zero,
itemBuilder: (context, index) {
return orderMealsItem(productList.setMealDataList[index]);
},
),
], ],
), ),
); );
} }
Widget orderMealsItem(SetMealDataList setMealDataList) {
return Column(children: setMealDataList.productInfoList.map((e) {
return Container(
margin: EdgeInsets.symmetric(
vertical: 10.h,
),
child: Row(
children: [
Expanded(
flex: 2,
child: Text(
e.productName,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: Color(0xffA29E9E),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
),
Expanded(
flex: 3,
child: Text(
"${(e.skuName == "") ? "" : e.skuName}",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: Color(0xffA29E9E),
fontSize: 13.sp,
fontWeight: MyFontWeight.regular,
),
),
),
Text(
"x${e.buyNumber.toString()}",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: Color(0xffFF7A1A),
fontSize: 13.sp,
fontWeight: MyFontWeight.regular,
),
),
],
),
);
}).toList(),);
}
Widget discountItem(Color color, textName, condition, amount) { Widget discountItem(Color color, textName, condition, amount) {
return Container( return Container(
margin: EdgeInsets.only(top: 9.h, bottom: 9.h), margin: EdgeInsets.only(top: 9.h, bottom: 9.h),

46
lib/settlement/settlement.dart

@ -1284,16 +1284,16 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
(settleOrderInfo.isRaise || payChannel == 5) // (settleOrderInfo.isRaise || payChannel == 5)
? "NONE" // ? "NONE"
: ((useVipPriceSelect == false && // : ((useVipPriceSelect == false &&
couponListBean?.id != "" && // couponListBean?.id != "" &&
((promotion?.id ?? productId) != "")) // ((promotion?.id ?? productId) != ""))
? "MEMBER_RANK" // ? "MEMBER_RANK"
: (isVips == false) // : (isVips == false)
? "MEMBER_RANK" // ? "MEMBER_RANK"
: "AUTO"), // : "AUTO"),
// preferentialType(), preferentialType(),
// (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false))) ? false :useVipPriceSelect, // (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false))) ? false :useVipPriceSelect,
// (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false)) || useVipPriceSelect == true) ? false :useBenefitSelect, // (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false)) || useVipPriceSelect == true) ? false :useBenefitSelect,
count1, count1,
@ -1305,17 +1305,17 @@ class _Settlement extends State<Settlement> {
String preferentialType(){ String preferentialType(){
if(settleOrderInfo.isRaise || payChannel == 5) if(settleOrderInfo.isRaise || payChannel == 5)
return "NONE"; return "NONE";
if((((promotion?.id ?? productId) ?? "") != "") && (couponListBean?.id ?? "") == ""){ if(settleOrderInfo.discountType == "ACTIVITY"){
return "ACTIVITY"; return "ACTIVITY";
}else if((couponListBean?.id ?? "") != "" && (((promotion?.id ?? productId) ?? "") == "")){ }else if(settleOrderInfo.discountType == "COUPON"){
return "COUPON"; return "COUPON";
}else if(useVipPriceSelect == false && (couponListBean?.id ?? "") == "" && ((promotion?.id ?? productId ?? "") == "")){ }else if(settleOrderInfo.discountType == "MEMBER_RANK" || settleOrderInfo.discountType == "SURPRISE"){
return "MEMBER_RANK"; return "MEMBER_RANK";
}else if(useVipPriceSelect == true && (couponListBean?.id ?? "") == "" && ((promotion?.id ?? productId ??"") == "")){ }else if(settleOrderInfo.discountType == "VIP"){
return "VIP"; return "VIP";
}else { }else {
return "AUTO"; return "AUTO";
} }
} }
vipPriceSelect(bool useVipPriceSelect) { vipPriceSelect(bool useVipPriceSelect) {
@ -1421,9 +1421,7 @@ class _Settlement extends State<Settlement> {
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
(couponBean?.id ?? 0) == 0 (couponBean?.id ?? 0) == 0
? ((isVips == false) ? "AUTO"
? "MEMBER_RANK"
: "AUTO")
: "COUPON", : "COUPON",
// useVipPriceSelect, // useVipPriceSelect,
// useBenefitSelect, // useBenefitSelect,
@ -1462,9 +1460,7 @@ class _Settlement extends State<Settlement> {
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
((pro?.id ?? 0) ?? productId) == 0 ((pro?.id ?? 0) ?? productId) == 0
? ((isVips == false) ?"AUTO"
? "MEMBER_RANK"
: "AUTO")
: "ACTIVITY", : "ACTIVITY",
// useVipPriceSelect, // useVipPriceSelect,
// useBenefitSelect, // useBenefitSelect,

2
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -118,7 +118,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
); );
} }
if (widget.diningStatus == 3) { if (widget.diningStatus == 3 && widget.isTakeOut != 2) {
// //
widgets.add( widgets.add(
discountItem( discountItem(

66
lib/view_widget/no_data_view.dart

@ -27,41 +27,43 @@ class NoDataView extends StatelessWidget {
return Container( return Container(
margin: margin, margin: margin,
alignment: Alignment.center, alignment: Alignment.center,
child: Column( child: Expanded(
children: [ child: Column(
Image( children: [
image: AssetImage(src), Image(
width: iconWidth, image: AssetImage(src),
height: iconHeight, width: iconWidth,
), height: iconHeight,
SizedBox(
height: 35.h,
),
Text(
text,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: fontSize,
height: 1.5,
color: Color(0xFF353535),
), ),
), SizedBox(
SizedBox( height: 35.h,
height: 10.h, ),
), Text(
if (isShowBtn) text,
Container( textAlign: TextAlign.center,
margin: EdgeInsets.symmetric(horizontal: 16.w), style: TextStyle(
child: RoundButton( fontSize: fontSize,
text: S.of(context).fanhuishouye, height: 1.5,
textColor: Colors.white, color: Color(0xFF353535),
fontSize: 14.sp,
padding: EdgeInsets.all(12.w),
backgroup: Color(0xFF32A060),
radius: 4,
), ),
), ),
], SizedBox(
height: 10.h,
),
if (isShowBtn)
Container(
margin: EdgeInsets.symmetric(horizontal: 16.w),
child: RoundButton(
text: S.of(context).fanhuishouye,
textColor: Colors.white,
fontSize: 14.sp,
padding: EdgeInsets.all(12.w),
backgroup: Color(0xFF32A060),
radius: 4,
),
),
],
),
), ),
); );
} }

Loading…
Cancel
Save