|
...
|
...
|
@@ -3,6 +3,8 @@ import 'dart:ui'; |
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:one_key/models/notebook.dart';
|
|
|
|
import 'package:one_key/pages/notebook/spread_widget.dart';
|
|
|
|
import 'package:one_key/provider/user_model.dart';
|
|
|
|
import 'package:one_key/res/colors.dart';
|
|
|
|
import 'package:one_key/route/navigator_util.dart';
|
|
|
|
import 'package:one_key/utils/utils.dart';
|
|
...
|
...
|
@@ -10,6 +12,7 @@ import 'package:one_key/widgets/MyDivider.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:provider/provider.dart';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 详细模式
|
|
...
|
...
|
@@ -27,7 +30,9 @@ class NoteBookItemF extends StatefulWidget { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class NoteBookItemFState extends State<NoteBookItemF> {
|
|
|
|
class NoteBookItemFState extends State<NoteBookItemF>
|
|
|
|
with SingleTickerProviderStateMixin {
|
|
|
|
bool _large = false;
|
|
|
|
_onOperateClick() {
|
|
|
|
if (widget.notebook.operationText == "通知客户") {
|
|
|
|
// String _nameStr = '';
|
|
...
|
...
|
@@ -69,10 +74,27 @@ class NoteBookItemFState extends State<NoteBookItemF> { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_updateSize(bool cando) {
|
|
|
|
if (!cando) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
setState(() {
|
|
|
|
_large = !_large;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
// TODO: implement build
|
|
|
|
Notebook notebook = widget.notebook;
|
|
|
|
UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
|
|
|
bool canDo = true;
|
|
|
|
if (userModel.user.role_name != '管理员' &&
|
|
|
|
userModel.user.role_name != '店长' &&
|
|
|
|
notebook.uid != "null" &&
|
|
|
|
notebook.uid != userModel.user.openid) {
|
|
|
|
canDo = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
Color bgColor = notebook.status == "2" || notebook.status == "1"
|
|
|
|
? MyColours.color_438E93
|
|
...
|
...
|
@@ -297,12 +319,127 @@ class NoteBookItemFState extends State<NoteBookItemF> { |
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
Positioned(
|
|
|
|
right: ScreenUtil().setWidth(8),
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath(true ? 'ordered_open' : 'ordered_off'),
|
|
|
|
width: ScreenUtil().setWidth(80),
|
|
|
|
))
|
|
|
|
child: StatefulBuilder(builder: (context, state) {
|
|
|
|
// return ScaleAnimatedContent(
|
|
|
|
// child: InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// state(() {
|
|
|
|
// show = !show;
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: Image.asset(
|
|
|
|
// Utils.getImgPath(show ? 'ordered_open' : 'ordered_off'),
|
|
|
|
// width: ScreenUtil().setWidth(80),
|
|
|
|
// )),
|
|
|
|
// show: show,
|
|
|
|
// );
|
|
|
|
return InkWell(
|
|
|
|
onTap: () => _updateSize(canDo),
|
|
|
|
child: AnimatedSize(
|
|
|
|
curve: Curves.easeIn,
|
|
|
|
duration: Duration(microseconds: 30000),
|
|
|
|
vsync: this,
|
|
|
|
child: _large
|
|
|
|
? Stack(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(232 * 2 + 8 * 2),
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color:
|
|
|
|
Color.fromRGBO(67, 142, 147, 0.2),
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(16)),
|
|
|
|
)),
|
|
|
|
Positioned(
|
|
|
|
top: ScreenUtil().setWidth(8),
|
|
|
|
left: ScreenUtil().setWidth(8),
|
|
|
|
child: Container(
|
|
|
|
width: ScreenUtil().setWidth(232 * 2),
|
|
|
|
height: ScreenUtil().setWidth(32 * 2),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color:
|
|
|
|
Color.fromRGBO(125, 174, 177, 1),
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(8)),
|
|
|
|
),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal:
|
|
|
|
ScreenUtil().setWidth(16)),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
'ordered_arrow_right'),
|
|
|
|
width:
|
|
|
|
ScreenUtil().setWidth(24 * 2),
|
|
|
|
),
|
|
|
|
HEmptyView(32),
|
|
|
|
RoundButton(
|
|
|
|
text: '到店',
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(36 * 2),
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(24 * 2),
|
|
|
|
gradientStart:
|
|
|
|
MyColours.color_ffffff,
|
|
|
|
gradientEnd:
|
|
|
|
MyColours.color_ffffff,
|
|
|
|
textColor:
|
|
|
|
MyColours.color_260101,
|
|
|
|
isBold: true,
|
|
|
|
fontSize: 28,
|
|
|
|
radius:
|
|
|
|
ScreenUtil().setWidth(8)),
|
|
|
|
HEmptyView(44),
|
|
|
|
RoundButton(
|
|
|
|
text: '离店',
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(36 * 2),
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(24 * 2),
|
|
|
|
gradientStart:
|
|
|
|
MyColours.color_ffffff,
|
|
|
|
gradientEnd:
|
|
|
|
MyColours.color_ffffff,
|
|
|
|
textColor:
|
|
|
|
MyColours.color_260101,
|
|
|
|
isBold: true,
|
|
|
|
fontSize: 28,
|
|
|
|
radius:
|
|
|
|
ScreenUtil().setWidth(8)),
|
|
|
|
HEmptyView(44),
|
|
|
|
Text(
|
|
|
|
'取消预订',
|
|
|
|
style: TextStyle(
|
|
|
|
decoration:
|
|
|
|
TextDecoration.underline,
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(28),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
))
|
|
|
|
],
|
|
|
|
)
|
|
|
|
: Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
canDo ? 'ordered_open' : 'ordered_off'),
|
|
|
|
width: ScreenUtil().setWidth(80),
|
|
|
|
)));
|
|
|
|
}))
|
|
|
|
// Positioned(
|
|
|
|
// right: ScreenUtil().setWidth(8),
|
|
|
|
// child: Image.asset(
|
|
|
|
// Utils.getImgPath(true ? 'ordered_open' : 'ordered_off'),
|
|
|
|
// width: ScreenUtil().setWidth(80),
|
|
|
|
// ))
|
|
|
|
]);
|
|
|
|
// return Stack(
|
|
|
|
// children: [
|
...
|
...
|
|