|
@@ -6,18 +6,19 @@ import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_ |
|
|
import 'package:cached_network_image/cached_network_image.dart'; |
|
|
import 'package:cached_network_image/cached_network_image.dart'; |
|
|
import 'package:zhiying_comm/zhiying_comm.dart'; |
|
|
import 'package:zhiying_comm/zhiying_comm.dart'; |
|
|
|
|
|
|
|
|
|
|
|
import 'model/Intellect_search_set_model.dart'; |
|
|
|
|
|
|
|
|
class IntellectSearchNoGoodsDialog extends StatefulWidget { |
|
|
class IntellectSearchNoGoodsDialog extends StatefulWidget { |
|
|
final IntellectDialogDataModel model; |
|
|
final IntellectDialogDataModel model; |
|
|
|
|
|
final IntellectSearchSetModel setModel; |
|
|
|
|
|
|
|
|
const IntellectSearchNoGoodsDialog({Key key, this.model}) : super(key: key); |
|
|
|
|
|
|
|
|
const IntellectSearchNoGoodsDialog({Key key, this.model, this.setModel}) : super(key: key); |
|
|
|
|
|
|
|
|
@override |
|
|
@override |
|
|
_IntellectSearchNoGoodsDialogState createState() => |
|
|
|
|
|
_IntellectSearchNoGoodsDialogState(); |
|
|
|
|
|
|
|
|
_IntellectSearchNoGoodsDialogState createState() => _IntellectSearchNoGoodsDialogState(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
class _IntellectSearchNoGoodsDialogState |
|
|
|
|
|
extends State<IntellectSearchNoGoodsDialog> { |
|
|
|
|
|
|
|
|
class _IntellectSearchNoGoodsDialogState extends State<IntellectSearchNoGoodsDialog> { |
|
|
TextEditingController _textEditingController; |
|
|
TextEditingController _textEditingController; |
|
|
|
|
|
|
|
|
NoGoodsDialogStyleModel _styleModel; |
|
|
NoGoodsDialogStyleModel _styleModel; |
|
@@ -42,8 +43,20 @@ class _IntellectSearchNoGoodsDialogState |
|
|
|
|
|
|
|
|
void requestStyle() { |
|
|
void requestStyle() { |
|
|
NetUtil.request("/api/v1/cfg/clipboard_unidentified", onSuccess: (data) { |
|
|
NetUtil.request("/api/v1/cfg/clipboard_unidentified", onSuccess: (data) { |
|
|
_styleModel = NoGoodsDialogStyleModel.fromJson( |
|
|
|
|
|
json.decode(data['clipboard_unidentified'])); |
|
|
|
|
|
|
|
|
_styleModel = NoGoodsDialogStyleModel.fromJson(json.decode(data['clipboard_unidentified'])); |
|
|
|
|
|
if (_styleModel?.iconList != null && widget?.setModel?.platform != null) { |
|
|
|
|
|
for (var index = _styleModel?.iconList?.length - 1; index >= 0; index--) { |
|
|
|
|
|
bool isExits = false; |
|
|
|
|
|
for (var item in widget?.setModel?.platform) { |
|
|
|
|
|
if (_styleModel?.iconList[index].pvd == item) { |
|
|
|
|
|
isExits = true; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (!isExits) { |
|
|
|
|
|
_styleModel?.iconList?.removeAt(index); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
setState(() {}); |
|
|
setState(() {}); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
@@ -63,11 +76,8 @@ class _IntellectSearchNoGoodsDialogState |
|
|
children: <Widget>[ |
|
|
children: <Widget>[ |
|
|
Container( |
|
|
Container( |
|
|
margin: EdgeInsets.only(top: 19, left: 42.5, right: 42.5), |
|
|
margin: EdgeInsets.only(top: 19, left: 42.5, right: 42.5), |
|
|
padding: EdgeInsets.only( |
|
|
|
|
|
top: 26, left: 15, right: 15, bottom: 24), |
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
color: HexColor.fromHex(_styleModel?.bgColor ?? ""), |
|
|
|
|
|
borderRadius: BorderRadius.circular(16)), |
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(top: 26, left: 15, right: 15, bottom: 24), |
|
|
|
|
|
decoration: BoxDecoration(color: HexColor.fromHex(_styleModel?.bgColor ?? ""), borderRadius: BorderRadius.circular(16)), |
|
|
width: double.infinity, |
|
|
width: double.infinity, |
|
|
child: Column( |
|
|
child: Column( |
|
|
children: <Widget>[_buildTopItem(), _buildBottomItem()], |
|
|
children: <Widget>[_buildTopItem(), _buildBottomItem()], |
|
@@ -85,7 +95,19 @@ class _IntellectSearchNoGoodsDialogState |
|
|
)), |
|
|
)), |
|
|
), |
|
|
), |
|
|
], |
|
|
], |
|
|
) |
|
|
|
|
|
|
|
|
), |
|
|
|
|
|
SizedBox( |
|
|
|
|
|
height: 16, |
|
|
|
|
|
), |
|
|
|
|
|
IconButton( |
|
|
|
|
|
iconSize: 36, |
|
|
|
|
|
icon: Icon( |
|
|
|
|
|
Icons.cancel, |
|
|
|
|
|
color: Colors.white, |
|
|
|
|
|
), |
|
|
|
|
|
onPressed: () { |
|
|
|
|
|
Navigator.pop(context); |
|
|
|
|
|
}) |
|
|
], |
|
|
], |
|
|
), |
|
|
), |
|
|
)); |
|
|
)); |
|
@@ -98,24 +120,15 @@ class _IntellectSearchNoGoodsDialogState |
|
|
children: <Widget>[ |
|
|
children: <Widget>[ |
|
|
Text( |
|
|
Text( |
|
|
_styleModel?.moduleList?.title?.content ?? "", |
|
|
_styleModel?.moduleList?.title?.content ?? "", |
|
|
style: TextStyle( |
|
|
|
|
|
color: HexColor.fromHex( |
|
|
|
|
|
_styleModel?.moduleList?.title?.textColor ?? ""), |
|
|
|
|
|
fontSize: 15), |
|
|
|
|
|
|
|
|
style: TextStyle(color: HexColor.fromHex(_styleModel?.moduleList?.title?.textColor ?? ""), fontSize: 15), |
|
|
), |
|
|
), |
|
|
Container( |
|
|
Container( |
|
|
margin: EdgeInsets.only(top: 12), |
|
|
margin: EdgeInsets.only(top: 12), |
|
|
decoration: BoxDecoration( |
|
|
|
|
|
color: HexColor.fromHex( |
|
|
|
|
|
_styleModel?.moduleList?.content?.bgColor ?? ""), |
|
|
|
|
|
borderRadius: BorderRadius.circular(10)), |
|
|
|
|
|
|
|
|
decoration: BoxDecoration(color: HexColor.fromHex(_styleModel?.moduleList?.content?.bgColor ?? ""), borderRadius: BorderRadius.circular(10)), |
|
|
child: TextField( |
|
|
child: TextField( |
|
|
controller: _textEditingController, |
|
|
controller: _textEditingController, |
|
|
textAlign: TextAlign.start, |
|
|
textAlign: TextAlign.start, |
|
|
style: TextStyle( |
|
|
|
|
|
color: HexColor.fromHex( |
|
|
|
|
|
_styleModel?.moduleList?.content?.textColor ?? ''), |
|
|
|
|
|
fontSize: 11), |
|
|
|
|
|
|
|
|
style: TextStyle(color: HexColor.fromHex(_styleModel?.moduleList?.content?.textColor ?? ''), fontSize: 11), |
|
|
decoration: InputDecoration( |
|
|
decoration: InputDecoration( |
|
|
contentPadding: EdgeInsets.only(left: 10, top: 10, bottom: 4), |
|
|
contentPadding: EdgeInsets.only(left: 10, top: 10, bottom: 4), |
|
|
border: InputBorder.none, |
|
|
border: InputBorder.none, |
|
@@ -139,31 +152,19 @@ class _IntellectSearchNoGoodsDialogState |
|
|
Expanded( |
|
|
Expanded( |
|
|
child: InkWell( |
|
|
child: InkWell( |
|
|
child: Container( |
|
|
child: Container( |
|
|
decoration: BoxDecoration( |
|
|
|
|
|
color: HexColor.fromHex( |
|
|
|
|
|
_styleModel?.moduleList?.btn?.bgColor ?? ""), |
|
|
|
|
|
borderRadius: BorderRadius.circular(50)), |
|
|
|
|
|
|
|
|
decoration: BoxDecoration(color: HexColor.fromHex(_styleModel?.moduleList?.btn?.bgColor ?? ""), borderRadius: BorderRadius.circular(50)), |
|
|
child: Center( |
|
|
child: Center( |
|
|
child: Padding( |
|
|
child: Padding( |
|
|
padding: const EdgeInsets.all(12.0), |
|
|
padding: const EdgeInsets.all(12.0), |
|
|
child: Text( |
|
|
child: Text( |
|
|
_styleModel?.moduleList?.btn?.content ?? "", |
|
|
_styleModel?.moduleList?.btn?.content ?? "", |
|
|
style: TextStyle( |
|
|
|
|
|
color: HexColor.fromHex( |
|
|
|
|
|
_styleModel?.moduleList?.btn?.textColor), |
|
|
|
|
|
fontSize: 12), |
|
|
|
|
|
|
|
|
style: TextStyle(color: HexColor.fromHex(_styleModel?.moduleList?.btn?.textColor), fontSize: 12), |
|
|
), |
|
|
), |
|
|
)), |
|
|
)), |
|
|
), |
|
|
), |
|
|
onTap: () { |
|
|
onTap: () { |
|
|
RouterUtil.route( |
|
|
RouterUtil.route( |
|
|
SkipModel.fromJson( |
|
|
|
|
|
_styleModel.moduleList.btn.skipInfo.toJson()), |
|
|
|
|
|
{ |
|
|
|
|
|
"keywords": searchText, |
|
|
|
|
|
"type": _styleModel.moduleList.btn.skipInfo.pvd |
|
|
|
|
|
}, |
|
|
|
|
|
context) |
|
|
|
|
|
|
|
|
SkipModel.fromJson(_styleModel.moduleList.btn.skipInfo.toJson()), {"keywords": searchText, "type": _styleModel.moduleList.btn.skipInfo.pvd}, context) |
|
|
.then((_) { |
|
|
.then((_) { |
|
|
Navigator.pop(context); |
|
|
Navigator.pop(context); |
|
|
}); |
|
|
}); |
|
@@ -181,20 +182,16 @@ class _IntellectSearchNoGoodsDialogState |
|
|
Container( |
|
|
Container( |
|
|
height: 1, |
|
|
height: 1, |
|
|
width: 68.5, |
|
|
width: 68.5, |
|
|
color: HexColor.fromHex( |
|
|
|
|
|
_styleModel?.moduleList?.segment?.textColor ?? ""), |
|
|
|
|
|
|
|
|
color: HexColor.fromHex(_styleModel?.moduleList?.segment?.textColor ?? ""), |
|
|
), |
|
|
), |
|
|
Text( |
|
|
Text( |
|
|
_styleModel?.moduleList?.segment?.content ?? "", |
|
|
_styleModel?.moduleList?.segment?.content ?? "", |
|
|
style: TextStyle( |
|
|
|
|
|
color: HexColor.fromHex( |
|
|
|
|
|
_styleModel?.moduleList?.segment?.textColor ?? "")), |
|
|
|
|
|
|
|
|
style: TextStyle(color: HexColor.fromHex(_styleModel?.moduleList?.segment?.textColor ?? "")), |
|
|
), |
|
|
), |
|
|
Container( |
|
|
Container( |
|
|
height: 1, |
|
|
height: 1, |
|
|
width: 68.5, |
|
|
width: 68.5, |
|
|
color: HexColor.fromHex( |
|
|
|
|
|
_styleModel?.moduleList?.segment?.textColor ?? ""), |
|
|
|
|
|
|
|
|
color: HexColor.fromHex(_styleModel?.moduleList?.segment?.textColor ?? ""), |
|
|
), |
|
|
), |
|
|
], |
|
|
], |
|
|
), |
|
|
), |
|
@@ -203,11 +200,7 @@ class _IntellectSearchNoGoodsDialogState |
|
|
), |
|
|
), |
|
|
Container( |
|
|
Container( |
|
|
height: 50, |
|
|
height: 50, |
|
|
child: ListView.builder( |
|
|
|
|
|
scrollDirection: Axis.horizontal, |
|
|
|
|
|
shrinkWrap: true, |
|
|
|
|
|
itemCount: _styleModel?.iconList?.length ?? 0, |
|
|
|
|
|
itemBuilder: _buildBottomListItem), |
|
|
|
|
|
|
|
|
child: ListView.builder(scrollDirection: Axis.horizontal, shrinkWrap: true, itemCount: _styleModel?.iconList?.length ?? 0, itemBuilder: _buildBottomListItem), |
|
|
) |
|
|
) |
|
|
], |
|
|
], |
|
|
); |
|
|
); |
|
@@ -234,16 +227,12 @@ class _IntellectSearchNoGoodsDialogState |
|
|
), |
|
|
), |
|
|
Text( |
|
|
Text( |
|
|
item.title ?? "", |
|
|
item.title ?? "", |
|
|
style: TextStyle( |
|
|
|
|
|
fontSize: 11, |
|
|
|
|
|
color: HexColor.fromHex(item.textColor ?? "")), |
|
|
|
|
|
|
|
|
style: TextStyle(fontSize: 11, color: HexColor.fromHex(item.textColor ?? "")), |
|
|
) |
|
|
) |
|
|
], |
|
|
], |
|
|
), |
|
|
), |
|
|
onTap: () { |
|
|
onTap: () { |
|
|
RouterUtil.route(SkipModel.fromJson(item.skipInfo.toJson()), |
|
|
|
|
|
{"keywords": searchText, "type": item.pvd}, context) |
|
|
|
|
|
.then((value) { |
|
|
|
|
|
|
|
|
RouterUtil.route(SkipModel.fromJson(item.skipInfo.toJson()), {"keywords": searchText, "type": item.pvd}, context).then((value) { |
|
|
Navigator.pop(context); |
|
|
Navigator.pop(context); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|