CINXE.COM
一支好镜头的诞生需要走过5个阶段--机器视觉网
<!DOCTYPE html> <!--[if lt IE 7]><html class="ie ie6 lt8 lt9 lt10"><![endif]--> <!--[if IE 7]><html class="ie ie7 lt8 lt9 lt10"><![endif]--> <!--[if IE 8]><html class="ie ie8 lt9 lt10"><![endif]--> <!--[if IE 9]><html class="ie ie9 lt10"><![endif]--> <!--[if (gt IE 9) | !(IE)]><!--> <html> <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="author" content="机器视觉网" /> <meta name="keywords" content="工业镜头,机器视觉,茉丽特,光学设计,机械设计" /> <meta name="description" content="今天的文章里,我们要从光学设计阶段开始,跟大家展示一下一支镜头的诞生过程。相信看完后大家会明白,镜头这个配件,并非想象的那么简单。--机器视觉网(www.china-vision.org)是机器视觉领域颇具影响和实力的门户网站,其利用行业资源的优势,为从事机器视觉,图像处理技术等领域的科技人员,采购人员提供一个最新最快的信息平台。" /> <meta name="renderer" content="webkit" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1" name="viewport" /> <meta content="email=no" name="format-detection"> <meta content="telephone=no" name="format-detection"> <meta name="baidu-site-verification" content="codeva-qgoWdOCvxm" /> <title>一支好镜头的诞生需要走过5个阶段--机器视觉网</title> <link rel="shortcut icon" href="/images/favicon.png" type="image/x-icon" /> <script>if (/*@cc_on!@*/false && document.documentMode === 10) document.documentElement.className += ' ie10';</script> <script>if (/*@cc_on!@*/false && document.documentMode === 11) document.documentElement.className += ' ie11';</script> <script>var controller = 'cases';</script> <!-- 添加IE10+Class --> <link href="/css/animate.css" rel="stylesheet" /> <link rel="stylesheet" href="/css/layui.css"> <link rel="stylesheet" href="/css/common.css"> <link rel="stylesheet" href="/js/swiper3/swiper.min.css"> <link type="text/css" rel="stylesheet" href="/css/public.css" /> <link type="text/css" rel="stylesheet" href="/css/news.css" /> <!--[if lt IE 9]> <script src="/js/html5.js"></script> <script src="/js/respond.src.js"></script> <![endif]--> <!--公用文件 END--> <script type="text/javascript" src="/js/jquery.js"></script> <script type="text/javascript" src="/js/layui.js"></script> </head> <body> <!--[if lt IE 9]> <p class="browserupgrade">您在使用 <strong></strong> 标准浏览本网站。请 <a href="http://browsehappy.com/" target="_blank">升级Internet Explorer浏览器</a> 来更好的体验本网站.</p> <![endif]--> <div class="wrapper fnt-16"> <!--page-header Begin--> <header class="page-header"> <div class="page-top cf"> <div class="page-wrap u-df u-ai-c u-fw u-jc-sb"> <div class="page-welcome fl">欢迎光临机器视觉网</div> <div class="page-rt"> <div class="page-login fr fnt-14"> <a href="/reg.html">免费注册</a><a href="/login.html">用户登录</a> </div> <div class="page-search fr fnt-14"> <form action="/search.html" method="get"> <div class="page-inp cf"><input name="keyword" class="fnt-14" placeholder="请输入关键词" type="text"></div> <div class="page-btn"><input name="" value="" class="fnt-14" type="submit"></div> </form> </div> </div> </div> </div> <div class="page-center"> <div class="page-wrap cf"> <div class="page-logo fl"><a href="/"><img src="/images/logo.jpg?v=222" title="机器视觉网" /></a></div> <div class="page-nav fr"> <!--pc 导航部分 Begin--> <nav class="nav phone_hide fnt-18 cf"> <ul class="fixed tac"><!--选中 样式 on,加到li上面--> <li> <a href="/">首页<em></em></a> </li> <li> <a href="/news.html">新闻<em></em></a> <div class="navlist"> <div class="page-wrap u-df u-fw u-jc-sb"> <ul class="cf wid01 fnt-20"> <li><a href="/news/14.html">企业动态</a></li> <li><a href="/news/2066.html">行业热点</a></li> <li><a href="/news/16.html">宏观报道</a></li> </ul> <div class="page-img"> <div class="bg_container bg_cover"><img src="/images/upload/page-header-navimg01.jpg" /></div> </div> </div> </div> </li> <li class="on"> <a href="/cases.html">案例<em></em></a> <div class="navlist"> <div class="page-wrap u-df u-fw u-jc-sb"> <ul class="cf wid02 fnt-20"> <li><a href="/cases/index/cate_id/128.html">镜头</a></li> <li><a href="/cases/index/cate_id/130.html">相机</a></li> <li><a href="/cases/index/cate_id/2129.html">传感器</a></li> <li><a href="/cases/index/cate_id/131.html">采集卡</a></li> <li><a href="/cases/index/cate_id/133.html">光源</a></li> <li><a href="/cases/index/cate_id/137.html">传输及线材</a></li> <li><a href="/cases/index/cate_id/780.html">系统产品</a></li> <li><a href="/cases/index/cate_id/135.html">智能设备</a></li> <li><a href="/cases/index/cate_id/134.html">解决方案</a></li> <li><a href="/cases/index/cate_id/2130.html">软件算法及深度学习</a></li> <li><a href="/cases/index/cate_id/2131.html">集成及工业计算机</a></li> <li><a href="/cases/index/cate_id/2132.html">机器人及机械臂</a></li> <li><a href="/cases/index/cate_id/2159.html">3D产品</a></li> <li><a href="/cases/index/cate_id/2158.html">行业综述</a></li> <li><a href="/cases/index/cate_id/23.html">其他</a></li> </ul> <div class="page-img"> <div class="bg_container bg_cover"><img src="/images/upload/page-header-navimg02.jpg" /></div> </div> </div> </div> </li> <li><a href="/product.html">产品<em></em></a></li> <li><a href="/interview.html">专访<em></em></a></li> <li><a href="/supply.html">供求<em></em></a></li> <li> <a href="/train.html">培训<em></em></a> <div class="navlist"> <div class="page-wrap u-df u-fw u-jc-sb"> <ul class="cf wid03 fnt-20"> <li><a href="/train-engineering.html">视觉工程师认证课程</a></li> <li><a href="/train-teachers.html">师资团队</a></li> <li><a href="/train-info.html">培训资讯</a></li> </ul> <div class="page-img"> <div class="bg_container bg_cover"><img src="/images/upload/page-header-navimg03.jpg" /></div> </div> </div> </div> </li> <li><a href="/download.html">下载<em></em></a></li> <li><a href="/paper.html">论文<em></em></a></li> <li><a href="/recruit.html">招聘<em></em></a></li> <li><a href="/book.html">书刊<em></em></a></li> <li><a href="/report.html">报告<em></em></a></li> <li><a href="/standard.html">标准<em></em></a></li> <li><a href="http://www.visionchinashow.net/" target="_blank">展会<em></em></a></li> <li> <a href="/member.html">会员<em></em></a> <div class="navlist"> <div class="page-wrap u-df u-fw u-jc-sb"> <ul class="cf wid04 fnt-20"> <li><a href="/member-introduction.html">联盟简介</a></li> <li><a href="/member-constitution.html">联盟章程</a></li> <li><a href="/member-upgrade-vip.html">联盟架构</a></li> <li><a href="/member-director.html">联盟理事</a></li> <li><a href="/member-membership-application.html">入会申请</a></li> <li><a href="/member-services.html">会员服务</a></li> <li><a href="/member-online-survey.html">在线调查</a></li> <li><a href="/member-party-building.html">联盟党建</a></li> <li><a href="/member-activities.html">联盟活动</a></li> <li><a href="/member-announcement.html">会员公告</a></li> <li><a href="/member-enterprises.html">会员企业</a></li> <li><a href="/member-video.html">在线视频</a></li> </ul> <div class="page-img"> <div class="bg_container bg_cover"><img src="/images/upload/page-header-navimg04.jpg" /></div> </div> </div> </div> </li> </ul> </nav> <!--pc 导航部分 End--> <!--手机端 导航部分 Begin--> <div class="nav_phone_btn page-nav-open"><span>Menu</span></div> <div class="nav_phone"> <div class="nav_phone_tit center"> <span class="fnt-30">导航</span> <div class="button"></div> </div> <div class="nav_phone_con cf"> <div class="phone-search cf"><form action="/search.html" method="get"><input name="keyword" class="fnt-24" placeholder="请输入关键词" type="text"><input type="submit" class="but fnt-16" value=""></form></div> <ul class="fnt-24"> <li><a href="/">首页</a></li> <li><a href="javascript:void(0);">新闻<div class="btn"><em></em></div></a> <ul> <li><a href="javascript:void(0);">返回</a></li> <li><a href="/news/14.html">企业动态</a></li> <li><a href="/news/2066.html">行业热点</a></li> <li><a href="/news/16.html">宏观报道</a></li> </ul> </li> <li><a href="javascript:void(0);">案例<div class="btn"><em></em></div></a> <ul> <li><a href="javascript:void(0);">返回</a></li> <li><a href="/cases/index/cate_id/128.html">镜头</a></li> <li><a href="/cases/index/cate_id/130.html">相机</a></li> <li><a href="/cases/index/cate_id/2129.html">传感器</a></li> <li><a href="/cases/index/cate_id/131.html">采集卡</a></li> <li><a href="/cases/index/cate_id/133.html">光源</a></li> <li><a href="/cases/index/cate_id/137.html">传输及线材</a></li> <li><a href="/cases/index/cate_id/780.html">系统产品</a></li> <li><a href="/cases/index/cate_id/135.html">智能设备</a></li> <li><a href="/cases/index/cate_id/134.html">解决方案</a></li> <li><a href="/cases/index/cate_id/2130.html">软件算法及深度学习</a></li> <li><a href="/cases/index/cate_id/2131.html">集成及工业计算机</a></li> <li><a href="/cases/index/cate_id/2132.html">机器人及机械臂</a></li> <li><a href="/cases/index/cate_id/2159.html">3D产品</a></li> <li><a href="/cases/index/cate_id/2158.html">行业综述</a></li> <li><a href="/cases/index/cate_id/23.html">其他</a></li> </ul> </li> <li><a href="/product.html">产品</a></li> <li><a href="/interview.html">专访</a></li> <li><a href="/supply.html">供求</a></li> <li><a href="javascript:void(0);">培训<div class="btn"><em></em></div></a> <ul> <li><a href="javascript:void(0);">返回</a></li> <li><a href="/train-engineering.html">视觉工程师认证课程</a></li> <li><a href="/train-teachers.html">师资团队</a></li> <li><a href="/train-info.html">培训资讯</a></li> </ul> </li> <li><a href="/download.html">下载</a></li> <li><a href="/paper.html">论文</a></li> <li><a href="/recruit.html">招聘</a></li> <li><a href="/book.html">书刊</a></li> <li><a href="/report.html">报告</a></li> <li><a href="/standard.html">标准</a></li> <li><a href="http://www.visionchinashow.net/">展会</a></li> <li><a href="javascript:void(0);">会员<div class="btn"><em></em></div></a> <ul> <li><a href="javascript:void(0);">返回</a></li> <li><a href="/member-introduction.html">联盟简介</a></li> <li><a href="/member-constitution.html">联盟章程</a></li> <li><a href="/member-upgrade-vip.html">联盟架构</a></li> <li><a href="/member-director.html">联盟理事</a></li> <li><a href="/member-membership-application.html">入会申请</a></li> <li><a href="/member-services.html">会员服务</a></li> <li><a href="/member-online-survey.html">在线调查</a></li> <li><a href="/member-party-building.html">联盟党建</a></li> <li><a href="/member-activities.html">联盟活动</a></li> <li><a href="/member-announcement.html">会员公告</a></li> <li><a href="/member-enterprises.html">会员企业</a></li> <li><a href="/member-video.html">在线视频</a></li> </ul> </li> </ul> </div> </div> <div class="phone-nav-bg"></div> <!--手机端 导航部分 End--> </div> </div> </div> </header> <!--page-header End--> <!--page-main Begin--> <section class="page-main cf"> <div class="page-current"> <div class="page-wrap"> <a href="/">首页</a><i class="song">></i><a href="/cases.html">案例</a><i class="song">></i><a href="/cases/index/cate_id/128.html">镜头</a><i class="song">></i><span>正文</span> </div> </div> <div class="page-wrap cf"> <div class="page-content-wrap cf"> <!--page-aside-detail-lf Begin--> <div class="page-aside-detail-lf cf"> <div class="page-time tac"> <div class="page-title tac"><span>日期</span></div> <dl> <dt class="fnt-26">08/02</dt><dd class="fnt-18">2024</dd> </dl> </div> <div class="page-share tac"> <div class="page-title tac"><span>咨询</span></div> <ul class="cf"> <li class="li01"> <div class="page-ico"><span></span></div> <div class="page-code-tc"> <p class="fnt-12">QQ扫一扫</p> <img src="/images/upload/ft-codeimg03.jpg" /> </div> </li> <li class="li02"> <div class="page-ico"><span></span></div> <!--<div class="bshare-custom icon-medium cf"> <div class="bsPromo bsPromo1"></div> <a title="分享到微信" class="bshare-weixin" href="javascript:void(0);"></a> </div> <script type="text/javascript" charset="utf-8" src="https://static.bshare.cn/b/buttonLite.js#style=-1&uuid=&pophcol=2&lang=zh"></script> <script type="text/javascript" charset="utf-8" src="https://static.bshare.cn/b/bshareC0.js"></script>--> <div class="page-code-tc"> <p class="fnt-12">Vision小助手<br />(CMVU)</p> <img src="/images/upload/ft-codeimg01.jpg" /> <!--<p class="fnt-12">机器视觉产业<br>联盟二维码</p> <img src="/images/upload/ft-codeimg02.jpg" />--> </div> </li> </ul> </div> </div> <!--page-aside-detail-lf End--> <div class="ns-detail-wrap fl"> <div class="page-title f-b fnt-30">一支好镜头的诞生需要走过5个阶段<div class="page-star fnt-16" rel="collect" data-id="224464">收藏</div></div> <div class="page-sub"><span>2024-08-02 15:57:47</span><span>来源: 中国机器视觉网</span></div> <div class="page-content"> <p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px;"><span style="font-size: 16px;">在机器视觉中,镜头作为一个获取图像的重要部分,却常常没有受到应有的重视。有些人认为,镜头不过是几个镜片和金属件的组合,并不值得投入太多的预算跟考虑。今天的文章里,我们要从光学设计阶段开始,跟大家展示一下一支镜头的诞生过程。相信看完后大家会明白,镜头这个配件,并非想象的那么简单。</span></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px;"><strong><span style="font-size: 16px;">光学设计阶段</span></strong></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px;"><span style="font-size: 16px;">在该阶段,根据客户的需求,计算出需要什么形状的镜片(曲率,厚度,材料等等)以及各个镜片之间的间距,为镜头的结构定了型。这个阶段涉及到大量的计算来进行不断反复的优化,使得光学系统的成像不断提高(MTF,畸变等光学性能)。另外,在此阶段也会做杂散光,鬼影,热点等相关的照明分析。通常会用光线追迹软件(ZEMAX,TracePro等)完成这一阶段。如果在指定的照明和相机敏感度的条件下计算成像质量,在试做前即可计算成像缺陷。<br/></span></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px; text-align: center;"><img src="/uploads/ueditor/image/20240802/4ee5b2a84b9b85e9.png" title="微信图片_20240802153432.png" alt="微信图片_20240802153432.png"/></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px;"><strong><span style="font-size: 16px;">机械设计阶段</span></strong></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px;"><span style="font-size: 16px;">在上一阶段的基础上,完善镜头的结构,定义了镜头的最终尺寸。这里同样需要考虑到镜头装配的难易程度,从而为后续提高良率和节省装配成本奠定基础。。<br/></span></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px; text-align: center;"><img src="/uploads/ueditor/image/20240802/95c88ea2034101a5.png" title="微信图片_20240802153441.png" alt="微信图片_20240802153441.png"/></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px;"><strong><span style="font-size: 16px;">镜片生产阶段</span></strong></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px;"><span style="font-size: 16px;">光学镜片的生产是一个耗时而又严谨的过程。从玻璃材料的混合,熔融,胚料的切割,到玻璃胚料的粗磨,精磨(达到厚度,曲率的要求),抛光(达到光圈及不规则光圈的要求)以及芯取(达到偏芯,矢高外径等要求),再到最终的镀膜(达到透过率及透射波长的要求),每一步都会决定最终成像的优劣!<br/></span></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px; text-align: center;"><img src="/uploads/ueditor/image/20240802/270f182af3779f73.png" title="微信图片_20240802153445.png" alt="微信图片_20240802153445.png"/></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px;"><strong><span style="font-size: 16px;">镜头装配阶段</span></strong></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px;"><span style="font-size: 16px;">到齐了所有的来料,就可以进行镜头的生产了。不同种类的镜头,装配的难易程度也自然相差很大。在装配高分辨率,大NA的镜头时,由于光学系统对镜片的偏芯等公差极为敏感,有时需要实时调芯装配的技术,使得一次装配的MTF大大提高。<br/></span></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px; text-align: center;"><img src="/uploads/ueditor/image/20240802/7209a78666a1d3d1.png" title="微信图片_20240802153448.png" alt="微信图片_20240802153448.png"/></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px;"><span style="font-size: 16px;">如果装配变焦镜头,或可变光阑的镜头,装配过程会更加繁琐,这时会涉及到诸如曲槽筒,光阑叶片及作动环等复杂的零件,装配花费的时间也自然更长。<br/></span></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px; text-align: center;"><img src="/uploads/ueditor/image/20240802/f09fb1b57094e796.png" title="微信图片_20240802153452.png" alt="微信图片_20240802153452.png"/></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px;"><strong><span style="font-size: 16px;">镜头检测阶段</span></strong></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px;"><span style="font-size: 16px;">该阶段需要对客户要求的所有参数:如倍率、工作距离、分辨率、畸变、相对照度,包括外观,环境测试等等进行检测,以保证出货的品质。<br/>Moritex开发了自主的镜头检测系统,可以同时检测镜头多个参数。而研发投入的MTF(传递函数)测试仪,则在样品阶段最大程度保证了和设计值对比的真实性。<br/></span></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px; text-align: center;"><img src="/uploads/ueditor/image/20240802/22161e89bb77f58a.png" title="微信图片_20240802153456.png" alt="微信图片_20240802153456.png"/></p><p style="line-height: 1.75em; margin-bottom: 15px; margin-top: 15px;"><span style="font-size: 16px;">综上所述,相信大家也明白了,一支镜头不仅仅是几个金属零件和镜片的结合。</span></p> </div> <div class="page-ft"> <ul> <li class="ellipsis">上一条:<a href="/cases-detail/224369.html" target="_blank" title="3D视觉引导铸铁打磨工作站——推动铸造业高效转型">3D视觉引导铸铁打磨工作站——推动铸造业高效转型</a></li> <li class="ellipsis">下一条:<a href="/cases-detail/224465.html" target="_blank" title="使用线传感器测量车载显示器后盖胶水轮廓">使用线传感器测量车载显示器后盖胶水轮廓</a></li> </ul> <div class="page-back"><a href="/cases.html">返回列表</a></div> </div> </div> <div class="page-aside fr"> <div class="page-title f-b fnt-30">为你推荐</div> <ul class="fnt-18"> <li><a href="/cases-detail/227585.html" class="ellipsis-2" target="_blank" title="前沿案例应用—Micro LED巨量转移">前沿案例应用—Micro LED巨量转移</a></li> <li><a href="/cases-detail/225387.html" class="ellipsis-2" target="_blank" title="基于离轴三反系统的线扫镜头设计">基于离轴三反系统的线扫镜头设计</a></li> <li><a href="/cases-detail/225372.html" class="ellipsis-2" target="_blank" title="工业镜头参数详解">工业镜头参数详解</a></li> <li><a href="/cases-detail/225159.html" class="ellipsis-2" target="_blank" title="什么是超透镜?超透镜的制造及其应用">什么是超透镜?超透镜的制造及其应用</a></li> <li><a href="/cases-detail/225028.html" class="ellipsis-2" target="_blank" title="Computar LC电动镜头对液位自动探测应用">Computar LC电动镜头对液位自动探测应用</a></li> <li><a href="/cases-detail/224913.html" class="ellipsis-2" target="_blank" title="机器视觉中常用的液态镜头基础总结">机器视觉中常用的液态镜头基础总结</a></li> </ul> <div class="page-more tac"><a href="/cases.html"><span>查看更多案例</span></a></div> </div> </div> </div> </section> <!--page-main End--> <!--page-footer Begin--> <footer class="page-footer fnt-14"> <div class="page-wrap u-df u-jc-sb u-ai-c u-fw"> <div class="page-lf flex-1"> <div class="ft-nav"> <ul> <li><a href="/">网站首页</a>|</li> <li><a href="/about.html">关于我们</a>|</li> <li><a href="/contact.html">联系我们</a>|</li> <li><a href="javascript:void(0);" onClick="SetHome(this,window.location);">设为首页</a></li> </ul> </div> <div class="page-ft-copy"> 地址:北京海淀区中关村南街四紫金数码园910房间 | <span>邮编:100190</span><br> Copyright © 2013 - 2021 www.china-vision.org All Rights Reserved Design by bygw.net </div> <div class="page-share"> <ul> <li> <a href="javascript:void(0);"><img src="/images/page-share-ico01.png" /><br>公众号</a> <div class="page-code wid20"> <dl class="cf"> <dd> <img src="/images/upload/ft-codeimg01.jpg" /> <p>Vision<br>机器视觉展</p> </dd> <dd> <img src="/images/upload/ft-codeimg02.jpg" /> <p>机器视觉产业联盟(CMVU)</p> </dd> </dl> </div> </li> <li> <a href="javascript:void(0);"><img src="/images/page-share-ico02.png" /><br>QQ</a> <div class="page-code"> <dl class="cf"> <dd> <img src="/images/upload/ft-codeimg04.jpg" /> <p>机器视觉产业联盟(CMVU)</p> </dd> </dl> </div> </li> </ul> </div> </div> <div class="page-ft-tel fnt-18"> <p class="phone_hide"><a href="javascript:void(0);" title="yxj@china-image.cn"><img src="/images/ft-tel-ico01.png" />010-62650592</a></p> <p class="phone_show"><a href="tel:010-62650592" target="_blank" title="yxj@china-image.cn"><img src="/images/ft-tel-ico01.png" />010-62650592</a></p> <p><a href="mailto:visionchina@china-image.cn" target="_blank" title="visionchina@china-image.cn"><img src="/images/ft-email01.png" />visionchina@china-image.cn</a></p> <p class="fnt-14">机器视觉网 <a href="http://beian.miit.gov.cn/" target="_blank" title="京ICP备16034613号-1">京ICP备16034613号-1</a></p> </div> </div> </footer> <!--page-login-tc Begin--> <div class="page-login-tc" style="display: none"> <div class="page-login-wrap u-df u-ai-c u-jc-c"> <div class="page-login-con"> <div class="page-tips fnt-14">* 请登录会员后进行操作</div> <div class="page-title fnt-24 tac">会员登录</div> <form class="layui-form" action=""> <div class="layui-form-item u-df u-ai-c u-fw"> <label class="layui-form-label">用户名</label> <div class="layui-input-block page-inp fnt-14 flex-1"> <input type="text" name="username" lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input"> </div> </div> <div class="layui-form-item u-df u-ai-c u-fw"> <label class="layui-form-label">密码</label> <div class="layui-input-block flex-1 page-inp fnt-14"> <input type="password" name="password" lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input"> </div> </div> <div class="tar layui-word-aux fnt-14"><a href="/forget.html">忘记密码?</a></div> <div class="layui-form-item"> <div class="layui-input-block tac"> <button type="submit" class="layui-btn" lay-submit="" lay-filter="login" callback_url="">登录</button> </div> </div> <div class="page-reg tac fnt-14"><a href="/reg.html">新用户注册账号</a></div> </form> <div class="page-btn-close page-close"></div> </div> </div> </div> <script> $(document).on('click','.page-login-tc .page-close',function(){ $(".page-login-tc").hide(); }) $('[rel="public-login"]').bind('click', function(){ var _this = $(this); $.ajax({ url: "/index/api/is_login", type: 'post', dataType: 'json', data: {}, success: function (res) { if (res.code == 100) { $(".page-login-tc").show(); $('[lay-filter="login"]').attr('callback_url', _this.attr('url')) } else { document.location.href = _this.attr('url'); } } }) }) layui.use(['form'], function(){ var form = layui.form ,layer = layui.layer form.on('submit(login)', function(data){ $.ajax({ url: "/index/api/login", type: 'post', dataType: 'json', data: data.field, success: function (res) { if (res.code == 200) { if($('[lay-filter="login"]').attr('callback_url') != ''){ document.location.href = $('[lay-filter="login"]').attr('callback_url'); } else { document.location.reload(); } } else { return layer.msg(res.msg); } } }) return false; }); }); </script> <!--page-login-tc End--> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?94cfb210596d6796b2c9ce168d0aa2a5"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <!--page-footer End--> </div> <script type="text/javascript" src="/js/base.js"></script> <script src="/js/wow.min2.js"></script> <script type="text/javascript" src="/js/public.js"></script> <script type="text/javascript" src="/js/swiper3/swiper.min.js"></script> <script type="text/javascript" src="/js/news.js"></script> <script type="text/javascript" src="/js/by.js?20210912"></script> </body> </html>