chore: 重写初始提交(清空历史,整理后全量提交)
@@ -0,0 +1,263 @@
|
||||
/*
|
||||
*@Name: 微新闻
|
||||
*@Author: xzw
|
||||
*@Copyright:layui.com
|
||||
*/
|
||||
|
||||
|
||||
#micronews-carouse{height: 300px; text-align: center;}
|
||||
#micronews-carouse>*[carousel-item] > *
|
||||
,#micronews-carouse .layui-carousel{background: none;}
|
||||
#micronews-carouse .layui-carousel img{ max-width: 100%;
|
||||
height: 300px;}
|
||||
|
||||
|
||||
.micronews .layui-fixbar li {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
margin-bottom: 1px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
font-size: 30px;
|
||||
background: #6294b5;
|
||||
color: rgb(255, 255, 255);
|
||||
opacity: 0.95;
|
||||
border-radius: 2px;}
|
||||
.micronews .layui-laypage .layui-laypage-curr .layui-laypage-em{background: #6394b5;}
|
||||
.micronews .layui-laypage-prev:hover ,.micronews .layui-laypage-next:hover{color: #6394b5;}
|
||||
.micronews .w1000{max-width: 1000px; margin:0 auto;}
|
||||
.micronews .layui-carousel>[carousel-item]>* {height: auto;}
|
||||
.micronews .layui-carousel-ind{margin-top: -20px;top: auto;bottom: 10px;}
|
||||
html, body{height: 100%;}
|
||||
/*header*/
|
||||
.micronews-header-wrap{border-bottom: 1px solid #6395b8; background: #fff;}
|
||||
.micronews-header{line-height: 70px; height: 70px; position: relative; font-size: 16px;}
|
||||
.micronews-header .logo,.micronews-header .nav,.micronews-header .search-bar,.micronews-header .search-bar button,.micronews-header .search-bar input{float: left;}
|
||||
.micronews-header .search-bar input{background: #f6f6f8;}
|
||||
.micronews-header .logo{width: 100px; text-align: center;}
|
||||
.micronews-header .nav{padding: 0 10px;}
|
||||
.micronews-header .nav a{display: inline-block; height: 70px; font-size: 16px; color: #222; padding:0 22px; float: left;}
|
||||
.micronews-header .nav a.active{background: #6294b5; color: #fff;}
|
||||
.micronews-header .nav a.active:hover{color:#fff;}
|
||||
.micronews-header .nav a:hover{color: #6294b5;}
|
||||
.micronews-header .search-bar{width: 280px; height: 38px; margin: 17px 0 0 20px; font-size: 14px;}
|
||||
.micronews-header .search-bar .layui-form-item{margin-bottom: 0;}
|
||||
.micronews-header .search-bar .layui-input-block{margin-left: 0; height: 38px;}
|
||||
.micronews-header .search-bar input{width: 229px; border:1px solid #e9eaec; border-right: none; border-radius: 2px 0px 0px 2px;}
|
||||
.micronews-header .search-bar button{width: 50px; background: #6294b5; padding:0; border-radius: 0 2px 2px 0px;}
|
||||
.micronews-header .login img{height: 100%;}
|
||||
.micronews-header .login{ position: absolute; right: 0; top: 0px; }
|
||||
.micronews-header .login a{color: #6294b5; display: inline-block; padding:0 10px;}
|
||||
.micronews-header .menu-icon{display: none;}
|
||||
.micronews-header .mobile-nav{display: none;}
|
||||
/*end-header*/
|
||||
|
||||
|
||||
/*baner*/
|
||||
.micronews .micronews-banner{margin: 40px auto 0 auto;}
|
||||
.micronews-banner .title{position: absolute; left: 20px; bottom: 14px; color: #fff; font-size: 22px; font-weight: 100;}
|
||||
/*end-baner*/
|
||||
|
||||
|
||||
/*content*/
|
||||
.micronews-container{padding: 30px 0 100px 0;}
|
||||
.micronews-container .layui-flow-more{margin:50px 0;}
|
||||
.micronews-container .layui-fluid{padding:0;}
|
||||
.micronews-container .main{padding-right: 50px;}
|
||||
.micronews-container .item{overflow:hidden; padding:20px 0; border-bottom: 1px solid #eaeaea;}
|
||||
.micronews-container .item img{float: left; margin-right: 30px;}
|
||||
.micronews-container .item h4{font-size: 20px; color: #222222; font-weight: bold; line-height: 32px; margin-bottom: 14px;}
|
||||
.micronews-container .b-txt .label{display:inline-block; padding: 0 4px; height:18px; line-height: 18px; background: #6294b5; font-size: 12px; cursor: pointer; color: #fff; border-radius: 2px; margin-right: 30px;}
|
||||
.micronews-container .b-txt .message{margin-right: 20px;}
|
||||
.micronews-container .b-txt .icon{color:#d2d6da; position: relative; top: 2px; cursor: pointer;}
|
||||
|
||||
|
||||
|
||||
.micronews-container .popular-info{background: #f5f6f7; border-top: 2px solid #6294b5; padding-bottom: 25px;}
|
||||
.micronews-container .popular-info .list{padding:16px 0;}
|
||||
.micronews-container .popular-info .list-item{position: relative;}
|
||||
.micronews-container .popular-info .list-item i.layui-badge-dot{margin:0 8px;}
|
||||
.micronews-container .layui-card{background: none; box-shadow:none;}
|
||||
.micronews-container .layui-card-body{padding:0 15px;}
|
||||
.micronews-container .layui-card-header{line-height: 50px; height: 50px;}
|
||||
.micronews-container .popular-info h3{line-height: 50px; font-size: 16px; color: #6294b5;}
|
||||
.micronews-container .popular-info .list:last-child{border-bottom: 0;}
|
||||
.micronews-container .popular-info .list{border-bottom: 1px solid #eaeaea; list-style-position: inside; list-style-type: decimal}
|
||||
.micronews-container .popular-info .list a{padding-right: 5px; padding-left: 10px;}
|
||||
.micronews-container .popular-info-tog i{display: block ;width: 4px; height: 4px; border-radius: 50%; color: #ceced0; position: absolute; top: 0; background: #cdcdcf; top: 26px; left: 8px;}
|
||||
.micronews-container .popular-info-tog .list{list-style-type: disc;}
|
||||
.micronews-container .popular-info-tog .list a{padding:0;}
|
||||
.micronews-container .popular-info-tog a{ margin-right:0; padding-right: 0; }
|
||||
.micronews-container .popular-info .heat-icon{display:inline-block; width: 12px; height: 16px; background: url(../img/heat.png) no-repeat center center; position: relative; top: 3px;}
|
||||
/*end-content*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*footer*/
|
||||
.micronews-footer-wrap{border-top: 2px solid #6294b5; color: #777777;}
|
||||
.micronews-footer{padding:36px 0 44px 0; position: relative;}
|
||||
.micronews-footer .ft-nav{margin-bottom: 24px;}
|
||||
.micronews-footer .ft-nav a{margin-right: 40px; color: #777777;}
|
||||
.micronews-footer .f-icon{position: absolute; right: 0; top: 46px;}
|
||||
.micronews-footer .w-icon{margin-right: 40px;}
|
||||
/*end-footer*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*micronews-details-container*/
|
||||
.micronews-details-container{padding:60px 0;}
|
||||
.micronews-details-container .main{margin-bottom: 50px;}
|
||||
|
||||
.micronews-details-container .b-txt{padding:10px 0; line-height: 35px;}
|
||||
.micronews-details-container .b-txt .icon{margin-right: 26px; color: }
|
||||
.micronews-details-container .b-txt .icon b{color: #ec414d;}
|
||||
.micronews-details-container .title{border-bottom: 1px solid #eaeaea;}
|
||||
.micronews-details-container .title h3{font-size: 24px;}
|
||||
.micronews-details-container .article{color: #555; padding: 10px 0 32px 0;}
|
||||
.micronews-details-container .article p{line-height: 30px;}
|
||||
.micronews-details-container .article p.mt30{margin-bottom: 30px;}
|
||||
.micronews-details-container .article .img-box{text-align: center; padding:12px; cursor: pointer;}
|
||||
.micronews-details-container .article .share-title{height: 30px; line-height: 30px;}
|
||||
.micronews-details-container .article .share-title .txt{position: relative; top: -4px; margin-right: 5px;}
|
||||
.micronews-details-container .article .share-title .icon{font-size: 26px; margin-right: 6px;}
|
||||
.micronews-details-container .article .share-title .icon.layui-icon-login-wechat{color: #3ab032;}
|
||||
.micronews-details-container .article .share-title .layui-icon-login-weibo{color: #f16420;}
|
||||
.micronews-details-container .article .share-title .layui-icon-login-qq{color: #04aed9;}
|
||||
.micronews-details-container .article .layui-btn{width: 96px; padding:0; height: 28px; line-height: 26px; background: #ec414d; border:1px solid #ec414d; margin-left: 37px; position: relative; top: -5px;}
|
||||
.micronews-details-container .article .layui-btn.active{background: #fff; color: #ec414d;}
|
||||
.micronews-details-container .article .layui-btn span{margin-left: 10px;}
|
||||
.micronews-details-container .leave-message .tit-box{line-height: 40px;}
|
||||
.micronews-details-container .leave-message .tit{font-size: 16px; margin-right: 28px;}
|
||||
.micronews-details-container .leave-message .tit-box .num{color: #b5b9bd;}
|
||||
.micronews-details-container .leave-message .tit-box b{color: #ec414d;}
|
||||
.micronews-details-container .leave-message .tear-box img{float: left;}
|
||||
.micronews-details-container .leave-message .tear-box form{padding-left: 50px; margin:10px 0;}
|
||||
.micronews-details-container .content-box .layui-form .layui-form-item{clear:none; margin-bottom: 0;}
|
||||
.micronews-details-container .content-box .layui-form .layui-btn{width: 90px; height: 30px; line-height: 30px; background: #6294b5; position: relative; z-index: 10; border-radius: 0}
|
||||
.micronews-details-container .content-box .layui-form .layui-textarea{border-radius: 0}
|
||||
.micronews-details-container .content-box .layui-form .message-text{position: absolute; height: 100%; width: 100%; padding:0 90px 0 0px; text-align: left; box-sizing: border-box; line-height: 30px;}
|
||||
.micronews-details-container .content-box .layui-form .message-text .txt{padding-left: 10px; border:1px solid #e6e6e6; height:100%; box-sizing: border-box; border-top:0; border-right: 0; color: #ec414d;}
|
||||
.micronews-details-container .content-box .layui-form .layui-input-block{margin-left: 0; min-height: 30px;}
|
||||
.micronews-details-container .content-box .ulCommentList{margin-bottom: 30px;}
|
||||
.micronews-details-container .content-box .ulCommentList .item-cont{padding-left: 50px;}
|
||||
.micronews-details-container .content-box .ulCommentList .cont{padding:10px 20px; background: #f5f6f7; word-wrap:break-word;}
|
||||
.micronews-details-container .liCont{padding:30px 0 0 0; border-bottom: 0;}
|
||||
.micronews-details-container .liCont img{float: left; width: 28px; height: 28px;}
|
||||
.micronews-details-container .cont .name{margin-right: 15px;}
|
||||
.micronews-details-container .cont .time{color: #6d6d6d; font-size: 12px;}
|
||||
.micronews-details-container .cont p{line-height: 26px;}
|
||||
.micronews-details-container .cont .text{color: #555;}
|
||||
/*end-micronews-details-container*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*micronews-list-container*/
|
||||
.micronews-list-container{padding-top: 16px;}
|
||||
.micronews-list-container h3{font-size: 16px; line-height: 50px; padding-left: 12px; font-weight: bold;}
|
||||
/*end-micronews-list-container*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*micronews-search-container*/
|
||||
.micronews-search-container p.num{color: #888888;}
|
||||
.micronews-search-container p.num span{color: #ec414d;}
|
||||
.micronews-search-container .item{border-bottom: 0; padding:30px 0;}
|
||||
.micronews-search-container .time{font-size: 14px; color: #868686; padding-left: 20px;}
|
||||
.micronews-search-container .item p{line-height: 30px; font-size: 16px;}
|
||||
/*end-micronews-search-container*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*micronews-login-container*/
|
||||
.micronews-login{width: 100%;min-height: 100%; background: url(../img/loadbg.jpg) no-repeat; background-size: cover;}
|
||||
.micronews-login-container .layui-form-item{margin:20px 0 0 0 ;}
|
||||
.micronews-login-container .agreement{margin-top: 0px;}
|
||||
.micronews-login-container .agreement a{color: #5980c5;}
|
||||
.micronews-login-container .wrap{ padding: 20px 40px; background: #fff; box-shadow: 1px 1px 10px 1px #ccc; box-sizing: border-box;}
|
||||
.micronews-login-container .wrap form{margin-bottom: 20px;}
|
||||
.micronews-login-container .form-box{margin:0 auto;width: 380px;padding-top: 20px;}
|
||||
.micronews-login-container .form-box h3{line-height: 60px;font-size: 28px; color: #5a94b9; text-align: center;}
|
||||
.micronews-login-container .layui-input-block{margin-left: 0; position: relative;}
|
||||
.micronews-login-container .layui-input-block span.txt{position: relative; top: 1px;}
|
||||
.micronews-login-container .agreement .layui-input-block{line-height: 36px;}
|
||||
.micronews-login-container .agreement .layui-unselect{margin:0;}
|
||||
.micronews-login-container .agreement .layui-unselect span{padding-right: 0;}
|
||||
.micronews-login-container .layui-input-block img{height: 36px; position: absolute; right: 1px; top: 1px; cursor: pointer;}
|
||||
.micronews-login-container .obtain{position: absolute; background: #eeeeee; right: 1px; top: 1px; height: 36px; color: #454545;}
|
||||
.micronews-login-container button{width: 100%; background: #6294b5;}
|
||||
.micronews-login-container .other-login{text-align: center;}
|
||||
.micronews-login-container .other-login a{margin:0 20px;}
|
||||
/*end-micronews-login-container*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*micronews-persInfo-content*/
|
||||
.micronews-persInfo-wrap{background: #f5f6f8;}
|
||||
.micronews-persInfo-content{padding:26px 0 90px 0;}
|
||||
.micronews-persInfo-content .main{margin:0 0 0 30px; padding-right: 0; background: #fff;}
|
||||
.micronews-persInfo-content .ulCommentList{padding:0 30px;}
|
||||
.micronews-persInfo-content .item{border-bottom: 0; padding:0;}
|
||||
.micronews-persInfo-content .item h4 {margin-bottom: 0}
|
||||
.micronews-persInfo-content .liCont{padding:30px 0; border-bottom: 1px solid #eaeaea;}
|
||||
.micronews-persInfo-content .liCont:last-child{border-bottom: 0;}
|
||||
.leave-message{min-height: 900px;}
|
||||
.micronews-persInfo-content .content-box{padding-bottom: 30px; display: none;}
|
||||
.micronews-persInfo-content .popular-info{background: #fff; border:0; padding: 60px 0 150px 0; text-align: center;}
|
||||
.micronews-persInfo-content .layui-card-header{height: auto; line-height: auto; border:0;}
|
||||
.micronews-persInfo-content .tab {margin-top: 30px; padding:0 60px;}
|
||||
.micronews-persInfo-content .tab li{ line-height: 40px; font-size: 16px; color: #666666; margin-bottom: 16px; cursor: pointer;}
|
||||
.micronews-persInfo-content .tab li.layui-this{border-bottom: 1px solid #6295b4; color: #6295b4;}
|
||||
/*end-micronews-persInfo-content*/
|
||||
|
||||
|
||||
/*中屏幕*/
|
||||
@media screen and (max-width: 1024px){
|
||||
.micronews-header{height: 60px; line-height: 60px;}
|
||||
.micronews-header .search-bar,.micronews-header .nav{display: none;}
|
||||
.micronews-header .logo{position: absolute; left: 50%; margin-left: -50px;}
|
||||
.micronews-banner .title{display: none;}
|
||||
.micronews-container .layui-fluid{padding:0 15px;}
|
||||
.micronews-footer{text-align: center;}
|
||||
|
||||
.micronews-footer .f-icon{position: static; margin-top: 20px;}
|
||||
.micronews-header .menu-icon{display: block; height: 100%; width:60px; cursor: pointer; text-align: center;}
|
||||
.micronews-header .menu-icon i{font-size: 26px; color: #6294b5;}
|
||||
.micronews-header .mobile-nav{display: none; position: absolute; top: 60px; left: 0; width: 100%; z-index: 100;}
|
||||
.micronews-header .mobile-nav li{display: block;}
|
||||
.micronews-header .mobile-nav .layui-nav{background: #fff; padding:0;}
|
||||
.micronews-header .mobile-nav .layui-nav a{color: #6294b5;}
|
||||
.micronews-header .mobile-nav .layui-nav .layui-this:after,.micronews-header .mobile-nav .layui-nav-bar{background: #6294b5; height: 3px;}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*小屏幕*/
|
||||
@media screen and (max-width: 768px){
|
||||
.micronews-container .main{padding-right: 0;}
|
||||
.micronews-details-container .article .img-box img{width: 100%;}
|
||||
.micronews-container .item img{float: none; margin:0 0 15px 0;}
|
||||
.micronews-container .item h4{font-size: 16px; line-height: 24px;}
|
||||
.micronews-footer .ft-nav a{display: block; margin:15px 0;}
|
||||
.micronews-login-container .form-box{padding:0 10px; width: auto; overflow-x: hidden;}
|
||||
.micronews-login-container .form-box form{width: 100%;}
|
||||
.micronews-login-container .form-box h3{line-height: 70px; font-size: 24px;}
|
||||
.micronews-persInfo-content .popular-info{padding:60px 0; margin-bottom: 20px;}
|
||||
.micronews-container .main{margin-left: 0;}
|
||||
#micronews-carouse{height: 150px;}
|
||||
#micronews-carouse img{height: 150px;}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 9.7 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1,214 @@
|
||||
/*
|
||||
*@Name: 微新闻
|
||||
*@Author: xzw
|
||||
*@Copyright:layui.com
|
||||
*/
|
||||
layui.define(['carousel','jquery','element','flow','laytpl','element','laypage','form','util'],function(exports){
|
||||
var carousel = layui.carousel,$ = layui.$,flow = layui.flow,laytpl = layui.laytpl,element = layui.element,laypage = layui.laypage,form = layui.form,
|
||||
util = layui.util;
|
||||
|
||||
|
||||
|
||||
|
||||
// 模拟首页数据
|
||||
|
||||
var index = {
|
||||
|
||||
|
||||
// 移动端下面导航按钮
|
||||
common:function(){
|
||||
var off = true;
|
||||
$('.menu-icon').on('click',function(){
|
||||
if(off){
|
||||
$('.mobile-nav').addClass('layui-show')
|
||||
}else{
|
||||
$('.mobile-nav').removeClass('layui-show')
|
||||
}
|
||||
off = !off
|
||||
})
|
||||
},
|
||||
|
||||
// 首页轮播
|
||||
banner: function(){
|
||||
//轮播
|
||||
var elemBanner = $('#micronews-carouse'), ins1 = carousel.render({
|
||||
elem: elemBanner
|
||||
,width: '100%'
|
||||
,height: elemBanner.height() + 'px'
|
||||
,arrow: 'none'
|
||||
,interval: 5000
|
||||
});
|
||||
$(window).on('resize', function(){
|
||||
var width = $(this).prop('innerWidth');
|
||||
ins1.reload({
|
||||
height: (width > 768 ? 300 : 150) + 'px'
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 内容的留加载
|
||||
contFlow: function(){
|
||||
flow.load({
|
||||
elem: '#LAY_demo2' //流加载容器
|
||||
,scrollElem: '#LAY_demo2' //滚动条所在元素,一般不用填,此处只是演示需要。
|
||||
,isAuto: false
|
||||
,done: function(page, next){ //加载下一页
|
||||
var lis = [];
|
||||
//以jQuery的Ajax请求为例,请求下一页数据(注意:page是从2开始返回)
|
||||
$.get('/api/list?page='+page, function(res){
|
||||
//假设你的列表返回在data集合中
|
||||
var getTpl = demo.innerHTML
|
||||
|
||||
layui.each(res.data, function(index, item){
|
||||
laytpl(getTpl).render(item, function(html){
|
||||
lis.push(html)
|
||||
});
|
||||
});
|
||||
|
||||
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
|
||||
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
|
||||
next(lis.join(''), page < res.pages);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
,
|
||||
|
||||
// 分页
|
||||
Page:function(ele,count){
|
||||
laypage.render({
|
||||
elem: ele //注意,这里的 ele 是 ID,不用加 # 号
|
||||
,count: count //数据总数,从服务端得到
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 输入留言
|
||||
EnterMessage: function(){
|
||||
$('.micronews-details-Publish').on('click',function(e){
|
||||
var event = e || event;
|
||||
var img = $(this).parents('form').siblings('a').find('img').attr('src');
|
||||
var messagetext = $(this).siblings('.message-text').find('.txt');
|
||||
var textarea = $(this).parents('.layui-form-item').siblings('.layui-form-text').children('.layui-input-block').children('textarea');
|
||||
if(!textarea.val()){
|
||||
messagetext.text('请输入留言')
|
||||
return;
|
||||
}
|
||||
var name = $(textarea).val();
|
||||
var view = $('.ulCommentList')
|
||||
var html = messageTpl.innerHTML;
|
||||
var data = {
|
||||
avatar : img,
|
||||
name : '我是锦鲤',
|
||||
cont : name,
|
||||
}
|
||||
$('.message-text .txt').text('')
|
||||
laytpl(html).render(data, function(html){
|
||||
view.prepend(html)
|
||||
});
|
||||
textarea.val("")
|
||||
return false;
|
||||
})
|
||||
},
|
||||
onInput: function(){
|
||||
// if (!("oninput" in document.body)) {
|
||||
// element.onpropertychange = function() {
|
||||
// if (event.propertyName == "value")
|
||||
// this.oninput && this.oninput(event);
|
||||
// }
|
||||
// }
|
||||
$("#onInput").bind("input propertychange",function(event){
|
||||
if(!$(this).val()){
|
||||
$('.message-text .txt').text('')
|
||||
return;
|
||||
}
|
||||
$('.message-text .txt').text('已经输入'+$(this).val().length+'字')
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
,
|
||||
//超出多少文件就省略号
|
||||
omitted: function(ele,num){
|
||||
$(ele).each(function() {
|
||||
var str = $(this).html();
|
||||
var subStr = str.substring(0, num);
|
||||
$(this).html(subStr + (str.length > num ? '...' : ''));
|
||||
});
|
||||
},
|
||||
|
||||
//搜索跳转的页面
|
||||
seachBtn: function(){
|
||||
$('.search-btn').on('click',function(){
|
||||
var inpVal = $(this).siblings('input').val();
|
||||
if(inpVal){
|
||||
window.location.href="search.html"
|
||||
};
|
||||
return false;
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
//获取验证码事件
|
||||
login: function(){
|
||||
var data = {
|
||||
status:true
|
||||
}
|
||||
$("#veriCodeBtn").click(function() {
|
||||
if(!/^1\d{10}$/.test($("#phone").val())){
|
||||
layer.msg("请输入正确的手机号");
|
||||
return false;
|
||||
}
|
||||
if(!$("#imgCode").val()){
|
||||
layer.msg("请输入验证码");
|
||||
return false;
|
||||
}
|
||||
var obj=this;
|
||||
if(data.status){
|
||||
$(obj).addClass(" layui-btn-disabled");
|
||||
$(obj).attr('disabled',"true");
|
||||
settime(obj);
|
||||
}
|
||||
})
|
||||
var countdown=60;
|
||||
function settime(obj) {
|
||||
if (countdown == 0) {
|
||||
obj.removeAttribute("disabled");
|
||||
obj.classList.remove("layui-btn-disabled")
|
||||
obj.value="获取验证码";
|
||||
countdown = 60;
|
||||
return;
|
||||
} else {
|
||||
|
||||
obj.value="重新发送(" + countdown + ")";
|
||||
countdown--;
|
||||
}
|
||||
setTimeout(function() { settime(obj) } ,1000)
|
||||
}
|
||||
form.on('submit(*)', function(data){
|
||||
window.location.href = 'index.html'
|
||||
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
|
||||
})
|
||||
}
|
||||
|
||||
// 右侧小箭头
|
||||
,arrowutil: function(){
|
||||
//固定 bar
|
||||
util.fixbar({
|
||||
click: function(type){
|
||||
if(type === 'bar1'){
|
||||
//
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
index.common()
|
||||
exports('index',index)
|
||||
});
|
||||