|
|
|
1
|
+import 'dart:io';
|
|
|
|
2
|
+import 'dart:ui';
|
|
|
|
3
|
+
|
|
1
|
import 'package:cached_network_image/cached_network_image.dart';
|
4
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
|
|
5
|
+
|
|
2
|
import 'package:flutter/material.dart';
|
6
|
import 'package:flutter/material.dart';
|
|
|
|
7
|
+import 'package:flutter/rendering.dart';
|
|
|
|
8
|
+import 'package:flutter/services.dart';
|
|
3
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
9
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
10
|
+import 'package:image_gallery_saver/image_gallery_saver.dart';
|
|
4
|
import 'package:one_key/provider/user_model.dart';
|
11
|
import 'package:one_key/provider/user_model.dart';
|
|
5
|
import 'package:one_key/utils/utils.dart';
|
12
|
import 'package:one_key/utils/utils.dart';
|
|
6
|
import 'package:one_key/widgets/system_app_bar.dart';
|
13
|
import 'package:one_key/widgets/system_app_bar.dart';
|
|
7
|
import 'package:one_key/widgets/v_empty_view.dart';
|
14
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
15
|
+import 'package:permission_handler/permission_handler.dart';
|
|
8
|
import 'package:provider/provider.dart';
|
16
|
import 'package:provider/provider.dart';
|
|
9
|
|
17
|
|
|
10
|
import '../../models/coupon_model.dart';
|
18
|
import '../../models/coupon_model.dart';
|
|
@@ -12,7 +20,9 @@ import '../../models/user.dart'; |
|
@@ -12,7 +20,9 @@ import '../../models/user.dart'; |
|
12
|
import '../../provider/base_info_provider.dart';
|
20
|
import '../../provider/base_info_provider.dart';
|
|
13
|
import '../../res/colors.dart';
|
21
|
import '../../res/colors.dart';
|
|
14
|
import '../../utils/screen_util.dart';
|
22
|
import '../../utils/screen_util.dart';
|
|
|
|
23
|
+import '../../utils/share_helper.dart';
|
|
15
|
import '../../widgets/h_empty_view.dart';
|
24
|
import '../../widgets/h_empty_view.dart';
|
|
|
|
25
|
+import '../../widgets/loading.dart';
|
|
16
|
import '../../widgets/round_button.dart';
|
26
|
import '../../widgets/round_button.dart';
|
|
17
|
|
27
|
|
|
18
|
/**
|
28
|
/**
|
|
@@ -33,6 +43,8 @@ class CouponPosterPage extends StatefulWidget { |
|
@@ -33,6 +43,8 @@ class CouponPosterPage extends StatefulWidget { |
|
33
|
|
43
|
|
|
34
|
class _CouponPosterPageState extends State<CouponPosterPage> {
|
44
|
class _CouponPosterPageState extends State<CouponPosterPage> {
|
|
35
|
String managerName = '';
|
45
|
String managerName = '';
|
|
|
|
46
|
+ // 全局key
|
|
|
|
47
|
+ final GlobalKey _rootWidgetKey = GlobalKey();
|
|
36
|
|
48
|
|
|
37
|
@override
|
49
|
@override
|
|
38
|
void initState() {
|
50
|
void initState() {
|
|
@@ -40,23 +52,41 @@ class _CouponPosterPageState extends State<CouponPosterPage> { |
|
@@ -40,23 +52,41 @@ class _CouponPosterPageState extends State<CouponPosterPage> { |
|
40
|
super.initState();
|
52
|
super.initState();
|
|
41
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
53
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
42
|
// if (widget.idstr != null && widget.idstr != 'null') {
|
54
|
// if (widget.idstr != null && widget.idstr != 'null') {
|
|
43
|
- _getCustomerActivityBaseinfo();
|
55
|
+ // _getCustomerActivityBaseinfo();
|
|
44
|
});
|
56
|
});
|
|
45
|
}
|
57
|
}
|
|
46
|
|
58
|
|
|
47
|
- _getCustomerActivityBaseinfo() async {
|
|
|
|
48
|
- BaseIndoProvider _baseIndoProvider =
|
|
|
|
49
|
- Provider.of<BaseIndoProvider>(context, listen: false);
|
|
|
|
50
|
- Map<String, String> params = {
|
|
|
|
51
|
- 'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
52
|
- "uid": Provider.of<UserModel>(context, listen: false).user.openid,
|
|
|
|
53
|
- };
|
59
|
+ // _getCustomerActivityBaseinfo() async {
|
|
|
|
60
|
+ // BaseIndoProvider _baseIndoProvider =
|
|
|
|
61
|
+ // Provider.of<BaseIndoProvider>(context, listen: false);
|
|
|
|
62
|
+ // Map<String, String> params = {
|
|
|
|
63
|
+ // 'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
64
|
+ // "uid": Provider.of<UserModel>(context, listen: false).user.openid,
|
|
|
|
65
|
+ // };
|
|
|
|
66
|
+
|
|
|
|
67
|
+ // bool success =
|
|
|
|
68
|
+ // await _baseIndoProvider.getCustomerActivityBaseinfo(context, params);
|
|
|
|
69
|
+ // if (success) {
|
|
|
|
70
|
+ // managerName = _baseIndoProvider.baseInfoSunModel.name;
|
|
|
|
71
|
+ // }
|
|
|
|
72
|
+ // }
|
|
54
|
|
73
|
|
|
55
|
- bool success =
|
|
|
|
56
|
- await _baseIndoProvider.getCustomerActivityBaseinfo(context, params);
|
|
|
|
57
|
- if (success) {
|
|
|
|
58
|
- managerName = _baseIndoProvider.baseInfoSunModel.name;
|
74
|
+ /// 截图
|
|
|
|
75
|
+ Future<Uint8List> _capturePng(
|
|
|
|
76
|
+ GlobalKey globalKey, {
|
|
|
|
77
|
+ double pixelRatio = 6.0, //截屏的图片与原图的比例
|
|
|
|
78
|
+ }) async {
|
|
|
|
79
|
+ try {
|
|
|
|
80
|
+ RenderRepaintBoundary boundary =
|
|
|
|
81
|
+ globalKey.currentContext?.findRenderObject() as RenderRepaintBoundary;
|
|
|
|
82
|
+ var image = await boundary.toImage(pixelRatio: pixelRatio);
|
|
|
|
83
|
+ ByteData byteData = await image.toByteData(format: ImageByteFormat.png);
|
|
|
|
84
|
+ Uint8List pngBytes = byteData?.buffer.asUint8List();
|
|
|
|
85
|
+ return pngBytes;
|
|
|
|
86
|
+ } catch (e) {
|
|
|
|
87
|
+ print(e);
|
|
59
|
}
|
88
|
}
|
|
|
|
89
|
+ return null;
|
|
60
|
}
|
90
|
}
|
|
61
|
|
91
|
|
|
62
|
@override
|
92
|
@override
|
|
@@ -87,21 +117,22 @@ class _CouponPosterPageState extends State<CouponPosterPage> { |
|
@@ -87,21 +117,22 @@ class _CouponPosterPageState extends State<CouponPosterPage> { |
|
87
|
} else {
|
117
|
} else {
|
|
88
|
title = '仅需${price}元,获取';
|
118
|
title = '仅需${price}元,获取';
|
|
89
|
}
|
119
|
}
|
|
90
|
- name = '${user.sellername}${widget.use.cash}元代金券';
|
120
|
+ // name = '${user.sellername}${widget.use.cash}元代金券';
|
|
|
|
121
|
+ name = '${widget.use.cash}元代金券';
|
|
91
|
} else if (widget.use.isDiscount) {
|
122
|
} else if (widget.use.isDiscount) {
|
|
92
|
if (price == '0') {
|
123
|
if (price == '0') {
|
|
93
|
title = '免费获取';
|
124
|
title = '免费获取';
|
|
94
|
} else {
|
125
|
} else {
|
|
95
|
title = '仅需${price}元,获取';
|
126
|
title = '仅需${price}元,获取';
|
|
96
|
}
|
127
|
}
|
|
97
|
- name = '${user.sellername}${widget.use.discount}折折扣券';
|
128
|
+ name = '${widget.use.discount}折折扣券';
|
|
98
|
} else if (widget.use.isDish) {
|
129
|
} else if (widget.use.isDish) {
|
|
99
|
if (price == '0') {
|
130
|
if (price == '0') {
|
|
100
|
title = '免费获取';
|
131
|
title = '免费获取';
|
|
101
|
} else {
|
132
|
} else {
|
|
102
|
title = '仅需${price}元,获取';
|
133
|
title = '仅需${price}元,获取';
|
|
103
|
}
|
134
|
}
|
|
104
|
- name = '${user.sellername}${widget.couponSunModel.aname}';
|
135
|
+ name = '${widget.couponSunModel.aname}';
|
|
105
|
}
|
136
|
}
|
|
106
|
}
|
137
|
}
|
|
107
|
} else {
|
138
|
} else {
|
|
@@ -118,129 +149,185 @@ class _CouponPosterPageState extends State<CouponPosterPage> { |
|
@@ -118,129 +149,185 @@ class _CouponPosterPageState extends State<CouponPosterPage> { |
|
118
|
children: [
|
149
|
children: [
|
|
119
|
Expanded(
|
150
|
Expanded(
|
|
120
|
child: SingleChildScrollView(
|
151
|
child: SingleChildScrollView(
|
|
121
|
- child: Column(
|
|
|
|
122
|
- mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
123
|
- children: [
|
|
|
|
124
|
- Stack(
|
|
|
|
125
|
- clipBehavior: Clip.none,
|
|
|
|
126
|
- children: [
|
|
|
|
127
|
- CachedNetworkImage(
|
|
|
|
128
|
- imageUrl: user.sellerimage,
|
|
|
|
129
|
- width: double.infinity,
|
|
|
|
130
|
- height: w(280),
|
|
|
|
131
|
- fit: BoxFit.cover,
|
|
|
|
132
|
- ),
|
|
|
|
133
|
- Positioned(
|
|
|
|
134
|
- bottom: -w(64),
|
|
|
|
135
|
- child: Container(
|
|
|
|
136
|
- // width: double.infinity,
|
|
|
|
137
|
- // height: w(128),
|
|
|
|
138
|
- padding: EdgeInsets.symmetric(
|
|
|
|
139
|
- horizontal: w(10), vertical: w(18)),
|
|
|
|
140
|
- margin: EdgeInsets.symmetric(horizontal: w(20)),
|
|
|
|
141
|
- decoration: BoxDecoration(
|
|
|
|
142
|
- color: Colors.white,
|
|
|
|
143
|
- borderRadius: BorderRadius.circular(r(8))),
|
|
|
|
144
|
- child: Column(
|
|
|
|
145
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
146
|
- children: [
|
|
|
|
147
|
- Text(
|
|
|
|
148
|
- user.sellername,
|
|
|
|
149
|
- overflow: TextOverflow.ellipsis,
|
|
|
|
150
|
- style: TextStyle(
|
|
|
|
151
|
- color: MyColours.color_E4461D,
|
|
|
|
152
|
- fontSize: font(16),
|
|
|
|
153
|
- fontWeight: FontWeight.bold),
|
|
|
|
154
|
- ),
|
|
|
|
155
|
- VEmptyView(30),
|
|
|
|
156
|
- Text(
|
|
|
|
157
|
- times,
|
|
|
|
158
|
- overflow: TextOverflow.ellipsis,
|
|
|
|
159
|
- style: TextStyle(
|
|
|
|
160
|
- color: MyColours.color_515151,
|
|
|
|
161
|
- fontSize: font(14),
|
152
|
+ child: RepaintBoundary(
|
|
|
|
153
|
+ key: _rootWidgetKey,
|
|
|
|
154
|
+ child: Container(
|
|
|
|
155
|
+ color: Colors.white,
|
|
|
|
156
|
+ child: Column(
|
|
|
|
157
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
158
|
+ children: [
|
|
|
|
159
|
+ Stack(
|
|
|
|
160
|
+ clipBehavior: Clip.none,
|
|
|
|
161
|
+ children: [
|
|
|
|
162
|
+ CachedNetworkImage(
|
|
|
|
163
|
+ imageUrl: user.sellerimage,
|
|
|
|
164
|
+ width: double.infinity,
|
|
|
|
165
|
+ height: w(280),
|
|
|
|
166
|
+ fit: BoxFit.cover,
|
|
162
|
),
|
167
|
),
|
|
163
|
- ),
|
|
|
|
164
|
- VEmptyView(10),
|
|
|
|
165
|
- RichText(
|
|
|
|
166
|
- text: TextSpan(
|
|
|
|
167
|
- style: TextStyle(
|
|
|
|
168
|
- fontSize: ScreenUtil().setSp(28),
|
|
|
|
169
|
- ),
|
|
|
|
170
|
- children: [
|
|
|
|
171
|
- TextSpan(
|
|
|
|
172
|
- text: '电话:',
|
|
|
|
173
|
- style: TextStyle(
|
|
|
|
174
|
- fontSize: font(14),
|
|
|
|
175
|
- color: MyColours.color_515151)),
|
|
|
|
176
|
- TextSpan(
|
|
|
|
177
|
- text: phone,
|
|
|
|
178
|
- style: TextStyle(
|
168
|
+ Positioned(
|
|
|
|
169
|
+ bottom: -w(64),
|
|
|
|
170
|
+ child: Container(
|
|
|
|
171
|
+ // width: double.infinity,
|
|
|
|
172
|
+ // height: w(128),
|
|
|
|
173
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
174
|
+ horizontal: w(10), vertical: w(18)),
|
|
|
|
175
|
+ margin: EdgeInsets.symmetric(
|
|
|
|
176
|
+ horizontal: w(20)),
|
|
|
|
177
|
+ decoration: BoxDecoration(
|
|
|
|
178
|
+ border: Border.all(
|
|
|
|
179
|
+ color: MyColours.color_E4461D,
|
|
|
|
180
|
+ width: w(1)),
|
|
|
|
181
|
+ color: Colors.white,
|
|
|
|
182
|
+ borderRadius:
|
|
|
|
183
|
+ BorderRadius.circular(r(8))),
|
|
|
|
184
|
+ child: Column(
|
|
|
|
185
|
+ crossAxisAlignment:
|
|
|
|
186
|
+ CrossAxisAlignment.start,
|
|
|
|
187
|
+ children: [
|
|
|
|
188
|
+ Text(
|
|
|
|
189
|
+ user.sellername,
|
|
179
|
overflow: TextOverflow.ellipsis,
|
190
|
overflow: TextOverflow.ellipsis,
|
|
180
|
- fontSize: font(14),
|
|
|
|
181
|
- color: MyColours.color_E4461D)),
|
|
|
|
182
|
- ])),
|
|
|
|
183
|
- VEmptyView(10),
|
|
|
|
184
|
- Row(
|
|
|
|
185
|
- children: [
|
|
|
|
186
|
- Text(
|
|
|
|
187
|
- address,
|
|
|
|
188
|
- overflow: TextOverflow.ellipsis,
|
|
|
|
189
|
- style: TextStyle(
|
|
|
|
190
|
- color: MyColours.color_515151,
|
|
|
|
191
|
- fontSize: font(14),
|
|
|
|
192
|
- ),
|
|
|
|
193
|
- ),
|
|
|
|
194
|
- Image.asset(
|
|
|
|
195
|
- Utils.getImgPath('location_orange'),
|
|
|
|
196
|
- width: w(25),
|
|
|
|
197
|
- )
|
|
|
|
198
|
- ],
|
|
|
|
199
|
- ),
|
|
|
|
200
|
- ],
|
|
|
|
201
|
- ),
|
|
|
|
202
|
- ))
|
|
|
|
203
|
- ],
|
|
|
|
204
|
- ),
|
|
|
|
205
|
- VEmptyView(170),
|
|
|
|
206
|
- Text(
|
|
|
|
207
|
- title,
|
|
|
|
208
|
- style: TextStyle(
|
|
|
|
209
|
- fontSize: font(32), color: MyColours.color_000000),
|
|
|
|
210
|
- ),
|
|
|
|
211
|
- VEmptyView(30),
|
|
|
|
212
|
- Padding(
|
|
|
|
213
|
- padding: EdgeInsets.symmetric(horizontal: w(20)),
|
|
|
|
214
|
- child: Row(
|
|
|
|
215
|
- children: [
|
|
|
|
216
|
- Image.asset(
|
|
|
|
217
|
- Utils.getImgPath('coupon_l'),
|
|
|
|
218
|
- height: w(100),
|
|
|
|
219
|
- ),
|
|
|
|
220
|
- HEmptyView(1),
|
|
|
|
221
|
- Expanded(
|
|
|
|
222
|
- child: Container(
|
|
|
|
223
|
- alignment: Alignment.center,
|
|
|
|
224
|
- constraints: BoxConstraints(minHeight: w(120)),
|
|
|
|
225
|
- decoration: BoxDecoration(color: Colors.red),
|
|
|
|
226
|
- child: Text(name,
|
|
|
|
227
|
- textAlign: TextAlign.center,
|
191
|
+ style: TextStyle(
|
|
|
|
192
|
+ color: MyColours.color_E4461D,
|
|
|
|
193
|
+ fontSize: font(16),
|
|
|
|
194
|
+ fontWeight: FontWeight.bold),
|
|
|
|
195
|
+ ),
|
|
|
|
196
|
+ VEmptyView(30),
|
|
|
|
197
|
+ Text(
|
|
|
|
198
|
+ times,
|
|
|
|
199
|
+ overflow: TextOverflow.ellipsis,
|
|
|
|
200
|
+ style: TextStyle(
|
|
|
|
201
|
+ color: MyColours.color_515151,
|
|
|
|
202
|
+ fontSize: font(14),
|
|
|
|
203
|
+ ),
|
|
|
|
204
|
+ ),
|
|
|
|
205
|
+ VEmptyView(10),
|
|
|
|
206
|
+ RichText(
|
|
|
|
207
|
+ text: TextSpan(
|
|
|
|
208
|
+ style: TextStyle(
|
|
|
|
209
|
+ fontSize: ScreenUtil()
|
|
|
|
210
|
+ .setSp(28),
|
|
|
|
211
|
+ ),
|
|
|
|
212
|
+ children: [
|
|
|
|
213
|
+ TextSpan(
|
|
|
|
214
|
+ text: '电话:',
|
|
|
|
215
|
+ style: TextStyle(
|
|
|
|
216
|
+ fontSize: font(14),
|
|
|
|
217
|
+ color: MyColours
|
|
|
|
218
|
+ .color_515151)),
|
|
|
|
219
|
+ TextSpan(
|
|
|
|
220
|
+ text: phone,
|
|
|
|
221
|
+ style: TextStyle(
|
|
|
|
222
|
+ overflow: TextOverflow
|
|
|
|
223
|
+ .ellipsis,
|
|
|
|
224
|
+ fontSize: font(14),
|
|
|
|
225
|
+ color: MyColours
|
|
|
|
226
|
+ .color_E4461D)),
|
|
|
|
227
|
+ ])),
|
|
|
|
228
|
+ VEmptyView(10),
|
|
|
|
229
|
+ Row(
|
|
|
|
230
|
+ children: [
|
|
|
|
231
|
+ Text(
|
|
|
|
232
|
+ address,
|
|
|
|
233
|
+ overflow:
|
|
|
|
234
|
+ TextOverflow.ellipsis,
|
|
|
|
235
|
+ style: TextStyle(
|
|
|
|
236
|
+ color:
|
|
|
|
237
|
+ MyColours.color_515151,
|
|
|
|
238
|
+ fontSize: font(14),
|
|
|
|
239
|
+ ),
|
|
|
|
240
|
+ ),
|
|
|
|
241
|
+ Image.asset(
|
|
|
|
242
|
+ Utils.getImgPath(
|
|
|
|
243
|
+ 'location_orange'),
|
|
|
|
244
|
+ width: w(25),
|
|
|
|
245
|
+ )
|
|
|
|
246
|
+ ],
|
|
|
|
247
|
+ ),
|
|
|
|
248
|
+ ],
|
|
|
|
249
|
+ ),
|
|
|
|
250
|
+ ))
|
|
|
|
251
|
+ ],
|
|
|
|
252
|
+ ),
|
|
|
|
253
|
+ VEmptyView(170),
|
|
|
|
254
|
+ Text(
|
|
|
|
255
|
+ title,
|
|
228
|
style: TextStyle(
|
256
|
style: TextStyle(
|
|
229
|
fontSize: font(32),
|
257
|
fontSize: font(32),
|
|
230
|
- color: MyColours.color_ffffff)),
|
|
|
|
231
|
- )),
|
|
|
|
232
|
- HEmptyView(1),
|
|
|
|
233
|
- Image.asset(
|
|
|
|
234
|
- Utils.getImgPath('coupon_r'),
|
|
|
|
235
|
- // width: w(20),
|
|
|
|
236
|
- height: w(100),
|
|
|
|
237
|
- ),
|
|
|
|
238
|
- ],
|
|
|
|
239
|
- )),
|
|
|
|
240
|
- VEmptyView(30),
|
|
|
|
241
|
- // CachedNetworkImage(imageUrl: imageUrl)
|
|
|
|
242
|
- ],
|
|
|
|
243
|
- )),
|
258
|
+ color: MyColours.color_000000),
|
|
|
|
259
|
+ ),
|
|
|
|
260
|
+ VEmptyView(30),
|
|
|
|
261
|
+ Padding(
|
|
|
|
262
|
+ padding:
|
|
|
|
263
|
+ EdgeInsets.symmetric(horizontal: w(20)),
|
|
|
|
264
|
+ child: Stack(
|
|
|
|
265
|
+ alignment: Alignment.center,
|
|
|
|
266
|
+ children: [
|
|
|
|
267
|
+ Image.asset(
|
|
|
|
268
|
+ Utils.getImgPath('coupon_bg')),
|
|
|
|
269
|
+ Positioned(
|
|
|
|
270
|
+ child: Padding(
|
|
|
|
271
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
272
|
+ horizontal: w(20)),
|
|
|
|
273
|
+ child: Text(name,
|
|
|
|
274
|
+ textAlign: TextAlign.center,
|
|
|
|
275
|
+ overflow:
|
|
|
|
276
|
+ TextOverflow.ellipsis,
|
|
|
|
277
|
+ style: TextStyle(
|
|
|
|
278
|
+ fontSize: font(32),
|
|
|
|
279
|
+ color: MyColours
|
|
|
|
280
|
+ .color_ffffff))))
|
|
|
|
281
|
+ ],
|
|
|
|
282
|
+ )),
|
|
|
|
283
|
+ // Padding(
|
|
|
|
284
|
+ // padding: EdgeInsets.symmetric(horizontal: w(20)),
|
|
|
|
285
|
+ // child: Row(
|
|
|
|
286
|
+ // children: [
|
|
|
|
287
|
+ // Image.asset(
|
|
|
|
288
|
+ // Utils.getImgPath('coupon_l'),
|
|
|
|
289
|
+ // height: w(100),
|
|
|
|
290
|
+ // ),
|
|
|
|
291
|
+ // HEmptyView(1),
|
|
|
|
292
|
+ // Expanded(
|
|
|
|
293
|
+ // child: Container(
|
|
|
|
294
|
+ // alignment: Alignment.center,
|
|
|
|
295
|
+ // constraints: BoxConstraints(minHeight: w(120)),
|
|
|
|
296
|
+ // decoration: BoxDecoration(
|
|
|
|
297
|
+ // color: Color.fromRGBO(252, 0, 0, 1)),
|
|
|
|
298
|
+ // child: Text(name,
|
|
|
|
299
|
+ // textAlign: TextAlign.center,
|
|
|
|
300
|
+ // style: TextStyle(
|
|
|
|
301
|
+ // fontSize: font(32),
|
|
|
|
302
|
+ // color: MyColours.color_ffffff)),
|
|
|
|
303
|
+ // )),
|
|
|
|
304
|
+ // HEmptyView(1),
|
|
|
|
305
|
+ // Image.asset(
|
|
|
|
306
|
+ // Utils.getImgPath('coupon_r'),
|
|
|
|
307
|
+ // // width: w(20),
|
|
|
|
308
|
+ // height: w(100),
|
|
|
|
309
|
+ // ),
|
|
|
|
310
|
+ // ],
|
|
|
|
311
|
+ // )),
|
|
|
|
312
|
+ VEmptyView(30),
|
|
|
|
313
|
+ if (widget.couponSunModel.liteQrcode != null)
|
|
|
|
314
|
+ CachedNetworkImage(
|
|
|
|
315
|
+ imageUrl: widget.couponSunModel.liteQrcode,
|
|
|
|
316
|
+ height: w(200),
|
|
|
|
317
|
+ ),
|
|
|
|
318
|
+
|
|
|
|
319
|
+ if (widget.couponSunModel.liteQrcode != null)
|
|
|
|
320
|
+ VEmptyView(20),
|
|
|
|
321
|
+ if (widget.couponSunModel.liteQrcode != null)
|
|
|
|
322
|
+ Text('长按二维码识别领取',
|
|
|
|
323
|
+ textAlign: TextAlign.center,
|
|
|
|
324
|
+ overflow: TextOverflow.ellipsis,
|
|
|
|
325
|
+ style: TextStyle(
|
|
|
|
326
|
+ fontSize: font(16),
|
|
|
|
327
|
+ color: MyColours.color_000000)),
|
|
|
|
328
|
+ VEmptyView(60),
|
|
|
|
329
|
+ ],
|
|
|
|
330
|
+ )))),
|
|
244
|
),
|
331
|
),
|
|
245
|
Container(
|
332
|
Container(
|
|
246
|
height: ScreenUtil().setWidth(91 * 2),
|
333
|
height: ScreenUtil().setWidth(91 * 2),
|
|
@@ -277,7 +364,35 @@ class _CouponPosterPageState extends State<CouponPosterPage> { |
|
@@ -277,7 +364,35 @@ class _CouponPosterPageState extends State<CouponPosterPage> { |
|
277
|
radius: ScreenUtil().setWidth(14),
|
364
|
radius: ScreenUtil().setWidth(14),
|
|
278
|
isBold: true,
|
365
|
isBold: true,
|
|
279
|
fontSize: 28,
|
366
|
fontSize: 28,
|
|
280
|
- onPressed: () {},
|
367
|
+ onPressed: () {
|
|
|
|
368
|
+ Utils.getPickPermission(context, () {
|
|
|
|
369
|
+ //获取截屏图像
|
|
|
|
370
|
+ //添加到图片数组中
|
|
|
|
371
|
+ Loading.showLoading(
|
|
|
|
372
|
+ context,
|
|
|
|
373
|
+ );
|
|
|
|
374
|
+ _capturePng(_rootWidgetKey).then((value) async {
|
|
|
|
375
|
+ if (value != null) {
|
|
|
|
376
|
+ print(value);
|
|
|
|
377
|
+ final result = await ImageGallerySaver.saveImage(
|
|
|
|
378
|
+ value,
|
|
|
|
379
|
+ quality: 100);
|
|
|
|
380
|
+ if (result != null) {
|
|
|
|
381
|
+ Utils.showToast("保存成功");
|
|
|
|
382
|
+ } else {
|
|
|
|
383
|
+ print('error');
|
|
|
|
384
|
+ Utils.showToast("保存失败");
|
|
|
|
385
|
+ // toast("");
|
|
|
|
386
|
+ }
|
|
|
|
387
|
+ Loading.hideLoading(context);
|
|
|
|
388
|
+ // setState(() {});
|
|
|
|
389
|
+ }
|
|
|
|
390
|
+ });
|
|
|
|
391
|
+ },
|
|
|
|
392
|
+ Platform.isIOS
|
|
|
|
393
|
+ ? Permission.photos
|
|
|
|
394
|
+ : Permission.storage);
|
|
|
|
395
|
+ },
|
|
281
|
),
|
396
|
),
|
|
282
|
HEmptyView(30),
|
397
|
HEmptyView(30),
|
|
283
|
Expanded(
|
398
|
Expanded(
|
|
@@ -287,7 +402,12 @@ class _CouponPosterPageState extends State<CouponPosterPage> { |
|
@@ -287,7 +402,12 @@ class _CouponPosterPageState extends State<CouponPosterPage> { |
|
287
|
radius: ScreenUtil().setWidth(14),
|
402
|
radius: ScreenUtil().setWidth(14),
|
|
288
|
isBold: false,
|
403
|
isBold: false,
|
|
289
|
fontSize: 28,
|
404
|
fontSize: 28,
|
|
290
|
- onPressed: () {},
|
405
|
+ onPressed: () {
|
|
|
|
406
|
+ ShareHelper.onShareWx(
|
|
|
|
407
|
+ context,
|
|
|
|
408
|
+ boundaryKey: _rootWidgetKey,
|
|
|
|
409
|
+ );
|
|
|
|
410
|
+ },
|
|
291
|
),
|
411
|
),
|
|
292
|
)
|
412
|
)
|
|
293
|
],
|
413
|
],
|