2017-10-10 73 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上 - 更新本地模擬器。