Commit 34ed9a5abc3a5a56182914c215526d46f9d0dfbf

Authored by wdn127929
1 parent 7af8dd92

存酒UI ok

  1 +import 'package:flutter/material.dart';
  2 +
  3 +class WineManageModel {
  4 + TextEditingController wineNameC = TextEditingController(); //酒品名称
  5 + TextEditingController wineNumC = TextEditingController(); //存酒数量
  6 + TextEditingController wineUnitC = TextEditingController(); //计量单位
  7 + List<String> imageData = [
  8 + 'https://www.ssfiction.com/wp-content/uploads/2020/08/20200805_5f2b1669e9a24.jpg',
  9 + 'https://www.ssfiction.com/wp-content/uploads/2020/08/20200805_5f2b1669e9a24.jpg'
  10 + ];
  11 +}
  1 +import 'package:cached_network_image/cached_network_image.dart';
  2 +import 'package:flutter/material.dart';
  3 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  4 +import 'package:provider/provider.dart';
  5 +
  6 +import '../../../models/wine_manage_model.dart';
  7 +import '../../../provider/upload_img_provider.dart';
  8 +import '../../../res/colors.dart';
  9 +import '../../../utils/screen_util.dart';
  10 +import '../../../utils/upload_image_util.dart';
  11 +import '../../../utils/utils.dart';
  12 +import '../../../widgets/MyDivider.dart';
  13 +import '../../../widgets/v_empty_view.dart';
  14 +import '../../online_check/img_picker_widget.dart';
  15 +import '../../online_check/photo_view_wiget.dart';
  16 +
  17 +//出库申请item
  18 +
  19 +class ApplyOutStoreItemPage extends StatefulWidget {
  20 + final WineManageModel wineManageModel;
  21 + final ScrollController controller;
  22 + final int index;
  23 +
  24 + ApplyOutStoreItemPage(
  25 + {Key key, this.wineManageModel, this.controller, this.index})
  26 + : super(key: key);
  27 +
  28 + @override
  29 + _ApplyOutStoreItemPageState createState() => _ApplyOutStoreItemPageState();
  30 +}
  31 +
  32 +class _ApplyOutStoreItemPageState extends State<ApplyOutStoreItemPage> {
  33 + Widget _textFieldWidget(
  34 + String title, String hintText, TextEditingController controller) {
  35 + return Column(children: [
  36 + Container(
  37 + height: ScreenUtil().setWidth(48 * 2),
  38 + padding: EdgeInsets.only(right: ScreenUtil().setWidth(16 * 2)),
  39 + child: Row(
  40 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  41 + crossAxisAlignment: CrossAxisAlignment.center,
  42 + children: [
  43 + Text(
  44 + title,
  45 + style: TextStyle(
  46 + color: MyColours.color_515151, fontSize: font(16)),
  47 + ),
  48 + Expanded(
  49 + child: Container(
  50 + height: ScreenUtil().setWidth(16 * 2),
  51 + alignment: Alignment.centerRight,
  52 + child: TextField(
  53 + maxLines: 1,
  54 + //输入文本的样式
  55 + style: TextStyle(
  56 + fontSize: ScreenUtil().setSp(32),
  57 + color: MyColours.color_515151),
  58 + controller: controller,
  59 + // focusNode: _phoneNode,
  60 + textAlign: TextAlign.right,
  61 + textAlignVertical: TextAlignVertical.center,
  62 +
  63 + // textAlignVertical:
  64 + // TextAlignVertical.center,
  65 + decoration: InputDecoration(
  66 + hintText: hintText,
  67 + hintStyle: TextStyle(
  68 + color: MyColours.color_999999,
  69 + fontSize: ScreenUtil().setSp(32),
  70 + ),
  71 + contentPadding: EdgeInsets.zero,
  72 + // contentPadding:
  73 + // EdgeInsets.symmetric(
  74 + // vertical: w(12)),
  75 + border:
  76 + OutlineInputBorder(borderSide: BorderSide.none),
  77 + ),
  78 + onChanged: (value) {
  79 + print(value);
  80 + // if (value.trim().isEmpty || value.trim().length > 11) {
  81 + // //内容为空,或 超过11位
  82 + // setState(() {
  83 + // _baseIndoProvider.userHistorys.clear();
  84 + // });
  85 + // return;
  86 + // }
  87 + // Map<String, String> params = {
  88 + // "keywords": value.trim(),
  89 + // "sid": Provider.of<UserModel>(context, listen: false)
  90 + // .user
  91 + // .sellerid,
  92 + // };
  93 + // _baseIndoProvider.getUserHistorys(context, params);
  94 + },
  95 + onEditingComplete: () {
  96 + FocusScope.of(context).requestFocus(FocusNode());
  97 + },
  98 + onTap: () {
  99 + // setState(() {
  100 + // showPhoneHistory = true;
  101 + // });
  102 + // Future.delayed(Duration(milliseconds: 300), () {
  103 + // _controller.jumpTo(_controller.position.maxScrollExtent);
  104 + // });
  105 + },
  106 + keyboardType: TextInputType.number,
  107 + ))),
  108 + // InkWell(
  109 + // onTap: () {
  110 + // // _openAddressBook();
  111 + // },
  112 + // child: Container(
  113 + // width: ScreenUtil().setWidth(74) * 2,
  114 + // height: ScreenUtil().setWidth(48),
  115 + // alignment: Alignment.centerRight,
  116 + // child: Text('一键录入',
  117 + // style: TextStyle(
  118 + // color: MyColours.color_515151,
  119 + // fontSize: ScreenUtil().setSp(28),
  120 + // )),
  121 + // ),
  122 + // ),
  123 + ],
  124 + )),
  125 + MyDivider(
  126 + double.infinity,
  127 + h(0.5),
  128 + color: MyColours.color_E7E7E7,
  129 + ),
  130 + ]);
  131 + }
  132 +
  133 + Widget _textWidget(String title, String subTitle) {
  134 + return Column(children: [
  135 + Container(
  136 + height: ScreenUtil().setWidth(48 * 2),
  137 + padding: EdgeInsets.only(right: ScreenUtil().setWidth(16 * 2)),
  138 + child: Row(
  139 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  140 + crossAxisAlignment: CrossAxisAlignment.center,
  141 + children: [
  142 + Text(
  143 + title,
  144 + style: TextStyle(
  145 + color: MyColours.color_515151, fontSize: font(16)),
  146 + ),
  147 + Expanded(
  148 + child: Container(
  149 + height: ScreenUtil().setWidth(16 * 2),
  150 + alignment: Alignment.centerRight,
  151 + child: Text(
  152 + subTitle,
  153 + //输入文本的样式
  154 + style: TextStyle(
  155 + fontSize: ScreenUtil().setSp(32),
  156 + color: MyColours.color_999999),
  157 + )),
  158 + )
  159 + ],
  160 + )),
  161 + MyDivider(
  162 + double.infinity,
  163 + h(0.5),
  164 + color: MyColours.color_E7E7E7,
  165 + ),
  166 + ]);
  167 + }
  168 +
  169 + //查看大图
  170 + _showPhotoView(BuildContext context, int index, List<String> imgs,
  171 + {isShow = false, List dashName}) async {
  172 + // if (imgs.length == 1 &&
  173 + // imgs[0] ==
  174 + // 'http://nosqn.colorcun.com/custom/lite-online/image/def-banner.png') {
  175 + // imgs[0] = 'http://nosqn.colorcun.com/app/seller-hj-empty.png';
  176 + // }
  177 + Utils.setBarStatus(false, color: Colors.black);
  178 + dynamic result = await showGeneralDialog(
  179 + context: context,
  180 + barrierDismissible: false,
  181 + // barrierColor: Colors.red,
  182 + barrierLabel:
  183 + MaterialLocalizations.of(context).modalBarrierDismissLabel,
  184 + transitionDuration: const Duration(milliseconds: 150),
  185 + pageBuilder: (BuildContext context, Animation animation,
  186 + Animation secondaryAnimation) {
  187 + Widget child = Stack(
  188 + children: <Widget>[
  189 + PhotoPreview(
  190 + initialIndex: index,
  191 + photoList: imgs,
  192 + isShow: isShow,
  193 + dashName: dashName)
  194 + ],
  195 + );
  196 + return child;
  197 + });
  198 + Utils.setBarStatus(true, color: Colors.white);
  199 + }
  200 +
  201 + /// 九宫格
  202 + Widget _getGridImg(context, List<String> temp) {
  203 + return GridView.builder(
  204 + controller: widget.controller,
  205 + // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
  206 + shrinkWrap: true,
  207 + itemCount: temp.length,
  208 +
  209 + //SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
  210 + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  211 + //横轴元素个数
  212 + crossAxisCount: 3,
  213 + //纵轴间距
  214 + mainAxisSpacing: ScreenUtil().setWidth(40),
  215 + //横轴间距
  216 + crossAxisSpacing: ScreenUtil().setWidth(36),
  217 + //子组件宽高长度比例
  218 + childAspectRatio: 1.0),
  219 + itemBuilder: (BuildContext context, int index) {
  220 + //Widget Function(BuildContext context, int index)
  221 +
  222 + return temp.length < 1
  223 + ? Text('')
  224 + : InkWell(
  225 + onTap: () {
  226 + ///没有上传完成的不可以点击
  227 + _showPhotoView(context, index, temp);
  228 + },
  229 + child: CachedNetworkImage(
  230 + imageUrl: temp[index],
  231 + fit: BoxFit.cover,
  232 + width: ScreenUtil().setWidth(100 * 2),
  233 + height: ScreenUtil().setWidth(100 * 2),
  234 + ));
  235 + });
  236 + }
  237 +
  238 + @override
  239 + Widget build(BuildContext context) {
  240 + return Container(
  241 + color: Colors.white,
  242 + padding: EdgeInsets.only(left: w(16)),
  243 + margin:
  244 + EdgeInsets.only(top: w(16), bottom: w(10), left: w(20), right: w(20)),
  245 + child: Column(
  246 + children: [
  247 + _textWidget(
  248 + '酒品名称',
  249 + "酒名",
  250 + ),
  251 + VEmptyView(16),
  252 + _textFieldWidget('出库数量', '数量', widget.wineManageModel.wineNumC),
  253 + VEmptyView(16),
  254 + _textWidget('计量单位', '计量单位'),
  255 + VEmptyView(16),
  256 + _textWidget('存酒编号', '存酒编号'),
  257 + VEmptyView(16),
  258 + _textWidget('存酒日期', '2023-02-14 15:34:23'),
  259 + VEmptyView(16),
  260 + _getGridImg(context, widget.wineManageModel.imageData),
  261 + VEmptyView(16),
  262 + ],
  263 + ),
  264 + );
  265 + }
  266 +}
  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  3 +import 'package:provider/provider.dart';
  4 +
  5 +import '../../../models/wine_manage_model.dart';
  6 +import '../../../provider/store_wine_provider.dart';
  7 +import '../../../res/colors.dart';
  8 +import '../../../route/navigator_util.dart';
  9 +import '../../../utils/screen_util.dart';
  10 +import '../../../utils/utils.dart';
  11 +import '../../../widgets/MyDivider.dart';
  12 +import '../../../widgets/h_empty_view.dart';
  13 +import '../../../widgets/round_button.dart';
  14 +import '../../../widgets/system_app_bar.dart';
  15 +import '../../../widgets/v_empty_view.dart';
  16 +import 'apply_out_store_item_page.dart';
  17 +
  18 +/**
  19 + * 申请出库页面
  20 + */
  21 +
  22 +class ApplyOutStorePage extends StatefulWidget {
  23 + ApplyOutStorePage({Key key}) : super(key: key);
  24 +
  25 + @override
  26 + _ApplyOutStorePageState createState() => _ApplyOutStorePageState();
  27 +}
  28 +
  29 +class _ApplyOutStorePageState extends State<ApplyOutStorePage> {
  30 + StoreWineProvider storeWineProvider;
  31 +
  32 + ScrollController _controller = ScrollController();
  33 +
  34 + List dataWine = [];
  35 +
  36 + @override
  37 + void initState() {
  38 + // TODO: implement initState
  39 + super.initState();
  40 + WineManageModel wineManageModel = WineManageModel();
  41 + dataWine.add(wineManageModel);
  42 + dataWine.add(wineManageModel);
  43 + }
  44 +
  45 + Widget _textItemWidget(
  46 + String title,
  47 + String subTitle,
  48 + ) {
  49 + return Column(children: [
  50 + Container(
  51 + height: ScreenUtil().setWidth(48 * 2),
  52 + padding: EdgeInsets.only(right: ScreenUtil().setWidth(16 * 2)),
  53 + child: Row(
  54 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  55 + crossAxisAlignment: CrossAxisAlignment.center,
  56 + children: [
  57 + Text(
  58 + title,
  59 + style: TextStyle(
  60 + color: MyColours.color_515151, fontSize: font(16)),
  61 + ),
  62 + Text(subTitle,
  63 + //输入文本的样式
  64 + style: TextStyle(
  65 + fontSize: ScreenUtil().setSp(32),
  66 + color: MyColours.color_999999)),
  67 + // ),
  68 + ],
  69 + )),
  70 + MyDivider(
  71 + double.infinity,
  72 + h(0.5),
  73 + color: MyColours.color_E7E7E7,
  74 + ),
  75 + ]);
  76 + }
  77 +
  78 + @override
  79 + Widget build(BuildContext context) {
  80 + storeWineProvider = Provider.of<StoreWineProvider>(context, listen: true);
  81 + return Scaffold(
  82 + appBar: SystemAppBar(
  83 + '存酒出库',
  84 + onTap: () {
  85 + Navigator.pop(context);
  86 + },
  87 + ),
  88 + body: Container(
  89 + child: Column(
  90 + children: [
  91 + Expanded(
  92 + child: SingleChildScrollView(
  93 + controller: _controller,
  94 + child: Column(
  95 + children: [
  96 + Container(
  97 + color: Colors.white,
  98 + padding: EdgeInsets.only(
  99 + left: ScreenUtil().setWidth(16 * 2)),
  100 + child: Column(
  101 + crossAxisAlignment: CrossAxisAlignment.center,
  102 + mainAxisAlignment: MainAxisAlignment.start,
  103 + children: [
  104 + VEmptyView(32),
  105 + _textItemWidget(
  106 + '联系电话', Utils.starPhone('18799999999')),
  107 + Container(
  108 + height: ScreenUtil().setWidth(48 * 2),
  109 + padding: EdgeInsets.only(
  110 + top: ScreenUtil().setWidth(16 * 2),
  111 + right: ScreenUtil().setWidth(16 * 2)),
  112 + child: Row(
  113 + mainAxisAlignment:
  114 + MainAxisAlignment.spaceBetween,
  115 + crossAxisAlignment: CrossAxisAlignment.center,
  116 + children: [
  117 + Text(
  118 + '客人姓名',
  119 + style: TextStyle(
  120 + color: MyColours.color_515151,
  121 + fontSize: font(16)),
  122 + ),
  123 + Expanded(
  124 + child: Container(
  125 + height: ScreenUtil().setWidth(16 * 2),
  126 + alignment: Alignment.centerRight,
  127 + child: Text('fff先生',
  128 + style: TextStyle(
  129 + fontSize: ScreenUtil().setSp(32),
  130 + color: MyColours.color_999999)),
  131 + )),
  132 + HEmptyView(40),
  133 + Container(
  134 + width: w(100),
  135 + alignment: Alignment.centerRight,
  136 + child: Text(
  137 + // '会员状态未知',
  138 + '会员',
  139 + style: TextStyle(
  140 + color: true
  141 + ? MyColours.color_999999
  142 + : MyColours.color_515151,
  143 + fontSize: ScreenUtil().setSp(32),
  144 + ),
  145 + ),
  146 + ),
  147 + ],
  148 + )),
  149 + ],
  150 + )),
  151 + ListView.builder(
  152 + shrinkWrap: true,
  153 + controller: _controller,
  154 + itemCount: dataWine.length,
  155 + itemBuilder: (context, index) {
  156 + WineManageModel wineManageModel = dataWine[index];
  157 + return ApplyOutStoreItemPage(
  158 + wineManageModel: wineManageModel,
  159 + controller: _controller,
  160 + index: index,
  161 + );
  162 + }),
  163 + ],
  164 + ),
  165 + )),
  166 + Container(
  167 + alignment: Alignment.centerLeft,
  168 + margin: EdgeInsets.only(
  169 + left: w(20), right: w(20), top: w(10), bottom: w(16)),
  170 + child: Text(
  171 + '注:为保障酒品安排,只有存酒管理员才可以进行存酒操作!',
  172 + style: TextStyle(
  173 + color: MyColours.color_999999, fontSize: font(10)),
  174 + )),
  175 + Container(
  176 + color: MyColours.color_ffffff,
  177 + padding: EdgeInsets.only(
  178 + top: ScreenUtil().setWidth(16 * 2),
  179 + bottom: ScreenUtil().setWidth(35 * 2),
  180 + left: ScreenUtil().setWidth(45 * 2),
  181 + right: ScreenUtil().setWidth(45 * 2),
  182 + ),
  183 + child: RoundButton(
  184 + text: '提交出库申请',
  185 + width: double.infinity,
  186 + height: ScreenUtil().setWidth(80),
  187 + radius: ScreenUtil().setWidth(10),
  188 + isBold: true,
  189 + fontSize: 32,
  190 + onPressed: () async {
  191 + // Utils.showToast('您不是店铺的存酒管理员,无权进行相关操作。');
  192 + // UserModel userModel =
  193 + // Provider.of<UserModel>(context, listen: false);
  194 + // if (userModel.user.role_name == '管理员' ||
  195 + // userModel.user.role_name == '店长') {
  196 + NavigatorUtil.goSmsCodeInputPage(context);
  197 + // } else {
  198 + // bool needRefresh =
  199 + // await NavigatorUtil.goCouponEditPage(context);
  200 + // print(needRefresh);
  201 + // if (needRefresh != null && needRefresh) {
  202 + // bus.emit('refresh_coupon_list_f');
  203 + // //刷新页面数据
  204 + // // _controller.callRefresh();
  205 + // // _couponNetworkData(tabController.index);
  206 + // }
  207 + // }
  208 + },
  209 + ))
  210 + ],
  211 + ),
  212 + ));
  213 + }
  214 +}
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 import 'package:flutter_screenutil/flutter_screenutil.dart'; 2 import 'package:flutter_screenutil/flutter_screenutil.dart';
  3 +import 'package:one_key/pages/my/store_wine_manage/create_wine_item_page.dart';
3 import 'package:one_key/widgets/MyDivider.dart'; 4 import 'package:one_key/widgets/MyDivider.dart';
4 import 'package:one_key/widgets/v_empty_view.dart'; 5 import 'package:one_key/widgets/v_empty_view.dart';
5 import 'package:provider/provider.dart'; 6 import 'package:provider/provider.dart';
6 7
  8 +import '../../../models/wine_manage_model.dart';
7 import '../../../provider/store_wine_provider.dart'; 9 import '../../../provider/store_wine_provider.dart';
8 import '../../../res/colors.dart'; 10 import '../../../res/colors.dart';
9 import '../../../utils/dialog_util.dart'; 11 import '../../../utils/dialog_util.dart';
@@ -30,11 +32,119 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { @@ -30,11 +32,119 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
30 String sexStr = '先生'; 32 String sexStr = '先生';
31 List sexList = []; 33 List sexList = [];
32 34
  35 + ScrollController _controller = ScrollController();
  36 + TextEditingController phoneC = TextEditingController(); //电话
  37 +
  38 + List dataWine = [];
  39 +
33 @override 40 @override
34 void initState() { 41 void initState() {
35 // TODO: implement initState 42 // TODO: implement initState
36 super.initState(); 43 super.initState();
37 sexList = ['先生', '女士', '公司']; 44 sexList = ['先生', '女士', '公司'];
  45 + WineManageModel wineManageModel = WineManageModel();
  46 + dataWine.add(wineManageModel);
  47 + }
  48 +
  49 + Widget _textFieldWidget(
  50 + String title, String hintText, TextEditingController controller) {
  51 + return Column(children: [
  52 + Container(
  53 + height: ScreenUtil().setWidth(48 * 2),
  54 + padding: EdgeInsets.only(right: ScreenUtil().setWidth(16 * 2)),
  55 + child: Row(
  56 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  57 + crossAxisAlignment: CrossAxisAlignment.center,
  58 + children: [
  59 + Text(
  60 + title,
  61 + style: TextStyle(
  62 + color: MyColours.color_515151, fontSize: font(16)),
  63 + ),
  64 + Expanded(
  65 + child: Container(
  66 + height: ScreenUtil().setWidth(16 * 2),
  67 + alignment: Alignment.centerRight,
  68 + child: TextField(
  69 + maxLines: 1,
  70 + //输入文本的样式
  71 + style: TextStyle(
  72 + fontSize: ScreenUtil().setSp(32),
  73 + color: MyColours.color_515151),
  74 + controller: controller,
  75 + // focusNode: _phoneNode,
  76 + textAlign: TextAlign.right,
  77 + textAlignVertical: TextAlignVertical.center,
  78 +
  79 + // textAlignVertical:
  80 + // TextAlignVertical.center,
  81 + decoration: InputDecoration(
  82 + hintText: hintText,
  83 + hintStyle: TextStyle(
  84 + color: MyColours.color_999999,
  85 + fontSize: ScreenUtil().setSp(32),
  86 + ),
  87 + contentPadding: EdgeInsets.zero,
  88 + // contentPadding:
  89 + // EdgeInsets.symmetric(
  90 + // vertical: w(12)),
  91 + border:
  92 + OutlineInputBorder(borderSide: BorderSide.none),
  93 + ),
  94 + onChanged: (value) {
  95 + print(value);
  96 + // if (value.trim().isEmpty || value.trim().length > 11) {
  97 + // //内容为空,或 超过11位
  98 + // setState(() {
  99 + // _baseIndoProvider.userHistorys.clear();
  100 + // });
  101 + // return;
  102 + // }
  103 + // Map<String, String> params = {
  104 + // "keywords": value.trim(),
  105 + // "sid": Provider.of<UserModel>(context, listen: false)
  106 + // .user
  107 + // .sellerid,
  108 + // };
  109 + // _baseIndoProvider.getUserHistorys(context, params);
  110 + },
  111 + onEditingComplete: () {
  112 + // _phoneNode.unfocus();
  113 + FocusScope.of(context).requestFocus(FocusNode());
  114 + },
  115 + onTap: () {
  116 + // setState(() {
  117 + // showPhoneHistory = true;
  118 + // });
  119 + // Future.delayed(Duration(milliseconds: 300), () {
  120 + // _controller.jumpTo(_controller.position.maxScrollExtent);
  121 + // });
  122 + },
  123 + keyboardType: TextInputType.number,
  124 + ))),
  125 + // InkWell(
  126 + // onTap: () {
  127 + // // _openAddressBook();
  128 + // },
  129 + // child: Container(
  130 + // width: ScreenUtil().setWidth(74) * 2,
  131 + // height: ScreenUtil().setWidth(48),
  132 + // alignment: Alignment.centerRight,
  133 + // child: Text('一键录入',
  134 + // style: TextStyle(
  135 + // color: MyColours.color_515151,
  136 + // fontSize: ScreenUtil().setSp(28),
  137 + // )),
  138 + // ),
  139 + // ),
  140 + ],
  141 + )),
  142 + MyDivider(
  143 + double.infinity,
  144 + h(0.5),
  145 + color: MyColours.color_E7E7E7,
  146 + ),
  147 + ]);
38 } 148 }
39 149
40 @override 150 @override
@@ -52,6 +162,7 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { @@ -52,6 +162,7 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
52 children: [ 162 children: [
53 Expanded( 163 Expanded(
54 child: SingleChildScrollView( 164 child: SingleChildScrollView(
  165 + controller: _controller,
55 child: Column( 166 child: Column(
56 children: [ 167 children: [
57 Container( 168 Container(
@@ -63,110 +174,7 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { @@ -63,110 +174,7 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
63 mainAxisAlignment: MainAxisAlignment.start, 174 mainAxisAlignment: MainAxisAlignment.start,
64 children: [ 175 children: [
65 VEmptyView(32), 176 VEmptyView(32),
66 - Container(  
67 - height: ScreenUtil().setWidth(48 * 2),  
68 - padding: EdgeInsets.only(  
69 - right: ScreenUtil().setWidth(16 * 2)),  
70 - child: Row(  
71 - mainAxisAlignment:  
72 - MainAxisAlignment.spaceBetween,  
73 - crossAxisAlignment: CrossAxisAlignment.center,  
74 - children: [  
75 - Text(  
76 - '联系电话',  
77 - style: TextStyle(  
78 - color: MyColours.color_515151,  
79 - fontSize: font(16)),  
80 - ),  
81 - Expanded(  
82 - child: Container(  
83 - height:  
84 - ScreenUtil().setWidth(16 * 2),  
85 - alignment: Alignment.centerRight,  
86 - child: TextField(  
87 - maxLines: 1,  
88 - //输入文本的样式  
89 - style: TextStyle(  
90 - fontSize:  
91 - ScreenUtil().setSp(32),  
92 - color:  
93 - MyColours.color_515151),  
94 - // controller: _baseIndoProvider.phoneController,  
95 - // focusNode: _phoneNode,  
96 - textAlign: TextAlign.right,  
97 - textAlignVertical:  
98 - TextAlignVertical.center,  
99 -  
100 - // textAlignVertical:  
101 - // TextAlignVertical.center,  
102 - decoration: InputDecoration(  
103 - hintText: "点击输入客人电话",  
104 - hintStyle: TextStyle(  
105 - color: MyColours.color_999999,  
106 - fontSize:  
107 - ScreenUtil().setSp(32),  
108 - ),  
109 - contentPadding: EdgeInsets.zero,  
110 - // contentPadding:  
111 - // EdgeInsets.symmetric(  
112 - // vertical: w(12)),  
113 - border: OutlineInputBorder(  
114 - borderSide:  
115 - BorderSide.none),  
116 - ),  
117 - onChanged: (value) {  
118 - print(value);  
119 - // if (value.trim().isEmpty || value.trim().length > 11) {  
120 - // //内容为空,或 超过11位  
121 - // setState(() {  
122 - // _baseIndoProvider.userHistorys.clear();  
123 - // });  
124 - // return;  
125 - // }  
126 - // Map<String, String> params = {  
127 - // "keywords": value.trim(),  
128 - // "sid": Provider.of<UserModel>(context, listen: false)  
129 - // .user  
130 - // .sellerid,  
131 - // };  
132 - // _baseIndoProvider.getUserHistorys(context, params);  
133 - },  
134 - onEditingComplete: () {  
135 - // _phoneNode.unfocus();  
136 - },  
137 - onTap: () {  
138 - // setState(() {  
139 - // showPhoneHistory = true;  
140 - // });  
141 - // Future.delayed(Duration(milliseconds: 300), () {  
142 - // _controller.jumpTo(_controller.position.maxScrollExtent);  
143 - // });  
144 - },  
145 - keyboardType:  
146 - TextInputType.number,  
147 - ))),  
148 - // InkWell(  
149 - // onTap: () {  
150 - // // _openAddressBook();  
151 - // },  
152 - // child: Container(  
153 - // width: ScreenUtil().setWidth(74) * 2,  
154 - // height: ScreenUtil().setWidth(48),  
155 - // alignment: Alignment.centerRight,  
156 - // child: Text('一键录入',  
157 - // style: TextStyle(  
158 - // color: MyColours.color_515151,  
159 - // fontSize: ScreenUtil().setSp(28),  
160 - // )),  
161 - // ),  
162 - // ),  
163 - ],  
164 - )),  
165 - MyDivider(  
166 - double.infinity,  
167 - h(0.5),  
168 - color: MyColours.color_E7E7E7,  
169 - ), 177 + _textFieldWidget('联系电话', "点击输入客人电话", phoneC),
170 Container( 178 Container(
171 height: ScreenUtil().setWidth(48 * 2), 179 height: ScreenUtil().setWidth(48 * 2),
172 padding: EdgeInsets.only( 180 padding: EdgeInsets.only(
@@ -238,6 +246,7 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { @@ -238,6 +246,7 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
238 }, 246 },
239 onEditingComplete: () { 247 onEditingComplete: () {
240 // _phoneNode.unfocus(); 248 // _phoneNode.unfocus();
  249 + FocusScope.of(context).requestFocus(FocusNode());
241 }, 250 },
242 onTap: () { 251 onTap: () {
243 // setState(() { 252 // setState(() {
@@ -299,6 +308,41 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { @@ -299,6 +308,41 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
299 ], 308 ],
300 )), 309 )),
301 ], 310 ],
  311 + )),
  312 + ListView.builder(
  313 + shrinkWrap: true,
  314 + controller: _controller,
  315 + itemCount: dataWine.length,
  316 + itemBuilder: (context, index) {
  317 + WineManageModel wineManageModel = dataWine[index];
  318 + return CreateWineItemPage(
  319 + wineManageModel: wineManageModel,
  320 + controller: _controller,
  321 + index: index,
  322 + onDel: () {
  323 + dataWine.removeAt(index);
  324 + setState(() {});
  325 + },
  326 + );
  327 + }),
  328 + InkWell(
  329 + onTap: () {
  330 + WineManageModel model = WineManageModel();
  331 + dataWine.add(model);
  332 + setState(() {});
  333 + },
  334 + child: Container(
  335 + color: Colors.white,
  336 + width: double.infinity,
  337 + height: w(48),
  338 + alignment: Alignment.center,
  339 + margin: EdgeInsets.symmetric(horizontal: w(20)),
  340 + child: Text(
  341 + '再加一项',
  342 + style: TextStyle(
  343 + color: MyColours.color_438E93,
  344 + fontSize: font(16)),
  345 + ),
302 )) 346 ))
303 ], 347 ],
304 ), 348 ),
  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  3 +import 'package:provider/provider.dart';
  4 +
  5 +import '../../../models/wine_manage_model.dart';
  6 +import '../../../provider/upload_img_provider.dart';
  7 +import '../../../res/colors.dart';
  8 +import '../../../utils/screen_util.dart';
  9 +import '../../../utils/upload_image_util.dart';
  10 +import '../../../widgets/MyDivider.dart';
  11 +import '../../../widgets/v_empty_view.dart';
  12 +import '../../online_check/img_picker_widget.dart';
  13 +
  14 +class CreateWineItemPage extends StatefulWidget {
  15 + final WineManageModel wineManageModel;
  16 + final ScrollController controller;
  17 + final int index;
  18 + final GestureTapCallback onDel;
  19 +
  20 + CreateWineItemPage(
  21 + {Key key, this.wineManageModel, this.controller, this.index, this.onDel})
  22 + : super(key: key);
  23 +
  24 + @override
  25 + _CreateWineItemPageState createState() => _CreateWineItemPageState();
  26 +}
  27 +
  28 +class _CreateWineItemPageState extends State<CreateWineItemPage> {
  29 + Widget _textFieldWidget(
  30 + String title, String hintText, TextEditingController controller) {
  31 + return Column(children: [
  32 + Container(
  33 + height: ScreenUtil().setWidth(48 * 2),
  34 + padding: EdgeInsets.only(right: ScreenUtil().setWidth(16 * 2)),
  35 + child: Row(
  36 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  37 + crossAxisAlignment: CrossAxisAlignment.center,
  38 + children: [
  39 + Text(
  40 + title,
  41 + style: TextStyle(
  42 + color: MyColours.color_515151, fontSize: font(16)),
  43 + ),
  44 + Expanded(
  45 + child: Container(
  46 + height: ScreenUtil().setWidth(16 * 2),
  47 + alignment: Alignment.centerRight,
  48 + child: TextField(
  49 + maxLines: 1,
  50 + //输入文本的样式
  51 + style: TextStyle(
  52 + fontSize: ScreenUtil().setSp(32),
  53 + color: MyColours.color_515151),
  54 + controller: controller,
  55 + // focusNode: _phoneNode,
  56 + textAlign: TextAlign.right,
  57 + textAlignVertical: TextAlignVertical.center,
  58 +
  59 + // textAlignVertical:
  60 + // TextAlignVertical.center,
  61 + decoration: InputDecoration(
  62 + hintText: hintText,
  63 + hintStyle: TextStyle(
  64 + color: MyColours.color_999999,
  65 + fontSize: ScreenUtil().setSp(32),
  66 + ),
  67 + contentPadding: EdgeInsets.zero,
  68 + // contentPadding:
  69 + // EdgeInsets.symmetric(
  70 + // vertical: w(12)),
  71 + border:
  72 + OutlineInputBorder(borderSide: BorderSide.none),
  73 + ),
  74 + onChanged: (value) {
  75 + print(value);
  76 + // if (value.trim().isEmpty || value.trim().length > 11) {
  77 + // //内容为空,或 超过11位
  78 + // setState(() {
  79 + // _baseIndoProvider.userHistorys.clear();
  80 + // });
  81 + // return;
  82 + // }
  83 + // Map<String, String> params = {
  84 + // "keywords": value.trim(),
  85 + // "sid": Provider.of<UserModel>(context, listen: false)
  86 + // .user
  87 + // .sellerid,
  88 + // };
  89 + // _baseIndoProvider.getUserHistorys(context, params);
  90 + },
  91 + onEditingComplete: () {
  92 + // _phoneNode.unfocus();
  93 + FocusScope.of(context).requestFocus(FocusNode());
  94 + },
  95 + onTap: () {
  96 + // setState(() {
  97 + // showPhoneHistory = true;
  98 + // });
  99 + // Future.delayed(Duration(milliseconds: 300), () {
  100 + // _controller.jumpTo(_controller.position.maxScrollExtent);
  101 + // });
  102 + },
  103 + keyboardType: TextInputType.number,
  104 + ))),
  105 + // InkWell(
  106 + // onTap: () {
  107 + // // _openAddressBook();
  108 + // },
  109 + // child: Container(
  110 + // width: ScreenUtil().setWidth(74) * 2,
  111 + // height: ScreenUtil().setWidth(48),
  112 + // alignment: Alignment.centerRight,
  113 + // child: Text('一键录入',
  114 + // style: TextStyle(
  115 + // color: MyColours.color_515151,
  116 + // fontSize: ScreenUtil().setSp(28),
  117 + // )),
  118 + // ),
  119 + // ),
  120 + ],
  121 + )),
  122 + MyDivider(
  123 + double.infinity,
  124 + h(0.5),
  125 + color: MyColours.color_E7E7E7,
  126 + ),
  127 + ]);
  128 + }
  129 +
  130 + @override
  131 + Widget build(BuildContext context) {
  132 + return Container(
  133 + color: Colors.white,
  134 + padding: EdgeInsets.only(left: w(16)),
  135 + margin:
  136 + EdgeInsets.only(top: w(16), bottom: w(10), left: w(20), right: w(20)),
  137 + child: Column(
  138 + children: [
  139 + _textFieldWidget(
  140 + '酒品名称',
  141 + "点击输入酒名",
  142 + widget.wineManageModel.wineNameC,
  143 + ),
  144 + VEmptyView(16),
  145 + _textFieldWidget('存酒数量', '点击输入数量', widget.wineManageModel.wineNumC),
  146 + VEmptyView(16),
  147 + _textFieldWidget(
  148 + '计量单位', '点击输入计量单位', widget.wineManageModel.wineUnitC),
  149 + VEmptyView(16),
  150 + _textFieldWidget('存酒编号', '点击输入存酒编号', null),
  151 + VEmptyView(16),
  152 + Consumer<UploadImageProvider>(builder: (context, model, _) {
  153 + return ImgPickerWidget(
  154 + scrollController: widget.controller,
  155 + model: model,
  156 + maxImageNumber: 3,
  157 + maxRemind: '三',
  158 + uploadType: UploadType.WineManageType,
  159 + deleteCallback: (int index) {
  160 + // _delTablePhoto(
  161 + // context,
  162 + // _uploadImageProvider
  163 + // .tableImageList[index]
  164 + // .photoID,
  165 + // index);
  166 + },
  167 + callback: () {
  168 + // for (UploadImgModel item
  169 + // in _uploadImageProvider
  170 + // .tableImageList) {
  171 + // if (item.process < 1) {
  172 + // Utils.showToast('正在上传图片,请稍等');
  173 + // return;
  174 + // }
  175 + // }
  176 + // //接口,和桌子绑定
  177 + // List imageQiniuUrlList = [];
  178 + // for (int i = 0;
  179 + // i <
  180 + // _uploadImageProvider
  181 + // .tableImageList.length;
  182 + // i++) {
  183 + // if (!_uploadImageProvider
  184 + // .tableImageList[i].isUpload) {
  185 + // imageQiniuUrlList.add({
  186 + // "url": _uploadImageProvider
  187 + // .tableImageList[i].qiniuUrl
  188 + // });
  189 + // }
  190 + // }
  191 + // _setTablePhoto(
  192 + // context, imageQiniuUrlList);
  193 + },
  194 + );
  195 + }),
  196 + VEmptyView(16),
  197 + widget.index != 0
  198 + ? MyDivider(
  199 + double.infinity,
  200 + h(0.5),
  201 + color: MyColours.color_E7E7E7,
  202 + )
  203 + : SizedBox(),
  204 + widget.index != 0
  205 + ? InkWell(
  206 + onTap: widget.onDel,
  207 + child: Container(
  208 + width: double.infinity,
  209 + height: w(48),
  210 + alignment: Alignment.center,
  211 + child: Text(
  212 + '删除该项',
  213 + style: TextStyle(
  214 + color: MyColours.color_438E93, fontSize: font(16)),
  215 + ),
  216 + ))
  217 + : SizedBox()
  218 + ],
  219 + ),
  220 + );
  221 + }
  222 +}
  1 +import 'package:cached_network_image/cached_network_image.dart';
  2 +import 'package:flutter/material.dart';
  3 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  4 +import 'package:provider/provider.dart';
  5 +
  6 +import '../../../models/wine_manage_model.dart';
  7 +import '../../../provider/upload_img_provider.dart';
  8 +import '../../../res/colors.dart';
  9 +import '../../../utils/screen_util.dart';
  10 +import '../../../utils/upload_image_util.dart';
  11 +import '../../../utils/utils.dart';
  12 +import '../../../widgets/MyDivider.dart';
  13 +import '../../../widgets/v_empty_view.dart';
  14 +import '../../online_check/img_picker_widget.dart';
  15 +import '../../online_check/photo_view_wiget.dart';
  16 +
  17 +//出库记录酒品item
  18 +
  19 +class OutStoreRecordItemPage extends StatefulWidget {
  20 + final WineManageModel wineManageModel;
  21 + final ScrollController controller;
  22 + final int index;
  23 +
  24 + OutStoreRecordItemPage(
  25 + {Key key, this.wineManageModel, this.controller, this.index})
  26 + : super(key: key);
  27 +
  28 + @override
  29 + _OutStoreRecordItemPageState createState() => _OutStoreRecordItemPageState();
  30 +}
  31 +
  32 +class _OutStoreRecordItemPageState extends State<OutStoreRecordItemPage> {
  33 + Widget _textWidget(String title, String subTitle) {
  34 + return Column(children: [
  35 + Container(
  36 + height: ScreenUtil().setWidth(48 * 2),
  37 + padding: EdgeInsets.only(right: ScreenUtil().setWidth(16 * 2)),
  38 + child: Row(
  39 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  40 + crossAxisAlignment: CrossAxisAlignment.center,
  41 + children: [
  42 + Text(
  43 + title,
  44 + style: TextStyle(
  45 + color: MyColours.color_515151, fontSize: font(16)),
  46 + ),
  47 + Expanded(
  48 + child: Container(
  49 + height: ScreenUtil().setWidth(16 * 2),
  50 + alignment: Alignment.centerRight,
  51 + child: Text(
  52 + subTitle,
  53 + //输入文本的样式
  54 + style: TextStyle(
  55 + fontSize: ScreenUtil().setSp(32),
  56 + color: MyColours.color_999999),
  57 + )),
  58 + )
  59 + ],
  60 + )),
  61 + MyDivider(
  62 + double.infinity,
  63 + h(0.5),
  64 + color: MyColours.color_E7E7E7,
  65 + ),
  66 + ]);
  67 + }
  68 +
  69 + //查看大图
  70 + _showPhotoView(BuildContext context, int index, List<String> imgs,
  71 + {isShow = false, List dashName}) async {
  72 + // if (imgs.length == 1 &&
  73 + // imgs[0] ==
  74 + // 'http://nosqn.colorcun.com/custom/lite-online/image/def-banner.png') {
  75 + // imgs[0] = 'http://nosqn.colorcun.com/app/seller-hj-empty.png';
  76 + // }
  77 + Utils.setBarStatus(false, color: Colors.black);
  78 + dynamic result = await showGeneralDialog(
  79 + context: context,
  80 + barrierDismissible: false,
  81 + // barrierColor: Colors.red,
  82 + barrierLabel:
  83 + MaterialLocalizations.of(context).modalBarrierDismissLabel,
  84 + transitionDuration: const Duration(milliseconds: 150),
  85 + pageBuilder: (BuildContext context, Animation animation,
  86 + Animation secondaryAnimation) {
  87 + Widget child = Stack(
  88 + children: <Widget>[
  89 + PhotoPreview(
  90 + initialIndex: index,
  91 + photoList: imgs,
  92 + isShow: isShow,
  93 + dashName: dashName)
  94 + ],
  95 + );
  96 + return child;
  97 + });
  98 + Utils.setBarStatus(true, color: Colors.white);
  99 + }
  100 +
  101 + /// 九宫格
  102 + Widget _getGridImg(context, List<String> temp) {
  103 + return GridView.builder(
  104 + controller: widget.controller,
  105 + // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
  106 + shrinkWrap: true,
  107 + itemCount: temp.length,
  108 +
  109 + //SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
  110 + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  111 + //横轴元素个数
  112 + crossAxisCount: 3,
  113 + //纵轴间距
  114 + mainAxisSpacing: ScreenUtil().setWidth(40),
  115 + //横轴间距
  116 + crossAxisSpacing: ScreenUtil().setWidth(36),
  117 + //子组件宽高长度比例
  118 + childAspectRatio: 1.0),
  119 + itemBuilder: (BuildContext context, int index) {
  120 + //Widget Function(BuildContext context, int index)
  121 +
  122 + return temp.length < 1
  123 + ? Text('')
  124 + : InkWell(
  125 + onTap: () {
  126 + ///没有上传完成的不可以点击
  127 + _showPhotoView(context, index, temp);
  128 + },
  129 + child: CachedNetworkImage(
  130 + imageUrl: temp[index],
  131 + fit: BoxFit.cover,
  132 + width: ScreenUtil().setWidth(100 * 2),
  133 + height: ScreenUtil().setWidth(100 * 2),
  134 + ));
  135 + });
  136 + }
  137 +
  138 + @override
  139 + Widget build(BuildContext context) {
  140 + return Container(
  141 + color: Colors.white,
  142 + padding: EdgeInsets.only(left: w(16)),
  143 + margin:
  144 + EdgeInsets.only(top: w(16), bottom: w(10), left: w(20), right: w(20)),
  145 + child: Column(
  146 + children: [
  147 + _textWidget(
  148 + '酒品名称',
  149 + "酒名",
  150 + ),
  151 + VEmptyView(16),
  152 + _textWidget('出库数量', '数量'),
  153 + VEmptyView(16),
  154 + _textWidget('计量单位', '计量单位'),
  155 + VEmptyView(16),
  156 + _textWidget('存酒编号', '存酒编号'),
  157 + VEmptyView(16),
  158 + _textWidget('出库日期', '2023-02-14 15:34:23'),
  159 + VEmptyView(16),
  160 + _getGridImg(context, widget.wineManageModel.imageData),
  161 + VEmptyView(16),
  162 + ],
  163 + ),
  164 + );
  165 + }
  166 +}
  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  3 +import 'package:one_key/pages/my/store_wine_manage/wine_detail_item_page.dart';
  4 +import 'package:one_key/utils/utils.dart';
  5 +import 'package:one_key/widgets/system_app_bar.dart';
  6 +import 'package:provider/provider.dart';
  7 +
  8 +import '../../../models/wine_manage_model.dart';
  9 +import '../../../provider/store_wine_provider.dart';
  10 +import '../../../res/colors.dart';
  11 +import '../../../utils/screen_util.dart';
  12 +import '../../../widgets/MyDivider.dart';
  13 +import '../../../widgets/h_empty_view.dart';
  14 +import '../../../widgets/v_empty_view.dart';
  15 +import 'out_store_record_item_page.dart';
  16 +
  17 +/***
  18 + * 出库记录
  19 + */
  20 +
  21 +class OutStoreRecordPage extends StatefulWidget {
  22 + OutStoreRecordPage({Key key}) : super(key: key);
  23 +
  24 + @override
  25 + _OutStoreRecordPageState createState() => _OutStoreRecordPageState();
  26 +}
  27 +
  28 +class _OutStoreRecordPageState extends State<OutStoreRecordPage> {
  29 + StoreWineProvider storeWineProvider;
  30 +
  31 + ScrollController _controller = ScrollController();
  32 +
  33 + List dataWine = [];
  34 +
  35 + @override
  36 + void initState() {
  37 + // TODO: implement initState
  38 + super.initState();
  39 + WineManageModel wineManageModel = WineManageModel();
  40 + dataWine.add(wineManageModel);
  41 + dataWine.add(wineManageModel);
  42 + }
  43 +
  44 + Widget _textItemWidget(String title, String subTitle,
  45 + {bool needBottom = true}) {
  46 + return Column(children: [
  47 + Container(
  48 + height: ScreenUtil().setWidth(48 * 2),
  49 + padding: EdgeInsets.only(right: ScreenUtil().setWidth(16 * 2)),
  50 + child: Row(
  51 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  52 + crossAxisAlignment: CrossAxisAlignment.center,
  53 + children: [
  54 + Text(
  55 + title,
  56 + style: TextStyle(
  57 + color: MyColours.color_515151, fontSize: font(16)),
  58 + ),
  59 + Text(subTitle,
  60 + //输入文本的样式
  61 + style: TextStyle(
  62 + fontSize: ScreenUtil().setSp(32),
  63 + color: MyColours.color_999999)),
  64 + // ),
  65 + ],
  66 + )),
  67 + needBottom
  68 + ? MyDivider(
  69 + double.infinity,
  70 + h(0.5),
  71 + color: MyColours.color_E7E7E7,
  72 + )
  73 + : SizedBox(),
  74 + ]);
  75 + }
  76 +
  77 + @override
  78 + Widget build(BuildContext context) {
  79 + storeWineProvider = Provider.of<StoreWineProvider>(context, listen: true);
  80 + return Scaffold(
  81 + appBar: SystemAppBar(
  82 + '存酒出库详情',
  83 + onTap: () {
  84 + Navigator.pop(context);
  85 + },
  86 + ),
  87 + body: Container(
  88 + child: Column(
  89 + children: [
  90 + Expanded(
  91 + child: SingleChildScrollView(
  92 + controller: _controller,
  93 + child: Column(
  94 + children: [
  95 + Container(
  96 + color: Colors.white,
  97 + padding: EdgeInsets.only(
  98 + left: ScreenUtil().setWidth(16 * 2)),
  99 + child: Column(
  100 + crossAxisAlignment: CrossAxisAlignment.center,
  101 + mainAxisAlignment: MainAxisAlignment.start,
  102 + children: [
  103 + VEmptyView(32),
  104 + _textItemWidget(
  105 + '联系电话', Utils.starPhone('18799999999')),
  106 + Container(
  107 + height: ScreenUtil().setWidth(48 * 2),
  108 + padding: EdgeInsets.only(
  109 + top: ScreenUtil().setWidth(16 * 2),
  110 + right: ScreenUtil().setWidth(16 * 2)),
  111 + child: Row(
  112 + mainAxisAlignment:
  113 + MainAxisAlignment.spaceBetween,
  114 + crossAxisAlignment: CrossAxisAlignment.center,
  115 + children: [
  116 + Text(
  117 + '客人姓名',
  118 + style: TextStyle(
  119 + color: MyColours.color_515151,
  120 + fontSize: font(16)),
  121 + ),
  122 + Expanded(
  123 + child: Container(
  124 + height: ScreenUtil().setWidth(16 * 2),
  125 + alignment: Alignment.centerRight,
  126 + child: Text('fff先生',
  127 + style: TextStyle(
  128 + fontSize: ScreenUtil().setSp(32),
  129 + color: MyColours.color_999999)),
  130 + )),
  131 + HEmptyView(40),
  132 + Container(
  133 + width: w(100),
  134 + alignment: Alignment.centerRight,
  135 + child: Text(
  136 + // '会员状态未知',
  137 + '会员',
  138 + style: TextStyle(
  139 + color: true
  140 + ? MyColours.color_999999
  141 + : MyColours.color_515151,
  142 + fontSize: ScreenUtil().setSp(32),
  143 + ),
  144 + ),
  145 + ),
  146 + ],
  147 + )),
  148 + VEmptyView(12),
  149 + MyDivider(
  150 + double.infinity,
  151 + h(0.5),
  152 + color: MyColours.color_E7E7E7,
  153 + ),
  154 + VEmptyView(16),
  155 + _textItemWidget('出库记录人', '诸葛孔明', needBottom: false),
  156 + ],
  157 + )),
  158 + ListView.builder(
  159 + shrinkWrap: true,
  160 + controller: _controller,
  161 + itemCount: dataWine.length,
  162 + itemBuilder: (context, index) {
  163 + WineManageModel wineManageModel = dataWine[index];
  164 + return OutStoreRecordItemPage(
  165 + wineManageModel: wineManageModel,
  166 + controller: _controller,
  167 + index: index,
  168 + );
  169 + }),
  170 + ],
  171 + ),
  172 + )),
  173 + // Container(
  174 + // alignment: Alignment.centerLeft,
  175 + // margin: EdgeInsets.only(
  176 + // left: w(20), right: w(20), top: w(10), bottom: w(16)),
  177 + // child: Text(
  178 + // '注:为保障酒品安排,只有存酒管理员才可以进行存酒操作!',
  179 + // style: TextStyle(
  180 + // color: MyColours.color_999999, fontSize: font(10)),
  181 + // )),
  182 + // Container(
  183 + // color: MyColours.color_ffffff,
  184 + // padding: EdgeInsets.only(
  185 + // top: ScreenUtil().setWidth(16 * 2),
  186 + // bottom: ScreenUtil().setWidth(35 * 2),
  187 + // left: ScreenUtil().setWidth(45 * 2),
  188 + // right: ScreenUtil().setWidth(45 * 2),
  189 + // ),
  190 + // child: Row(
  191 + // children: [
  192 + // RoundButton(
  193 + // text: '出库记录',
  194 + // width: w(100),
  195 + // height: ScreenUtil().setWidth(80),
  196 + // radius: ScreenUtil().setWidth(10),
  197 + // isBold: true,
  198 + // borderColor: MyColours.color_438E93,
  199 + // gradientStart: MyColours.color_ffffff,
  200 + // gradientEnd: MyColours.color_ffffff,
  201 + // textColor: MyColours.color_438E93,
  202 + // fontSize: 32,
  203 + // onPressed: () async {
  204 + // // UserModel userModel =
  205 + // // Provider.of<UserModel>(context, listen: false);
  206 + // // if (userModel.user.role_name == '管理员' ||
  207 + // // userModel.user.role_name == '店长') {
  208 + // // NavigatorUtil.goCouponCreateSelectTypePage(context);
  209 + // // } else {
  210 + // // bool needRefresh =
  211 + // // await NavigatorUtil.goCouponEditPage(context);
  212 + // // print(needRefresh);
  213 + // // if (needRefresh != null && needRefresh) {
  214 + // // bus.emit('refresh_coupon_list_f');
  215 + // // //刷新页面数据
  216 + // // // _controller.callRefresh();
  217 + // // // _couponNetworkData(tabController.index);
  218 + // // }
  219 + // // }
  220 + // },
  221 + // ),
  222 + // HEmptyView(30),
  223 + // Expanded(
  224 + // child: RoundButton(
  225 + // text: '存酒出库',
  226 + // // width: w(218),
  227 + // height: ScreenUtil().setWidth(80),
  228 + // radius: ScreenUtil().setWidth(10),
  229 + // isBold: true,
  230 + // gradientStart: true
  231 + // ? MyColours.color_BFC4D4
  232 + // : MyColours.color_438E93,
  233 + // gradientEnd: true
  234 + // ? MyColours.color_BFC4D4
  235 + // : MyColours.color_438E93,
  236 + // fontSize: 32,
  237 + // onPressed: () async {
  238 + // Utils.showToast('您不是店铺的存酒管理员,无权进行相关操作。');
  239 + // // UserModel userModel =
  240 + // // Provider.of<UserModel>(context, listen: false);
  241 + // // if (userModel.user.role_name == '管理员' ||
  242 + // // userModel.user.role_name == '店长') {
  243 + // // NavigatorUtil.goCouponCreateSelectTypePage(context);
  244 + // // } else {
  245 + // // bool needRefresh =
  246 + // // await NavigatorUtil.goCouponEditPage(context);
  247 + // // print(needRefresh);
  248 + // // if (needRefresh != null && needRefresh) {
  249 + // // bus.emit('refresh_coupon_list_f');
  250 + // // //刷新页面数据
  251 + // // // _controller.callRefresh();
  252 + // // // _couponNetworkData(tabController.index);
  253 + // // }
  254 + // // }
  255 + // },
  256 + // )),
  257 + // ],
  258 + // ))
  259 + ],
  260 + ),
  261 + ));
  262 + }
  263 +}
  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  3 +import 'package:one_key/res/colors.dart';
  4 +import 'package:one_key/utils/dialog_util.dart';
  5 +import 'package:one_key/widgets/MyDivider.dart';
  6 +import 'package:one_key/widgets/system_app_bar.dart';
  7 +
  8 +import 'package:pin_code_fields/pin_code_fields.dart';
  9 +
  10 +import '../../../utils/screen_util.dart';
  11 +import '../../../widgets/round_button.dart';
  12 +
  13 +/**
  14 + * 短信验证码输入,酒品出库申请
  15 + */
  16 +
  17 +class SmsCodeInputPage extends StatefulWidget {
  18 + SmsCodeInputPage({Key key}) : super(key: key);
  19 +
  20 + @override
  21 + _SmsCodeInputPageState createState() => _SmsCodeInputPageState();
  22 +}
  23 +
  24 +class _SmsCodeInputPageState extends State<SmsCodeInputPage> {
  25 + @override
  26 + Widget build(BuildContext context) {
  27 + return Scaffold(
  28 + backgroundColor: MyColours.color_ffffff,
  29 + appBar: SystemAppBar(
  30 + '存酒出库确认',
  31 + onTap: () {
  32 + Navigator.pop(context);
  33 + },
  34 + ),
  35 + body: Column(
  36 + children: [
  37 + Expanded(
  38 + child: SingleChildScrollView(
  39 + child: Column(
  40 + children: [
  41 + Container(
  42 + height: w(48),
  43 + padding: EdgeInsets.symmetric(horizontal: w(16)),
  44 + alignment: Alignment.centerLeft,
  45 + child: Text(
  46 + '请输入客户手机收到的短信验证码:',
  47 + style: TextStyle(
  48 + color: MyColours.color_515151, fontSize: font(16)),
  49 + ),
  50 + ),
  51 + Padding(
  52 + padding: EdgeInsets.only(left: w(16)),
  53 + child: MyDivider(
  54 + double.infinity,
  55 + w(0.5),
  56 + color: MyColours.color_E7E7E7,
  57 + )),
  58 + Padding(
  59 + padding:
  60 + EdgeInsets.symmetric(vertical: w(23), horizontal: w(32)),
  61 + child: PinCodeTextField(
  62 + autoFocus: true,
  63 + appContext: context,
  64 + pastedTextStyle: TextStyle(
  65 + color: MyColours.color_438E93,
  66 + fontWeight: FontWeight.bold,
  67 + ),
  68 + length: 6,
  69 + obscureText: false,
  70 +
  71 + dialogConfig: DialogConfig(
  72 + dialogTitle: '确认',
  73 + dialogContent: '是否粘贴',
  74 + negativeText: '取消',
  75 + affirmativeText: '粘贴',
  76 + ),
  77 + obscuringCharacter: '*',
  78 + // obscuringWidget: const FlutterLogo(
  79 + // size: 24,
  80 + // ),
  81 + blinkWhenObscuring: true,
  82 + animationType: AnimationType.fade,
  83 + validator: (v) {
  84 + if (v.length < 6) {
  85 + return null;
  86 + return "请输入6位";
  87 + } else {
  88 + return null;
  89 + }
  90 + },
  91 + pinTheme: PinTheme(
  92 + shape: PinCodeFieldShape.box,
  93 + borderRadius: BorderRadius.circular(r(5)),
  94 + fieldHeight: w(50),
  95 + fieldWidth: w(35),
  96 + activeFillColor: Colors.white,
  97 + activeColor: Colors.white,
  98 + selectedFillColor: Colors.white,
  99 + inactiveFillColor: Colors.white,
  100 + disabledColor: Colors.white,
  101 + borderWidth: w(1),
  102 + inactiveColor: MyColours.color_999999,
  103 + selectedColor: MyColours.color_438E93),
  104 + cursorColor: MyColours.color_515151,
  105 +
  106 + animationDuration: const Duration(milliseconds: 300),
  107 + enableActiveFill: true,
  108 + // errorAnimationController: errorController,
  109 + // controller: textEditingController,
  110 + keyboardType: TextInputType.number,
  111 + boxShadows: [
  112 + BoxShadow(
  113 + offset: Offset(0, 1),
  114 + color: Colors.black12,
  115 + blurRadius: r(5),
  116 + )
  117 + ],
  118 + onCompleted: (v) {
  119 + debugPrint("Completed");
  120 + },
  121 + // onTap: () {
  122 + // print("Pressed");
  123 + // },
  124 + onChanged: (value) {
  125 + debugPrint(value);
  126 + setState(() {
  127 + // currentText = value;
  128 + });
  129 + },
  130 + ))
  131 + ],
  132 + ))),
  133 + Container(
  134 + color: MyColours.color_ffffff,
  135 + padding: EdgeInsets.only(
  136 + top: ScreenUtil().setWidth(16 * 2),
  137 + bottom: ScreenUtil().setWidth(35 * 2),
  138 + left: ScreenUtil().setWidth(45 * 2),
  139 + right: ScreenUtil().setWidth(45 * 2),
  140 + ),
  141 + child: RoundButton(
  142 + text: '确认出库',
  143 + width: double.infinity,
  144 + height: ScreenUtil().setWidth(80),
  145 + radius: ScreenUtil().setWidth(10),
  146 + isBold: true,
  147 + fontSize: 32,
  148 + onPressed: () async {
  149 + DialogUtil.cupertinoAlertDialogOnly(context,
  150 + content: '客户欧阳正德的酒品已经出库。\n您可以在存酒管理-出库记录中查看详细信息。',
  151 + rTitle: '我知道了');
  152 + // Utils.showToast('您不是店铺的存酒管理员,无权进行相关操作。');
  153 + // UserModel userModel =
  154 + // Provider.of<UserModel>(context, listen: false);
  155 + // if (userModel.user.role_name == '管理员' ||
  156 + // userModel.user.role_name == '店长') {
  157 + // NavigatorUtil.goSmsCodeInputPage(context);
  158 + // } else {
  159 + // bool needRefresh =
  160 + // await NavigatorUtil.goCouponEditPage(context);
  161 + // print(needRefresh);
  162 + // if (needRefresh != null && needRefresh) {
  163 + // bus.emit('refresh_coupon_list_f');
  164 + // //刷新页面数据
  165 + // // _controller.callRefresh();
  166 + // // _couponNetworkData(tabController.index);
  167 + // }
  168 + // }
  169 + },
  170 + ))
  171 + ],
  172 + ),
  173 + );
  174 + }
  175 +}
@@ -274,55 +274,60 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage> @@ -274,55 +274,60 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage>
274 }) 274 })
275 ])), 275 ])),
276 276
277 - Container(  
278 - height: ScreenUtil().setWidth(91 * 2),  
279 - width: double.infinity,  
280 - padding: EdgeInsets.only(  
281 - top: ScreenUtil().setWidth(12 * 2),  
282 - bottom: ScreenUtil().setWidth(25 * 2),  
283 - left: ScreenUtil().setWidth(45 * 2),  
284 - right: ScreenUtil().setWidth(45 * 2),  
285 - ),  
286 - decoration: BoxDecoration(  
287 - color: MyColours.color_ffffff,  
288 - boxShadow: [  
289 - BoxShadow(  
290 - spreadRadius: ScreenUtil().setWidth(2),  
291 - color: Color.fromRGBO(0, 0, 0, 0.1),  
292 - offset: Offset(0, ScreenUtil().setWidth(-2)),  
293 - blurRadius: ScreenUtil().setWidth(8))  
294 - ],  
295 - borderRadius: BorderRadius.all(  
296 - Radius.circular(ScreenUtil().setWidth(16)),  
297 - ),  
298 - ),  
299 - child: RoundButton(  
300 - text: '新建存酒',  
301 - height: ScreenUtil().setWidth(80),  
302 - radius: ScreenUtil().setWidth(10),  
303 - isBold: true,  
304 - fontSize: 32,  
305 - textColor: MyColours.color_F8F9FD,  
306 - onPressed: () async {  
307 - // UserModel userModel =  
308 - // Provider.of<UserModel>(context, listen: false);  
309 - // if (userModel.user.role_name == '管理员' ||  
310 - // userModel.user.role_name == '店长') {  
311 - NavigatorUtil.goCreateStoreWinePage(context);  
312 - // } else {  
313 - // bool needRefresh =  
314 - // await NavigatorUtil.goCouponEditPage(context);  
315 - // print(needRefresh);  
316 - // if (needRefresh != null && needRefresh) {  
317 - // bus.emit('refresh_coupon_list_f');  
318 - // //刷新页面数据  
319 - // // _controller.callRefresh();  
320 - // // _couponNetworkData(tabController.index);  
321 - // }  
322 - // }  
323 - },  
324 - ),  
325 - ) 277 + Container(
  278 + height: ScreenUtil().setWidth(91 * 2),
  279 + width: double.infinity,
  280 + padding: EdgeInsets.only(
  281 + top: ScreenUtil().setWidth(12 * 2),
  282 + bottom: ScreenUtil().setWidth(25 * 2),
  283 + left: ScreenUtil().setWidth(45 * 2),
  284 + right: ScreenUtil().setWidth(45 * 2),
  285 + ),
  286 + decoration: BoxDecoration(
  287 + color: MyColours.color_ffffff,
  288 + boxShadow: [
  289 + BoxShadow(
  290 + spreadRadius: ScreenUtil().setWidth(2),
  291 + color: Color.fromRGBO(0, 0, 0, 0.1),
  292 + offset: Offset(0, ScreenUtil().setWidth(-2)),
  293 + blurRadius: ScreenUtil().setWidth(8))
  294 + ],
  295 + borderRadius: BorderRadius.all(
  296 + Radius.circular(ScreenUtil().setWidth(16)),
  297 + ),
  298 + ),
  299 + child: RoundButton(
  300 + text: '新建存酒',
  301 + height: ScreenUtil().setWidth(80),
  302 + radius: ScreenUtil().setWidth(10),
  303 + isBold: true,
  304 + fontSize: 32,
  305 + textColor: MyColours.color_F8F9FD,
  306 + gradientStart:
  307 + true ? MyColours.color_BFC4D4 : MyColours.color_438E93,
  308 + gradientEnd:
  309 + true ? MyColours.color_BFC4D4 : MyColours.color_438E93,
  310 + onPressed: () async {
  311 + Utils.showToast('您不是店铺的存酒管理员,无权进行相关操作。');
  312 + // UserModel userModel =
  313 + // Provider.of<UserModel>(context, listen: false);
  314 + // if (userModel.user.role_name == '管理员' ||
  315 + // userModel.user.role_name == '店长') {
  316 + NavigatorUtil.goCreateStoreWinePage(context);
  317 + // } else {
  318 + // bool needRefresh =
  319 + // await NavigatorUtil.goCouponEditPage(context);
  320 + // print(needRefresh);
  321 + // if (needRefresh != null && needRefresh) {
  322 + // bus.emit('refresh_coupon_list_f');
  323 + // //刷新页面数据
  324 + // // _controller.callRefresh();
  325 + // // _couponNetworkData(tabController.index);
  326 + // }
  327 + // }
  328 + },
  329 + ),
  330 + )
326 331
327 // _searchWidget(), 332 // _searchWidget(),
328 // Positioned( 333 // Positioned(
  1 +import 'package:cached_network_image/cached_network_image.dart';
  2 +import 'package:flutter/material.dart';
  3 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  4 +import 'package:provider/provider.dart';
  5 +
  6 +import '../../../models/wine_manage_model.dart';
  7 +import '../../../provider/upload_img_provider.dart';
  8 +import '../../../res/colors.dart';
  9 +import '../../../utils/screen_util.dart';
  10 +import '../../../utils/upload_image_util.dart';
  11 +import '../../../utils/utils.dart';
  12 +import '../../../widgets/MyDivider.dart';
  13 +import '../../../widgets/v_empty_view.dart';
  14 +import '../../online_check/img_picker_widget.dart';
  15 +import '../../online_check/photo_view_wiget.dart';
  16 +
  17 +//只查看
  18 +
  19 +class WineDetailItemPage extends StatefulWidget {
  20 + final WineManageModel wineManageModel;
  21 + final ScrollController controller;
  22 + final int index;
  23 +
  24 + WineDetailItemPage(
  25 + {Key key, this.wineManageModel, this.controller, this.index})
  26 + : super(key: key);
  27 +
  28 + @override
  29 + _WineDetailItemPageState createState() => _WineDetailItemPageState();
  30 +}
  31 +
  32 +class _WineDetailItemPageState extends State<WineDetailItemPage> {
  33 + Widget _textWidget(String title, String subTitle) {
  34 + return Column(children: [
  35 + Container(
  36 + height: ScreenUtil().setWidth(48 * 2),
  37 + padding: EdgeInsets.only(right: ScreenUtil().setWidth(16 * 2)),
  38 + child: Row(
  39 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  40 + crossAxisAlignment: CrossAxisAlignment.center,
  41 + children: [
  42 + Text(
  43 + title,
  44 + style: TextStyle(
  45 + color: MyColours.color_515151, fontSize: font(16)),
  46 + ),
  47 + Expanded(
  48 + child: Container(
  49 + height: ScreenUtil().setWidth(16 * 2),
  50 + alignment: Alignment.centerRight,
  51 + child: Text(
  52 + subTitle,
  53 + //输入文本的样式
  54 + style: TextStyle(
  55 + fontSize: ScreenUtil().setSp(32),
  56 + color: MyColours.color_999999),
  57 + )),
  58 + )
  59 + ],
  60 + )),
  61 + MyDivider(
  62 + double.infinity,
  63 + h(0.5),
  64 + color: MyColours.color_E7E7E7,
  65 + ),
  66 + ]);
  67 + }
  68 +
  69 + //查看大图
  70 + _showPhotoView(BuildContext context, int index, List<String> imgs,
  71 + {isShow = false, List dashName}) async {
  72 + // if (imgs.length == 1 &&
  73 + // imgs[0] ==
  74 + // 'http://nosqn.colorcun.com/custom/lite-online/image/def-banner.png') {
  75 + // imgs[0] = 'http://nosqn.colorcun.com/app/seller-hj-empty.png';
  76 + // }
  77 + Utils.setBarStatus(false, color: Colors.black);
  78 + dynamic result = await showGeneralDialog(
  79 + context: context,
  80 + barrierDismissible: false,
  81 + // barrierColor: Colors.red,
  82 + barrierLabel:
  83 + MaterialLocalizations.of(context).modalBarrierDismissLabel,
  84 + transitionDuration: const Duration(milliseconds: 150),
  85 + pageBuilder: (BuildContext context, Animation animation,
  86 + Animation secondaryAnimation) {
  87 + Widget child = Stack(
  88 + children: <Widget>[
  89 + PhotoPreview(
  90 + initialIndex: index,
  91 + photoList: imgs,
  92 + isShow: isShow,
  93 + dashName: dashName)
  94 + ],
  95 + );
  96 + return child;
  97 + });
  98 + Utils.setBarStatus(true, color: Colors.white);
  99 + }
  100 +
  101 + /// 九宫格
  102 + Widget _getGridImg(context, List<String> temp) {
  103 + return GridView.builder(
  104 + controller: widget.controller,
  105 + // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
  106 + shrinkWrap: true,
  107 + itemCount: temp.length,
  108 +
  109 + //SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
  110 + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  111 + //横轴元素个数
  112 + crossAxisCount: 3,
  113 + //纵轴间距
  114 + mainAxisSpacing: ScreenUtil().setWidth(40),
  115 + //横轴间距
  116 + crossAxisSpacing: ScreenUtil().setWidth(36),
  117 + //子组件宽高长度比例
  118 + childAspectRatio: 1.0),
  119 + itemBuilder: (BuildContext context, int index) {
  120 + //Widget Function(BuildContext context, int index)
  121 +
  122 + return temp.length < 1
  123 + ? Text('')
  124 + : InkWell(
  125 + onTap: () {
  126 + ///没有上传完成的不可以点击
  127 + _showPhotoView(context, index, temp);
  128 + },
  129 + child: CachedNetworkImage(
  130 + imageUrl: temp[index],
  131 + fit: BoxFit.cover,
  132 + width: ScreenUtil().setWidth(100 * 2),
  133 + height: ScreenUtil().setWidth(100 * 2),
  134 + ));
  135 + });
  136 + }
  137 +
  138 + @override
  139 + Widget build(BuildContext context) {
  140 + return Container(
  141 + color: Colors.white,
  142 + padding: EdgeInsets.only(left: w(16)),
  143 + margin:
  144 + EdgeInsets.only(top: w(16), bottom: w(10), left: w(20), right: w(20)),
  145 + child: Column(
  146 + children: [
  147 + _textWidget(
  148 + '酒品名称',
  149 + "酒名",
  150 + ),
  151 + VEmptyView(16),
  152 + _textWidget('存酒数量', '数量'),
  153 + VEmptyView(16),
  154 + _textWidget('计量单位', '计量单位'),
  155 + VEmptyView(16),
  156 + _textWidget('存酒编号', '存酒编号'),
  157 + VEmptyView(16),
  158 + _getGridImg(context, widget.wineManageModel.imageData),
  159 + VEmptyView(16),
  160 + ],
  161 + ),
  162 + );
  163 + }
  164 +}
  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  3 +import 'package:one_key/pages/my/store_wine_manage/wine_detail_item_page.dart';
  4 +import 'package:one_key/utils/utils.dart';
  5 +import 'package:one_key/widgets/system_app_bar.dart';
  6 +import 'package:provider/provider.dart';
  7 +
  8 +import '../../../models/wine_manage_model.dart';
  9 +import '../../../provider/store_wine_provider.dart';
  10 +import '../../../res/colors.dart';
  11 +import '../../../route/navigator_util.dart';
  12 +import '../../../utils/screen_util.dart';
  13 +import '../../../widgets/MyDivider.dart';
  14 +import '../../../widgets/h_empty_view.dart';
  15 +import '../../../widgets/round_button.dart';
  16 +import '../../../widgets/v_empty_view.dart';
  17 +
  18 +/**
  19 + *
  20 + * 存酒详情页,只查看
  21 + */
  22 +class WineDetailPage extends StatefulWidget {
  23 + WineDetailPage({Key key}) : super(key: key);
  24 +
  25 + @override
  26 + _WineDetailPageState createState() => _WineDetailPageState();
  27 +}
  28 +
  29 +class _WineDetailPageState extends State<WineDetailPage> {
  30 + StoreWineProvider storeWineProvider;
  31 +
  32 + ScrollController _controller = ScrollController();
  33 +
  34 + List dataWine = [];
  35 +
  36 + @override
  37 + void initState() {
  38 + // TODO: implement initState
  39 + super.initState();
  40 + WineManageModel wineManageModel = WineManageModel();
  41 + dataWine.add(wineManageModel);
  42 + dataWine.add(wineManageModel);
  43 + }
  44 +
  45 + Widget _textItemWidget(
  46 + String title,
  47 + String subTitle,
  48 + ) {
  49 + return Column(children: [
  50 + Container(
  51 + height: ScreenUtil().setWidth(48 * 2),
  52 + padding: EdgeInsets.only(right: ScreenUtil().setWidth(16 * 2)),
  53 + child: Row(
  54 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  55 + crossAxisAlignment: CrossAxisAlignment.center,
  56 + children: [
  57 + Text(
  58 + title,
  59 + style: TextStyle(
  60 + color: MyColours.color_515151, fontSize: font(16)),
  61 + ),
  62 + Text(subTitle,
  63 + //输入文本的样式
  64 + style: TextStyle(
  65 + fontSize: ScreenUtil().setSp(32),
  66 + color: MyColours.color_999999)),
  67 + // ),
  68 + ],
  69 + )),
  70 + MyDivider(
  71 + double.infinity,
  72 + h(0.5),
  73 + color: MyColours.color_E7E7E7,
  74 + ),
  75 + ]);
  76 + }
  77 +
  78 + @override
  79 + Widget build(BuildContext context) {
  80 + storeWineProvider = Provider.of<StoreWineProvider>(context, listen: true);
  81 + return Scaffold(
  82 + appBar: SystemAppBar(
  83 + '存酒详情',
  84 + onTap: () {
  85 + Navigator.pop(context);
  86 + },
  87 + ),
  88 + body: Container(
  89 + child: Column(
  90 + children: [
  91 + Expanded(
  92 + child: SingleChildScrollView(
  93 + controller: _controller,
  94 + child: Column(
  95 + children: [
  96 + Container(
  97 + color: Colors.white,
  98 + padding: EdgeInsets.only(
  99 + left: ScreenUtil().setWidth(16 * 2)),
  100 + child: Column(
  101 + crossAxisAlignment: CrossAxisAlignment.center,
  102 + mainAxisAlignment: MainAxisAlignment.start,
  103 + children: [
  104 + VEmptyView(32),
  105 + _textItemWidget(
  106 + '联系电话', Utils.starPhone('18799999999')),
  107 + Container(
  108 + height: ScreenUtil().setWidth(48 * 2),
  109 + padding: EdgeInsets.only(
  110 + top: ScreenUtil().setWidth(16 * 2),
  111 + right: ScreenUtil().setWidth(16 * 2)),
  112 + child: Row(
  113 + mainAxisAlignment:
  114 + MainAxisAlignment.spaceBetween,
  115 + crossAxisAlignment: CrossAxisAlignment.center,
  116 + children: [
  117 + Text(
  118 + '客人姓名',
  119 + style: TextStyle(
  120 + color: MyColours.color_515151,
  121 + fontSize: font(16)),
  122 + ),
  123 + Expanded(
  124 + child: Container(
  125 + height: ScreenUtil().setWidth(16 * 2),
  126 + alignment: Alignment.centerRight,
  127 + child: Text('fff先生',
  128 + style: TextStyle(
  129 + fontSize: ScreenUtil().setSp(32),
  130 + color: MyColours.color_999999)),
  131 + )),
  132 + HEmptyView(40),
  133 + Container(
  134 + width: w(100),
  135 + alignment: Alignment.centerRight,
  136 + child: Text(
  137 + // '会员状态未知',
  138 + '会员',
  139 + style: TextStyle(
  140 + color: true
  141 + ? MyColours.color_999999
  142 + : MyColours.color_515151,
  143 + fontSize: ScreenUtil().setSp(32),
  144 + ),
  145 + ),
  146 + ),
  147 + ],
  148 + )),
  149 + ],
  150 + )),
  151 + ListView.builder(
  152 + shrinkWrap: true,
  153 + controller: _controller,
  154 + itemCount: dataWine.length,
  155 + itemBuilder: (context, index) {
  156 + WineManageModel wineManageModel = dataWine[index];
  157 + return WineDetailItemPage(
  158 + wineManageModel: wineManageModel,
  159 + controller: _controller,
  160 + index: index,
  161 + );
  162 + }),
  163 + ],
  164 + ),
  165 + )),
  166 + Container(
  167 + alignment: Alignment.centerLeft,
  168 + margin: EdgeInsets.only(
  169 + left: w(20), right: w(20), top: w(10), bottom: w(16)),
  170 + child: Text(
  171 + '注:为保障酒品安排,只有存酒管理员才可以进行存酒操作!',
  172 + style: TextStyle(
  173 + color: MyColours.color_999999, fontSize: font(10)),
  174 + )),
  175 + Container(
  176 + color: MyColours.color_ffffff,
  177 + padding: EdgeInsets.only(
  178 + top: ScreenUtil().setWidth(16 * 2),
  179 + bottom: ScreenUtil().setWidth(35 * 2),
  180 + left: ScreenUtil().setWidth(45 * 2),
  181 + right: ScreenUtil().setWidth(45 * 2),
  182 + ),
  183 + child: Row(
  184 + children: [
  185 + RoundButton(
  186 + text: '出库记录',
  187 + width: w(100),
  188 + height: ScreenUtil().setWidth(80),
  189 + radius: ScreenUtil().setWidth(10),
  190 + isBold: true,
  191 + borderColor: MyColours.color_438E93,
  192 + gradientStart: MyColours.color_ffffff,
  193 + gradientEnd: MyColours.color_ffffff,
  194 + textColor: MyColours.color_438E93,
  195 + fontSize: 32,
  196 + onPressed: () async {
  197 + // UserModel userModel =
  198 + // Provider.of<UserModel>(context, listen: false);
  199 + // if (userModel.user.role_name == '管理员' ||
  200 + // userModel.user.role_name == '店长') {
  201 + NavigatorUtil.goOutStoreRecordPage(context);
  202 + // } else {
  203 + // bool needRefresh =
  204 + // await NavigatorUtil.goCouponEditPage(context);
  205 + // print(needRefresh);
  206 + // if (needRefresh != null && needRefresh) {
  207 + // bus.emit('refresh_coupon_list_f');
  208 + // //刷新页面数据
  209 + // // _controller.callRefresh();
  210 + // // _couponNetworkData(tabController.index);
  211 + // }
  212 + // }
  213 + },
  214 + ),
  215 + HEmptyView(30),
  216 + Expanded(
  217 + child: RoundButton(
  218 + text: '存酒出库',
  219 + // width: w(218),
  220 + height: ScreenUtil().setWidth(80),
  221 + radius: ScreenUtil().setWidth(10),
  222 + isBold: true,
  223 + gradientStart: true
  224 + ? MyColours.color_BFC4D4
  225 + : MyColours.color_438E93,
  226 + gradientEnd: true
  227 + ? MyColours.color_BFC4D4
  228 + : MyColours.color_438E93,
  229 + fontSize: 32,
  230 + onPressed: () async {
  231 + Utils.showToast('您不是店铺的存酒管理员,无权进行相关操作。');
  232 + // UserModel userModel =
  233 + // Provider.of<UserModel>(context, listen: false);
  234 + // if (userModel.user.role_name == '管理员' ||
  235 + // userModel.user.role_name == '店长') {
  236 + NavigatorUtil.goApplyOutStorePage(context);
  237 + // } else {
  238 + // bool needRefresh =
  239 + // await NavigatorUtil.goCouponEditPage(context);
  240 + // print(needRefresh);
  241 + // if (needRefresh != null && needRefresh) {
  242 + // bus.emit('refresh_coupon_list_f');
  243 + // //刷新页面数据
  244 + // // _controller.callRefresh();
  245 + // // _couponNetworkData(tabController.index);
  246 + // }
  247 + // }
  248 + },
  249 + )),
  250 + ],
  251 + ))
  252 + ],
  253 + ),
  254 + ));
  255 + }
  256 +}
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 import 'package:flutter_screenutil/flutter_screenutil.dart'; 2 import 'package:flutter_screenutil/flutter_screenutil.dart';
  3 +import 'package:one_key/route/navigator_util.dart';
3 import 'package:one_key/widgets/h_empty_view.dart'; 4 import 'package:one_key/widgets/h_empty_view.dart';
4 5
5 import '../../../res/colors.dart'; 6 import '../../../res/colors.dart';
@@ -23,7 +24,9 @@ class _WineInStoreItemState extends State<WineInStoreItem> { @@ -23,7 +24,9 @@ class _WineInStoreItemState extends State<WineInStoreItem> {
23 @override 24 @override
24 Widget build(BuildContext context) { 25 Widget build(BuildContext context) {
25 return InkWell( 26 return InkWell(
26 - onTap: () {}, 27 + onTap: () {
  28 + NavigatorUtil.goWineDetailPage(context);
  29 + },
27 child: Container( 30 child: Container(
28 // width: ScreenUtil().setWidth(610), 31 // width: ScreenUtil().setWidth(610),
29 margin: EdgeInsets.fromLTRB( 32 margin: EdgeInsets.fromLTRB(
@@ -3,6 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -3,6 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
3 import 'package:one_key/widgets/h_empty_view.dart'; 3 import 'package:one_key/widgets/h_empty_view.dart';
4 4
5 import '../../../res/colors.dart'; 5 import '../../../res/colors.dart';
  6 +import '../../../route/navigator_util.dart';
6 import '../../../utils/screen_util.dart'; 7 import '../../../utils/screen_util.dart';
7 import '../../../widgets/v_empty_view.dart'; 8 import '../../../widgets/v_empty_view.dart';
8 9
@@ -23,7 +24,9 @@ class _WineOutStoreItemState extends State<WineOutStoreItem> { @@ -23,7 +24,9 @@ class _WineOutStoreItemState extends State<WineOutStoreItem> {
23 @override 24 @override
24 Widget build(BuildContext context) { 25 Widget build(BuildContext context) {
25 return InkWell( 26 return InkWell(
26 - onTap: () {}, 27 + onTap: () {
  28 + NavigatorUtil.goOutStoreRecordPage(context);
  29 + },
27 child: Container( 30 child: Container(
28 // width: ScreenUtil().setWidth(610), 31 // width: ScreenUtil().setWidth(610),
29 margin: EdgeInsets.fromLTRB( 32 margin: EdgeInsets.fromLTRB(
@@ -43,6 +43,7 @@ class ImgPickerWidget extends StatefulWidget { @@ -43,6 +43,7 @@ class ImgPickerWidget extends StatefulWidget {
43 final UploadImageProvider model; 43 final UploadImageProvider model;
44 final UploadType uploadType; 44 final UploadType uploadType;
45 final DeleteCallback deleteCallback; 45 final DeleteCallback deleteCallback;
  46 + final String maxRemind;
46 ImgPickerWidget( 47 ImgPickerWidget(
47 {Key key, 48 {Key key,
48 this.scrollController, 49 this.scrollController,
@@ -51,7 +52,8 @@ class ImgPickerWidget extends StatefulWidget { @@ -51,7 +52,8 @@ class ImgPickerWidget extends StatefulWidget {
51 this.maxImageNumber = 5, 52 this.maxImageNumber = 5,
52 this.model, 53 this.model,
53 this.uploadType, 54 this.uploadType,
54 - this.deleteCallback}) 55 + this.deleteCallback,
  56 + this.maxRemind})
55 : super(key: key); 57 : super(key: key);
56 58
57 @override 59 @override
@@ -108,6 +110,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { @@ -108,6 +110,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
108 widget.model.imageListDenvironment.add(imgModel); 110 widget.model.imageListDenvironment.add(imgModel);
109 } else if (widget.uploadType == UploadType.TableManagerType) { 111 } else if (widget.uploadType == UploadType.TableManagerType) {
110 widget.model.tableImageList.add(imgModel); 112 widget.model.tableImageList.add(imgModel);
  113 + } else if (widget.uploadType == UploadType.WineManageType) {
  114 + widget.model.wineImageList.add(imgModel);
111 } 115 }
112 } else { 116 } else {
113 print('No image selected.'); 117 print('No image selected.');
@@ -124,6 +128,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { @@ -124,6 +128,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
124 temp = widget.model.imageListDenvironment; 128 temp = widget.model.imageListDenvironment;
125 } else if (widget.uploadType == UploadType.TableManagerType) { 129 } else if (widget.uploadType == UploadType.TableManagerType) {
126 temp = widget.model.tableImageList; 130 temp = widget.model.tableImageList;
  131 + } else if (widget.uploadType == UploadType.WineManageType) {
  132 + temp = widget.model.wineImageList;
127 } 133 }
128 UploadImageUtil().startUpload(context, File(pickedFile.path), 134 UploadImageUtil().startUpload(context, File(pickedFile.path),
129 temp.length - 1, true, widget.model, widget.uploadType, 135 temp.length - 1, true, widget.model, widget.uploadType,
@@ -142,15 +148,15 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { @@ -142,15 +148,15 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
142 temp = widget.model.imageListDenvironment; 148 temp = widget.model.imageListDenvironment;
143 } else if (widget.uploadType == UploadType.TableManagerType) { 149 } else if (widget.uploadType == UploadType.TableManagerType) {
144 temp = widget.model.tableImageList; 150 temp = widget.model.tableImageList;
  151 + } else if (widget.uploadType == UploadType.WineManageType) {
  152 + temp = widget.model.wineImageList;
145 } 153 }
146 - List<AssetEntity> imgList = await AssetPicker.pickAssets(context,  
147 - pickerConfig:AssetPickerConfig( 154 + List<AssetEntity> imgList = await AssetPicker.pickAssets(context,
  155 + pickerConfig: AssetPickerConfig(
148 maxAssets: widget.maxImageNumber - temp.length, 156 maxAssets: widget.maxImageNumber - temp.length,
149 - // selectedAssets: assets,  
150 - requestType: type,  
151 - themeColor: MyColours.color_199095  
152 - )  
153 - ); 157 + // selectedAssets: assets,
  158 + requestType: type,
  159 + themeColor: MyColours.color_199095));
154 160
155 /// context is required, other params is optional. 161 /// context is required, other params is optional.
156 // List<AssetEntity> imgList = await PhotoPicker.pickAsset( 162 // List<AssetEntity> imgList = await PhotoPicker.pickAsset(
@@ -446,6 +452,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { @@ -446,6 +452,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
446 temp = widget.model.imageListDenvironment; 452 temp = widget.model.imageListDenvironment;
447 } else if (widget.uploadType == UploadType.TableManagerType) { 453 } else if (widget.uploadType == UploadType.TableManagerType) {
448 temp = widget.model.tableImageList; 454 temp = widget.model.tableImageList;
  455 + } else if (widget.uploadType == UploadType.WineManageType) {
  456 + temp = widget.model.wineImageList;
449 } 457 }
450 return _getGridImg( 458 return _getGridImg(
451 temp.length < widget.maxImageNumber ? temp.length + 1 : temp.length, 459 temp.length < widget.maxImageNumber ? temp.length + 1 : temp.length,
@@ -507,7 +515,16 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { @@ -507,7 +515,16 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
507 style: TextStyle( 515 style: TextStyle(
508 fontSize: ScreenUtil().setSp(24), 516 fontSize: ScreenUtil().setSp(24),
509 color: MyColours.color_999999), 517 color: MyColours.color_999999),
510 - ) 518 + ),
  519 + widget.maxRemind != null ? VEmptyView(10) : SizedBox(),
  520 + widget.maxRemind != null
  521 + ? Text(
  522 + '最多${widget.maxRemind}张照片',
  523 + style: TextStyle(
  524 + fontSize: ScreenUtil().setSp(18),
  525 + color: MyColours.color_999999),
  526 + )
  527 + : SizedBox()
511 ], 528 ],
512 )), 529 )),
513 ); 530 );
@@ -30,7 +30,7 @@ class UploadImageProvider extends ChangeNotifier { @@ -30,7 +30,7 @@ class UploadImageProvider extends ChangeNotifier {
30 List<UploadImgModel> feastRemarkDjImageList = []; //宴会备注图片信息列表----定金 30 List<UploadImgModel> feastRemarkDjImageList = []; //宴会备注图片信息列表----定金
31 List<UploadImgModel> feastRemarkContractImageList = []; //宴会备注图片信息列表----合同 31 List<UploadImgModel> feastRemarkContractImageList = []; //宴会备注图片信息列表----合同
32 List<UploadImgModel> feastRemarkInvoiceImageList = []; //宴会备注图片信息列表----发票 32 List<UploadImgModel> feastRemarkInvoiceImageList = []; //宴会备注图片信息列表----发票
33 - 33 + List<UploadImgModel> wineImageList = []; //新建存酒
34 int countUpload = 0; 34 int countUpload = 0;
35 UploadImageProvider() { 35 UploadImageProvider() {
36 touxiang.process = 0.01; 36 touxiang.process = 0.01;
@@ -1403,4 +1403,39 @@ class NavigatorUtil { @@ -1403,4 +1403,39 @@ class NavigatorUtil {
1403 return _navigateTo(context, "${Routes.create_store_wine_page}", 1403 return _navigateTo(context, "${Routes.create_store_wine_page}",
1404 replace: replace); 1404 replace: replace);
1405 } 1405 }
  1406 +
  1407 + ///我的------存酒详情
  1408 + static Future<dynamic> goWineDetailPage(
  1409 + BuildContext context, {
  1410 + replace = false,
  1411 + }) {
  1412 + return _navigateTo(context, "${Routes.wine_detail_page}", replace: replace);
  1413 + }
  1414 +
  1415 + ///我的------存酒记录
  1416 + static Future<dynamic> goOutStoreRecordPage(
  1417 + BuildContext context, {
  1418 + replace = false,
  1419 + }) {
  1420 + return _navigateTo(context, "${Routes.out_store_record_page}",
  1421 + replace: replace);
  1422 + }
  1423 +
  1424 + ///我的------申请出库
  1425 + static Future<dynamic> goApplyOutStorePage(
  1426 + BuildContext context, {
  1427 + replace = false,
  1428 + }) {
  1429 + return _navigateTo(context, "${Routes.apply_out_store_page}",
  1430 + replace: replace);
  1431 + }
  1432 +
  1433 + ///我的------申请出库短信验证
  1434 + static Future<dynamic> goSmsCodeInputPage(
  1435 + BuildContext context, {
  1436 + replace = false,
  1437 + }) {
  1438 + return _navigateTo(context, "${Routes.sms_code_input_page}",
  1439 + replace: replace);
  1440 + }
1406 } 1441 }
@@ -184,7 +184,11 @@ import '../pages/my/plan_dish/plan_dish_create_select_type_page.dart'; @@ -184,7 +184,11 @@ import '../pages/my/plan_dish/plan_dish_create_select_type_page.dart';
184 import '../pages/my/plan_dish/plan_dish_eidt_page.dart'; 184 import '../pages/my/plan_dish/plan_dish_eidt_page.dart';
185 import '../pages/my/plan_dish/plan_new_dish_first_page.dart'; 185 import '../pages/my/plan_dish/plan_new_dish_first_page.dart';
186 import '../pages/my/plan_dish/plan_new_dish_page.dart'; 186 import '../pages/my/plan_dish/plan_new_dish_page.dart';
  187 +import '../pages/my/store_wine_manage/apply_out_store_page.dart';
  188 +import '../pages/my/store_wine_manage/out_store_record_page.dart';
  189 +import '../pages/my/store_wine_manage/sms_code_input_page.dart';
187 import '../pages/my/store_wine_manage/store_wine_manage_home_page.dart'; 190 import '../pages/my/store_wine_manage/store_wine_manage_home_page.dart';
  191 +import '../pages/my/store_wine_manage/wine_detail_page.dart';
188 import '../pages/my/table_manage/merge_table_select_page.dart'; 192 import '../pages/my/table_manage/merge_table_select_page.dart';
189 import '../pages/order_advance/customer_detail_page.dart'; 193 import '../pages/order_advance/customer_detail_page.dart';
190 import '../pages/order_advance/order_advance_home_page.dart'; 194 import '../pages/order_advance/order_advance_home_page.dart';
@@ -2292,12 +2296,50 @@ var storeWineManageHomePageHandle = new Handler( @@ -2292,12 +2296,50 @@ var storeWineManageHomePageHandle = new Handler(
2292 return ChangeNotifierProvider<StoreWineProvider>( 2296 return ChangeNotifierProvider<StoreWineProvider>(
2293 create: (_) => StoreWineProvider(), child: StoreWineManageHomePage()); 2297 create: (_) => StoreWineProvider(), child: StoreWineManageHomePage());
2294 }); 2298 });
  2299 +
2295 ///我的----新建存酒 2300 ///我的----新建存酒
2296 var createStoreWinePageHandle = new Handler( 2301 var createStoreWinePageHandle = new Handler(
2297 handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { 2302 handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
2298 // String idstr = params["idstr"].first; 2303 // String idstr = params["idstr"].first;
2299 2304
2300 return ChangeNotifierProvider<StoreWineProvider>( 2305 return ChangeNotifierProvider<StoreWineProvider>(
2301 - create: (_) => StoreWineProvider(), child: CreateStoreWinePage()); 2306 + create: (_) => StoreWineProvider(),
  2307 + child: ChangeNotifierProvider<UploadImageProvider>(
  2308 + create: (_) => UploadImageProvider(), child: CreateStoreWinePage()));
2302 }); 2309 });
2303 2310
  2311 +///我的----存酒详情
  2312 +var wineDetailPageHandle = new Handler(
  2313 + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
  2314 + // String idstr = params["idstr"].first;
  2315 +
  2316 + return ChangeNotifierProvider<StoreWineProvider>(
  2317 + create: (_) => StoreWineProvider(), child: WineDetailPage());
  2318 +});
  2319 +
  2320 +///我的----存酒记录
  2321 +var outStoreRecordPageHandle = new Handler(
  2322 + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
  2323 + // String idstr = params["idstr"].first;
  2324 +
  2325 + return ChangeNotifierProvider<StoreWineProvider>(
  2326 + create: (_) => StoreWineProvider(), child: OutStoreRecordPage());
  2327 +});
  2328 +
  2329 +///我的----申请出库
  2330 +var applyOutStorePageHandle = new Handler(
  2331 + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
  2332 + // String idstr = params["idstr"].first;
  2333 +
  2334 + return ChangeNotifierProvider<StoreWineProvider>(
  2335 + create: (_) => StoreWineProvider(), child: ApplyOutStorePage());
  2336 +});
  2337 +
  2338 +///我的----申请出库短信验证输入
  2339 +var smsCodeInputPageHandle = new Handler(
  2340 + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
  2341 + // String idstr = params["idstr"].first;
  2342 +
  2343 + return ChangeNotifierProvider<StoreWineProvider>(
  2344 + create: (_) => StoreWineProvider(), child: SmsCodeInputPage());
  2345 +});
@@ -192,6 +192,11 @@ class Routes { @@ -192,6 +192,11 @@ class Routes {
192 static String store_wine_manag_home_page = 192 static String store_wine_manag_home_page =
193 "/store_wine_manag_home_page"; //我的---存酒管理首页 193 "/store_wine_manag_home_page"; //我的---存酒管理首页
194 static String create_store_wine_page = "/create_store_wine_page"; //新建存酒 194 static String create_store_wine_page = "/create_store_wine_page"; //新建存酒
  195 + static String wine_detail_page = "/wine_detail_page"; //存酒详情
  196 +
  197 + static String out_store_record_page = "/out_store_record_page"; //出库记录
  198 + static String apply_out_store_page = "/apply_out_store_page"; //出库申请
  199 + static String sms_code_input_page = "/sms_code_input_page"; //出库申请短信验证
195 200
196 static void configureRoutes(FluroRouter router) { 201 static void configureRoutes(FluroRouter router) {
197 router.notFoundHandler = new Handler( 202 router.notFoundHandler = new Handler(
@@ -378,5 +383,9 @@ class Routes { @@ -378,5 +383,9 @@ class Routes {
378 handler: storeWineManageHomePageHandle); 383 handler: storeWineManageHomePageHandle);
379 384
380 router.define(create_store_wine_page, handler: createStoreWinePageHandle); 385 router.define(create_store_wine_page, handler: createStoreWinePageHandle);
  386 + router.define(wine_detail_page, handler: wineDetailPageHandle);
  387 + router.define(out_store_record_page, handler: outStoreRecordPageHandle);
  388 + router.define(apply_out_store_page, handler: applyOutStorePageHandle);
  389 + router.define(sms_code_input_page, handler: smsCodeInputPageHandle);
381 } 390 }
382 } 391 }
@@ -5598,6 +5598,62 @@ class DialogUtil { @@ -5598,6 +5598,62 @@ class DialogUtil {
5598 ); 5598 );
5599 } 5599 }
5600 5600
  5601 + static Future cupertinoAlertDialogOnly(BuildContext context,
  5602 + {String title = "",
  5603 + String content = "内容",
  5604 + String lTitle = "取消",
  5605 + String rTitle = "确定",
  5606 + Color rColor = MyColours.color_438E93,
  5607 + bool isBold = false,
  5608 + bool isBoldContent = false,
  5609 + Color contentColor = MyColours.color_99000000,
  5610 + VoidCallback lCallback,
  5611 + VoidCallback rCallback}) {
  5612 + showCupertinoDialog(
  5613 + context: context,
  5614 + builder: (context) {
  5615 + return CupertinoAlertDialog(
  5616 + title: title != ''
  5617 + ? Text(title,
  5618 + style: TextStyle(
  5619 + fontWeight: FontWeight.bold,
  5620 + fontSize: ScreenUtil().setSp(32),
  5621 + color: MyColours.color_E6000000))
  5622 + : SizedBox(),
  5623 + content: Text(content,
  5624 + style: TextStyle(
  5625 + fontWeight:
  5626 + isBoldContent ? FontWeight.bold : FontWeight.normal,
  5627 + fontSize: ScreenUtil().setSp(32),
  5628 + color: contentColor)),
  5629 + actions: [
  5630 + // CupertinoDialogAction(
  5631 + // child: Text(lTitle,
  5632 + // style: TextStyle(
  5633 + // fontSize: ScreenUtil().setSp(32),
  5634 + // color: MyColours.color_E6000000)),
  5635 + // onPressed: () {
  5636 + // Navigator.of(context).pop();
  5637 + // lCallback();
  5638 + // },
  5639 + // ),
  5640 + CupertinoDialogAction(
  5641 + child: Text(rTitle,
  5642 + style: TextStyle(
  5643 + fontWeight: isBold ? FontWeight.bold : FontWeight.normal,
  5644 + fontSize: ScreenUtil().setSp(32),
  5645 + color: rColor)),
  5646 + onPressed: () {
  5647 + Navigator.of(context).pop();
  5648 + rCallback();
  5649 + },
  5650 + ),
  5651 + ],
  5652 + );
  5653 + },
  5654 + );
  5655 + }
  5656 +
5601 static Future cupertinoAlertDialog(BuildContext context, 5657 static Future cupertinoAlertDialog(BuildContext context,
5602 {String title = "", 5658 {String title = "",
5603 String content = "内容", 5659 String content = "内容",
@@ -22,7 +22,8 @@ enum UploadType { @@ -22,7 +22,8 @@ enum UploadType {
22 FeastRemarkXtType, //宴会备注--选台 22 FeastRemarkXtType, //宴会备注--选台
23 FeastRemarkDjType, //宴会备注--定金 23 FeastRemarkDjType, //宴会备注--定金
24 FeastRemarkContractType, //宴会备注--合同 24 FeastRemarkContractType, //宴会备注--合同
25 - FeastRemarkInvoiceType //宴会备注--发票 25 + FeastRemarkInvoiceType, //宴会备注--发票
  26 + WineManageType //新建存酒
26 27
27 } 28 }
28 29
@@ -91,6 +92,9 @@ class UploadImageUtil { @@ -91,6 +92,9 @@ class UploadImageUtil {
91 //宴会备注 ---发票 92 //宴会备注 ---发票
92 uploadImageProvider.feastRemarkInvoiceImageList[index].process = 93 uploadImageProvider.feastRemarkInvoiceImageList[index].process =
93 percent; 94 percent;
  95 + } else if (uploadType == UploadType.WineManageType) {
  96 + //新建存酒
  97 + uploadImageProvider.wineImageList[index].process = percent;
94 } 98 }
95 99
96 uploadImageProvider.notifyListeners(); 100 uploadImageProvider.notifyListeners();
@@ -169,6 +173,10 @@ class UploadImageUtil { @@ -169,6 +173,10 @@ class UploadImageUtil {
169 uploadImageProvider.feastRemarkInvoiceImageList[index].process = 1; 173 uploadImageProvider.feastRemarkInvoiceImageList[index].process = 1;
170 uploadImageProvider.feastRemarkInvoiceImageList[index].qiniuUrl = 174 uploadImageProvider.feastRemarkInvoiceImageList[index].qiniuUrl =
171 imgUrl; 175 imgUrl;
  176 + } else if (uploadType == UploadType.WineManageType) {
  177 + //新建存酒
  178 + uploadImageProvider.wineImageList[index].process = 1;
  179 + uploadImageProvider.wineImageList[index].qiniuUrl = imgUrl;
172 } 180 }
173 181
174 // 取消当前任务 182 // 取消当前任务
@@ -959,6 +959,13 @@ packages: @@ -959,6 +959,13 @@ packages:
959 url: "https://pub.flutter-io.cn" 959 url: "https://pub.flutter-io.cn"
960 source: hosted 960 source: hosted
961 version: "0.14.0" 961 version: "0.14.0"
  962 + pin_code_fields:
  963 + dependency: "direct main"
  964 + description:
  965 + name: pin_code_fields
  966 + url: "https://pub.flutter-io.cn"
  967 + source: hosted
  968 + version: "7.4.0"
962 platform: 969 platform:
963 dependency: transitive 970 dependency: transitive
964 description: 971 description:
@@ -182,6 +182,7 @@ dependencies: @@ -182,6 +182,7 @@ dependencies:
182 flutter_image_compress: ^1.1.3 182 flutter_image_compress: ^1.1.3
183 image: ^4.0.15 183 image: ^4.0.15
184 image_cropper: ^3.0.1 184 image_cropper: ^3.0.1
  185 + pin_code_fields: ^7.4.0
185 186
186 187
187 #表格多选组建 188 #表格多选组建