2017-10-10 5 views
3

現在、ターゲットアカウントの残高を示すReceiptCardを作成しようとしています。ボットフレームワークエミュレータに表示されたときに、生成されたカードからTaxとTotalフィールドを削除する方法はありますか?Microsoft Bot-Builder用ReceiptCardのカスタマイズ

私はエミュレータ・ウィンドウに今取得してい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; 
} 

結果を生成するための

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") 
     } 
    }; 
} 

方法をReceiptCardsを生成するための方法: 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の下のものを置き換える:Windows上の\ユーザー[あなたのユーザ名] \のAppData \ローカル\ botframework \を - あなたの更新しますローカルエミュレータ。

関連する問題