From 2b8aa8a0def9e239c95dd929736f2ba64849a29a Mon Sep 17 00:00:00 2001 From: mukaiu Date: Fri, 16 Nov 2018 14:59:34 +0800 Subject: [PATCH] =?UTF-8?q?#153=20=E6=94=AF=E6=8C=81=20card=E6=B6=88?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/apps/im/chatbot/index.html | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/contact-center/app/src/main/resources/templates/apps/im/chatbot/index.html b/contact-center/app/src/main/resources/templates/apps/im/chatbot/index.html index 22824d85..f985a02b 100644 --- a/contact-center/app/src/main/resources/templates/apps/im/chatbot/index.html +++ b/contact-center/app/src/main/resources/templates/apps/im/chatbot/index.html @@ -258,7 +258,7 @@ @@ -590,13 +608,21 @@ } function createCard(message,data){ - for (let i = 0; i < data.length; i++) { + let item = data[0]; - } + let html = '

' + item.title + '

' + item.summary + '

' + + var element = $(html); + element.click(function(){ + window.open(item.hyperlink); + }) + + return element; } function showExtmsg(username,createtime,message,json) { var expmsg = JSON.parse(json); + var type = expmsg[0].type; var content; if (type == 'button') {