栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

springboot+layui 整合百度富文本编辑器ueditor入门使用教程(踩过的坑)

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

springboot+layui 整合百度富文本编辑器ueditor入门使用教程(踩过的坑)

 优质资源分享 
学习路线指引(点击解锁)知识定位人群定位
李 Python实战微信订餐小程序 李进阶级本课程是python flask+微信小程序的完美结合,从项目搭建到腾讯云部署上线,打造一个全栈订餐系统。
Python量化交易实战入门级手把手带你打造一个易扩展、更安全、效率更高的量化交易系统
springboot+layui 整合百度富文本编辑器ueditor入门使用教程(踩过的坑)

写在前面:

​ 富文本编辑器,Multi-function Text Editor, 简称 MTE, 是一种可内嵌于浏览器,所见即所得的文本编辑器。

​ UEditor 是由百度「FEX前端研发团队」开发的所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点,开源基于 MIT协议,允许自由使用和修改代码。

效果如图:

01 首先去官网下载ueditor包

官方网址:http://fex.baidu.com/ueditor/#start-start(下载jsp版本就可以)

02 解压

你会看到这样的界面:

​ dialogs:弹出对话框对应的资源和JS文件
​ lang:编辑器国际化显示的文件
​ themes:样式图片和样式文件
​ php/jsp/.net:涉及到服务器端操作的后台文件,根据你选择的不同后台版本,这里也会不同,这里我们选择jsp
​ third-party:第三方插件(包括代码高亮,源码编辑等组件)
​ index.html:源码文件,用于演示完整的界面
​ ueditor.all.js:开发版代码合并的结果,目录下所有文件的打包文件
​ ueditor.all.min.js:ueditor.all.js文件的压缩版,建议在正式部署时采用
​ ueditor.config.js:编辑器的配置文件,建议和编辑器实例化页面置于同一目录
​ ueditor.parse.js:编辑的内容显示页面引用,会自动加载表格、列表、代码高亮等样式
​ ueditor.all.min.js:ueditor.parse.js文件的压缩版,建议在内容展示页正式部署时采用

03 写个小demo测试一下(layui) 第一步、把解压后的文件夹整个放到springboot项目中的static目录下

第二步、放入示例代码

testLayui_Ueditor.html

html>


    layui ueditortitle>
    <meta charset="utf-8">
    
    <script src="https://www.layuicdn.com/layui-v2.5.5/layui.js">script>
    <style>
 .box {
 width: 60%;
 margin: 60px auto;
 }
 style>
head>
<body>

<form  action="">
    
        <label >标题label>
        
            <input type="text" name="title" >
        div>
    div>
    
        <label >内容label>
        
            <textarea id="container" name="content">textarea>
        div>
    div>
    
        
            <button  lay-submit lay-filter="formDemo">立即提交button>
            <button type="reset" >重置button>
        div>
    div>
form>


<script type="text/javascript" src="../../../../../static/UEditor/ueditor.config.js">script>

<script type="text/javascript" src="../../../../../static/UEditor/ueditor.all.js">script>
<script type="text/javascript" src="../../../../../static/UEditor/lang/zh-cn/zh-cn.js">script>
<script>
 layui.use('form', function(){
 var form = layui.form;
 // 实例化编辑器
 var ue = UE.getEditor('container');
 // var content = ue.getContent();
 // console.log(content)
 //监听提交
 form.on('submit(formDemo)', function(data){
 console.log(data.field)
 return false;
 });
 });
script>
body>
html>

</pre> 
<p>几个注意的点:</p> 
<blockquote> 
 <ol><li>注意引入正确的layui.css和layui.js</li><li>引入ueditor需要的js文件,注意引入顺序必须为 .config 在前,之后 .all,其他的js文件可以引也可以不引,不引入也会自动调用到,主要是config和all,要按先后顺序引入!</li><li>实例化编辑器:</li></ol> 
 <p>var ue = UE.getEditor(‘container’); //此处放的是id</p> 
</blockquote> 
小结 
<p>这个文件直接使用浏览器打开就是可以看到如下图的效果的。</p> 
<p>但是注意,这里引入js文件的路径为完整的路径</p> 
<p></p> 
04 整合到springboot项目中 
<p>基本步骤和上述静态整合类似,只不过上面的只需要打开静态html页面就可以看到效果了,而下面我们要做的是把ueditor整合到整个项目里,也就是说要在项目运行之后,加载页面。</p> 
第一步 还是把整个解压缩的文件放到static目录下 
第二步 整合html页 
<ol><li>首先引入js文件</li></ol> 
<p>这里有个坑需要注意!</p> 
<blockquote> 
 <p>因为Springboot默认的静态资源路径为static,我们不需要再添加/static/前缀,所以需要使用正确的方式来引用,否则就会导致404的问题。</p> 
 <p>也就是说如果我们的路径中多写了static,使用相对路径来获取js文件,可能会找不到。</p> 
 <p>例如:…/static/UEditor/ueditor.all.js</p> 
</blockquote> 
<ul><li>推荐使用thymeleaf方式(从static的下一个目录开始写相对路径!)</li></ul> 
<pre class="brush:java;toolbar:false"><html xmlns:th="http://www.thymeleaf.org" >
<script type="text/javascript" th:src="@{/UEditor/ueditor.config.js}">script>
<script type="text/javascript" th:src="@{/UEditor/ueditor.all.js}">script>

</pre> 
<ol start="2"><li>然后把ueditor放在你需要放的地方(一般是textarea)</li></ol> 
<p>例如:</p> 
<pre class="brush:java;toolbar:false">
    <textarea id='container' name='text' >textarea>
div>

</pre> 
<ol start="3"><li>实例化</li></ol> 
<pre class="brush:java;toolbar:false">
 if(document.getElementById('container')!=null){
 var ue = UE.getEditor('container');
 }
 ue.ready(function() {
 ue.setHeight(400);
 var html = ue.getContent();
 console.log("正文部分:"+html)
 })


</pre> 
最关键的一步 
<blockquote> 
 <p>!!!!!!</p> 
</blockquote> 
<p>注意看</p> 
<p>如果按上面的步骤跑了一遍,会发现还是会失败,因为静态加载和运行项目之后的加载,ueditor的运行状态是不一样的,下面我介绍一下ueditor大概是怎么跑起来的。</p> 
<p>首先 当我们静态加载这个插件的时候,会发现路径大概是这个样子的:也就是我们可以看到localhost开始一直后面跟的是项目的完整路径!</p> 
<p>[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-oXFbkOiY-1654922957652)(springboot+layui 整合百度富文本编辑器ueditor使用教程(踩过的坑)/image-20220610232118981.png)]</p> 
<p>那么这个插件我们只引入了两个js文件,那其他的文件是怎么运行的呢?</p> 
<p>我们可以打开其中的 config.js 文件一探究竟!</p> 
<p></p> 
<p>所以我们不难发现,这个插件大概是这么运行的:</p> 
<ol><li>加载两个引入的js文件,通过js文件获取其他文件的访问路径,例如jsp文件夹、css文件等等。</li><li>通过路径访问加载其他文件,完成整个插件的部署配置!</li></ol> 
<p>下面我们打开jsp文件夹看看:</p> 
<p></p> 
<p></p> 
<p></p> 
<p>虽然我没太看懂这些是啥,但是我大概可以猜到,这个文件可能和我们上面分析的调用其他资源有关系</p> 
<p>下面我们来验证一下这个猜想,我们还是用静态的方式先看一下:</p> 
<p>F12打开调试可以看到</p> 
<p></p> 
<p>所以我们大致可以确定,其他文件需要通过这个jsp文件完成调度。</p> 
<hr /> 
<p>好了,讲完了上面的过程,下面我们分析一下,静态的和动态的有什么区别,也就是项目跑没跑到底为什么会影响ueditor的加载呢?</p> 
<p>其实道理很简单,问题就出在访问的路径上!</p> 
<p>静态的方式,访问路径是固定的本地路径,所以不存在配置问题,但是当你项目跑起来了,比如springboot项目是存在项目的路径的,而这个项目的路径,如果你不去告诉ueditor,它是不清楚在哪里的,所以也就没办法去用jsp调用其他资源了!</p> 
<p>下面两张图告诉你区别:可以看到同样的 jsp?,但是前面是不一样的,这也就导致了如果不去配置前面的路径,ueditor的其他资源必然是找不到的!</p> 
<ol><li>静态页面</li></ol> 
<p>​ http://localhost:63342/science/static/UEditor/jsp/controller.jsp?action=config&&noCache=1654874890533</p> 
<ol start="2"><li>项目跑起来之后的访问路径</li></ol> 
<p>​ http://169.254.208.81:8008/UEditor/jsp/controller.jsp?action=config&&noCache=1654875217963</p> 
<p></p> 
<blockquote> 
 <p>ueditor为我们提供了一种很方便的方式来配置这个路径,只需要在你引用了插件的html文件的最开头加上这样一句话:</p> 
</blockquote> 
<pre class="brush:java;toolbar:false">"text/javascript">
 window.UEDITOR_HOME_URL = "http://169.254.208.81:8008/UEditor/";


</pre> 
<p>之后再次运行项目可以看到ueditor正常显示!好了,分享完毕,希望对大家有帮助!</p></div>
</div>
<div style="clear: both;"></div>
<div class="author-info fl">
<div><span class="gray">转载请注明:</span>文章转载自 <a href="https://www.mshxw.com/" class="blue">www.mshxw.com</a></div>
<div><span class="gray">本文地址:</span><a href="https://www.mshxw.com/it/967248.html" class="blue">https://www.mshxw.com/it/967248.html</a></div>
</div>
<div class="prev fl">
<p>   <a style='text-align:left;' class='center-block text-center glyphicon glyphicon-collapse-down' href="https://www.mshxw.com/it/967281.html">上一篇  Day643.IoC和AOP是扩展的核心 -Java业务开发常见错误</a>
 </p>
<p>   <a style='text-align:left;' class='center-block text-center glyphicon glyphicon-collapse-down' href="https://www.mshxw.com/it/967203.html">下一篇  Selenium报错ERR</a>
  </p>
</div>
<div class="new_tag fl">
</div>
</div>
<div class="new_r fr" style="border-radius:10px;">
<div class="tui fl">
<h3>Java相关栏目本月热门文章</h3>
<ul>
  <li><span>1</span><a href="https://www.mshxw.com/it/1041277.html" title="【Linux驱动开发】设备树详解(二)设备树语法详解">【Linux驱动开发】设备树详解(二)设备树语法详解</a></li>
  <li><span>2</span><a href="https://www.mshxw.com/it/1041273.html" title="别跟客户扯细节">别跟客户扯细节</a></li>
  <li><span>3</span><a href="https://www.mshxw.com/it/1041266.html" title="Springboot+RabbitMQ+ACK机制(生产方确认(全局、局部)、消费方确认)、知识盲区">Springboot+RabbitMQ+ACK机制(生产方确认(全局、局部)、消费方确认)、知识盲区</a></li>
  <li><span>4</span><a href="https://www.mshxw.com/it/1041261.html" title="【Java】对象处理流(ObjectOutputStream和ObjectInputStream)">【Java】对象处理流(ObjectOutputStream和ObjectInputStream)</a></li>
  <li><span>5</span><a href="https://www.mshxw.com/it/1041256.html" title="【分页】常见两种SpringBoot项目中分页技巧">【分页】常见两种SpringBoot项目中分页技巧</a></li>
  <li><span>6</span><a href="https://www.mshxw.com/it/1041299.html" title="一文带你搞懂OAuth2.0">一文带你搞懂OAuth2.0</a></li>
  <li><span>7</span><a href="https://www.mshxw.com/it/1041297.html" title="我要写整个中文互联网界最牛逼的JVM系列教程 | 「JVM与Java体系架构」章节:虚拟机与Java虚拟机介绍">我要写整个中文互联网界最牛逼的JVM系列教程 | 「JVM与Java体系架构」章节:虚拟机与Java虚拟机介绍</a></li>
  <li><span>8</span><a href="https://www.mshxw.com/it/1041296.html" title="【Spring Cloud】新闻头条微服务项目:FreeMarker模板引擎实现文章静态页面生成">【Spring Cloud】新闻头条微服务项目:FreeMarker模板引擎实现文章静态页面生成</a></li>
  <li><span>9</span><a href="https://www.mshxw.com/it/1041294.html" title="JavaSE - 封装、static成员和内部类">JavaSE - 封装、static成员和内部类</a></li>
  <li><span>10</span><a href="https://www.mshxw.com/it/1041291.html" title="树莓派mjpg-streamer实现监控及拍照功能调试">树莓派mjpg-streamer实现监控及拍照功能调试</a></li>
  <li><span>11</span><a href="https://www.mshxw.com/it/1041289.html" title="用c++写一个蓝屏代码">用c++写一个蓝屏代码</a></li>
  <li><span>12</span><a href="https://www.mshxw.com/it/1041285.html" title="从JDK8源码中看ArrayList和LinkedList的区别">从JDK8源码中看ArrayList和LinkedList的区别</a></li>
  <li><span>13</span><a href="https://www.mshxw.com/it/1041281.html" title="idea 1、报错java: 找不到符号 符号: 变量 log 2、转换成Maven项目">idea 1、报错java: 找不到符号 符号: 变量 log 2、转换成Maven项目</a></li>
  <li><span>14</span><a href="https://www.mshxw.com/it/1041282.html" title="在openwrt使用C语言增加ubus接口(包含C uci操作)">在openwrt使用C语言增加ubus接口(包含C uci操作)</a></li>
  <li><span>15</span><a href="https://www.mshxw.com/it/1041278.html" title="Spring 解决循环依赖">Spring 解决循环依赖</a></li>
  <li><span>16</span><a href="https://www.mshxw.com/it/1041275.html" title="SpringMVC——基于MVC架构的Spring框架">SpringMVC——基于MVC架构的Spring框架</a></li>
  <li><span>17</span><a href="https://www.mshxw.com/it/1041272.html" title="Andy‘s First Dictionary C++ STL set应用">Andy‘s First Dictionary C++ STL set应用</a></li>
  <li><span>18</span><a href="https://www.mshxw.com/it/1041271.html" title="动态内存管理">动态内存管理</a></li>
  <li><span>19</span><a href="https://www.mshxw.com/it/1041270.html" title="我的创作纪念日">我的创作纪念日</a></li>
  <li><span>20</span><a href="https://www.mshxw.com/it/1041269.html" title="Docker自定义镜像-Dockerfile">Docker自定义镜像-Dockerfile</a></li>
</ul>
</div>
</div>
</div>
<!-- 公共尾部 -->
<div class="link main">
<div class="link_tit">
<span class="on">热门相关搜索</span>
</div>
<div class="link_tab">
<div class="link_con">
<a href="http://www.mshxw.com/TAG_1/luyouqishezhi.html">路由器设置</a>
<a href="http://www.mshxw.com/TAG_1/mutuopan.html">木托盘</a>
<a href="http://www.mshxw.com/TAG_1/baotamianban.html">宝塔面板</a>
<a href="http://www.mshxw.com/TAG_1/shaoerpython.html">儿童python教程</a>
<a href="http://www.mshxw.com/TAG_1/xinqingdiluo.html">心情低落</a>
<a href="http://www.mshxw.com/TAG_1/pengyouquan.html">朋友圈</a>
<a href="http://www.mshxw.com/TAG_1/vim.html">vim</a>
<a href="http://www.mshxw.com/TAG_1/shuangyiliuxueke.html">双一流学科</a>
<a href="http://www.mshxw.com/TAG_1/zhuanshengben.html">专升本</a>
<a href="http://www.mshxw.com/TAG_1/wodexuexiao.html">我的学校</a>
<a href="http://www.mshxw.com/TAG_1/rijixuexiao.html">日记学校</a>
<a href="http://www.mshxw.com/TAG_1/xidianpeixunxuexiao.html">西点培训学校</a>
<a href="http://www.mshxw.com/TAG_1/qixiuxuexiao.html">汽修学校</a>
<a href="http://www.mshxw.com/TAG_1/qingshu.html">情书</a>
<a href="http://www.mshxw.com/TAG_1/huazhuangxuexiao.html">化妆学校</a>
<a href="http://www.mshxw.com/TAG_1/tagouwuxiao.html">塔沟武校</a>
<a href="http://www.mshxw.com/TAG_1/yixingmuban.html">异形模板</a>
<a href="http://www.mshxw.com/TAG_1/xinandaxuepaiming.html">西南大学排名</a>
<a href="http://www.mshxw.com/TAG_1/zuijingpirenshengduanju.html">最精辟人生短句</a>
<a href="http://www.mshxw.com/TAG_1/6bujiaonizhuihuibeipian.html">6步教你追回被骗的钱</a>
<a href="http://www.mshxw.com/TAG_1/nanchangdaxue985.html">南昌大学排名</a>
<a href="http://www.mshxw.com/TAG_1/qingchaoshierdi.html">清朝十二帝</a>
<a href="http://www.mshxw.com/TAG_1/beijingyinshuaxueyuanpaiming.html">北京印刷学院排名</a>
<a href="http://www.mshxw.com/TAG_1/beifanggongyedaxuepaiming.html">北方工业大学排名</a>
<a href="http://www.mshxw.com/TAG_1/beijinghangkonghangtiandaxuepaiming.html">北京航空航天大学排名</a>
<a href="http://www.mshxw.com/TAG_1/shoudoujingjimaoyidaxuepaiming.html">首都经济贸易大学排名</a>
<a href="http://www.mshxw.com/TAG_1/zhongguochuanmeidaxuepaiming.html">中国传媒大学排名</a>
<a href="http://www.mshxw.com/TAG_1/shoudoushifandaxuepaiming.html">首都师范大学排名</a>
<a href="http://www.mshxw.com/TAG_1/zhongguodezhidaxue(beijing)paiming.html">中国地质大学(北京)排名</a>
<a href="http://www.mshxw.com/TAG_1/beijingxinxikejidaxuepaiming.html">北京信息科技大学排名</a>
<a href="http://www.mshxw.com/TAG_1/zhongyangminzudaxuepaiming.html">中央民族大学排名</a>
<a href="http://www.mshxw.com/TAG_1/beijingwudaoxueyuanpaiming.html">北京舞蹈学院排名</a>
<a href="http://www.mshxw.com/TAG_1/beijingdianyingxueyuanpaiming.html">北京电影学院排名</a>
<a href="http://www.mshxw.com/TAG_1/zhongguohuquxueyuanpaiming.html">中国戏曲学院排名</a>
<a href="http://www.mshxw.com/TAG_1/hebeizhengfazhiyexueyuanpaiming.html">河北政法职业学院排名</a>
<a href="http://www.mshxw.com/TAG_1/hebeijingmaodaxuepaiming.html">河北经贸大学排名</a>
<a href="http://www.mshxw.com/TAG_1/tianjinzhongdeyingyongjishudaxuepaiming.html">天津中德应用技术大学排名</a>
<a href="http://www.mshxw.com/TAG_1/tianjinyixuegaodengzhuankexuejiaopaiming.html">天津医学高等专科学校排名</a>
<a href="http://www.mshxw.com/TAG_1/tianjinmeishuxueyuanpaiming.html">天津美术学院排名</a>
<a href="http://www.mshxw.com/TAG_1/tianjinyinlexueyuanpaiming.html">天津音乐学院排名</a>
<a href="http://www.mshxw.com/TAG_1/tianjingongyedaxuepaiming.html">天津工业大学排名</a>
<a href="http://www.mshxw.com/TAG_1/beijinggongyedaxuegengdanxueyuanpaiming.html">北京工业大学耿丹学院排名</a>
<a href="http://www.mshxw.com/TAG_1/beijingjingchaxueyuanpaiming.html">北京警察学院排名</a>
<a href="http://www.mshxw.com/TAG_1/tianjinkejidaxuepaiming.html">天津科技大学排名</a>
<a href="http://www.mshxw.com/TAG_1/beijingyoudiandaxue(hongfujiaoou)paiming.html">北京邮电大学(宏福校区)排名</a>
<a href="http://www.mshxw.com/TAG_1/beijingwanglaozhiyexueyuanpaiming.html">北京网络职业学院排名</a>
<a href="http://www.mshxw.com/TAG_1/beijingdaxueyixuebupaiming.html">北京大学医学部排名</a>
<a href="http://www.mshxw.com/TAG_1/hebeikejidaxuepaiming.html">河北科技大学排名</a>
<a href="http://www.mshxw.com/TAG_1/hebeidezhidaxuepaiming.html">河北地质大学排名</a>
<a href="http://www.mshxw.com/TAG_1/hebeitiyoxueyuanpaiming.html">河北体育学院排名</a>
</div>
</div>
</div>
<div class="footer">
<div class="dl_con">
<div class="width1200">
<dl>
<dt>学习工具</dt>
<dd><a href="https://www.mshxw.com/tools/algebra/" title="代数计算器">代数计算器</a></dd>
<dd><a href="https://www.mshxw.com/tools/trigonometry/" title="三角函数计算器">三角函数</a></dd>
<dd><a href="https://www.mshxw.com/tools/analytical/" title="解析几何">解析几何</a></dd>
<dd><a href="https://www.mshxw.com/tools/solidgeometry/" title="立体几何">立体几何</a></dd>
</dl>
<dl>
<dt>知识解答</dt>
<dd><a href="https://www.mshxw.com/ask/1033/"  title="教育知识">教育知识</a></dd>
<dd><a href="https://www.mshxw.com/ask/1180/"  title="百科知识">百科知识</a></dd>
<dd><a href="https://www.mshxw.com/ask/1155/"  title="生活知识">生活知识</a></dd>
<dd><a class="https://www.mshxw.com/ask/1199/"  title="常识知识">常识知识</a></dd>
</dl>
<dl>
<dt>写作必备</dt>
<dd><a href="https://www.mshxw.com/zuowen/1128/" title="作文大全">作文大全</a></dd>
<dd><a href="https://www.mshxw.com/zuowen/1130/" title="作文素材">作文素材</a></dd>
<dd><a href="https://www.mshxw.com/zuowen/1132/" title="句子大全">句子大全</a></dd>

<dd><a href="https://www.mshxw.com/zuowen/1154/" title="实用范文">实用范文</a></dd>
</dl>
<dl class="mr0">
<dt>关于我们</dt>
<dd><a href="https://www.mshxw.com/about/index.html" title="关于我们" rel="nofollow">关于我们</a></dd>
<dd><a href="https://www.mshxw.com/about/contact.html" title="联系我们" rel="nofollow">联系我们</a></dd>
<dd><a href="https://www.mshxw.com/sitemap/" title="网站地图">网站地图</a></dd>
</dl>
<div class="dl_ewm">
<div class="wx"> <img src="https://www.mshxw.com/skin/sinaskin//kaotop/picture/gzh.jpg" alt="交流群">
<p>名师互学网交流群</p>
</div>
<div class="wx"><img src="https://www.mshxw.com/skin/sinaskin//kaotop/picture/weixin.jpg" alt="名师互学网客服">
<p>名师互学网客服</p>
</div>
</div>
</div>
</div>
<div class="copyright">
<p>名师互学网 版权所有 (c)2021-2022      ICP备案号:<a href="https://beian.miit.gov.cn" rel="nofollow">晋ICP备2021003244-6号</a>
 </p>
</div>
</div>
<!-- 手机端 -->
<div class="m_foot_top">
<img src="https://www.mshxw.com/foot.gif" width="192" height="27" alt="我们一直用心在做"><br/>
<a href="https://www.mshxw.com/about/index.html">关于我们</a>
<a href="https://www.mshxw.com/archiver/">文章归档</a>
<a href="https://www.mshxw.com/sitemap">网站地图</a>
<a href="https://www.mshxw.com/about/contact.html">联系我们</a>
<p>版权所有 (c)2021-2022 MSHXW.COM</p>
<p>ICP备案号:<a href="https://beian.miit.gov.cn/" rel="nofollow">晋ICP备2021003244-6号</a></p>
</div>
<div class="to_top" style="display:none;"><img src="https://www.mshxw.com/skin/sinaskin//kaotop/picture/to_top.png"></div>
<!--广告!-->
<script type="text/javascript" src="https://www.mshxw.com/skin/sinaskin//kaotop/js/top.js"></script>
<script src="https://www.mshxw.com/skin/sinaskin//kaotop/js/fixed.js" type="text/javascript"></script>
<!--头条搜索!-->
<script>
(function(){
var el = document.createElement("script");
el.src = "https://lf1-cdn-tos.bytegoofy.com/goofy/ttzz/push.js?018f42187355ee18d1bfcee0487fc91a76ac6319beb05b7dc943033ed22c446d3d72cd14f8a76432df3935ab77ec54f830517b3cb210f7fd334f50ccb772134a";
el.id = "ttzz";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(el, s);
})(window)
</script>
<!--头条搜索结束!-->
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?e05fec1c87ee5ca07f1ce57d093866c4";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
</div>
</div>
<script type="text/javascript">
$(".alert_kf").click(function() {
      mantis.requestChat();
 });
</script>
<script type="text/javascript">
var mySwiper_weixin = new Swiper('.pc_swiper_weixin', {
autoplay: 3000, //可选选项,自动滑动
loop: true,
speed: 1000,
pagination: '.swiper-pagination',
paginationClickable: true,
})
</script>
<script type="text/javascript">
$(function() {
$(window).scroll(function() {
if ($(window).scrollTop() > 100) {
$(".to_top").fadeIn(1000);
} else {
$(".to_top").fadeOut(1000);
}
});
$(".to_top").click(function() {
if ($('html').scrollTop()) {
$('html').animate({
scrollTop: 0
}, 300);
return false;
}
$('body').animate({
scrollTop: 0
}, 300);
return false;
});
});
</script>
</body>
</html>