[Go] GO語言實戰-為部落格園增加gofly線上客服功能
阿新 • • 發佈:2020-08-13
gofly最近準備完善對外的js引用功能,類似很多知名客服系統那樣直接引入js就可以使用,現在只是簡單的實現了下
程式碼在github,可以在頁面上看到, gofly地址在這裡https://gofly.sopans.com/ , 開發和部署方式在github的readme.md
首先要申請js許可權
因為部落格園有引用jquery, 所以就不需要引入了,自己部署好以後,直接把程式碼加入到頁面頁尾程式碼裡就行
<script src="https://cdn.bootcdn.net/ajax/libs/layer/3.1.1/layer.min.js"></script> <link href="https://gofly.sopans.com/static/css/gofly-front.css" rel="stylesheet" type="text/css"/> <div id="launchButton" class="launchButton"> <svg x="0px" y="0px" viewBox="0 0 27 21.9" aria-labelledby="title desc" role="img" class="xhl-launch-button-svg"><title>Chat Icon </title><desc>three small dots to indicate that an agent isavailable to chat</desc><path fill="#ffffff" d="M23.2,0L2.6,1.7C1,1.9,0,3.2,0,4.9v8c0,1.6,0.8,3,2.4,3.1l5.3,0.5c0,0,1,1.6,0.3,3.2C7.2,21.3,6,21.9,6,21.9 c4.2,0,6.6-3.1,7.8-4.9l9.4,0.7c1.8,0.2,3.8-1.3,3.8-3.1V3.1C27,1.3,25-0.1,23.2,0z M6.4,10.1c-0.9,0-1.7-0.7-1.7-1.7 c0-0.9,0.7-1.7,1.7-1.7C7.3,6.8,8,7.5,8,8.5C8,9.4,7.3,10.1,6.4,10.1z M13.2,10.1c-0.9,0-1.7-0.7-1.7-1.7c0-0.9,0.7-1.7,1.7-1.7 c0.9,0,1.7,0.7,1.7,1.7C14.8,9.4,14.1,10.1,13.2,10.1z M19.9,10.1c-0.9,0-1.7-0.7-1.7-1.7c0-0.9,0.7-1.7,1.7-1.7 c0.9,0,1.7,0.7,1.7,1.7C21.6,9.4,20.9,10.1,19.9,10.1z"></path></svg> <div class="launchButtonText"> Chat with us </div> </div> <script> var GOFLY_URL="https://域名"; </script> <script src="https://域名/static/js/gofly-front.js"></script>