|
|
|
import 'dart:typed_data';
|
|
|
|
import 'dart:ui';
|
|
|
|
|
|
|
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
|
|
import 'package:common_utils/common_utils.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/rendering.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:one_key/models/seller_phone_model.dart';
|
|
|
|
import 'package:one_key/models/user.dart';
|
|
...
|
...
|
@@ -9,12 +14,15 @@ import 'package:one_key/provider/base_info_provider.dart'; |
|
|
|
import 'package:one_key/provider/coupon_provider.dart';
|
|
|
|
import 'package:one_key/provider/user_model.dart';
|
|
|
|
import 'package:one_key/res/colors.dart';
|
|
|
|
import 'package:one_key/utils/misc.dart';
|
|
|
|
import 'package:one_key/utils/navigator_util.dart';
|
|
|
|
import 'package:one_key/utils/utils.dart';
|
|
|
|
import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
import 'package:one_key/widgets/round_button.dart';
|
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'dart:ui' as ui;
|
|
|
|
|
|
|
|
class InvicationPage extends StatefulWidget {
|
|
|
|
final String rid; //预订订单id
|
|
...
|
...
|
@@ -46,6 +54,7 @@ class InvicationPageState extends State<InvicationPage> { |
|
|
|
String phone = '填写电话';
|
|
|
|
String qiniuUrl = '';
|
|
|
|
final GlobalKey key = new GlobalKey();
|
|
|
|
final GlobalKey globalKey = GlobalKey();
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
...
|
...
|
@@ -250,6 +259,18 @@ class InvicationPageState extends State<InvicationPage> { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///获取截图
|
|
|
|
Future<Uint8List> _getImage() async {
|
|
|
|
BuildContext buildContext = globalKey.currentContext;
|
|
|
|
if (null != buildContext) {
|
|
|
|
RenderRepaintBoundary boundary = buildContext.findRenderObject();
|
|
|
|
ui.Image image = await boundary.toImage(pixelRatio: 6);
|
|
|
|
ByteData byteData = await image.toByteData(format: ImageByteFormat.png);
|
|
|
|
Uint8List pngBytes = byteData.buffer.asUint8List();
|
|
|
|
return pngBytes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
// Utils.changeStatusColor(color: Colors.transparent);
|
|
...
|
...
|
@@ -507,123 +528,174 @@ class InvicationPageState extends State<InvicationPage> { |
|
|
|
// ScreenUtil().setHeight(33 * 2),
|
|
|
|
// ),
|
|
|
|
// VEmptyView(50),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(58),
|
|
|
|
child: Text(
|
|
|
|
user.sellername,
|
|
|
|
style: TextStyle(
|
|
|
|
// letterSpacing: ScreenUtil()
|
|
|
|
// .setWidth(2.13 * 2),
|
|
|
|
color: MyColours.color_BA9953,
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(42)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(14),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(58),
|
|
|
|
child: Text(
|
|
|
|
'${dateTimeStr}',
|
|
|
|
style: TextStyle(
|
|
|
|
letterSpacing: ScreenUtil()
|
|
|
|
.setWidth(1.8 * 2),
|
|
|
|
color: MyColours.color_BA9953,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(42)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(26),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(44),
|
|
|
|
child: Text(
|
|
|
|
'已为您安排在包间',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(28),
|
|
|
|
GestureDetector(
|
|
|
|
onTapDown:
|
|
|
|
(TapDownDetails details) =>
|
|
|
|
onTapDown(context, details),
|
|
|
|
child: Container(
|
|
|
|
child: Stack(
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
overflow: Overflow.visible,
|
|
|
|
|
|
|
|
RepaintBoundary(
|
|
|
|
key: globalKey,
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.fromLTRB(
|
|
|
|
ScreenUtil().setWidth(10),
|
|
|
|
ScreenUtil().setWidth(10),
|
|
|
|
ScreenUtil().setWidth(10),
|
|
|
|
ScreenUtil().setWidth(40)),
|
|
|
|
// color: Colors.red,
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
maxWidth: ScreenUtil()
|
|
|
|
.setWidth(195 * 2)),
|
|
|
|
padding: EdgeInsets.fromLTRB(
|
|
|
|
ScreenUtil().setWidth(60),
|
|
|
|
ScreenUtil().setWidth(30),
|
|
|
|
ScreenUtil().setWidth(60),
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(24 * 2)),
|
|
|
|
// height:
|
|
|
|
// ScreenUtil().setWidth(84 * 2),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius
|
|
|
|
.all(Radius.circular(
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
13 * 2))),
|
|
|
|
border: Border.all(
|
|
|
|
color: MyColours
|
|
|
|
.color_BA9953,
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(4))),
|
|
|
|
height:
|
|
|
|
ScreenUtil().setWidth(58),
|
|
|
|
child: Text(
|
|
|
|
widget.tableInfo
|
|
|
|
.replaceAll("\n", ""),
|
|
|
|
user.sellername,
|
|
|
|
style: TextStyle(
|
|
|
|
// letterSpacing: ScreenUtil()
|
|
|
|
// .setWidth(2.13 * 2),
|
|
|
|
color: MyColours
|
|
|
|
.color_BA9953,
|
|
|
|
fontWeight:
|
|
|
|
FontWeight.bold,
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(52)),
|
|
|
|
.setSp(42)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
key: key,
|
|
|
|
bottom: ScreenUtil()
|
|
|
|
.setWidth(-24),
|
|
|
|
child: _baseIndoProvider
|
|
|
|
.photoList
|
|
|
|
.length >
|
|
|
|
0
|
|
|
|
? RoundButton(
|
|
|
|
onPressed: () {
|
|
|
|
_seePhoto();
|
|
|
|
},
|
|
|
|
text: '浏览照片',
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(68 * 2),
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(24 * 2),
|
|
|
|
fontSize: 26,
|
|
|
|
textColor: MyColours
|
|
|
|
.color_333333,
|
|
|
|
isBold: false,
|
|
|
|
gradientStart:
|
|
|
|
MyColours
|
|
|
|
.color_BA9953,
|
|
|
|
gradientEnd: MyColours
|
|
|
|
.color_BA9953,
|
|
|
|
VEmptyView(14),
|
|
|
|
Container(
|
|
|
|
height:
|
|
|
|
ScreenUtil().setWidth(58),
|
|
|
|
child: Text(
|
|
|
|
'${dateTimeStr}',
|
|
|
|
style: TextStyle(
|
|
|
|
letterSpacing:
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
1.8 * 2),
|
|
|
|
color: MyColours
|
|
|
|
.color_BA9953,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(42)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(26),
|
|
|
|
Container(
|
|
|
|
height:
|
|
|
|
ScreenUtil().setWidth(44),
|
|
|
|
child: Text(
|
|
|
|
'已为您安排在包间',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_ffffff,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(28),
|
|
|
|
GestureDetector(
|
|
|
|
onTapDown: (TapDownDetails
|
|
|
|
details) =>
|
|
|
|
onTapDown(
|
|
|
|
context, details),
|
|
|
|
child: Container(
|
|
|
|
child: Stack(
|
|
|
|
alignment: Alignment
|
|
|
|
.bottomCenter,
|
|
|
|
overflow:
|
|
|
|
Overflow.visible,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
maxWidth:
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
195 *
|
|
|
|
2)),
|
|
|
|
padding: EdgeInsets
|
|
|
|
.fromLTRB(
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
60),
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
30),
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
60),
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
24 *
|
|
|
|
2)),
|
|
|
|
// height:
|
|
|
|
// ScreenUtil().setWidth(84 * 2),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
Radius.circular(
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(13 *
|
|
|
|
2))),
|
|
|
|
border: Border.all(
|
|
|
|
color: MyColours
|
|
|
|
.color_BA9953,
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
4))),
|
|
|
|
child: Text(
|
|
|
|
widget.tableInfo
|
|
|
|
.replaceAll(
|
|
|
|
"\n", ""),
|
|
|
|
style: TextStyle(
|
|
|
|
// letterSpacing: ScreenUtil()
|
|
|
|
// .setWidth(2.13 * 2),
|
|
|
|
color: MyColours
|
|
|
|
.color_BA9953,
|
|
|
|
fontWeight:
|
|
|
|
FontWeight
|
|
|
|
.bold,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil()
|
|
|
|
.setSp(
|
|
|
|
52)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
key: key,
|
|
|
|
bottom: ScreenUtil()
|
|
|
|
.setWidth(-24),
|
|
|
|
child: _baseIndoProvider
|
|
|
|
.photoList
|
|
|
|
.length >
|
|
|
|
0
|
|
|
|
? RoundButton(
|
|
|
|
onPressed:
|
|
|
|
() {
|
|
|
|
_seePhoto();
|
|
|
|
},
|
|
|
|
text: '浏览照片',
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
68 *
|
|
|
|
2),
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
24 *
|
|
|
|
2),
|
|
|
|
fontSize: 26,
|
|
|
|
textColor:
|
|
|
|
MyColours
|
|
|
|
.color_333333,
|
|
|
|
isBold: false,
|
|
|
|
gradientStart:
|
|
|
|
MyColours
|
|
|
|
.color_BA9953,
|
|
|
|
gradientEnd:
|
|
|
|
MyColours
|
|
|
|
.color_BA9953,
|
|
|
|
)
|
|
|
|
: Container(),
|
|
|
|
)
|
|
|
|
: Container(),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
VEmptyView(70),
|
|
|
|
VEmptyView(30),
|
|
|
|
Container(
|
|
|
|
// height: ScreenUtil().setWidth(40),
|
|
|
|
child: Text(
|
|
...
|
...
|
@@ -700,6 +772,8 @@ class InvicationPageState extends State<InvicationPage> { |
|
|
|
Expanded(
|
|
|
|
child: GestureDetector(
|
|
|
|
onTap: () async {
|
|
|
|
// Uint8List image = await _getImage();
|
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(
|
|
|
|
_baseIndoProvider.baseInfoSunModel)) {
|
|
|
|
Utils.showToast('请输入个人资料');
|
...
|
...
|
|