From ef17fec647eb707c7734d79b6571979a136017e8 Mon Sep 17 00:00:00 2001 From: mukaiu Date: Fri, 16 Nov 2018 14:04:04 +0800 Subject: [PATCH] =?UTF-8?q?#153=20=E6=94=AF=E6=8C=81qlist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/apps/im/chatbot/index.html | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) 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 43cb0703..22824d85 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 @@ -268,6 +268,10 @@ background-color: #e6f2ff; cursor: default; } + + .msg-list{ + color: #4598ee + } @@ -557,9 +561,32 @@ } function createQList(message,data){ + var element = $('

' + message + '

') + var list = element.find('.button-box'); for (let i = 0; i < data.length; i++) { - + var item = data[i]; + var allowClick = true; + var btn = $('
'(i + 1) + '.' + item.label + '
'); + var regClick = function (key) { + btn.click(function () { + if (allowClick) { + allowClick = false; + socket.emit('message', { + appid: "${appid!''}", + userid: "${userid!''}", + type: "message", + session: "${sessionid!''}", + orgi: "${orgi!''}", + message: key + }); + } + }); + } + regClick(item.text); + list.append(btn); } + + return element; } function createCard(message,data){