|
...
|
...
|
@@ -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 '../../provider/base_info_provider.dart';
|
|
|
|
import '../../utils/screen_util.dart';
|
|
|
|
import '../../widgets/page_exception.dart';
|
|
|
|
|
|
...
|
...
|
@@ -40,6 +41,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
|
|
final heightCell = ScreenUtil().setWidth(80);
|
|
|
|
CouponProvider couponProvider;
|
|
|
|
PageState pageState = PageState.Loading;
|
|
|
|
String managerName = '';
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
...
|
...
|
@@ -48,6 +50,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
// if (widget.idstr != null && widget.idstr != 'null') {
|
|
|
|
_getActivityById();
|
|
|
|
_getCustomerActivityBaseinfo();
|
|
|
|
// } else {
|
|
|
|
// couponProvider.couponSunModel = widget.couponSunModel;
|
|
|
|
// pageState = PageState.Success;
|
|
...
|
...
|
@@ -56,6 +59,21 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
_getCustomerActivityBaseinfo() async {
|
|
|
|
BaseIndoProvider _baseIndoProvider =
|
|
|
|
Provider.of<BaseIndoProvider>(context, listen: false);
|
|
|
|
Map<String, String> params = {
|
|
|
|
'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
|
|
|
|
};
|
|
|
|
|
|
|
|
bool success =
|
|
|
|
await _baseIndoProvider.getCustomerActivityBaseinfo(context, params);
|
|
|
|
if (success) {
|
|
|
|
managerName = _baseIndoProvider.baseInfoSunModel.name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_getActivityById() async {
|
|
|
|
pageState = PageState.Loading;
|
|
|
|
bool success = await couponProvider
|
|
...
|
...
|
@@ -216,21 +234,28 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
|
|
},
|
|
|
|
rightImgName: couponProvider != null &&
|
|
|
|
couponProvider.couponSunModel != null &&
|
|
|
|
couponProvider.couponSunModel.isType == '1' &&
|
|
|
|
couponProvider.couponSunModel.isExamine == '1' &&
|
|
|
|
// 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') {
|
|
|
|
if (couponProvider.couponSunModel.isType == '1' &&
|
|
|
|
couponProvider.couponSunModel.isExamine == '1' &&
|
|
|
|
couponProvider.couponSunModel.status == '1') {
|
|
|
|
//店铺可核销券
|
|
|
|
//店铺券
|
|
|
|
Utils.goShareBuyCouponToWeChat(
|
|
|
|
context,
|
|
|
|
widget.idstr,
|
|
|
|
couponProvider.couponSunModel.use,
|
|
|
|
couponProvider.couponSunModel);
|
|
|
|
} else if (couponProvider.couponSunModel.isType == '2' &&
|
|
|
|
couponProvider.couponSunModel.status == '1') {
|
|
|
|
// 我的优惠券
|
|
|
|
Utils.goShareBuyCouponToWeChatMy(context, widget.idstr,
|
|
|
|
managerName, couponProvider.couponSunModel);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
...
|
...
|
@@ -442,7 +467,8 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
|
|
_item(
|
|
|
|
'发放总量限制',
|
|
|
|
couponProvider
|
|
|
|
.couponSunModel.grantNum??''),
|
|
|
|
.couponSunModel.grantNum ??
|
|
|
|
''),
|
|
|
|
// _select(
|
|
|
|
// '谁可以发放',
|
|
|
|
// '查看',
|
...
|
...
|
|