我有一个名为“表单搜索”的对话框,它有一个自适应卡。当我单击提交按钮时,控件不会进入下一个流程,而是以错误结束。但是如果使用英雄卡,按钮点击会触发下一个流程。可能是什么问题。
session.message 不包含和值,也不会触发到下一个流程。
bot.dialog("/FormSearch",[
function(session,args, next) {
var card = {
contentType: "application/vnd.microsoft.card.adaptive",
content:{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": 2,
"items": [
{
"type": "TextBlock",
"text": "Tell us about yourself",
"weight": "bolder",
"size": "medium"
},
{
"type": "TextBlock",
"text": "Your name",
"wrap": true
},
{
"type": "Input.Text",
"id": "myName",
"placeholder": "Last, First"
},
{
"type": "TextBlock",
"text": "Your email",
"wrap": true
},
{
"type": "Input.Text",
"id": "myEmail",
"placeholder": "youremail@example.com",
"style": "email"
},
{
"type": "TextBlock",
"text": "Phone Number"
},
{
"type": "Input.Text",
"id": "myTel",
"placeholder": "xxx.xxx.xxxx",
"style": "tel"
}
]
},
{
"type": "Column",
"width": 1,
"items": [
{
"type": "Image",
"url": "https://upload.wikimedia.org/wikipedia/commons/b/b2/Diver_Silhouette%2C_Great_Barrier_Reef.jpg",
"size": "auto"
}
]
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Submit"
}
]
}
}
// var card = new builder.HeroCard(session)
// .title('card title')
// .subtitle('subtitle')
// .images([builder.CardImage.create(session, 'http://oobrien.com/wordpress/wp-content/uploads/2016/07/googlemaps_july2016.jpg')])
// .buttons([
// builder.CardAction.openUrl(session, 'https://www.google.com', "Navigate"),
// builder.CardAction.postBack(session, 'select', "select")
// ]);
var msg = new builder.Message(session).addAttachment(card);
builder.Prompts.text(session, 'Fill in the below form');
session.send(msg);
},
function(session,results) {
console.log('next flow ____________');
if (session.message && session.message.value) {
console.log('A Card Submit Action obj was received');
session.send('form submitted');
}
}
]);
触发错误消息