添加订单弹窗回调

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

@ -130,6 +130,15 @@ class _ChatTypePageState extends State<ChatTypePage> {
context, _workGroupWid, "技能组客服-电商-回调", 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,
String title, String commodity, ValueSetter<String> customCallback) {
String title, String commodity, ValueSetter<String> customCallback,{Widget? widget}) {
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,
String title, String commodity, ValueSetter<String>? customCallback) {
startChat(context, uuid, type, title, commodity, '', false, customCallback);
String title, String commodity, ValueSetter<String>? customCallback,
{Widget? widget}) {
startChat(context, uuid, type, title, commodity, '', false, customCallback,widget:widget);
}
// -()
@ -266,7 +267,9 @@ class BytedeskKefu {
String commodity,
String postScript,
bool isV2Robot,
ValueSetter<String>? customCallback) {
ValueSetter<String>? customCallback,
{Widget? widget}
) {
Navigator.of(context).push(new MaterialPageRoute(builder: (context) {
return new ChatKFProvider(
wid: uuid,

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

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

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

Loading…
Cancel
Save