Commit 04093900f37f6430dae19c23340ae54d700bb018

Authored by wdn127929
1 parent 359b58ab

变更预订记录OK

@@ -112,6 +112,8 @@ class NotebookDetail { @@ -112,6 +112,8 @@ class NotebookDetail {
112 String up_date; //订单修改时间 112 String up_date; //订单修改时间
113 String deposit_cancel; //订金走向 113 String deposit_cancel; //订金走向
114 114
  115 + String log_photo; //下单照片
  116 +
115 String get statuImgAssets { 117 String get statuImgAssets {
116 switch (status) { 118 switch (status) {
117 case "0": 119 case "0":
@@ -306,7 +308,7 @@ class NotebookDetail { @@ -306,7 +308,7 @@ class NotebookDetail {
306 308
307 @override 309 @override
308 String toString() { 310 String toString() {
309 - return 'NotebookDetail{id: $id, uid: $uid ,con_amount:$con_amount,abolition: $abolition, tableinfo: $tableinfo,actual_pum:$actual_pum, pnum: $pnum, rname: $rname, sex: $sex, phone: $phone, cusdem: $cusdem, cusman: $cusman, ddate: $ddate, is_set_ddate: $is_set_ddate, ddate_solt: $ddate_solt, status: $status, action: $action, type: $type, note_name: $note_name, seller_user_phone:$seller_user_phone, nick_name: $nick_name,channel: $channel, cdate: $cdate, demands: $demands, tables: $tables, cancel: $cancel, gid: $gid,guest_uid:$guest_uid,reserve_type:$reserve_type,place_order_name:$place_order_name,is_user_comments:$is_user_comments,deposit_cancel:$deposit_cancel,up_date:$up_date}'; 311 + return 'NotebookDetail{id: $id, uid: $uid ,con_amount:$con_amount,abolition: $abolition, tableinfo: $tableinfo,actual_pum:$actual_pum, pnum: $pnum, rname: $rname, sex: $sex, phone: $phone, cusdem: $cusdem, cusman: $cusman, ddate: $ddate, is_set_ddate: $is_set_ddate, ddate_solt: $ddate_solt, status: $status, action: $action, type: $type, note_name: $note_name, seller_user_phone:$seller_user_phone, nick_name: $nick_name,channel: $channel, cdate: $cdate, demands: $demands, tables: $tables, cancel: $cancel, gid: $gid,guest_uid:$guest_uid,reserve_type:$reserve_type,place_order_name:$place_order_name,is_user_comments:$is_user_comments,deposit_cancel:$deposit_cancel,up_date:$up_date,log_photo:$log_photo}';
310 } 312 }
311 } 313 }
312 314
@@ -317,6 +319,7 @@ class Cancel { @@ -317,6 +319,7 @@ class Cancel {
317 String uname; 319 String uname;
318 String desc; 320 String desc;
319 String cdate; 321 String cdate;
  322 + String log_photo;
320 323
321 String get cdateStr { 324 String get cdateStr {
322 DateTime dateTime = 325 DateTime dateTime =
@@ -55,7 +55,8 @@ NotebookDetail _$NotebookDetailFromJson(Map<String, dynamic> json) { @@ -55,7 +55,8 @@ NotebookDetail _$NotebookDetailFromJson(Map<String, dynamic> json) {
55 ..place_order_name = json['place_order_name'] as String 55 ..place_order_name = json['place_order_name'] as String
56 ..is_user_comments = json['is_user_comments'] as dynamic 56 ..is_user_comments = json['is_user_comments'] as dynamic
57 ..up_date = json['up_date'] as String 57 ..up_date = json['up_date'] as String
58 - ..deposit_cancel = json['deposit_cancel'] as String; 58 + ..deposit_cancel = json['deposit_cancel'] as String
  59 + ..log_photo = json['log_photo'] as String;
59 } 60 }
60 61
61 Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) => 62 Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) =>
@@ -96,6 +97,7 @@ Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) => @@ -96,6 +97,7 @@ Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) =>
96 'is_user_comments': instance.is_user_comments, 97 'is_user_comments': instance.is_user_comments,
97 'up_date': instance.up_date, 98 'up_date': instance.up_date,
98 'deposit_cancel': instance.deposit_cancel, 99 'deposit_cancel': instance.deposit_cancel,
  100 + 'log_photo': instance.log_photo,
99 }; 101 };
100 OrderInfo _$OrderInfoFromJson(Map<String, dynamic> json) { 102 OrderInfo _$OrderInfoFromJson(Map<String, dynamic> json) {
101 return OrderInfo( 103 return OrderInfo(
@@ -159,13 +161,15 @@ Cancel _$CancelFromJson(Map<String, dynamic> json) { @@ -159,13 +161,15 @@ Cancel _$CancelFromJson(Map<String, dynamic> json) {
159 return Cancel() 161 return Cancel()
160 ..uname = json['uname'] as String 162 ..uname = json['uname'] as String
161 ..desc = json['desc'] as String 163 ..desc = json['desc'] as String
162 - ..cdate = json['cdate'] as String; 164 + ..cdate = json['cdate'] as String
  165 + ..log_photo = json['log_photo'] as String;
163 } 166 }
164 167
165 Map<String, dynamic> _$CancelToJson(Cancel instance) => <String, dynamic>{ 168 Map<String, dynamic> _$CancelToJson(Cancel instance) => <String, dynamic>{
166 'uname': instance.uname, 169 'uname': instance.uname,
167 'desc': instance.desc, 170 'desc': instance.desc,
168 - 'cdate': instance.cdate 171 + 'cdate': instance.cdate,
  172 + 'log_photo':instance.log_photo
169 }; 173 };
170 174
171 Order _$OrderFromJson(Map<String, dynamic> json) { 175 Order _$OrderFromJson(Map<String, dynamic> json) {
@@ -30,22 +30,25 @@ class ReserveActionLogModol { @@ -30,22 +30,25 @@ class ReserveActionLogModol {
30 class ReserveActionLogSunModol { 30 class ReserveActionLogSunModol {
31 String content; 31 String content;
32 String upDate; 32 String upDate;
33 - String nick_name; 33 + String nickName;
  34 + String logPhoto;
34 35
35 - ReserveActionLogSunModol({this.content, this.upDate, this.nick_name}); 36 + ReserveActionLogSunModol(
  37 + {this.content, this.upDate, this.nickName, this.logPhoto});
36 38
37 ReserveActionLogSunModol.fromJson(Map<String, dynamic> json) { 39 ReserveActionLogSunModol.fromJson(Map<String, dynamic> json) {
38 content = json['content']; 40 content = json['content'];
39 upDate = json['up_date']; 41 upDate = json['up_date'];
40 - nick_name = json['nick_name']; 42 + nickName = json['nick_name'];
  43 + logPhoto = json['log_photo'];
41 } 44 }
42 45
43 Map<String, dynamic> toJson() { 46 Map<String, dynamic> toJson() {
44 final Map<String, dynamic> data = new Map<String, dynamic>(); 47 final Map<String, dynamic> data = new Map<String, dynamic>();
45 data['content'] = this.content; 48 data['content'] = this.content;
46 data['up_date'] = this.upDate; 49 data['up_date'] = this.upDate;
47 - data['nick_name'] = this.nick_name;  
48 - 50 + data['nick_name'] = this.nickName;
  51 + data['log_photo'] = this.logPhoto;
49 return data; 52 return data;
50 } 53 }
51 } 54 }
@@ -58,6 +58,7 @@ import '../../models/reserve_deposit_model.dart'; @@ -58,6 +58,7 @@ import '../../models/reserve_deposit_model.dart';
58 import '../../provider/collect_store_provider.dart'; 58 import '../../provider/collect_store_provider.dart';
59 import '../../utils/screen_util.dart'; 59 import '../../utils/screen_util.dart';
60 import '../../widgets/special_text/my_extended_text_selection_controls.dart'; 60 import '../../widgets/special_text/my_extended_text_selection_controls.dart';
  61 +import '../online_check/photo_view_wiget.dart';
61 62
62 class NotebookDetailPage extends StatefulWidget { 63 class NotebookDetailPage extends StatefulWidget {
63 final String rid; 64 final String rid;
@@ -202,7 +203,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -202,7 +203,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
202 bus.on("refresh_detail_reserve_recheck", (args) { 203 bus.on("refresh_detail_reserve_recheck", (args) {
203 _getReserveRecheckByRid(); //获取核餐记录 204 _getReserveRecheckByRid(); //获取核餐记录
204 }); 205 });
205 - bus.on("refresh_action_log", (args) { 206 + bus.on("refresh_action_log", (args) {
206 _getReserveActionLog(); //获取变更记录 207 _getReserveActionLog(); //获取变更记录
207 }); 208 });
208 }); 209 });
@@ -455,9 +456,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -455,9 +456,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
455 bus.off("refresh_detail"); 456 bus.off("refresh_detail");
456 bus.off("refresh_detail_deposit"); 457 bus.off("refresh_detail_deposit");
457 bus.off("refresh_detail_reserve_recheck"); 458 bus.off("refresh_detail_reserve_recheck");
458 - bus.off("refresh_action_log");  
459 -  
460 - 459 + bus.off("refresh_action_log");
461 } 460 }
462 461
463 ///获取订单详情 462 ///获取订单详情
@@ -1856,6 +1855,38 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -1856,6 +1855,38 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
1856 ]); 1855 ]);
1857 } 1856 }
1858 1857
  1858 + //查看大图
  1859 + _showPhotoView(BuildContext context, int index, List<String> imgs,
  1860 + {isShow = false, List dashName}) async {
  1861 + // if (imgs.length == 1 &&
  1862 + // imgs[0] ==
  1863 + // 'http://nosqn.colorcun.com/custom/lite-online/image/def-banner.png') {
  1864 + // imgs[0] = 'http://nosqn.colorcun.com/app/seller-hj-empty.png';
  1865 + // }
  1866 + Utils.setBarStatus(false, color: Colors.black);
  1867 + dynamic result = await showGeneralDialog(
  1868 + context: context,
  1869 + barrierDismissible: false,
  1870 + // barrierColor: Colors.red,
  1871 + barrierLabel:
  1872 + MaterialLocalizations.of(context).modalBarrierDismissLabel,
  1873 + transitionDuration: const Duration(milliseconds: 150),
  1874 + pageBuilder: (BuildContext context, Animation animation,
  1875 + Animation secondaryAnimation) {
  1876 + Widget child = Stack(
  1877 + children: <Widget>[
  1878 + PhotoPreview(
  1879 + initialIndex: index,
  1880 + photoList: imgs,
  1881 + isShow: isShow,
  1882 + dashName: dashName)
  1883 + ],
  1884 + );
  1885 + return child;
  1886 + });
  1887 + Utils.setBarStatus(true, color: Colors.white);
  1888 + }
  1889 +
1859 ///订单操作UI 1890 ///订单操作UI
1860 Widget _operatingRecord() { 1891 Widget _operatingRecord() {
1861 return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ 1892 return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
@@ -1868,7 +1899,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -1868,7 +1899,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
1868 style: TextStyle(color: MyColours.color_515151, fontSize: font(15)), 1899 style: TextStyle(color: MyColours.color_515151, fontSize: font(15)),
1869 ), 1900 ),
1870 Container( 1901 Container(
1871 - padding: EdgeInsets.only(left: w(13), top: w(20)), 1902 + padding: EdgeInsets.only(left: w(30), top: w(20)),
1872 child: 1903 child:
1873 Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ 1904 Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
1874 Text( 1905 Text(
@@ -1877,12 +1908,26 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -1877,12 +1908,26 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
1877 style: 1908 style:
1878 TextStyle(color: MyColours.color_515151, fontSize: font(14)), 1909 TextStyle(color: MyColours.color_515151, fontSize: font(14)),
1879 ), 1910 ),
  1911 + Spacer(),
1880 Text( 1912 Text(
1881 '${detailEntity.place_order_name ?? ''} ${_getDateTime(detailEntity.cdate)}', 1913 '${detailEntity.place_order_name ?? ''} ${_getDateTime(detailEntity.cdate)}',
1882 overflow: TextOverflow.ellipsis, 1914 overflow: TextOverflow.ellipsis,
1883 style: 1915 style:
1884 TextStyle(color: MyColours.color_999999, fontSize: font(14)), 1916 TextStyle(color: MyColours.color_999999, fontSize: font(14)),
1885 ), 1917 ),
  1918 + if (detailEntity.log_photo != null && detailEntity.log_photo != '')
  1919 + HEmptyView(16),
  1920 + if (detailEntity.log_photo != null && detailEntity.log_photo != '')
  1921 + InkWell(
  1922 + onTap: () {
  1923 + _showPhotoView(context, 0, [detailEntity.log_photo]);
  1924 + },
  1925 + child: Text(
  1926 + '照片',
  1927 + overflow: TextOverflow.ellipsis,
  1928 + style: TextStyle(
  1929 + color: MyColours.color_438E93, fontSize: font(14)),
  1930 + ))
1886 ])), 1931 ])),
1887 1932
1888 // if (detailModel.reserveActionLogData.length > 0) 1933 // if (detailModel.reserveActionLogData.length > 0)
@@ -1893,59 +1938,100 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -1893,59 +1938,100 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
1893 itemBuilder: (context, index) { 1938 itemBuilder: (context, index) {
1894 ReserveActionLogSunModol data = 1939 ReserveActionLogSunModol data =
1895 detailModel.reserveActionLogData[index]; 1940 detailModel.reserveActionLogData[index];
  1941 + bool show = data.logPhoto != null && data.logPhoto != '';
1896 return Container( 1942 return Container(
1897 - padding: EdgeInsets.only(left: w(13), top: w(20)),  
1898 - child: Row(  
1899 - mainAxisAlignment: MainAxisAlignment.spaceBetween,  
1900 - children: [  
1901 - Text(  
1902 - '变更预订',  
1903 - overflow: TextOverflow.ellipsis,  
1904 - style: TextStyle(  
1905 - color: MyColours.color_515151, fontSize: font(14)),  
1906 - ),  
1907 - Text(  
1908 - '${data.nick_name ?? ''} ${data.upDate}',  
1909 - overflow: TextOverflow.ellipsis,  
1910 - style: TextStyle(  
1911 - color: MyColours.color_999999, fontSize: font(14)),  
1912 - ),  
1913 - ])); 1943 + padding:
  1944 + EdgeInsets.only(left: w(30), top: index == 0 ? w(16) : 0),
  1945 + child: Column(
  1946 + crossAxisAlignment: CrossAxisAlignment.start,
  1947 + children: [
  1948 + Row(
  1949 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1950 + children: [
  1951 + Text(
  1952 + '订单修改',
  1953 + overflow: TextOverflow.ellipsis,
  1954 + style: TextStyle(
  1955 + color: MyColours.color_515151,
  1956 + fontSize: font(14)),
  1957 + ),
  1958 + Spacer(),
  1959 + Text(
  1960 + '${data.nickName ?? ''} ${data.upDate}',
  1961 + overflow: TextOverflow.ellipsis,
  1962 + style: TextStyle(
  1963 + color: MyColours.color_999999,
  1964 + fontSize: font(14)),
  1965 + ),
  1966 + if (show) HEmptyView(16),
  1967 + if (show)
  1968 + InkWell(
  1969 + onTap: () {
  1970 + _showPhotoView(context, 0, [data.logPhoto]);
  1971 + },
  1972 + child: Text(
  1973 + '照片',
  1974 + overflow: TextOverflow.ellipsis,
  1975 + style: TextStyle(
  1976 + color: MyColours.color_438E93,
  1977 + fontSize: font(14)),
  1978 + ))
  1979 + ]),
  1980 + Container(
  1981 + // color: Colors.red,
  1982 + padding: EdgeInsets.only(
  1983 + left: w(10),
  1984 + top: w(12),
  1985 + ),
  1986 + child: Text(
  1987 + data.content,
  1988 + overflow: TextOverflow.ellipsis,
  1989 + style: TextStyle(
  1990 + height: 2,
  1991 + color: MyColours.color_515151,
  1992 + fontSize: font(14)),
  1993 + ))
  1994 + ],
  1995 + ));
1914 }), 1996 }),
1915 - if (detailEntity.up_date != null)  
1916 - Container(  
1917 - padding: EdgeInsets.only(left: w(13), top: w(20)),  
1918 - child: Row(  
1919 - mainAxisAlignment: MainAxisAlignment.spaceBetween,  
1920 - children: [  
1921 - Text(  
1922 - '最后修改',  
1923 - overflow: TextOverflow.ellipsis,  
1924 - style: TextStyle(  
1925 - color: MyColours.color_515151, fontSize: font(14)),  
1926 - ),  
1927 - // HEmptyView(40),  
1928 - Expanded(  
1929 - child: Text(  
1930 - '${detailEntity.nick_name ?? ''}' +  
1931 - ' ' +  
1932 - '${detailEntity.seller_user_phone ?? ''}' +  
1933 - (detailEntity.up_date == null  
1934 - ? ''  
1935 - : ' ${_getDateTime(detailEntity.up_date)}'),  
1936 - // overflow: TextOverflow.ellipsis,  
1937 - textAlign: TextAlign.right,  
1938 - style: TextStyle(  
1939 - color: MyColours.color_999999, fontSize: font(14)),  
1940 - )),  
1941 - ])), 1997 + // if (detailEntity.up_date != null)
  1998 + // Container(
  1999 + // padding: EdgeInsets.only(left: w(13), top: w(20)),
  2000 + // child: Row(
  2001 + // mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2002 + // children: [
  2003 + // Text(
  2004 + // '最后修改',
  2005 + // overflow: TextOverflow.ellipsis,
  2006 + // style: TextStyle(
  2007 + // color: MyColours.color_515151, fontSize: font(14)),
  2008 + // ),
  2009 + // // HEmptyView(40),
  2010 + // Expanded(
  2011 + // child: Text(
  2012 + // '${detailEntity.nick_name ?? ''}' +
  2013 + // ' ' +
  2014 + // '${detailEntity.seller_user_phone ?? ''}' +
  2015 + // (detailEntity.up_date == null
  2016 + // ? ''
  2017 + // : ' ${_getDateTime(detailEntity.up_date)}'),
  2018 + // // overflow: TextOverflow.ellipsis,
  2019 + // textAlign: TextAlign.right,
  2020 + // style: TextStyle(
  2021 + // color: MyColours.color_999999, fontSize: font(14)),
  2022 + // )),
  2023 + // ])),
1942 Offstage( 2024 Offstage(
1943 offstage: (detailEntity.status == "4" && detailEntity.cancel != null) 2025 offstage: (detailEntity.status == "4" && detailEntity.cancel != null)
1944 ? false 2026 ? false
1945 : true, 2027 : true,
1946 child: Column(children: <Widget>[ 2028 child: Column(children: <Widget>[
1947 Container( 2029 Container(
1948 - padding: EdgeInsets.only(left: w(13), top: w(10)), 2030 + padding: EdgeInsets.only(
  2031 + left: w(30),
  2032 + top: detailModel.reserveActionLogData.length > 0
  2033 + ? 0
  2034 + : w(16)),
1949 child: Row( 2035 child: Row(
1950 mainAxisAlignment: MainAxisAlignment.spaceBetween, 2036 mainAxisAlignment: MainAxisAlignment.spaceBetween,
1951 children: [ 2037 children: [
@@ -1955,18 +2041,34 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -1955,18 +2041,34 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
1955 style: TextStyle( 2041 style: TextStyle(
1956 color: MyColours.color_515151, fontSize: font(14)), 2042 color: MyColours.color_515151, fontSize: font(14)),
1957 ), 2043 ),
1958 - HEmptyView(40),  
1959 - Expanded(  
1960 - child: Text( 2044 + Spacer(),
  2045 + Text(
1961 '${detailEntity.abolition == '2' ? '顾客在线取消' : detailEntity.cancel?.uname ?? ""} ${detailEntity.cancel?.cdateStr ?? ""}', 2046 '${detailEntity.abolition == '2' ? '顾客在线取消' : detailEntity.cancel?.uname ?? ""} ${detailEntity.cancel?.cdateStr ?? ""}',
1962 overflow: TextOverflow.ellipsis, 2047 overflow: TextOverflow.ellipsis,
1963 - textAlign: TextAlign.right, 2048 + // textAlign: TextAlign.right,
1964 style: TextStyle( 2049 style: TextStyle(
1965 color: MyColours.color_999999, fontSize: font(14)), 2050 color: MyColours.color_999999, fontSize: font(14)),
1966 - )), 2051 + ),
  2052 + if (detailEntity.cancel?.log_photo != null &&
  2053 + detailEntity.cancel?.log_photo != '')
  2054 + HEmptyView(16),
  2055 + if (detailEntity.cancel?.log_photo != null &&
  2056 + detailEntity.cancel?.log_photo != '')
  2057 + InkWell(
  2058 + onTap: () {
  2059 + _showPhotoView(
  2060 + context, 0, [detailEntity.cancel?.log_photo]);
  2061 + },
  2062 + child: Text(
  2063 + '照片',
  2064 + overflow: TextOverflow.ellipsis,
  2065 + style: TextStyle(
  2066 + color: MyColours.color_438E93,
  2067 + fontSize: font(14)),
  2068 + ))
1967 ])), 2069 ])),
1968 Container( 2070 Container(
1969 - padding: EdgeInsets.only(left: w(13), top: w(10)), 2071 + padding: EdgeInsets.only(left: w(30), top: w(16)),
1970 child: Row( 2072 child: Row(
1971 mainAxisAlignment: MainAxisAlignment.spaceBetween, 2073 mainAxisAlignment: MainAxisAlignment.spaceBetween,
1972 children: [ 2074 children: [
@@ -1982,10 +2084,10 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -1982,10 +2084,10 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
1982 style: TextStyle( 2084 style: TextStyle(
1983 color: MyColours.color_999999, fontSize: font(14)), 2085 color: MyColours.color_999999, fontSize: font(14)),
1984 ), 2086 ),
1985 - ])) 2087 + ])),
  2088 + VEmptyView(20),
  2089 + // MyDivider(double.infinity, w(0.5), color: MyColours.color_BFC4D4),
1986 ])), 2090 ])),
1987 - VEmptyView(20),  
1988 - MyDivider(double.infinity, w(0.5), color: MyColours.color_BFC4D4),  
1989 ]); 2091 ]);
1990 } 2092 }
1991 2093