|
@@ -18,6 +18,7 @@ import 'package:one_key/widgets/system_app_bar.dart'; |
|
@@ -18,6 +18,7 @@ import 'package:one_key/widgets/system_app_bar.dart'; |
|
18
|
import 'package:one_key/widgets/v_empty_view.dart';
|
18
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
19
|
import 'package:provider/provider.dart';
|
19
|
import 'package:provider/provider.dart';
|
|
20
|
|
20
|
|
|
|
|
21
|
+import '../../provider/base_info_provider.dart';
|
|
21
|
import '../../utils/screen_util.dart';
|
22
|
import '../../utils/screen_util.dart';
|
|
22
|
import '../../widgets/page_exception.dart';
|
23
|
import '../../widgets/page_exception.dart';
|
|
23
|
|
24
|
|
|
@@ -40,6 +41,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
@@ -40,6 +41,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
40
|
final heightCell = ScreenUtil().setWidth(80);
|
41
|
final heightCell = ScreenUtil().setWidth(80);
|
|
41
|
CouponProvider couponProvider;
|
42
|
CouponProvider couponProvider;
|
|
42
|
PageState pageState = PageState.Loading;
|
43
|
PageState pageState = PageState.Loading;
|
|
|
|
44
|
+ String managerName = '';
|
|
43
|
|
45
|
|
|
44
|
@override
|
46
|
@override
|
|
45
|
void initState() {
|
47
|
void initState() {
|
|
@@ -48,6 +50,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
@@ -48,6 +50,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
48
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
50
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
49
|
// if (widget.idstr != null && widget.idstr != 'null') {
|
51
|
// if (widget.idstr != null && widget.idstr != 'null') {
|
|
50
|
_getActivityById();
|
52
|
_getActivityById();
|
|
|
|
53
|
+ _getCustomerActivityBaseinfo();
|
|
51
|
// } else {
|
54
|
// } else {
|
|
52
|
// couponProvider.couponSunModel = widget.couponSunModel;
|
55
|
// couponProvider.couponSunModel = widget.couponSunModel;
|
|
53
|
// pageState = PageState.Success;
|
56
|
// pageState = PageState.Success;
|
|
@@ -56,6 +59,21 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
@@ -56,6 +59,21 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
56
|
});
|
59
|
});
|
|
57
|
}
|
60
|
}
|
|
58
|
|
61
|
|
|
|
|
62
|
+ _getCustomerActivityBaseinfo() async {
|
|
|
|
63
|
+ BaseIndoProvider _baseIndoProvider =
|
|
|
|
64
|
+ Provider.of<BaseIndoProvider>(context, listen: false);
|
|
|
|
65
|
+ Map<String, String> params = {
|
|
|
|
66
|
+ 'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
67
|
+ "uid": Provider.of<UserModel>(context, listen: false).user.openid,
|
|
|
|
68
|
+ };
|
|
|
|
69
|
+
|
|
|
|
70
|
+ bool success =
|
|
|
|
71
|
+ await _baseIndoProvider.getCustomerActivityBaseinfo(context, params);
|
|
|
|
72
|
+ if (success) {
|
|
|
|
73
|
+ managerName = _baseIndoProvider.baseInfoSunModel.name;
|
|
|
|
74
|
+ }
|
|
|
|
75
|
+ }
|
|
|
|
76
|
+
|
|
59
|
_getActivityById() async {
|
77
|
_getActivityById() async {
|
|
60
|
pageState = PageState.Loading;
|
78
|
pageState = PageState.Loading;
|
|
61
|
bool success = await couponProvider
|
79
|
bool success = await couponProvider
|
|
@@ -216,21 +234,28 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
@@ -216,21 +234,28 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
216
|
},
|
234
|
},
|
|
217
|
rightImgName: couponProvider != null &&
|
235
|
rightImgName: couponProvider != null &&
|
|
218
|
couponProvider.couponSunModel != null &&
|
236
|
couponProvider.couponSunModel != null &&
|
|
219
|
- couponProvider.couponSunModel.isType == '1' &&
|
|
|
|
220
|
- couponProvider.couponSunModel.isExamine == '1' &&
|
237
|
+ // couponProvider.couponSunModel.isType == '1' &&
|
|
|
|
238
|
+ // couponProvider.couponSunModel.isExamine == '1' &&
|
|
221
|
couponProvider.couponSunModel.status == '1'
|
239
|
couponProvider.couponSunModel.status == '1'
|
|
222
|
? 'share.png'
|
240
|
? 'share.png'
|
|
223
|
: null,
|
241
|
: null,
|
|
224
|
onTapRight: () {
|
242
|
onTapRight: () {
|
|
|
|
243
|
+ // if (couponProvider.couponSunModel.isType == '1' &&
|
|
|
|
244
|
+ // couponProvider.couponSunModel.isExamine == '1' &&
|
|
|
|
245
|
+ // couponProvider.couponSunModel.status == '1') {
|
|
225
|
if (couponProvider.couponSunModel.isType == '1' &&
|
246
|
if (couponProvider.couponSunModel.isType == '1' &&
|
|
226
|
- couponProvider.couponSunModel.isExamine == '1' &&
|
|
|
|
227
|
couponProvider.couponSunModel.status == '1') {
|
247
|
couponProvider.couponSunModel.status == '1') {
|
|
228
|
- //店铺可核销券
|
248
|
+ //店铺券
|
|
229
|
Utils.goShareBuyCouponToWeChat(
|
249
|
Utils.goShareBuyCouponToWeChat(
|
|
230
|
context,
|
250
|
context,
|
|
231
|
widget.idstr,
|
251
|
widget.idstr,
|
|
232
|
couponProvider.couponSunModel.use,
|
252
|
couponProvider.couponSunModel.use,
|
|
233
|
couponProvider.couponSunModel);
|
253
|
couponProvider.couponSunModel);
|
|
|
|
254
|
+ } else if (couponProvider.couponSunModel.isType == '2' &&
|
|
|
|
255
|
+ couponProvider.couponSunModel.status == '1') {
|
|
|
|
256
|
+ // 我的优惠券
|
|
|
|
257
|
+ Utils.goShareBuyCouponToWeChatMy(context, widget.idstr,
|
|
|
|
258
|
+ managerName, couponProvider.couponSunModel);
|
|
234
|
}
|
259
|
}
|
|
235
|
},
|
260
|
},
|
|
236
|
),
|
261
|
),
|
|
@@ -442,7 +467,8 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
@@ -442,7 +467,8 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
442
|
_item(
|
467
|
_item(
|
|
443
|
'发放总量限制',
|
468
|
'发放总量限制',
|
|
444
|
couponProvider
|
469
|
couponProvider
|
|
445
|
- .couponSunModel.grantNum??''),
|
470
|
+ .couponSunModel.grantNum ??
|
|
|
|
471
|
+ ''),
|
|
446
|
// _select(
|
472
|
// _select(
|
|
447
|
// '谁可以发放',
|
473
|
// '谁可以发放',
|
|
448
|
// '查看',
|
474
|
// '查看',
|