添加订单弹窗回调

master
章文轩 2 years ago
parent 634aa29577
commit ad5dbd5379

@ -130,6 +130,15 @@ class _ChatTypePageState extends State<ChatTypePage> {
context, _workGroupWid, "技能组客服-电商-回调", custom, (value) { context, _workGroupWid, "技能组客服-电商-回调", custom, (value) {
print('value为custom参数原样返回 $value'); print('value为custom参数原样返回 $value');
// //
showModalBottomSheet(
context: context,
builder: (context) {
return Container(
width: 200,
height: 200,
color: Colors.red,
);
});
}); });
}, },
), ),

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -207,9 +207,9 @@ class BytedeskKefu {
} }
static void startWorkGroupChatShopCallback(BuildContext context, String wid, static void startWorkGroupChatShopCallback(BuildContext context, String wid,
String title, String commodity, ValueSetter<String> customCallback) { String title, String commodity, ValueSetter<String> customCallback,{Widget? widget}) {
startChatShop(context, wid, BytedeskConstants.CHAT_TYPE_WORKGROUP, title, startChatShop(context, wid, BytedeskConstants.CHAT_TYPE_WORKGROUP, title,
commodity, customCallback); commodity, customCallback,widget: widget);
} }
// //
@ -247,8 +247,9 @@ class BytedeskKefu {
// -() // -()
static void startChatShop(BuildContext context, String uuid, String type, static void startChatShop(BuildContext context, String uuid, String type,
String title, String commodity, ValueSetter<String>? customCallback) { String title, String commodity, ValueSetter<String>? customCallback,
startChat(context, uuid, type, title, commodity, '', false, customCallback); {Widget? widget}) {
startChat(context, uuid, type, title, commodity, '', false, customCallback,widget:widget);
} }
// -() // -()
@ -266,7 +267,9 @@ class BytedeskKefu {
String commodity, String commodity,
String postScript, String postScript,
bool isV2Robot, bool isV2Robot,
ValueSetter<String>? customCallback) { ValueSetter<String>? customCallback,
{Widget? widget}
) {
Navigator.of(context).push(new MaterialPageRoute(builder: (context) { Navigator.of(context).push(new MaterialPageRoute(builder: (context) {
return new ChatKFProvider( return new ChatKFProvider(
wid: uuid, wid: uuid,

@ -51,6 +51,7 @@ class ChatKFPage extends StatefulWidget {
final bool? isThread; final bool? isThread;
final Thread? thread; final Thread? thread;
final ValueSetter<String>? customCallback; final ValueSetter<String>? customCallback;
final Widget? widget;
// //
ChatKFPage( ChatKFPage(
{Key? key, {Key? key,
@ -63,7 +64,7 @@ class ChatKFPage extends StatefulWidget {
this.isV2Robot, this.isV2Robot,
this.isThread, this.isThread,
this.thread, this.thread,
this.customCallback}) this.customCallback, this.widget})
: super(key: key); : super(key: key);
// //
@override @override
@ -254,7 +255,7 @@ class _ChatKFPageState extends State<ChatKFPage>
// style: TextStyle(color: Colors.black), // style: TextStyle(color: Colors.black),
), ),
))), ))),
) ),
], ],
), ),
body: MultiBlocListener( body: MultiBlocListener(
@ -658,7 +659,10 @@ class _ChatKFPageState extends State<ChatKFPage>
// //
handleUploadVideo: _handleUploadVideo, handleUploadVideo: _handleUploadVideo,
// //
handleCaptureVideo: _handleCaptureVideo), handleCaptureVideo: _handleCaptureVideo,
handleShowOrders: _handleShowOrders,
),
); );
} }
@ -682,6 +686,13 @@ class _ChatKFPageState extends State<ChatKFPage>
_pickImage(); _pickImage();
} }
void _handleShowOrders() async {
print('_handleShowOrders');
if(widget.customCallback!=null){
widget.customCallback!('点击订单');
}
}
void _handleFileSelection() async { void _handleFileSelection() async {
print('_handleFileSelection'); print('_handleFileSelection');
} }

@ -14,6 +14,7 @@ class ChatKFProvider extends StatelessWidget {
final String? postscript; final String? postscript;
final bool? isV2Robot; final bool? isV2Robot;
final ValueSetter<String>? customCallback; final ValueSetter<String>? customCallback;
final Widget? widget;
// //
const ChatKFProvider( const ChatKFProvider(
{Key? key, {Key? key,
@ -24,7 +25,7 @@ class ChatKFProvider extends StatelessWidget {
this.custom, this.custom,
this.postscript, this.postscript,
this.isV2Robot, this.isV2Robot,
this.customCallback}) this.customCallback, this.widget})
: super(key: key); : super(key: key);
// //
@override @override
@ -49,7 +50,8 @@ class ChatKFProvider extends StatelessWidget {
postscript: postscript, postscript: postscript,
isV2Robot: isV2Robot, isV2Robot: isV2Robot,
isThread: false, isThread: false,
customCallback: customCallback), customCallback: customCallback,
widget: widget,),
); );
} }
} }

@ -73,7 +73,7 @@ class ExtraItems extends StatefulWidget {
this.handleFileSelection, this.handleFileSelection,
this.handlePickerSelection, this.handlePickerSelection,
this.handleUploadVideo, this.handleUploadVideo,
this.handleCaptureVideo, this.handleCaptureVideo, this.handleShowOrders,
}) : super(key: key); }) : super(key: key);
final void Function()? handleImageSelection; final void Function()? handleImageSelection;
@ -81,6 +81,8 @@ class ExtraItems extends StatefulWidget {
final void Function()? handlePickerSelection; final void Function()? handlePickerSelection;
final void Function()? handleUploadVideo; final void Function()? handleUploadVideo;
final void Function()? handleCaptureVideo; final void Function()? handleCaptureVideo;
final void Function()? handleShowOrders;///
@override @override
_ExtraItemsState createState() => _ExtraItemsState(); _ExtraItemsState createState() => _ExtraItemsState();
@ -127,11 +129,11 @@ class _ExtraItemsState extends State<ExtraItems> {
Row( Row(
children: [ children: [
// TODO: // TODO:
// ExtraItem( ExtraItem(
// title: "文件", title: "发送订单",
// image: AssetImage('assets/images/chat/extra_file.webp'), image: AssetImage('assets/images/chat/extra_wallet.png'),
// onPressed: widget.handleFileSelection, onPressed: widget.handleShowOrders,
// ), ),
// ExtraItem( // ExtraItem(
// title: "语音输入", // title: "语音输入",
// image: AssetImage('assets/images/chat/extra_voice.webp'), // image: AssetImage('assets/images/chat/extra_voice.webp'),

Loading…
Cancel
Save