Commit 7bf7c349f493cc133e4c432f8ff3e1401c663f5a

Authored by wdn127929
1 parent a6eaf305

营销中心----优惠券选择页面item UI

... ... @@ -15,17 +15,17 @@ if (flutterRoot == null) {
def flutterVersionCode = "481"
def flutterVersionCode = "482"
if (flutterVersionCode == null) {
flutterVersionCode = '481'
flutterVersionCode = '482'
}
def flutterVersionName = "4.8.1"
def flutterVersionName = "4.8.2"
if (flutterVersionName == null) {
flutterVersionName = '4.8.1'
flutterVersionName = '4.8.2'
}
... ...
... ... @@ -18,6 +18,7 @@ class CouponItemF extends StatefulWidget {
final CouponSunModel couponSonModel;
final bool showBtn;
final bool showCheck;
final bool radio;
CouponItemF(
{Key key,
this.from,
... ... @@ -25,7 +26,8 @@ class CouponItemF extends StatefulWidget {
this.onPressedSwich,
this.couponSonModel,
this.showBtn = false,
this.showCheck = false})
this.showCheck = false,
this.radio = false})
: super(key: key);
@override
... ... @@ -56,301 +58,316 @@ class _CouponItemFState extends State<CouponItemF> {
5,
context);
}
return Stack(
alignment: widget.from == 'select'
? Alignment.centerLeft
: AlignmentDirectional.topStart,
children: [
InkWell(
onTap: widget.onPressed,
child: Container(
// width: ScreenUtil().setWidth(610),
margin: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(32)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
spreadRadius: ScreenUtil().setWidth(2),
color: Color.fromRGBO(0, 0, 0, 0.25),
offset: Offset(0, ScreenUtil().setWidth(8)),
blurRadius: ScreenUtil().setWidth(8))
],
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(16)),
return Column(children: [
Stack(
alignment: widget.from == 'select'
? Alignment.centerLeft
: AlignmentDirectional.topStart,
children: [
InkWell(
onTap: widget.onPressed,
child: Container(
// width: ScreenUtil().setWidth(610),
margin: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(0)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
spreadRadius: ScreenUtil().setWidth(2),
color: Color.fromRGBO(0, 0, 0, 0.25),
offset: Offset(0, ScreenUtil().setWidth(8)),
blurRadius: ScreenUtil().setWidth(8))
],
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(16)),
),
),
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: ScreenUtil().setWidth(40),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(24)),
decoration: BoxDecoration(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? sunModel.isType == '1'
? MyColours.color_438E93
: MyColours.color_ED7B2F
: MyColours.color_999999,
borderRadius: BorderRadius.only(
topLeft:
Radius.circular(ScreenUtil().setWidth(16)),
topRight:
Radius.circular(ScreenUtil().setWidth(16)))),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
sunModel.isType == '1'
? sunModel.isExamine == '1'
? '店铺优惠券(核销)'
: '店铺优惠券'
: '我的优惠券',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(24)),
),
InkWell(
onTap: widget.onPressedSwich,
child: Text(
sunModel.isType == '1'
? sunModel.isExamine == '1'
? '被领取:${sunModel.receiveNum}张 已核销:${sunModel.useNum}张'
: '创建人:${sunModel.nickname ?? sunModel.uid} 被领取:${sunModel.receiveNum}张'
: '被领取:${sunModel.receiveNum}张',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(20))),
),
],
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: ScreenUtil().setWidth(40),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(24)),
decoration: BoxDecoration(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? sunModel.isType == '1'
? MyColours.color_438E93
: MyColours.color_ED7B2F
: MyColours.color_999999,
borderRadius: BorderRadius.only(
topLeft:
Radius.circular(ScreenUtil().setWidth(16)),
topRight: Radius.circular(
ScreenUtil().setWidth(16)))),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
sunModel.isType == '1'
? sunModel.isExamine == '1'
? '店铺优惠券(核销)'
: '店铺优惠券'
: '我的优惠券',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(24)),
),
InkWell(
onTap: widget.onPressedSwich,
child: Text(
sunModel.isType == '1'
? sunModel.isExamine == '1'
? '被领取:${sunModel.receiveNum}张 已核销:${sunModel.useNum}张'
: '创建人:${sunModel.nickname ?? sunModel.uid} 被领取:${sunModel.receiveNum}张'
: '被领取:${sunModel.receiveNum}张',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(20))),
),
],
),
),
),
Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(24 * 2),
ScreenUtil().setWidth(9 * 2),
ScreenUtil().setWidth(10),
ScreenUtil().setWidth(20)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(24 * 2),
ScreenUtil().setWidth(9 * 2),
ScreenUtil().setWidth(10),
ScreenUtil().setWidth(20)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: ScreenUtil().setWidth(232 * 2),
child: Container(
height: ScreenUtil().setWidth(25 * 2),
constraints: BoxConstraints(
maxWidth: ScreenUtil().setWidth(190)),
child: Text(
sunModel.aname,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? MyColours.color_515151
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(36),
fontWeight: FontWeight.bold),
),
)),
Container(
height: ScreenUtil().setWidth(14 * 2),
width: ScreenUtil().setWidth(232 * 2),
child: Container(
height: ScreenUtil().setWidth(25 * 2),
constraints: BoxConstraints(
maxWidth: ScreenUtil().setWidth(190)),
child: Text(
sunModel.aname,
maxLines: 2,
child: Text('${sunModel.desc}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? MyColours.color_515151
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(36),
fontWeight: FontWeight.bold),
),
)),
Container(
height: ScreenUtil().setWidth(14 * 2),
width: ScreenUtil().setWidth(232 * 2),
child: Text('${sunModel.desc}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? MyColours.color_515151
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
)),
),
VEmptyView(16),
(ObjectUtil.isNotEmpty(sunModel.stime) &&
sunModel.stime != '0') ||
(ObjectUtil.isNotEmpty(sunModel.etime) &&
sunModel.etime != '0')
? Container(
child: Text(
'使用时间:${ObjectUtil.isNotEmpty(sunModel.stime) ? Utils.getDateStrFromJiekou(sunModel.stime) : '--'} 至 ${ObjectUtil.isNotEmpty(sunModel.etime) ? Utils.getDateStrFromJiekou(sunModel.etime) : '--'}',
style: TextStyle(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20))),
)
: Container(),
],
),
// widget.from == 'select'
// ? widget.showCheck
// ? Positioned(
// right: 0,
// top: ScreenUtil().setWidth(20),
// child: Image.asset(
// Utils.getImgPath(widget.couponSonModel.isCheck
// ? 'check_r'
// : 'check_un'),
// width: ScreenUtil().setWidth(40),
// height: ScreenUtil().setWidth(40),
// ))
// : Container()
// :
),
ObjectUtil.isNotEmpty(sunModel.explain)
? const MySeparator(
width: 3, color: MyColours.color_f3f3f3)
: SizedBox(),
ObjectUtil.isNotEmpty(sunModel.explain)
? InkWell(
onTap: () {
if (explainH > 19) {
setState(() {
widget.couponSonModel.showText =
!widget.couponSonModel.showText;
});
}
},
child: Container(
width: double.infinity,
decoration: BoxDecoration(
color: widget.from == 'history'
? MyColours.color_ffffff
? MyColours.color_BFC4D4
: notSelect
? MyColours.color_ffffff
: MyColours.color_FAFAFA,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(
ScreenUtil().setWidth(20)),
bottomRight: Radius.circular(
ScreenUtil().setWidth(20)))),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
widget.couponSonModel.showText
? Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(24 * 2),
ScreenUtil().setWidth(14),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(14)),
width: ScreenUtil().screenWidth -
ScreenUtil().setWidth(92 * 2),
child: Text(
'说明:${sunModel.explain}',
maxLines: 5,
style: TextStyle(
color: widget.from ==
'history'
? MyColours.color_BFC4D4
: MyColours
.color_999999,
fontSize: ScreenUtil()
.setSp(20))),
)
: Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(24 * 2),
ScreenUtil().setWidth(14),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(14)),
width: ScreenUtil().screenWidth -
ScreenUtil().setWidth(92 * 2) +
ScreenUtil().setWidth(20),
child: Text(
'说明:${sunModel.explain}',
maxLines: 1,
overflow: TextOverflow.fade,
softWrap: false,
style: TextStyle(
color: widget.from ==
'history'
? MyColours.color_BFC4D4
: MyColours
.color_999999,
fontSize: ScreenUtil()
.setSp(20))),
),
Spacer(),
explainH > 19
? Container(
margin: EdgeInsets.only(
top: ScreenUtil().setWidth(10),
right:
ScreenUtil().setWidth(16)),
child: Image.asset(
!widget.couponSonModel.showText
? Utils.getImgPath(
'quan_down_f')
: Utils.getImgPath(
'quan_up_f'),
width:
ScreenUtil().setWidth(28),
height:
ScreenUtil().setWidth(28)),
)
: Container(),
HEmptyView(14)
],
)),
)
: Container(),
],
),
)),
Positioned(
left: ScreenUtil().setWidth(21),
child: widget.from == 'select'
? Image.asset(
Utils.getImgPath(
sunModel.isCheck ? 'c_mul_select' : 'c_not_edit'),
width: w(21),
)
: Container()),
Positioned(
right: ScreenUtil().setWidth(100),
top: ScreenUtil().setWidth(37 * 2),
child: widget.showBtn
? RoundButton(
width: widget.from == 'history'
? ScreenUtil().setWidth(44 * 2)
: ScreenUtil().setWidth(32 * 2),
height: ScreenUtil().setWidth(21 * 2),
radius: ScreenUtil().setWidth(10),
text: widget.from == 'history'
? '已过期'
: notSelect
? '停用'
: '启用',
fontSize: 24,
textColor: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? MyColours.color_438E93
: MyColours.color_999999,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? MyColours.color_438E93
: MyColours.color_999999,
onPressed: widget.onPressedSwich,
)
: Container())
]);
? MyColours.color_515151
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
)),
),
VEmptyView(16),
(ObjectUtil.isNotEmpty(sunModel.stime) &&
sunModel.stime != '0') ||
(ObjectUtil.isNotEmpty(sunModel.etime) &&
sunModel.etime != '0')
? Container(
child: Text(
'使用时间:${ObjectUtil.isNotEmpty(sunModel.stime) ? Utils.getDateStrFromJiekou(sunModel.stime) : '--'} 至 ${ObjectUtil.isNotEmpty(sunModel.etime) ? Utils.getDateStrFromJiekou(sunModel.etime) : '--'}',
style: TextStyle(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20))),
)
: Container(),
],
),
// widget.from == 'select'
// ? widget.showCheck
// ? Positioned(
// right: 0,
// top: ScreenUtil().setWidth(20),
// child: Image.asset(
// Utils.getImgPath(widget.couponSonModel.isCheck
// ? 'check_r'
// : 'check_un'),
// width: ScreenUtil().setWidth(40),
// height: ScreenUtil().setWidth(40),
// ))
// : Container()
// :
),
ObjectUtil.isNotEmpty(sunModel.explain)
? const MySeparator(
width: 3, color: MyColours.color_f3f3f3)
: SizedBox(),
ObjectUtil.isNotEmpty(sunModel.explain)
? InkWell(
onTap: () {
if (explainH > 19) {
setState(() {
widget.couponSonModel.showText =
!widget.couponSonModel.showText;
});
}
},
child: Container(
width: double.infinity,
decoration: BoxDecoration(
color: widget.from == 'history'
? MyColours.color_ffffff
: notSelect
? MyColours.color_ffffff
: MyColours.color_FAFAFA,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(
ScreenUtil().setWidth(20)),
bottomRight: Radius.circular(
ScreenUtil().setWidth(20)))),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
widget.couponSonModel.showText
? Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(24 * 2),
ScreenUtil().setWidth(14),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(14)),
width: ScreenUtil().screenWidth -
ScreenUtil().setWidth(92 * 2),
child: Text(
'说明:${sunModel.explain}',
maxLines: 5,
style: TextStyle(
color: widget.from ==
'history'
? MyColours
.color_BFC4D4
: MyColours
.color_999999,
fontSize: ScreenUtil()
.setSp(20))),
)
: Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(24 * 2),
ScreenUtil().setWidth(14),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(14)),
width: ScreenUtil().screenWidth -
ScreenUtil()
.setWidth(92 * 2) +
ScreenUtil().setWidth(20),
child: Text(
'说明:${sunModel.explain}',
maxLines: 1,
overflow: TextOverflow.fade,
softWrap: false,
style: TextStyle(
color: widget.from ==
'history'
? MyColours
.color_BFC4D4
: MyColours
.color_999999,
fontSize: ScreenUtil()
.setSp(20))),
),
Spacer(),
explainH > 19
? Container(
margin: EdgeInsets.only(
top:
ScreenUtil().setWidth(10),
right: ScreenUtil()
.setWidth(16)),
child: Image.asset(
!widget.couponSonModel
.showText
? Utils.getImgPath(
'quan_down_f')
: Utils.getImgPath(
'quan_up_f'),
width:
ScreenUtil().setWidth(28),
height: ScreenUtil()
.setWidth(28)),
)
: Container(),
HEmptyView(14)
],
)),
)
: Container(),
VEmptyView(32),
],
),
)),
Positioned(
left: ScreenUtil().setWidth(21),
child: widget.from == 'select'
? Image.asset(
Utils.getImgPath(sunModel.isCheck
? widget.radio
? 'select_f'
: 'c_mul_select'
: widget.radio
? 'show_select_f'
: 'c_not_edit'),
width: w(25),
)
: Container()),
Positioned(
right: ScreenUtil().setWidth(100),
top: ScreenUtil().setWidth(37 * 2),
child: widget.showBtn
? RoundButton(
width: widget.from == 'history'
? ScreenUtil().setWidth(44 * 2)
: ScreenUtil().setWidth(32 * 2),
height: ScreenUtil().setWidth(21 * 2),
radius: ScreenUtil().setWidth(10),
text: widget.from == 'history'
? '已过期'
: notSelect
? '停用'
: '启用',
fontSize: 24,
textColor: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? MyColours.color_438E93
: MyColours.color_999999,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? MyColours.color_438E93
: MyColours.color_999999,
onPressed: widget.onPressedSwich,
)
: Container())
]),
VEmptyView(32)
]);
}
}
... ...
... ... @@ -5,6 +5,7 @@ import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/pages/coupon/coupon_item.dart';
import 'package:one_key/pages/coupon/coupon_item_f.dart';
import 'package:one_key/provider/SmsModel.dart';
import 'package:one_key/provider/coupon_provider.dart';
import 'package:one_key/provider/user_model.dart';
... ... @@ -157,9 +158,10 @@ class _MarkingCouponSelectPageState extends State<MarkingCouponSelectPage> {
// ? 'assets/select.png'
// : 'assets/unselect.png',
// width: ScreenUtil().setWidth(44)),
child: CouponItem(
child: CouponItemF(
from: 'select',
showCheck: true,
radio: true,
couponSonModel:
couponProvider.couponListSelect[index],
onPressed: () {
... ...
... ... @@ -81,10 +81,18 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
// 'uid': userModel.user.openid
};
await marketingCenterProvider.getNewRechargeList(context, params);
if (rechargeData == null &&
marketingCenterProvider.rechargeList != null &&
marketingCenterProvider.rechargeList.length > 0) {
rechargeData = marketingCenterProvider.rechargeList[0];
List<RechargeListSunModel> rechargeListCanUse = [];
if (marketingCenterProvider.rechargeList.length > 0) {
marketingCenterProvider.rechargeList.forEach((element) {
if (element.isOpen == '1') {
//启用状态
rechargeListCanUse.add(element);
}
});
}
if (rechargeData == null && rechargeListCanUse.length > 0) {
rechargeData = rechargeListCanUse[0];
_getRechargeContent();
setState(() {});
}
... ... @@ -470,15 +478,16 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
: SizedBox(),
],
),
VEmptyView(20),
Text(
content,
style: TextStyle(
height: 1.2,
fontSize: font(10),
fontWeight: FontWeight.bold,
color: MyColours.color_515151),
)
if (content != '') VEmptyView(20),
if (content != '')
Text(
content,
style: TextStyle(
height: 1.2,
fontSize: font(10),
fontWeight: FontWeight.bold,
color: MyColours.color_515151),
)
],
)),
RoundButton(
... ... @@ -508,27 +517,27 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
color: MyColours.color_ffffff,
margin: EdgeInsets.only(left: w(21), top: w(12), right: w(21)),
child: Column(children: [
// InkWell(
// onTap: () {
// setState(() {
// isLink = !isLink;
// });
// },
// child: Row(
// children: [
// Image.asset(
// Utils.getImgPath(isLink ? 'f_select' : 'f_select_not'),
// width: w(20),
// ),
// HEmptyView(20),
// Text(
// '推荐店内充值优惠活动链接',
// style: TextStyle(
// fontSize: font(14), color: MyColours.color_515151),
// )
// ],
// )),
// VEmptyView(24),
InkWell(
onTap: () {
setState(() {
isLink = !isLink;
});
},
child: Row(
children: [
Image.asset(
Utils.getImgPath(isLink ? 'f_select' : 'f_select_not'),
width: w(20),
),
HEmptyView(20),
Text(
'推荐店内充值优惠活动链接',
style: TextStyle(
fontSize: font(14), color: MyColours.color_515151),
)
],
)),
VEmptyView(24),
Container(
height: w(180),
child: _uploadImageProvider.firstImage.file != null ||
... ... @@ -713,38 +722,38 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
});
}),
),
// VEmptyView(40),
// Container(
// width: w(188),
// height: w(22),
// alignment: Alignment.center,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(r(11)),
// gradient: LinearGradient(stops: [
// -0.57,
// 0.55,
// 1.48
// ], colors: [
// MyColours.color_4C8DAD,
// MyColours.color_0143A3,
// MyColours.color_42A5FF
// ], begin: Alignment.centerLeft, end: Alignment.centerRight)),
// child: RoundButton(
// width: w(186),
// height: w(20),
// text: '点击了解更多会员优惠政策',
// gradientStart: MyColours.color_ffffff,
// gradientEnd: MyColours.color_ffffff,
// borderColor: Colors.transparent,
// // borderColor: MyColours.color_999999,
// textColor: MyColours.color_999999,
// radius: r(11),
// fontSize: 24,
// isBold: true,
// onPressed: () {},
// )),
// VEmptyView(18),
VEmptyView(40),
Container(
width: w(188),
height: w(22),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(r(11)),
gradient: LinearGradient(stops: [
-0.57,
0.55,
1.48
], colors: [
MyColours.color_4C8DAD,
MyColours.color_0143A3,
MyColours.color_42A5FF
], begin: Alignment.centerLeft, end: Alignment.centerRight)),
child: RoundButton(
width: w(186),
height: w(20),
text: '点击了解更多会员优惠政策',
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: Colors.transparent,
// borderColor: MyColours.color_999999,
textColor: MyColours.color_999999,
radius: r(11),
fontSize: 24,
isBold: true,
onPressed: () {},
)),
VEmptyView(18),
// Container(
// height: w(28),
// alignment: Alignment.center,
... ... @@ -865,7 +874,7 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
Map temp =
await NavigatorUtil.goMarkingRechargeSelectPage(
context, rechargeData.id);
if (temp['recharge'] != null) {
if (temp != null && temp['recharge'] != null) {
rechargeData = temp['recharge'];
_getRechargeContent();
setState(() {});
... ...
... ... @@ -1366,25 +1366,29 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> {
// .setWidth(imgSize * 2),
height: w(180),
)),
VEmptyView(40),
Container(
width: double.infinity,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
),
child: Text(
_marketingCenterProvider.markDataModel.marketing.wecomle,
style: TextStyle(
color: MyColours.color_000000,
fontSize: ScreenUtil().setSp(40),
textBaseline: TextBaseline.alphabetic),
textAlign: TextAlign.center,
maxLines: 5,
overflow: TextOverflow.ellipsis,
// maxLength: 38,
if (_marketingCenterProvider.markDataModel.marketing.wecomle != null &&
_marketingCenterProvider.markDataModel.marketing.wecomle != '')
VEmptyView(40),
if (_marketingCenterProvider.markDataModel.marketing.wecomle != null &&
_marketingCenterProvider.markDataModel.marketing.wecomle != '')
Container(
width: double.infinity,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
),
child: Text(
_marketingCenterProvider.markDataModel.marketing.wecomle,
style: TextStyle(
color: MyColours.color_000000,
fontSize: ScreenUtil().setSp(40),
textBaseline: TextBaseline.alphabetic),
textAlign: TextAlign.center,
maxLines: 5,
overflow: TextOverflow.ellipsis,
// maxLength: 38,
),
),
),
_marketingCenterProvider.markDataModel.marketing.isLink == '1'
? VEmptyView(90)
: SizedBox(),
... ...
... ... @@ -44,6 +44,8 @@ class _MarkingRechargeSelectPageState extends State<MarkingRechargeSelectPage> {
MarketingCenterProvider marketingCenterProvider;
RechargeListSunModel selectData;
List<RechargeListSunModel> rechargeListCanUse = []; //没有停用的优惠
@override
void initState() {
// TODO: implement initState
... ... @@ -51,6 +53,7 @@ class _MarkingRechargeSelectPageState extends State<MarkingRechargeSelectPage> {
WidgetsBinding.instance.addPostFrameCallback((_) {
// if (!couponProvider.hasModify) {
_getNewRechargeList();
// } else {
// couponProvider.pageStateSelect = PageState.Success;
// // couponProvider.notifyListeners();
... ... @@ -66,20 +69,35 @@ class _MarkingRechargeSelectPageState extends State<MarkingRechargeSelectPage> {
///获取优惠券列表数据
///
_getNewRechargeList() async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {
"sellerid": userModel.user.sellerid,
// 'uid': userModel.user.openid
};
await marketingCenterProvider.getNewRechargeList(context,params);
outerloop:
for (var i = 0; i < marketingCenterProvider.rechargeList.length; i++) {
if (marketingCenterProvider.rechargeList[i].id == widget.selectid) {
marketingCenterProvider.rechargeList[i].isCheck = true;
selectData = marketingCenterProvider.rechargeList[i];
break outerloop;
await marketingCenterProvider.getNewRechargeList(context, params);
rechargeListCanUse = [];
marketingCenterProvider.rechargeList.forEach((element) {
if (element.isOpen == '1') {
//启用状态
rechargeListCanUse.add(element);
}
});
if (rechargeListCanUse.length == 0) {
marketingCenterProvider.pageStateRechargeHome = PageState.Empty;
} else {
marketingCenterProvider.pageStateRechargeHome = PageState.Success;
outerloop:
for (var i = 0; i < rechargeListCanUse.length; i++) {
if (rechargeListCanUse[i].id == widget.selectid) {
rechargeListCanUse[i].isCheck = true;
selectData = rechargeListCanUse[i];
break outerloop;
}
}
}
setState(() {});
}
... ... @@ -90,7 +108,7 @@ class _MarkingRechargeSelectPageState extends State<MarkingRechargeSelectPage> {
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'优惠券',
'充值优惠活动',
onTap: () {
Navigator.pop(context);
},
... ... @@ -129,15 +147,12 @@ class _MarkingRechargeSelectPageState extends State<MarkingRechargeSelectPage> {
return InkWell(
onTap: () {
//改这里 ******8
marketingCenterProvider.rechargeList
.forEach((element) {
rechargeListCanUse.forEach((element) {
element.isCheck = false;
});
marketingCenterProvider
.rechargeList[index].isCheck = true;
selectData =
marketingCenterProvider.rechargeList[index];
rechargeListCanUse[index].isCheck = true;
selectData = rechargeListCanUse[index];
},
// child: Row(
// children: [
... ... @@ -159,30 +174,25 @@ class _MarkingRechargeSelectPageState extends State<MarkingRechargeSelectPage> {
child: RechargeItem(
from: 'select',
showCheck: true,
rechargeListSunModel: marketingCenterProvider
.rechargeList[index],
rechargeListSunModel:
rechargeListCanUse[index],
onPressed: () {
// bool old = couponProvider
// .couponListSelect[index].isCheck;
//改这里 ******8
marketingCenterProvider.rechargeList
.forEach((element) {
rechargeListCanUse.forEach((element) {
element.isCheck = false;
});
marketingCenterProvider
.rechargeList[index].isCheck = true;
rechargeListCanUse[index].isCheck = true;
selectData = marketingCenterProvider
.rechargeList[index];
selectData = rechargeListCanUse[index];
// couponProvider
// .couponListSelect[index].isCheck = !old;
setState(() {});
}));
},
childCount:
marketingCenterProvider.rechargeList.length),
}, childCount: rechargeListCanUse.length),
)
],
// onRefresh: () async {
... ...
... ... @@ -94,74 +94,167 @@ class _RechargeItemState extends State<RechargeItem> {
// }
return InkWell(
onTap: widget.onPressed,
child: Stack(
clipBehavior: Clip.none,
alignment: Alignment.centerLeft,
children: [
InkWell(
onTap: widget.onPressed,
child: Container(
// width: ScreenUtil().setWidth(610),
margin: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(30),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(0)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
spreadRadius: ScreenUtil().setWidth(2),
color: Color.fromRGBO(0, 0, 0, 0.25),
offset: Offset(0, ScreenUtil().setWidth(8)),
blurRadius: ScreenUtil().setWidth(8))
],
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(16)),
),
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: ScreenUtil().setWidth(60),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
decoration: decoration,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
widget.rechargeListSunModel.rname,
style: TextStyle(
color: MyColours.color_ffffff,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
),
Text(
'更新时间:${widget.rechargeListSunModel.cdateStr}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(20))),
],
child: Column(
children: [
Stack(
clipBehavior: Clip.none,
alignment: Alignment.centerLeft,
children: [
InkWell(
onTap: widget.onPressed,
child: Container(
// width: ScreenUtil().setWidth(610),
margin: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(0)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
spreadRadius: ScreenUtil().setWidth(2),
color: Color.fromRGBO(0, 0, 0, 0.25),
offset: Offset(0, ScreenUtil().setWidth(8)),
blurRadius: ScreenUtil().setWidth(8))
],
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(16)),
),
),
Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(20 * 2),
ScreenUtil().setWidth(26),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(26)),
child: widget.from == 'menu-show'
? Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: ScreenUtil().setWidth(60),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
decoration: decoration,
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
widget.rechargeListSunModel.rname,
style: TextStyle(
color: MyColours.color_ffffff,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
),
Text(
'更新时间:${widget.rechargeListSunModel.cdateStr}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(20))),
],
),
),
Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(20 * 2),
ScreenUtil().setWidth(26),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(26)),
child: widget.from == 'menu-show'
? Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
if (widget.rechargeListSunModel
.rechargeList.isPrice ==
'1')
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
constraints: BoxConstraints(
maxWidth: w(180)),
margin: EdgeInsets.only(
bottom: w(5)),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠余额${widget.rechargeListSunModel.rechargeList.price}元;',
maxLines: 10,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color: MyColours
.color_999999,
fontSize: ScreenUtil()
.setSp(20),
)),
),
if (widget.rechargeListSunModel
.rechargeList.isScore ==
'1')
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
margin: EdgeInsets.only(
bottom: w(5)),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${widget.rechargeListSunModel.rechargeList.score}积分;',
maxLines: 10,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color: MyColours
.color_999999,
fontSize: ScreenUtil()
.setSp(20),
)),
),
if (widget.rechargeListSunModel
.rechargeList.isCoupons ==
'1')
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${Utils.listToStringEnglish3(widget.rechargeListSunModel.rechargeList.couponsNames)}。',
maxLines: 10,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color: MyColours
.color_999999,
fontSize: ScreenUtil()
.setSp(20),
)),
),
],
)),
if (widget
.rechargeListSunModel.qrcode !=
null)
Column(
children: [
CachedNetworkImage(
imageUrl: widget
.rechargeListSunModel
.qrcode,
width: w(60),
fit: BoxFit.cover,
),
VEmptyView(10),
Text(
'长按识别二维码前往充值',
style: TextStyle(
fontSize: font(10),
color:
MyColours.color_999999),
)
],
)
],
)
: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
... ... @@ -171,13 +264,11 @@ class _RechargeItemState extends State<RechargeItem> {
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
constraints: BoxConstraints(
maxWidth: w(180)),
margin:
EdgeInsets.only(bottom: w(5)),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠余额${widget.rechargeListSunModel.rechargeList.price}元;',
maxLines: 10,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
... ... @@ -195,7 +286,7 @@ class _RechargeItemState extends State<RechargeItem> {
EdgeInsets.only(bottom: w(5)),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${widget.rechargeListSunModel.rechargeList.score}积分;',
maxLines: 10,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
... ... @@ -211,7 +302,7 @@ class _RechargeItemState extends State<RechargeItem> {
// width: ScreenUtil().setWidth(232 * 2),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${Utils.listToStringEnglish3(widget.rechargeListSunModel.rechargeList.couponsNames)}。',
maxLines: 10,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
... ... @@ -220,174 +311,105 @@ class _RechargeItemState extends State<RechargeItem> {
)),
),
],
)),
if (widget.rechargeListSunModel.qrcode !=
null)
Column(
children: [
CachedNetworkImage(
imageUrl: widget
.rechargeListSunModel.qrcode,
width: w(60),
fit: BoxFit.cover,
),
VEmptyView(10),
Text(
'长按识别二维码前往充值',
style: TextStyle(
fontSize: font(10),
color: MyColours.color_999999),
)
],
)
],
)
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (widget.rechargeListSunModel.rechargeList
.isPrice ==
'1')
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
margin: EdgeInsets.only(bottom: w(5)),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠余额${widget.rechargeListSunModel.rechargeList.price}元;',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
)),
),
if (widget.rechargeListSunModel.rechargeList
.isScore ==
'1')
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
margin: EdgeInsets.only(bottom: w(5)),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${widget.rechargeListSunModel.rechargeList.score}积分;',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
)),
),
if (widget.rechargeListSunModel.rechargeList
.isCoupons ==
'1')
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${Utils.listToStringEnglish3(widget.rechargeListSunModel.rechargeList.couponsNames)}。',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
)),
),
],
),
),
// widget.from == 'select'
// ? widget.showCheck
// ? Positioned(
// right: 0,
// top: ScreenUtil().setWidth(20),
// child: Image.asset(
// Utils.getImgPath(widget.couponSonModel.isCheck
// ? 'check_r'
// : 'check_un'),
// width: ScreenUtil().setWidth(40),
// height: ScreenUtil().setWidth(40),
// ))
// : Container()
// :
),
if (widget.showBtn && widget.from != 'history')
MySeparator(
width: w(4), color: MyColours.color_BFC4D4),
if (widget.showBtn) VEmptyView(15),
if (widget.showBtn && widget.from != 'history')
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
RoundButton(
width: widget.from == 'history'
? ScreenUtil().setWidth(50 * 2)
: ScreenUtil().setWidth(50 * 2),
height: ScreenUtil().setWidth(20 * 2),
radius: ScreenUtil().setWidth(10),
text: '删除',
fontSize: 24,
textColor: MyColours.color_E34D59,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_E34D59,
onPressed: widget.onPressedDel,
),
HEmptyView(34),
RoundButton(
width: ScreenUtil().setWidth(50 * 2),
height: ScreenUtil().setWidth(20 * 2),
radius: ScreenUtil().setWidth(10),
text: widget.rechargeListSunModel.isOpen ==
'1'
? '禁用'
: '启用',
// widget.from == 'select'
// ? widget.showCheck
// ? Positioned(
// right: 0,
// top: ScreenUtil().setWidth(20),
// child: Image.asset(
// Utils.getImgPath(widget.couponSonModel.isCheck
// ? 'check_r'
// : 'check_un'),
// width: ScreenUtil().setWidth(40),
// height: ScreenUtil().setWidth(40),
// ))
// : Container()
// :
///启用
fontSize: 24,
textColor: MyColours.color_438E93,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
onPressed: widget.onPressedUse,
),
HEmptyView(38),
],
),
if (widget.showBtn && widget.from != 'history')
VEmptyView(15)
],
),
if (widget.showBtn && widget.from != 'history')
MySeparator(
width: w(4), color: MyColours.color_BFC4D4),
if (widget.showBtn) VEmptyView(15),
if (widget.showBtn && widget.from != 'history')
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
RoundButton(
)),
widget.showCheck
? Positioned(
left: w(10),
// top: ScreenUtil().setWidth(115),
child: Image.asset(
Utils.getImgPath(widget.rechargeListSunModel.isCheck
? 'select_f'
: 'show_select_f'),
width: ScreenUtil().setWidth(50),
height: ScreenUtil().setWidth(50),
))
: SizedBox(),
if (widget.from == 'history')
Positioned(
right: ScreenUtil().setWidth(100),
top: ScreenUtil().setWidth(60 * 2),
child: widget.showBtn
? RoundButton(
width: widget.from == 'history'
? ScreenUtil().setWidth(50 * 2)
: ScreenUtil().setWidth(50 * 2),
height: ScreenUtil().setWidth(20 * 2),
? ScreenUtil().setWidth(44 * 2)
: ScreenUtil().setWidth(32 * 2),
height: ScreenUtil().setWidth(21 * 2),
radius: ScreenUtil().setWidth(10),
text: '删除',
text: '已过期',
fontSize: 24,
textColor: MyColours.color_E34D59,
textColor: MyColours.color_BFC4D4,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_E34D59,
onPressed: widget.onPressedDel,
),
HEmptyView(34),
RoundButton(
width: ScreenUtil().setWidth(50 * 2),
height: ScreenUtil().setWidth(20 * 2),
radius: ScreenUtil().setWidth(10),
text: widget.rechargeListSunModel.isOpen == '1'
? '禁用'
: '启用',
///启用
fontSize: 24,
textColor: MyColours.color_438E93,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
onPressed: widget.onPressedUse,
),
HEmptyView(38),
],
),
if (widget.showBtn && widget.from != 'history')
VEmptyView(15)
],
),
)),
widget.showCheck
? Positioned(
left: w(10),
top: ScreenUtil().setWidth(115),
child: Image.asset(
Utils.getImgPath(widget.rechargeListSunModel.isCheck
? 'select_f'
: 'show_select_f'),
width: ScreenUtil().setWidth(50),
height: ScreenUtil().setWidth(50),
))
: SizedBox(),
if (widget.from == 'history')
Positioned(
right: ScreenUtil().setWidth(100),
top: ScreenUtil().setWidth(60 * 2),
child: widget.showBtn
? RoundButton(
width: widget.from == 'history'
? ScreenUtil().setWidth(44 * 2)
: ScreenUtil().setWidth(32 * 2),
height: ScreenUtil().setWidth(21 * 2),
radius: ScreenUtil().setWidth(10),
text: '已过期',
fontSize: 24,
textColor: MyColours.color_BFC4D4,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_BFC4D4,
)
: Container())
]));
borderColor: MyColours.color_BFC4D4,
)
: Container())
]),
VEmptyView(30)
],
));
}
}
... ...
... ... @@ -226,7 +226,10 @@ class _RechargeSelectStoreCouponPageState
}
couponProvider.getCheckValue();
}
}));
})
);
}, childCount: couponProvider.couponListSelect.length),
)
],
... ...