2017-10-10 70 views
3

我正在尝试创建显示目标帐户未结余额的收据卡。在Bot Framework模拟器中显示时,是否有任何方法可以从生成的卡中删除“税”和“总计”字段?为Microsoft Bot-Builder定制ReceiptCard

产生ReceiptCards

private ReceiptCard GenerateNewReceiptCardAccount(Account account) 
{ 
    return new ReceiptCard() 
    { 
     Title = "Account Number: " + account.AccountNumber.ToUpperInvariant(), 

     Facts = new List<Fact> 
     { 
      new Fact("Reference Month:", account.MonthRef), 
     }, 

     Items = GetReceiptItemListAccount(account), 

     Buttons = new List<CardAction> 
     { 
      new CardAction(
       ActionTypes.OpenUrl, 
       "More Details", 
       "https://github.com/amido/azure-vector-icons/blob/master/renders/file.png", 
       "https://gmail.com") 
     } 
    }; 
} 

方法产生ReceiptItems

private List<ReceiptItem> GetReceiptItemListAccount(Account account) 
{ 
    List<ReceiptItem> ri = new List<ReceiptItem>(); 

    ri.Add(new ReceiptItem("30-Days Outstanding Balance", price: "$ " + account.Outstanding30Days.ToString("F"))); 
    ri.Add(new ReceiptItem("Current Outstanding Balance", price: "$ " + account.OutstandingCurrent.ToString("F"))); 
    ri.Add(new ReceiptItem("Total Outstanding Balance", price: "$ " + account.OutstandingTotal.ToString("F"))); 

    return ri; 
} 

我得到现在在模拟器窗口结果方法: ReceiptCardEmulator

回答

1

这PR修复该问题:https://github.com/Microsoft/BotFramework-WebChat/pull/603通过确保税收和总价值前显示。

它只是不是在最新的模拟器呢。它是在网络聊天控制,可在这里:https://cdn.botframework.com/botframework-webchat/latest/botchat.js & https://cdn.botframework.com/botframework-webchat/latest/botchat.css

专业提示: 您也可以将这些文件并替换下C的:\用户[YourUserName] \应用程序数据\本地\ botframework \ Windows上 - 更新本地模拟器。