是否可以在自适应卡的主体数组中添加 action.open url ?

is it possible to add action.open url inside the body array in adaptive card?

在我的机器人应用程序中,我需要在 text.I 之间显示一个 action.open Url 按钮,需要在正文中添加 Action.Open url如图所示,日期结束时 json 的标记,需要单击 url link 来执行一些操作。

Adaptive Card Design Image

是否可以在 body 标签内的文本之间或文本顶部添加按钮?

{
    "type": "AdaptiveCard",
    "body": [
        {
            "type": "TextBlock",
            "size": "Medium",
            "weight": "Bolder",
            "color": "Warning",
            "text": "Company Name"
        },
        {
            "type": "TextBlock",
            "text": "Meeting Details",
            "wrap": true
        },
        {
            "type": "FactSet",
            "facts": [
                {
                    "title": "Description",
                    "value": "xxx"
                },
                {
                    "title": "Key Note Speaker",
                    "value": "yyy"
                },
                {
                    "title": "Date :",
                    "value": "03/25/2019 12:30:00 PM"
                }
            ]
        },
       
        {
            "type": "TextBlock",
            "horizontalAlignment": "Center",
            "size": "ExtraLarge",
            "weight": "Bolder",
            "color": "Accent",
            "text": "**************"
        },
        {
            "type": "TextBlock",
            "text": "Meeting Details",
            "wrap": true
        },
        {
            "type": "FactSet",
            "facts": [
                 {
                    "title": "Description",
                    "value": "xxx"
                },
                {
                    "title": "Key Note Speaker",
                    "value": "yyy"
                },
                {
                    "title": "Date :",
                    "value": "03/25/2019 12:30:00 PM"
                }
            ]
        },
        {
            "type": "TextBlock",
            "horizontalAlignment": "Center",
            "size": "ExtraLarge",
            "weight": "Bolder",
            "color": "Accent",
            "text": "**************"
        }
    ],

     "actions": [
          {
            "type": "Action.OpenUrl",
            "title": "Add to Calender",
            "url": "http://adaptivecards.io"
            },
             {
            "type": "Action.OpenUrl",
            "title": " Click here to add more Info ",
            "url": "http://adaptivecards.io"
            }
     ],
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.0"
}

遗憾的是,AdaptiveCards 中按钮的默认位置在卡片底部,您无法更改它。但是,您可以使用 selectAction 属性向卡片添加您喜欢的样式的图像,该属性将在用户单击图像时提交与操作关联的数据。有关详细信息,请参阅下面的示例 AdaptiveCard JSON 和 Images and Select Actions.

的 AdaptiveCard 文档

截图

JSON

{
    "type": "AdaptiveCard",
    "body": [
        {
            "type": "TextBlock",
            "size": "Large",
            "weight": "Bolder",
            "color": "Accent",
            "text": "Company Name"
        },
        {
            "type": "TextBlock",
            "separator": true,
            "size": "Medium",
            "text": "Meeting Details"
        },
        {
            "type": "TextBlock",
            "text": "Description:"
        },
        {
            "type": "TextBlock",
            "text": "Keynote Speaker:"
        },
        {
            "type": "TextBlock",
            "text": "Date:"
        },
        {
            "type": "Image",
            "selectAction": {
                "type": "Action.Submit",
                "data": "Meeting 1"
            },
            "url": "C:\Users\v-thdurn\Developer\Node\Azure\thdurn-all-channels-src\resources\button.png"
        },
        {
            "type": "TextBlock",
            "separator": true,
            "size": "Medium",
            "text": "Meeting Details"
        },
        {
            "type": "TextBlock",
            "text": "Description:"
        },
        {
            "type": "TextBlock",
            "text": "Keynote Speaker:"
        },
        {
            "type": "TextBlock",
            "text": "Date:"
        },
        {
            "type": "Image",
            "selectAction": {
                "type": "Action.Submit",
                "data": "Meeting 2"
            },
            "url": "C:\Users\v-thdurn\Developer\Node\Azure\thdurn-all-channels-src\resources\button.png"
        }
    ],
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.0"
}

希望对您有所帮助!