|
...
|
...
|
@@ -18,6 +18,7 @@ import 'package:one_key/widgets/system_app_bar.dart'; |
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
import '../../models/IsExamineModel.dart';
|
|
|
|
import '../../utils/screen_util.dart';
|
|
|
|
import '../../widgets/page_exception.dart';
|
|
|
|
|
|
...
|
...
|
@@ -26,10 +27,12 @@ import '../../widgets/page_exception.dart'; |
|
|
|
*/
|
|
|
|
|
|
|
|
class CouponVerificationDetailPage extends StatefulWidget {
|
|
|
|
final CouponSunModel couponSunModel;
|
|
|
|
final String idstr;
|
|
|
|
CouponVerificationDetailPage({Key key, this.couponSunModel, this.idstr})
|
|
|
|
: super(key: key);
|
|
|
|
final IsExamineSunModel isExamineSunModel;
|
|
|
|
|
|
|
|
CouponVerificationDetailPage({
|
|
|
|
Key key,
|
|
|
|
this.isExamineSunModel,
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_CouponVerificationDetailPageState createState() =>
|
|
...
|
...
|
@@ -49,27 +52,15 @@ class _CouponVerificationDetailPageState |
|
|
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
// if (widget.idstr != null && widget.idstr != 'null') {
|
|
|
|
_getActivityById();
|
|
|
|
// _getActivityById();
|
|
|
|
// } else {
|
|
|
|
// couponProvider.couponSunModel = widget.couponSunModel;
|
|
|
|
// pageState = PageState.Success;
|
|
|
|
// setState(() {});
|
|
|
|
// ;
|
|
|
|
// pageState = PageState.Success;
|
|
|
|
// setState(() {});
|
|
|
|
// }
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
_getActivityById() async {
|
|
|
|
pageState = PageState.Loading;
|
|
|
|
bool success = await couponProvider
|
|
|
|
.getActivityById(context, {'id': widget.idstr}, isShowLoading: false);
|
|
|
|
if (success) {
|
|
|
|
pageState = PageState.Success;
|
|
|
|
} else {
|
|
|
|
pageState = PageState.ConnectivityError;
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
|
|
|
|
///时间选择
|
|
|
|
Widget _select(String title, String hintText, GestureTapCallback onTap) {
|
|
|
|
return InkWell(
|
|
...
|
...
|
@@ -216,277 +207,215 @@ class _CouponVerificationDetailPageState |
|
|
|
onTap: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
rightImgName: couponProvider.couponSunModel.isType == '1' &&
|
|
|
|
couponProvider.couponSunModel.isExamine == '1' &&
|
|
|
|
couponProvider.couponSunModel.status == '1'
|
|
|
|
? 'share.png'
|
|
|
|
: null,
|
|
|
|
onTapRight: () {
|
|
|
|
if (couponProvider.couponSunModel.isType == '1' &&
|
|
|
|
couponProvider.couponSunModel.isExamine == '1' &&
|
|
|
|
couponProvider.couponSunModel.status == '1') {
|
|
|
|
//店铺可核销券
|
|
|
|
Utils.goShareBuyCouponToWeChat(
|
|
|
|
context,
|
|
|
|
widget.idstr,
|
|
|
|
couponProvider.couponSunModel.use,
|
|
|
|
couponProvider.couponSunModel);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
|
|
body: Consumer<CouponProvider>(builder: (context, model, _) {
|
|
|
|
if (pageState != PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: pageState,
|
|
|
|
callback: () {
|
|
|
|
_getActivityById();
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有数据哦,",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return Column(children: [
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
controller: controller,
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(32)),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
VEmptyView(56),
|
|
|
|
_item(
|
|
|
|
'券类型',
|
|
|
|
couponProvider.couponSunModel.isType == '1'
|
|
|
|
? '店铺优惠券'
|
|
|
|
: '我的优惠券'),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item('券编码', 'NO.01774420230223150306'),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item('券名称', couponProvider.couponSunModel.aname),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
body:
|
|
|
|
// Consumer<CouponProvider>(builder: (context, model, _) {
|
|
|
|
// if (pageState != PageState.Success) {
|
|
|
|
// return ExceptionPage(
|
|
|
|
// pageState: pageState,
|
|
|
|
// callback: () {
|
|
|
|
// // _getActivityById();
|
|
|
|
// },
|
|
|
|
// emptyMsg: "暂时没有数据哦,",
|
|
|
|
// emptyImg: "empty_search",
|
|
|
|
// showMsg: "加载中,请稍后...",
|
|
|
|
// );
|
|
|
|
// } else {
|
|
|
|
// return
|
|
|
|
Column(children: [
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
controller: controller,
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(32)),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
VEmptyView(56),
|
|
|
|
_item(
|
|
|
|
'券类型',
|
|
|
|
widget.isExamineSunModel.type == '1'
|
|
|
|
? '店铺优惠券'
|
|
|
|
: '我的优惠券'),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item('券编码', widget.isExamineSunModel.orderNo ?? ''),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item(
|
|
|
|
'券名称', widget.isExamineSunModel.rechargeName ?? ""),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
|
|
|
|
VEmptyView(24),
|
|
|
|
if (couponProvider.couponSunModel.use != null)
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
// _item(
|
|
|
|
// '券用途',
|
|
|
|
// couponProvider.couponSunModel.use.isCash
|
|
|
|
// ? '代金券'
|
|
|
|
// : couponProvider
|
|
|
|
// .couponSunModel.use.isDiscount
|
|
|
|
// ? '折扣券'
|
|
|
|
// : couponProvider
|
|
|
|
// .couponSunModel.use.isDish
|
|
|
|
// ? '菜品券'
|
|
|
|
// : ''),
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(2),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// _item(
|
|
|
|
// couponProvider.couponSunModel.use.isCash
|
|
|
|
// ? '金额'
|
|
|
|
// : couponProvider
|
|
|
|
// .couponSunModel.use.isDiscount
|
|
|
|
// ? '折扣率'
|
|
|
|
// : couponProvider
|
|
|
|
// .couponSunModel.use.isDish
|
|
|
|
// ? '菜品'
|
|
|
|
// : '',
|
|
|
|
// couponProvider.couponSunModel.use.isCash
|
|
|
|
// ? '${couponProvider.couponSunModel.use.cash}元'
|
|
|
|
// : couponProvider
|
|
|
|
// .couponSunModel.use.isDiscount
|
|
|
|
// ? '${couponProvider.couponSunModel.use.discount}折'
|
|
|
|
// : couponProvider
|
|
|
|
// .couponSunModel.use.isDish
|
|
|
|
// ? couponProvider
|
|
|
|
// .couponSunModel.use.dish
|
|
|
|
// : ''),
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(2),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
// VEmptyView(24),
|
|
|
|
_item(
|
|
|
|
'销售价',
|
|
|
|
'${couponProvider.couponSunModel.price}元' ??
|
|
|
|
''),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
VEmptyView(24),
|
|
|
|
_item(
|
|
|
|
'销售价', '${widget.isExamineSunModel.price ?? ''}元'),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item('券要求', widget.isExamineSunModel.desc ?? ''),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item(
|
|
|
|
'有效期从',
|
|
|
|
Utils.getDateStrFromJiekou(
|
|
|
|
widget.isExamineSunModel.stime)),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item(
|
|
|
|
'有效期至',
|
|
|
|
Utils.getDateStrFromJiekou(
|
|
|
|
widget.isExamineSunModel.etime)),
|
|
|
|
|
|
|
|
Column(children: [
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item(
|
|
|
|
'使用限制',
|
|
|
|
widget.isExamineSunModel.expDate.isNone
|
|
|
|
? '无'
|
|
|
|
: widget.isExamineSunModel.expDate.isBirthday
|
|
|
|
? '会员生日当天'
|
|
|
|
: widget.isExamineSunModel.expDate.isWeek
|
|
|
|
? '每周指定日期餐段可用'
|
|
|
|
: ''),
|
|
|
|
if (widget.isExamineSunModel.expDate.isWeek)
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(16)),
|
|
|
|
child: Text(
|
|
|
|
widget.isExamineSunModel.expDate.weekShow,
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
style: TextStyle(
|
|
|
|
height: 1.5,
|
|
|
|
fontSize: font(16),
|
|
|
|
color: MyColours.color_999999),
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
_item('券要求', couponProvider.couponSunModel.desc),
|
|
|
|
)),
|
|
|
|
if (widget.isExamineSunModel.expDate.isWeek)
|
|
|
|
VEmptyView(24),
|
|
|
|
]),
|
|
|
|
|
|
|
|
// widget.isExamineSunModel.isType == '1'
|
|
|
|
// ? Column(
|
|
|
|
// crossAxisAlignment:
|
|
|
|
// CrossAxisAlignment.start,
|
|
|
|
// children: [
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(2),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// _item('创建人',
|
|
|
|
// widget.isExamineSunModel.uid),
|
|
|
|
// ],
|
|
|
|
// )
|
|
|
|
// : SizedBox(),
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item(
|
|
|
|
'有效期从',
|
|
|
|
Utils.getDateStrFromJiekou(
|
|
|
|
couponProvider.couponSunModel.stime)),
|
|
|
|
_item('核销日期',
|
|
|
|
widget.isExamineSunModel.examineTimeStr),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item(
|
|
|
|
'有效期至',
|
|
|
|
Utils.getDateStrFromJiekou(
|
|
|
|
couponProvider.couponSunModel.etime)),
|
|
|
|
|
|
|
|
Column(children: [
|
|
|
|
Container(
|
|
|
|
_item('核销人',
|
|
|
|
widget.isExamineSunModel.examineName ?? ''),
|
|
|
|
// _select(
|
|
|
|
// '谁可以发放',
|
|
|
|
// '查看',
|
|
|
|
// () async {
|
|
|
|
// await NavigatorUtil
|
|
|
|
// .goCouponToPersonnalPage(
|
|
|
|
// context,
|
|
|
|
// couponProvider
|
|
|
|
// .couponSunModel.uidList,
|
|
|
|
// onlyShow: true);
|
|
|
|
// },
|
|
|
|
// )
|
|
|
|
],
|
|
|
|
),
|
|
|
|
widget.isExamineSunModel.explain != null &&
|
|
|
|
widget.isExamineSunModel.explain != ''
|
|
|
|
? Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item(
|
|
|
|
'使用限制',
|
|
|
|
couponProvider.couponSunModel.expDate.isNone
|
|
|
|
? '无'
|
|
|
|
: couponProvider
|
|
|
|
.couponSunModel.expDate.isBirthday
|
|
|
|
? '会员生日当天'
|
|
|
|
: couponProvider
|
|
|
|
.couponSunModel.expDate.isWeek
|
|
|
|
? '每周指定日期餐段可用'
|
|
|
|
: ''),
|
|
|
|
if (couponProvider.couponSunModel.expDate.isWeek)
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(16)),
|
|
|
|
child: Text(
|
|
|
|
couponProvider
|
|
|
|
.couponSunModel.expDate.weekShow,
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
style: TextStyle(
|
|
|
|
height: 1.5,
|
|
|
|
fontSize: font(16),
|
|
|
|
color: MyColours.color_999999),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
if (couponProvider.couponSunModel.expDate.isWeek)
|
|
|
|
VEmptyView(24),
|
|
|
|
]),
|
|
|
|
|
|
|
|
// couponProvider.couponSunModel.isType == '1'
|
|
|
|
// ? Column(
|
|
|
|
// crossAxisAlignment:
|
|
|
|
// CrossAxisAlignment.start,
|
|
|
|
// children: [
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(2),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// _item('创建人',
|
|
|
|
// couponProvider.couponSunModel.uid),
|
|
|
|
// ],
|
|
|
|
// )
|
|
|
|
// : SizedBox(),
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item('核销日期', '2023-05-05'),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item('核销人', '核销人'),
|
|
|
|
// _select(
|
|
|
|
// '谁可以发放',
|
|
|
|
// '查看',
|
|
|
|
// () async {
|
|
|
|
// await NavigatorUtil
|
|
|
|
// .goCouponToPersonnalPage(
|
|
|
|
// context,
|
|
|
|
// couponProvider
|
|
|
|
// .couponSunModel.uidList,
|
|
|
|
// onlyShow: true);
|
|
|
|
// },
|
|
|
|
// )
|
|
|
|
],
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
widget.isExamineSunModel.explain != null &&
|
|
|
|
widget.isExamineSunModel.explain != ''
|
|
|
|
? VEmptyView(24)
|
|
|
|
: SizedBox(),
|
|
|
|
widget.isExamineSunModel.explain != null &&
|
|
|
|
widget.isExamineSunModel.explain != ''
|
|
|
|
? _item('券说明', '')
|
|
|
|
: SizedBox(),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
if (widget.isExamineSunModel.explain != null &&
|
|
|
|
widget.isExamineSunModel.explain != '')
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
widget.isExamineSunModel.explain,
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
style: TextStyle(
|
|
|
|
// height: 1.5,
|
|
|
|
fontSize: font(16),
|
|
|
|
color: MyColours.color_999999),
|
|
|
|
),
|
|
|
|
couponProvider.couponSunModel.explain != null &&
|
|
|
|
couponProvider.couponSunModel.explain != ''
|
|
|
|
? Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
couponProvider.couponSunModel.explain != null &&
|
|
|
|
couponProvider.couponSunModel.explain != ''
|
|
|
|
? VEmptyView(24)
|
|
|
|
: SizedBox(),
|
|
|
|
couponProvider.couponSunModel.explain != null &&
|
|
|
|
couponProvider.couponSunModel.explain != ''
|
|
|
|
? _item('券说明', '')
|
|
|
|
: SizedBox(),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
if (couponProvider.couponSunModel.explain != null &&
|
|
|
|
couponProvider.couponSunModel.explain != '')
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
couponProvider.couponSunModel.explain,
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
style: TextStyle(
|
|
|
|
// height: 1.5,
|
|
|
|
fontSize: font(16),
|
|
|
|
color: MyColours.color_999999),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (couponProvider.couponSunModel.explain != null &&
|
|
|
|
couponProvider.couponSunModel.explain != '')
|
|
|
|
VEmptyView(24),
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(2),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
VEmptyView(24),
|
|
|
|
_canUse(
|
|
|
|
'立即启用',
|
|
|
|
couponProvider.couponSunModel.status == '1'
|
|
|
|
? true
|
|
|
|
: false)
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
)
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}));
|
|
|
|
),
|
|
|
|
if (widget.isExamineSunModel.explain != null &&
|
|
|
|
widget.isExamineSunModel.explain != '')
|
|
|
|
VEmptyView(24),
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(2),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// _canUse(
|
|
|
|
// '立即启用',
|
|
|
|
// widget.isExamineSunModel.status == '1'
|
|
|
|
// ? true
|
|
|
|
// : false)
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
)
|
|
|
|
])
|
|
|
|
// ;
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|