diff --git a/fangija-zsyf/css/main.css b/fangija-zsyf/css/main.css index fc7e40c..62a2538 100644 --- a/fangija-zsyf/css/main.css +++ b/fangija-zsyf/css/main.css @@ -7,30 +7,30 @@ ul li{list-style:none;} img{display:block;} a{color:#18a2ff;} em{font-style:normal;} +em.up{color:#ff1100;} +em.down{color:#2cb66a;} .dn{display:none;} .di{display:inline;} -.c3{color:#333;} -.c3{color:#333;} -.c3{color:#333;} -.c6{color:#666;} -.c9{color:#999;font-size:0.75rem} -.content{background:#efeff4;color:#333;z-index:1;} -.popup{background:#fcf9fe;} .content{background:#f3f3f3;color:#333;z-index:1;} +.content.infinite-scroll{background:none;} +.content-padded{margin:0.75rem;} +.content-padded h1{font-size:1rem;} +.content-padded p{text-align:justify;} +.content-padded p span{margin-left:1rem;} .popup{background:#f3f3f3;} /* 标题栏 */ -.page>header.bar{position:static;padding-left:0.75rem;padding-right:0.75rem;} .page > header.bar{position:static;padding-left:0.75rem;padding-right:0.75rem;} .bar:after{height:0;} +.bar .button-nav{color:#999;} .bar .button-nav.pull-left{margin-left:0;} .bar .button-nav.pull-right{margin-right:0;} -.bar .icon.icon-logo{width:70px;height:20px;background-size:100%;float:left;} .bar .icon.icon-logo{width:70px;height:20px;background:url(../images/icon-logo.png) no-repeat;background-size:100%;float:left;} .bar .icon.icon-path{width:20px;height:4px;background:url(../images/icon-path.png) no-repeat;background-size:100%;float:right;} +.bar .icon.icon-path01{width:20px;height:4px;background:url(../images/icon-path01.png) no-repeat;background-size:100%;float:right;} .bar .icon.icon-left{font-size:0.85rem;margin-left:-0.15rem;} -.bar .button-nav{color:#fff;} +.title{color:#333;margin-left:-0.75rem;} /* 子导航 */ .popover { @@ -174,6 +174,18 @@ em{font-style:normal;} .bar-tab .tab-item.active, .bar-tab .tab-item:active{color:#18a2ff;} .bar-tab .tab-item .icon{padding:0;font-size:1.05rem;} +.bar-tab .tab-item .icon.icon-tab01{width:20px;background:url(../images/icon-tab01.png) no-repeat center center;background-size:100%;} +.bar-tab .tab-item .icon.icon-tab02{width:20px;background:url(../images/icon-tab02.png) no-repeat center center;background-size:100%;} +.bar-tab .tab-item .icon.icon-tab03{width:20px;background:url(../images/icon-tab03.png) no-repeat center center;background-size:100%;} +.bar-tab .tab-item .icon.icon-tab04{width:20px;background:url(../images/icon-tab04.png) no-repeat center center;background-size:100%;} +.bar-tab .tab-item .icon.icon-tab05{width:20px;background:url(../images/icon-tab05.png) no-repeat center center;background-size:100%;} + +.bar-tab .tab-item.active .icon.icon-tab01{background:url(../images/icon-tab01-active.png) no-repeat center center;background-size:100%;} +.bar-tab .tab-item.active .icon.icon-tab02{background:url(../images/icon-tab02-active.png) no-repeat center center;background-size:100%;} +.bar-tab .tab-item.active .icon.icon-tab03{background:url(../images/icon-tab03-active.png) no-repeat center center;background-size:100%;} +.bar-tab .tab-item.active .icon.icon-tab04{background:url(../images/icon-tab04-active.png) no-repeat center center;background-size:100%;} +.bar-tab .tab-item.active .icon.icon-tab05{background:url(../images/icon-tab05-active.png) no-repeat center center;background-size:100%;} + .bar-tab .tab-item .icon.icon-around01{width:14px;background:url(../images/icon-around01.png) no-repeat center center;background-size:100%;} .bar-tab .tab-item .icon.icon-around02{width:15px;background:url(../images/icon-around02.png) no-repeat center center;background-size:100%;} .bar-tab .tab-item .icon.icon-around03{width:18px;background:url(../images/icon-around03.png) no-repeat center center;background-size:100%;} @@ -207,19 +219,18 @@ em{font-style:normal;} i.loginIcon01{width:14px;height:26px;background:url(../images/loginIcon01.png) no-repeat center 1px;background-size:100%;display:block;} i.loginIcon02{width:15px;height:25px;background:url(../images/loginIcon02.png) no-repeat center 3px;background-size:100%;display:block;} i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) no-repeat center 3px;background-size:100%;display:block;} -.item-link .item-inner .inpu{width:70px;height:24px;line-height:24px;float:left;margin:0 6px;text-align:center;border:solid 1px #d7d7d7;} -#input_phoneNumber{padding-top:3px;} -#input_phoneNumber,#input_codeImg,#input_codeSms,#input_codeInvite{width:175px;margin-left:-80px;} -.item-link .item-inner label{float:left;text-align:right;padding-left:0;} -.item-link .item-inner label i.loginCode{width:70px;height:25px;background:url(../images/loginCode.png) no-repeat center center;background-size:100%;display:block;margin-top:-2px;} +.item-content .item-inner .inpu{width:70px;height:24px;line-height:24px;float:left;margin:0 6px;text-align:center;border:solid 1px #d7d7d7;} +.item-content .item-inner label i.loginCode{width:70px;height:25px;background:url(../images/loginCode.png) no-repeat center center;background-size:100%;display:block;margin-top:-2px;} .sendCode{padding:0 8px;height:27px;background:#fff;border:solid 1px #2db0fc;border-radius:3px;color:#2db0fc;text-align:center;line-height:26px;font-size:0.7rem;float:right;margin-top:-2px;} .waiting{padding:0 8px;height:27px;background:#0a8ddf;border:solid 1px #0a8ddf;border-radius:3px;color:#fff;text-align:center;line-height:26px;font-size:0.7rem;float:right;margin-top:-2px;} -.agreement{overflow:hidden;margin-left:0.75rem;margin-top:0.75rem;} -.agreement span{float:left;} -.agreement span a{font-size:0.75rem;color:#263238;} -.check{margin-top:2px;margin-right:10px;} -.check a{display:block;width:18px;height:18px;border:solid 1px #a8a8a8;border-radius:4px;position:relative;} +.content-block > p.agreement{font-size:0.75rem;color:#333;} +.content-block > p.agreement a{font-size:0.75rem;} +.check{width:18px;height:18px;border:solid 1px #a8a8a8;border-radius:4px;display:inline-block;vertical-align:middle;position:relative;} .checkImg{width:10px;height:10px;position:absolute;top:3px;left:3px;} +#input_codeImg,#input_codeSms{width:35%;} +#input_feedback{width:100%;height:100px;} +#loginWX_btn{background:#64ac22;} +#loginWX_btn .icon{width:25px;height:25px;background:url(../images/icon-wx.png) no-repeat center center;background-size:100%;margin-right:0.5rem;} /* 首页 */ .totalValue{padding:1rem 0;overflow:hidden;} @@ -232,122 +243,90 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n .totalValue a{color:rgba(255,255,255,0.8);line-height:1.5rem;border:solid 1px rgba(255,255,255,0.8);border-radius:0.2rem;padding:0 0.4rem;float:right;margin-top:1em;} .totalValue a.open-preloader-title01{border:solid 1px rgba(255,255,255,0.8);text-decoration:none;padding:0.1rem 0.3rem;margin-top:0.9rem;} .totalValue a.open-preloader-title01 i{width:8px;height:1.2rem;background:url(../images/arrow_check.png) no-repeat right center;background-size:100%;float:right;margin-left:0.3rem;} -.totalValue img{width:70px;float:right;height:100%;} .totalValue img{width:70px;height:100%;float:right;} .totalValue div.addPropertyBox{width:140px;margin:0 auto;float:none;} -.totalValue div.addPropertyBox .addProperty{width:140px;height:60px;background:rgba(255,255,255,0.2);border:dashed 1px #fff;border-radius:5px;font-size:0.8rem;color:#fff;line-height:60px;text-decoration:none;display:block;float:none;margin-top:1.2rem;} -.totalValue div.addPropertyBox .addProperty i{float:left;width:20px;height:20px;margin-left:1rem;margin-right:0.5rem;} .totalValue div.addPropertyBox .addProperty{width:140px;height:60px;background:rgba(255,255,255,0.2);border:dashed 1px #fff;border-radius:5px;font-size:1em;color:#fff;line-height:60px;text-decoration:none;display:block;float:none;margin-top:1.2rem;} .totalValue div.addPropertyBox .addProperty i{float:left;width:20px;height:20px;margin-left:0.8rem;margin-right:0.5rem;} .totalValue div.addPropertyBox + p{font-size:0.75rem;color:#fff;text-align:center;margin-top:0.85rem;} .totalValue01 div.addPropertyBox .addProperty{background:#fff;} -.totalValue01 div.addPropertyBox .addProperty i{float:left;width:20px;height:20px;margin-left:1rem;margin-right:0.5rem;} .totalValue01 div.addPropertyBox .addProperty i{float:left;width:20px;height:20px;margin-left:0.8rem;margin-right:0.5rem;} .totalValue01 div.addPropertyBox + p{color:#999;} -.indexCard{height:210px;overflow:hidden;margin:0.75rem;margin-bottom:3.5rem;position:relative;} -.indexCard .card{width:48.5%;text-align:center;color:#fff;margin:0;} -.indexCard .card.indexCard01{height:100%;background:#12b6cb;position:absolute;top:0;left:0;} -.indexCard .card.indexCard02{height:47.2%;background:#aa8abc;position:absolute;top:0;right:0;} -.indexCard .card.indexCard03{height:47.2%;background:#f2914a;position:absolute;bottom:0;right:0;} -.indexCard .card-content-inner{padding:1.6rem 1rem;} -.indexCard .card-content-inner p{font-size:0.9rem;line-height:1.5rem;margin:0;} -.icon-index01{width:38%;margin:0 auto;margin-top:1rem;margin-bottom:0.5rem;} -.icon-index02{width:24%;float:left;} -.icon-index03{width:24%;float:left;} /* 块 */ .content-block01{padding:0;} +.content-block > p{color:#999;font-size:0.75rem;} .content-block-title{color:#999;line-height:1.8rem;margin:0.2rem 0;margin-left:0.75rem;} +.content-block-title em{color:#ff1100;font-size:0.7rem;} +.content-block-title .button{width:80px;float:right;margin-top:0.15rem;margin-right:0.75rem;padding:0;} .content-block-title + .list-block, .content-block-title + .content-block, .content-block-title + .card{margin-top:0;} -/* 块 */ /* 列表 */ .list-block{margin:0;} .list-block .item-content{min-height:auto;} .list-block .item-content .item-inner01{background:none;padding-right:0.75rem;} -.list-block .item-title.label{width:auto;color:#666;} -.list-block .item-title.label font{color:#263238;} -.list-block .item-subtitle{color:#666;} -.list-block .item-subtitle small{font-size:0.85em;} +.list-block .list-container .item-title-row:first-child{margin-bottom:0.1rem;} + .list-block .item-title{color:#333;font-size:0.8rem;} .list-block .item-title.label{width:auto;color:#666;font-size:0.8rem;} .list-block .item-title.label font{color:#333;font-size:0.8rem;} .list-block .item-title label{color:#333;font-size:0.8rem;display:inline-block;vertical-align:top;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} -.list-block .item-title small{color:#999;font-size:0.65rem;} -.list-block .item-title span{color:#666;font-size:0.75rem;} -.list-block .item-after{color:#333;font-size:0.8rem;} -.list-block .item-after span{color:#999;font-size:0.75rem;} -.list-block .item-after em{color:#ff1100;font-size:0.8rem;} -.list-block .item-subtitle{color:#666;font-size:0.75rem;} -.list-block .item-subtitle span{display:inline-block;vertical-align:middle;max-width:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#666;font-size:0.75rem;} -.list-block .item-subtitle label{max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} -.list-block .item-subtitle small{color:#999;font-size:0.65rem;} +.list-block .item-title font{font-size:0.8rem;} +.list-block .item-title small{color:#999;font-size:0.7rem;} +.list-block .item-title span{color:#999;font-size:0.7rem;} +.list-block .item-title input{display:inline-block;text-align:center;width:60px;border:solid 1px #e6e6ea;} +.list-block .item-title .button.button-fill{display:inline-block;width:50px;height:24px;line-height:24px;margin-left:0.5rem;vertical-align:2px;} +.list-block .item-title.row{margin-left:0;width:100%;} +.list-block .item-title.row .col-50{margin-left:0;} +.list-block .item-title.row .col-50 p{margin:0;} +.list-block .item-title.row .col-50 p label{color:#999;font-size:0.7rem;vertical-align:middle;} +.list-block .item-title.row .col-50 p span{color:#333;font-size:0.7rem;margin-left:-5px;vertical-align:middle;} +.list-block .item-title.row .col-50 p span.span01{display:inline-block;max-width:160%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} -.clearHistory,.noHistory{color:#666;text-align:center;margin-top:10px;cursor:pointer;} -.content-block01{padding:0;} -.content-block .di a{margin-right:10px;} -.topic + .media-list ul{margin-bottom:0.75rem;} - - - - - -.theme + .media-list ul{margin-bottom:0.5rem;} -.list-block.media-list .item-media{padding-top:0;padding-bottom:0;} -label.label-checkbox i.icon-form-checkbox{margin-right:0.5rem;} -label.label-checkbox i.current{background:url(../images/checkImg.png) no-repeat center center #2db0fc;background-size:0.55rem;border:none;} -label.label-checkbox i.current{background:url(../images/checkImg.png) no-repeat center center #18a2ff;background-size:0.55rem;border:none;} -.item-media i.check{width:24px;height:24px;border-radius:1.1rem;border:solid 1px #c7c7cc;margin:0;} -.item-media i.checked{background:url(../images/checkImg.png) no-repeat center center #18a2ff;border:solid 1px #18a2ff;background-size:0.55rem;} - -.content-block-title{color:#999;line-height:1.8rem;margin:0.2rem 0;margin-left:0.75rem;} -.content-block-title + .list-block, .content-block-title + .content-block, .content-block-title + .card{margin-top:0;} -.list-block.list-block01{margin-top:66px;margin-bottom:76px;} -.list-block.list-block02{margin-bottom:0.5rem;} -.list-block ul:before{transform:scaleY(1);} -.list-block ul:after{transform:scaleY(1);} - -/* 列表 */ -.list-block{margin:0;} -.list-block .item-content{min-height:auto;} -.list-block .item-content .item-inner01{background:none;padding-right:0.75rem;} -.list-block .item-title font{color:#333;font-size:0.8rem;} -.list-block .item-title.label{width:auto;color:#666;font-size:0.8rem;} -.list-block .item-title.label font{color:#263238;font-size:0.8rem;} -.list-block .item-title label{color:#333;font-size:0.8rem;display:inline-block;vertical-align:top;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} -.list-block .item-title small{color:#999;font-size:0.75rem;} -.list-block .item-title span{color:#666;font-size:0.75rem;} .list-block .item-after{color:#333;font-size:0.8rem;} .popup .list-block .item-after{line-height:2.4rem;font-size:0.75rem;} -.list-block .item-after span{color:#999;font-size:0.75rem;} +.list-block .item-after span{color:#999;font-size:0.7rem;} .list-block .item-after em{color:#ff1100;font-size:0.8rem;} -.list-block .item-subtitle{color:#999;font-size:0.75rem;} -.list-block .item-subtitle span{display:inline-block;vertical-align:middle;max-width:80%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#999;font-size:0.75rem;} +.list-block .item-after font{color:#666;font-size:0.7rem;} +.list-block .item-after small{color:#999;font-size:0.8rem;} + +.list-block .item-subtitle{color:#999;font-size:0.7rem;} +.list-block .item-subtitle.row{width:100%;margin-left:0;} +.list-block .item-subtitle.row .col-50{width:50%;margin-left:0;} +.list-block .item-subtitle.row .col-100{margin-left:0;} +.list-block .item-subtitle span{display:inline-block;vertical-align:middle;max-width:80%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#999;font-size:0.7rem;} .list-block .item-subtitle label{max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} .list-block .item-subtitle small{color:#999;font-size:0.65rem;} +.list-block .item-subtitle em.em01{color:#ff1100;} +.list-block .item-subtitle em.em02{color:#333;} +.list-block .item-subtitle em.noData{color:#999;} +.list-block .item-subtitle div{font-size:0.7rem;} +.list-block .item-subtitle div.noData{color:#999;} +.list-block .item-subtitle div em{font-size:0.7rem;text-align:center;} +.list-block .item-subtitle div em strong{font-weight:normal;color:#ff1100;font-size:1.2rem;} +.list-block .item-subtitle div label{display:block;color:#666;font-size:0.7rem;text-align:center;max-width:100%;} +.list-block .item-subtitle div p{margin-bottom:0;} +.list-block .item-subtitle div .button{width:5rem;height:2.1rem;line-height:2rem;margin:0 auto;} +.list-block .item-subtitle div.priceBox01 em{display:block;color:#333;} -.popup .list-block .item-after {line-height: 2.4rem;font-size: 0.75rem;} +.list-block .item-media{padding-top:0;padding-bottom:0;} +.list-block .item-inner .item-media{width:1.2rem;height:1.2rem;float:left;margin-right:0.2rem;} +.list-block .item-inner .item-media img{width:100%;} -.list-block .item-title small.small01{color:#2db0fc;font-size:0.65rem;} -.list-block .item-title small.small02{color:#2db0fc;font-size:0.65rem;} -.list-block .item-title .info02 small.small01{margin-top:0;margin-bottom:0;} -.list-block .item-subtitle small.small01{color:#2db0fc;margin-top:0.3rem;} -.list-block .item-subtitle small.small01:nth-of-type(1){background:#eaf7ff;color:#2db0fc;} -.list-block .item-subtitle small.small01:nth-of-type(2){background:#fff7e7;color:#f5b715;} -.list-block .item-subtitle small.small01:nth-of-type(3){background:#e9f8f0;color:#2cb66a;} -.clearHistory,.noHistory{color:#666;text-align:center;margin-top:10px;cursor:pointer;} +.list-block li.noData{padding:0.75rem;padding-top:1rem;} +.list-block li.noData img{margin:0 auto;} +.list-block li.noData p{color:#999;text-align:center;} +.list-block li.noData p a{text-decoration:underline;} - -.searchHistory{padding:0.75rem;padding-bottom:0.5rem;border-top:solid 1px #e7e7e7;color:#999;font-size:0.75rem;} +.searchHistory{padding:0.75rem;padding-bottom:0.5rem;border-top:solid 1px #e5e5e5;color:#999;font-size:0.75rem;} .icon-near{width:12px;height:16px;background:url(../images/icon-address.png) no-repeat center center;background-size:100%;margin-right:0.3rem;} .icon-history{width:15px;height:15px;background:url(../images/icon-history.png) no-repeat center center;background-size:100%;margin-right:0.3rem;} +.searchHistory a{font-size:0.75rem;float:right;} .clearHistory,.noHistory{color:#666;text-align:center;margin-top:10px;cursor:pointer;} - -.theme + .media-list ul{margin-bottom:0.5rem;} -.list-block.media-list .item-media{padding-top:0;padding-bottom:0;} +.list-block .item-content label.label-checkbox{float:left;padding-left:0;} +.list-block .item-content label.label-checkbox .item-media{width:auto;height:auto;padding:0;margin:0;} label.label-checkbox i.icon-form-checkbox{margin-right:0.5rem;} label.label-checkbox i.current{background:url(../images/checkImg.png) no-repeat center center #18a2ff;background-size:0.55rem;border:none;} .item-media i.check{width:24px;height:24px;border-radius:1.1rem;border:solid 1px #c7c7cc;margin:0;} @@ -355,6 +334,7 @@ label.label-checkbox i.current{background:url(../images/checkImg.png) no-repeat .list-block.list-block01{margin-top:66px;margin-bottom:76px;} .list-block.list-block02{margin-bottom:0.5rem;} +.list-block.mb05{margin-bottom:0.5rem;} .list-block ul:before{transform:scaleY(1);} .list-block ul:after{transform:scaleY(1);} @@ -364,7 +344,8 @@ small.spacing01a{margin-right:3.5px;} label.spacing01{margin-right:26px;} label.spacing02{margin-right:27px;} -.textAlignLeft{width:100%;height:auto;text-align:left;position:absolute;left:105px;} +.textAlignLeft{width:100%;height:auto;text-align:left;position:absolute;left:88px;} +.textAlignLeft01{left:110px;} .textAlignRight{width:100%;height:auto;text-align:right;position:absolute;right:30px;} .textAlignRight01{right:54px;} .textAlignRight02{right:0.75rem;} @@ -383,6 +364,8 @@ input::-webkit-input-placeholder { color: #999; } +.infoBox01{float:left;width:80px;margin-top:0.8rem;} +.infoBox02{float:left;border-left:solid 1px #e5e5e5;padding-left:0.5rem;margin-left:0.5rem;} .info{overflow:hidden;line-height:1rem;margin-bottom:0.2rem;} .info01{padding-left:0.75rem;padding-top:0.55rem;} .info02{margin-bottom:0.5rem;} @@ -399,18 +382,23 @@ input::-webkit-input-placeholder { .info span font.c9{color:#999;} .info span em{color:#ff1100;font-size:0.75rem;} .info span em font{font-size:0.7rem;vertical-align:text-bottom;} +.list-block .item-title .info > label{font-size:0.5rem;color:#f5b715;line-height:0.75rem;display:block;} +.list-block .item-title .info > span{color:#666;} +.list-block .item-title .info > em{color:#ff1100;display:block;} +.list-block .item-title .info > em strong{font-size:1.2rem;font-weight:normal;} .list-block .item-title span.c3{color:#333;font-size:0.8rem;margin-right:0.2rem;display:inline-block;vertical-align:top;} .list-block .item-title span.c3a{max-width:112px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} .list-block .item-title span.c6{color:#666;font-size:0.65rem;border-left:solid 1px #bfbfbf;margin-left:0.1rem;padding-left:0.3rem;display:inline-block;vertical-align:middle;} .list-block .item-title span.c6a{max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} .list-block .item-title span.c9{color:#999;font-size:0.75rem;} .info i.icon-warning{width:15px;height:15px;background:url(../images/icon-warning.png) no-repeat center center;background-size:100%;float:none;display:block;margin:0 auto;margin-top:0.2rem;} -.list-block .item-title .info label{font-size:0.5rem;color:#f5b715;line-height:0.75rem;display:block;} .small01{height:0.9rem;background:#eaf7ff;border-radius:2px;padding:0 5px;color:#2db0fc;font-size:0.65rem;line-height:1rem;float:left;margin:0.1rem 0;margin-right:0.2rem;} .small01:nth-of-type(1){background:#eaf7ff;color:#2db0fc;} .small01:nth-of-type(2){background:#fff7e7;color:#f5b715;} .small01:nth-of-type(3){background:#e9f8f0;color:#2cb66a;} .small02{height:0.9rem;background:none;border:solid 1px #2db0fc;border-radius:2px;padding:0 5px;color:#2db0fc;font-size:0.65rem;line-height:0.9rem;float:left;margin:0.1rem 0;margin-left:0.2rem;} +.small03{border:solid 1px #ccc;border-radius:2px;padding:0 5px;color:#999;font-size:0.65rem;line-height:1rem;display:inline-block;vertical-align:middle;margin-left:0.5rem;} +.small04{width:49px;height:1.1rem;background:#18a2ff;border-radius:2px;padding:0 5px;color:#fff;font-size:0.65rem;line-height:1.2rem;display:block;margin:0 auto;margin-bottom:0.2rem;} .list-block .item-title small.small01{color:#2db0fc;font-size:0.65rem;} .list-block .item-title small.small02{color:#2db0fc;font-size:0.65rem;} .list-block .item-title .info02 small.small01{margin-top:0;margin-bottom:0;} @@ -418,51 +406,109 @@ input::-webkit-input-placeholder { .list-block .item-subtitle small.small01:nth-of-type(1){background:#eaf7ff;color:#2db0fc;} .list-block .item-subtitle small.small01:nth-of-type(2){background:#fff7e7;color:#f5b715;} .list-block .item-subtitle small.small01:nth-of-type(3){background:#e9f8f0;color:#2cb66a;} +.list-block .item-subtitle small.small04{color:#fff;} .delete_btn{width:12px;height:15px;background:url(../images/delete.png) no-repeat left center;background-size:100%;float:right;margin-right:0.75rem;margin-top:0.3rem;} -/* 登录 */ -i.loginIcon01{width:14px;height:26px;background:url(../images/loginIcon01.png) no-repeat center 1px;background-size:100%;display:block;} -i.loginIcon02{width:15px;height:25px;background:url(../images/loginIcon02.png) no-repeat center 3px;background-size:100%;display:block;} -i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) no-repeat center 3px;background-size:100%;display:block;} -.item-link .item-inner .inpu{width:70px;height:24px;line-height:24px;float:left;margin:0 6px;text-align:center;border:solid 1px #d7d7d7;} -#input_phoneNumber{padding-top:3px;} -#input_phoneNumber,#input_codeImg,#input_codeSms,#input_codeInvite{width:175px;margin-left:-80px;} -.item-link .item-inner label{float:left;text-align:right;padding-left:0;} -.item-link .item-inner label i.loginCode{width:70px;height:25px;background:url(../images/loginCode.png) no-repeat center center;background-size:100%;display:block;margin-top:-2px;} -.sendCode{padding:0 8px;height:27px;background:#fff;border:solid 1px #2db0fc;border-radius:3px;color:#2db0fc;text-align:center;line-height:26px;font-size:0.7rem;float:right;margin-top:-2px;} -.waiting{padding:0 8px;height:27px;background:#0a8ddf;border:solid 1px #0a8ddf;border-radius:3px;color:#fff;text-align:center;line-height:26px;font-size:0.7rem;float:right;margin-top:-2px;} -.agreement{overflow:hidden;margin-left:0.75rem;margin-top:0.75rem;} -.agreement span{float:left;} -.agreement span a{font-size:0.75rem;color:#263238;} -.check{margin-top:2px;margin-right:10px;} -.check a{display:block;width:18px;height:18px;border:solid 1px #a8a8a8;border-radius:4px;position:relative;} -.checkImg{width:10px;height:10px;position:absolute;top:3px;left:3px;} +/* 卡片 */ +.card{border-radius:0.625rem;box-shadow:0 7px 22px 0 rgba(207,203,201,0.50);} +.card div:before,.card div:after{height:0;} + +.cardPrice{background-image:linear-gradient(219deg,#FFD95F 0%,#FF961D 77%);color:#fff;} +.cardPrice .card-header span{font-size:0.8rem;} +.cardPrice .card-header span input{background:none;border:none;outline:none;max-width:3.8rem;} +.cardPrice .card-content-inner{font-size:2.25rem;text-align:center;padding-top:0;} +.cardPrice .card-content-inner span{font-size:0.75rem;margin-left:0.3rem;} +.cardPrice .card-footer{background:#fff;color:#333;border-radius:0 0 0.625rem 0.625rem;} +.cardPrice .card-footer span em{font-size:0.75rem;display:block;} +.cardPrice .card-footer span em strong{font-size:1rem;} +.cardPrice .card-footer span label{font-size:0.7rem;color:#999;display:block;} +.icon-address01{width:11px;height:13px;background:url(../images/icon-address01.png) no-repeat center center;background-size:100%;margin-right:0.3rem;} +.icon-address02{width:13px;height:13px;background:url(../images/icon-address02.png) no-repeat center center;background-size:100%;margin-right:0.3rem;} +.icon-down{font-size:0.75rem;margin-left:0.3rem;} +.icon-arrow-red{width:8px;height:12px;background:url(../images/icon-arrow-red.png) no-repeat center center;background-size:100%;margin-left:0.3rem;vertical-align:baseline;} +.icon-arrow-green{width:8px;height:12px;background:url(../images/icon-arrow-green.png) no-repeat center center;background-size:100%;margin-left:0.3rem;vertical-align:baseline;} + +.cardNearbyName span{font-size:0.75rem;} +.cardNearbyBox{width:100%;overflow-x:scroll;} +.cardNearbyWin{width:22.5rem;height:5.5rem;} +.cardNearby{width:6.75rem;border-radius:0.16rem;border-left:solid 5px #C7B3FB;float:left;margin-right:0;margin-top:0;} +.cardNearby div{padding-top:0;padding-bottom:0;} +.cardNearby .card-header{font-size:0.75rem;min-height:1.5rem;} +.cardNearby .card-content-inner{font-size:0.75rem;color:#EA122C;} +.cardNearby .card-footer{font-size:0.65rem;color:#999;min-height:1.5rem;margin-top:-0.2rem;} +.cardNearby:nth-child(1){border-left:solid 5px #C7B3FB;} +.cardNearby:nth-child(2){border-left:solid 5px #FFA4A4;} +.cardNearby:nth-child(3){border-left:solid 5px #BFE077;} + +.cardInfo > img{width:100%;height:180px;border-radius:0.625rem;position:absolute;} +.cardInfo > .cardInfoMask{width:100%;height:100%;background:rgba(0,0,0,0.25);border-radius:0.625rem;position:absolute;} + +.cardInfo01{height:180px;color:#fff;} +.cardInfo01 span{font-size:0.75rem;color:#fff;font-weight:normal;} +.cardInfo01 .card-header{padding-left:0.5rem;padding-right:0.5rem;font-size:1rem;font-weight:bold;} +.cardInfo01 .card-content-inner{padding-left:0.5rem;padding-right:0.5rem;padding-top:0;} +.cardInfo01 .card-footer{padding-left:0.5rem;padding-right:0.5rem;padding-bottom:0;position:absolute;bottom:0;} + +.cardInfo02 > img{height:142px;} +.cardInfo02 .card-footer{width:100%;background:#fff;border-radius:0 0 0.625rem 0.625rem;padding-top:0.3rem;padding-bottom:0.3rem;} +.cardInfo02 .card-footer span em{font-size:0.75rem;color:#EA122C;} +.cardInfo02 .card-footer span em strong{font-size:1rem;color:#EA122C;} +.cardInfo02 .card-footer span small{height:0.9rem;border-radius:2px;padding:0 5px;line-height:1rem;margin-left:0.2rem;} +.cardInfo02 .card-footer span small:nth-child(1){background:#E7F2FF;color:#76A5DD;} +.cardInfo02 .card-footer span small:nth-child(2){background:#E6F9E6;color:#6FBA6F;} +.cardInfo02 .card-footer span small:nth-child(3){background:#FDF3DD;color:#E8AF27;} +.cardInfo02 .card-footer span small:nth-child(4){background:#FDE9E2;color:#DD7B57;} +.cardInfo02 .card-footer span small:nth-child(5){background:#F5EFFF;color:#A585D6;} + +.icon-praise-white{width:12px;height:12px;background:url(../images/icon-praise-white.png) no-repeat center center;background-size:100%;margin-right:0.3rem;vertical-align:baseline;} +.icon-comments-white{width:13px;height:12px;background:url(../images/icon-comments-white.png) no-repeat center center;background-size:100%;margin-right:0.3rem;vertical-align:baseline;} +.icon-praise-grey{width:12px;height:12px;background:url(../images/icon-praise-grey.png) no-repeat center center;background-size:100%;margin-right:0.3rem;vertical-align:baseline;} +.icon-comments-grey{width:13px;height:12px;background:url(../images/icon-comments-grey.png) no-repeat center center;background-size:100%;margin-right:0.3rem;vertical-align:baseline;} /* 顶部 */ -.top{width:100%;background:#efeff4;padding:0.75rem 0.5rem;overflow:hidden;position:fixed;top:0;z-index:20;} -/* popup顶部 */ -.top{width:100%;background:#f3f3f3;padding:0.75rem 0.5rem;overflow:hidden;position:absolute;top:0;z-index:20;} -.top .searchBox{position:relative;line-height:36px;overflow:hidden;} -.top .searchBox .cityChoice{float:left;margin-right:10px;} -.top .searchBox .cityChoice a{line-height:36px;color:#666;display:block;} -.top .searchBox span{display:block;background:#fff;border:solid 1px #e6e6ea;border-radius:6px;overflow:hidden;} -.top .searchBox span input{width:80%;height:34px;padding-left:12px;float:left;border:none;font-size:0.7rem;} -.top .searchBox span i{width:16px;height:16px;background:url(../images/search.png) no-repeat left center;background-size:100%;float:left;margin-left:10px;margin-top:9px;} +.top{width:100%;padding:0.75rem 0.5rem;border-bottom:solid 1px #dcdcdc;overflow:hidden;position:absolute;top:0;z-index:10;} +.top.bar{height:auto;} +.top.bar ~ .content{top:66px;} +.top .searchBox{background:#eee;border-radius:0.25rem;overflow:hidden;padding:0.3rem 0;} +.top .searchBox .cityChoice{float:left;margin-left:0.5rem;margin-right:0.5rem;} +.top .searchBox .cityChoice a{color:#333;display:inline-block;} +.top .searchBox .cityChoice i{width:10px;height:5px;background:url(../images/arrow_select.png) no-repeat center center;background-size:100%;display:inline-block;vertical-align:middle;margin-left:0.2rem;} +.top .searchBox span{float:left;border-left:solid 1px #e0e0e0;overflow:hidden;} +.top .searchBox span input{width:85%;background:none;padding-left:0.25rem;display:inline-block;vertical-align:text-bottom;border:none;font-size:0.7rem;} +.top .searchBox span i{width:16px;height:16px;background:url(../images/search.png) no-repeat left center;background-size:100%;display:inline-block;vertical-align:text-bottom;margin-left:0.3rem;} .top .searchBox .cancel{float:right;color:#2db0fc;} +.top01{background:#fff;border-bottom:solid 1px #e5e5e5;padding:0 0.5rem;} +.top01 .searchBox{background:none;} +.top01 .searchBox .country{float:left;margin:0;margin-top:1px;font-size:0.75rem;line-height:24px;} +.top01 .searchBox .cityChoice{border-left:solid 1px #e5e5e5;padding-left:0.5rem;} +.top01 .searchBox .cityChoice a{font-size:0.75rem;} +.top01 .searchBox span{width:45%;border-left:solid 1px #e5e5e5;} +.top01 .searchBox span input{width:60%;font-size:0.75rem;} +.top01 .searchBox .active,.top01 .searchBox .cityChoice a.active{color:#18a2ff;} +.top01 .searchBox .noData,.top01 .searchBox .cityChoice a.noData{color:#999;} + +.topCity{overflow:hidden;background:#fff;border-top:solid 1px #e5e5e5;border-bottom:solid 1px #e5e5e5;} +.topCity div{float:left;margin-right:0.4rem;} +.topCity div.active{color:#18a2ff;} +.topCity span{float:right;} +.topCity span a{color:#333;} +.topCity span a.active{color:#18a2ff;} +.topCity .icon-right{font-size:0.5rem;color:#999;padding:0;margin-left:0.1rem;} + .popup .bar{height:66px;padding-left:0;padding-right:0;position:absolute;right:0;left:0;z-index:10;} -.popup .bar:after{background-color:#efeff4;} -.popup .bar .searchbar{padding:0.75rem 0.5rem;height:66px;background:#efeff4;position:absolute;right:0;left:0;z-index:10;} .popup .bar:after{background-color:#f3f3f3;} .popup .bar .searchbar{padding:0.75rem 0.5rem;margin:0;height:66px;background:#f3f3f3;position:absolute;right:0;left:0;z-index:10;} .popup .bar .searchbar .searchbar-cancel{line-height:36px;} +.popup .bar .searchbar .col-5{margin-left:1.5%;margin-right:2.5%;} +.popup .bar .searchbar .icon-left{padding:0;line-height:38px;} .popup .bar .searchbar .search-input input{height:36px;border:solid 1px #e6e6ea;} .bar.bar-nav01{height:auto;overflow:hidden;padding-left:0.5rem;padding-right:0.5rem;} .bar.bar-nav01 .button-link{color:#18a2ff;} -/* popup底部 */ -.popup .bottom{height:66px;background:#e4e4e9;border-top:solid 1px #d7d7d7;position:fixed;right:0;left:0;bottom:0;z-index:10;} -.popup .bottom .searchbar{height:66px;background:#e4e4e9;border-top:solid 1px #d7d7d7;position:fixed;right:0;left:0;bottom:0;z-index:10;} +/* 底部 */ +.popup .bottom{height:66px;background:#e4e4e9;border-top:solid 1px #d7d7d7;position:absolute;right:0;left:0;bottom:0;z-index:10;} +.popup .bottom .searchbar{height:66px;background:#e4e4e9;border-top:solid 1px #d7d7d7;position:absolute;right:0;left:0;bottom:0;z-index:10;} .popup .bottom .searchbar .search-input{line-height:36px;overflow:hidden;margin:0 0.5rem;} .popup .bottom .searchbar .search-input div{width:30%;float:left;} .popup .bottom .searchbar .search-input input{width:50%;height:36px;background:#fff;border:solid 1px #e6e6ea;border-right:solid 1px #fff;border-radius:0;padding-left:12px;float:left;} @@ -477,36 +523,6 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n .topBg p label{color:rgba(255,255,255,0.8);} .topBg + .buttons-tab .button{font-size:0.7rem;padding:0 0.3rem;} -.topBg01{padding-top:0.75rem;padding-bottom:0.5rem;} -.topBg01 img{width:70px;height:100%;margin:0 auto;margin-bottom:0.1rem;} -.topBg01 p label{font-size:0.7rem;color:#333;} -.topBg01>p{font-size:0.65rem;color:#999;text-align:left;margin-top:0.5rem;} -.topBg01>p em{font-size:0.65rem;color:#ff1100;} - -.topBg02{background:#ecf6ff;border-bottom:solid 1px #e7e7e7;color:#333;text-align:justify;padding-top:1rem;} -.topBg02 p label{color:#999;} -.topBg02 + p{font-size:0.65rem;color:#999;text-align:left;margin-left:0.75rem;margin-top:1rem;} -.topBg02 + p em{font-size:0.65rem;color:#29a1f7;} - -.topBg02 + p + .list-block{margin-bottom:0.75rem;position:relative;} -.topBg02 + p + .list-block span{color:#666;} -.topBg02 + p + .list-block em{color:#ff1100;} - -.selectBox{background:#fff;border-top:solid 1px #e7e7e7;text-align:center;line-height:50px;overflow:hidden;} -.selectBox div{float:left;width:50%;} -.selectBox div a{color:#333;display:inline-block;} -.selectBox div i{font-size:0.5rem;margin-left:0.3rem;} - -.selectContent{width:100%;position:absolute;top:52px;z-index:20000;} -.selectContent .list-block i{width:16px;margin-right:0.3rem;} - -.mask{width:100%;height:100%;background:rgba(0,0,0,0.4);position:absolute;top:52px;z-index:10600;} - -.topBg02 + .noData{background:#fff;height:90%;text-align:center;padding-top:3rem;margin-top:0.75rem;} -.topBg02 + .noData img{width:30%;margin:0 auto;} -.topBg02 + .noData p{color:#666;margin-top:0.5rem;margin-bottom:1.5rem;} -.topBg02 + .noData a{text-decoration:underline;} - .priceInfo{color:#fff;margin-top:0.75rem;overflow:hidden;} .priceInfoLeft{float:left;width:50%;} .priceInfoRight{float:right;width:50%;} @@ -519,36 +535,21 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n .priceInfo div div span{float:left;font-size:0.65rem;line-height:22px;width:146px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;} .priceInfoTitle{overflow:hidden;margin-bottom:0.5rem;} .priceInfoTitle .priceInfo-address{float:left;margin-right:0.5rem;font-size:0.85rem;text-align:left;} -.priceInfoTitle #input_status{width:90px;background:url(../images/arrow_select.png) no-repeat 3.7rem center rgba(255,255,255,0.2);border:solid 1px #fff;float:right;color:rgba(255,255,255,0.8);padding:0.1rem 0.2rem;padding-right:0.5rem;} .priceInfoTitle #input_status{width:90px;background:url(../images/arrow_select.png) no-repeat 3.6rem center rgba(255,255,255,0.2);border:solid 1px #fff;float:right;color:rgba(255,255,255,0.8);padding:0.1rem 0.2rem;padding-right:0.5rem;} -/* 底部 */ -.popup .bottom{height:66px;background:#e4e4e9;border-top:solid 1px #d7d7d7;position:fixed;right:0;left:0;bottom:0;z-index:10;} -.popup .bottom .searchbar{height:66px;background:#e4e4e9;border-top:solid 1px #d7d7d7;position:fixed;right:0;left:0;bottom:0;z-index:10;} -.popup .bottom .searchbar .search-input{line-height:36px;overflow:hidden;margin:0 0.5rem;} -.popup .bottom .searchbar .search-input div{width:30%;float:left;} -.popup .bottom .searchbar .search-input input{width:50%;height:36px;background:#fff;border:solid 1px #e6e6ea;border-right:solid 1px #fff;border-radius:0;padding-left:12px;float:left;} -.popup .bottom .searchbar .search-input a{width:20%;height:36px;border:solid 1px #e6e6ea;border-radius:0;line-height:34px;float:left;margin:0;top:0;} .button.button-fill.management_btn{color:rgba(255,255,255,0.8);line-height:1.2rem;background:none;border:solid 1px rgba(255,255,255,0.8);border-radius:0.2rem;padding:0 0.4rem;float:right;} .button.button-fill.management_btn i{font-size:0.5rem;color:#fff;} .button.management_btn i.icon:first-child:last-child{margin-left:0.1rem;} .button.button-fill.management_btn01{color:#333;border:solid 1px #666;position:absolute;top:0.75rem;right:0.75rem;} .button.button-fill.management_btn01 i{color:#333;} - -/* 评估结果 */ -.icon-result01{width:15px;height:24px;background:url(../images/icon-result01.png) no-repeat center center;background-size:100%;margin-right:0.75rem;margin-top:-3px;} -.icon-result02{width:15px;height:24px;background:url(../images/icon-result02.png) no-repeat center center;background-size:100%;margin-right:0.75rem;margin-top:-3px;} -.icon-result03{width:15px;height:24px;background:url(../images/icon-result03.png) no-repeat center center;background-size:100%;margin-right:0.75rem;margin-top:-3px;} -.icon-result04{width:15px;height:24px;background:url(../images/icon-result04.png) no-repeat center center;background-size:100%;margin-right:0.75rem;margin-top:-3px;} -.icon-result05{width:15px;height:24px;background:url(../images/icon-result05.png) no-repeat center center;background-size:100%;margin-right:0.75rem;margin-top:-3px;} -.icon-result06{width:15px;height:24px;background:url(../images/icon-result06.png) no-repeat center center;background-size:100%;margin-right:0.75rem;margin-top:-3px;} -.topic{background:#fff;border-top:solid 1px #e7e7e7;border-bottom:solid 1px #e7e7e7;margin-bottom:0.5rem;} -.topic .topicTitle{font-size:0.85rem;border-bottom:solid 1px #e7e7e7;line-height:2.5rem;margin-left:0.75rem;padding-right:0.75rem;color:#666;overflow:hidden;} +.topic{background:#fff;border-top:solid 1px #e5e5e5;border-bottom:solid 1px #e5e5e5;margin-bottom:0.5rem;} +.topic .topicTitle{font-size:0.85rem;border-bottom:solid 1px #e5e5e5;line-height:2.5rem;margin-left:0.75rem;padding-right:0.75rem;color:#666;overflow:hidden;} .topic .topicTitle > img{float:left;width:90px;margin-right:10px;} .topic .topicTitle > small{color:#999;} .topic .topicTitle > em{margin-left:0.5rem;font-size:inherit;} .topic .topicTitle > span{float:right;color:#999;font-size:0.8rem;} +.topic .topicTitle > span em{color:#333;} .topic .topicTitle > span em.up{color:#ff1100;font-size:0.8rem;} .topic .topicTitle > span em.down{color:#2cb66a;font-size:0.8rem;} .topic .topicTitle > div{float:left;} @@ -559,54 +560,13 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n .topic .topicTitle > div:nth-child(2){text-align:right;float:right;} .topic .topicTitle > div:nth-child(2) p label{color:#999;} .topic .topicTitle > div:nth-child(2) p em{color:#ff1100;} +.topic .topicTitle.topicTitle01{border-bottom:none;} .topic .topicContent .topicTitle01{color:#333;margin-top:0;font-size:0.85rem;} .topic .topicContent .topicTitle01 em{font-size:1.2rem;} .topic .icon-note{width:16px;height:16px;background:url(../images/icon-note.png) no-repeat center center;background-size:100%;margin-left:0.3rem;margin-top:-2px;} -.icon-address{width:14px;height:24px;background:url(../images/icon-address.png) no-repeat center center;background-size:100%;margin-right:0.5rem;margin-top:-3px;} -.icon-address + span{color:#333;} - -.bar.bar-nav02{height:2.5rem;line-height:2.5rem;position:static;background:#fff;margin-top:0.75rem;} -.bar.bar-nav02 .title{color:#333;line-height:2.5rem;} -.bar.bar-nav02 .button-nav{color:#999;font-size:0.7rem;height:2.5rem;line-height:2.5rem;} -.bar.bar-nav02 .button-nav span{font-size:0.6rem;} -.bar.bar-nav02 .icon.icon-left{font-size:0.6rem;margin-left:0.1rem;margin-top:-2px;} -.bar.bar-nav02 .icon.icon-right{font-size:0.6rem;margin-right:0.1rem;margin-top:-2px;} -.bar.bar-nav02 .icon-note{width:16px;height:51px;background:url(../images/icon-note.png) no-repeat center center;background-size:100%;margin-left:0.1rem;margin-top:-2px;position:absolute;} - -.topicBox .topic{position:relative;} -.topicBox .arrow_title{width:15px;position:absolute;top:-8px;left:50%;margin-left:-8.5px;} -.topicBox .list-block02{margin-bottom:0.75rem;} -.list-block ul:before{transform:scaleY(1);} -.list-block ul:after{transform:scaleY(1);} - -.topic{background:#fff;border-top:solid 1px #e7e7e7;border-bottom:solid 1px #e7e7e7;margin-bottom:0.75rem;} -.topic .topicTitle{font-size:0.85rem;border-bottom:solid 1px #e7e7e7;line-height:2.5rem;margin-left:0.75rem;padding-right:0.75rem;color:#666;overflow:hidden;} -.topic .topicTitle img{float:left;width:90px;margin-right:10px;} -.topic .topicTitle>div{float:left;} -.topic .topicTitle>div p{font-size:0.7rem;line-height:0.6rem;color:#999;} -.topic .topicTitle>div p label{color:#333;} -.topic .topicTitle>div p font{font-size:0.7rem;} -.topic .topicTitle>div p font i{font-size:0.7rem;font-style:normal;margin-right:1rem;} -.topic .topicTitle>div:nth-child(2){text-align:right;float:right;} -.topic .topicTitle>div:nth-child(2) p label{color:#999;} -.topic .topicTitle>div:nth-child(2) p em{color:#ff1100;} -.topic .topicTitle .icon-note{width:16px;height:16px;background:url(../images/icon-note.png) no-repeat center center;background-size:100%;margin-left:0.3rem;margin-top:-2px;} - .topic01{margin-bottom:0.5rem;} .topic01 .topicTitle{position:relative;} -.topic01 .topicTitle>div{padding:0.4rem 0;} -.topic01 .topicTitle>div.scale{width:70px;height:70px;position:absolute;right:0.3rem;top:50%;margin-top:-35px;} -.topic01 .topicTitle>div p a{font-size:0.7rem;color:#999;text-decoration:underline;} -.topic01 .topicTitle>div p small{font-size:0.7rem;} -.topic01a .topicTitle>div{padding:0;} -.topic01a .topicTitle>div:nth-child(2){font-size:0.8rem;color:#a0a0a0;text-align:left;float:left;margin-left:0.3rem;margin-top:-2px;} -.topic01a .topicTitle>div:nth-child(2) p a{vertical-align:0.5rem;} -.topic01a .topicTitle>div:nth-child(3){text-align:left;float:left;margin-left:0.3rem;width:52%;} -.topic01a .topicTitle>div:nth-child(3) p{margin-bottom:0;} -.topic01a .topicTitle>div:nth-child(3) p a{vertical-align:0.5rem;} -.topic01a .topicTitle>div:nth-child(3) p font{vertical-align:0.5rem;} -.topic01a .topicTitle>div:nth-child(3) p small{vertical-align:0.5rem;} .topic01 .topicTitle > div{padding:0.4rem 0;} .topic01 .topicTitle > div.scale{width:70px;height:70px;position:absolute;right:0.3rem;top:50%;margin-top:-35px;} .topic01 .topicTitle > div p a{font-size:0.7rem;color:#999;text-decoration:underline;} @@ -620,32 +580,19 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n .topic01a .topicTitle > div:nth-child(3) p font{vertical-align:0.5rem;} .topic01a .topicTitle > div:nth-child(3) p small{vertical-align:0.5rem;} -.topic .topicContent{overflow:hidden;padding:0.6rem 0.75rem;color:#999;} .topic .topicContent{overflow:hidden;padding:0.75rem;color:#999;} .topic .topicContent img{width:100%;} -.topic .topicContent>p{overflow:hidden;margin:0.8em 0;} -.topic .topicContent>p>label{float:left;} -.topic .topicContent>p>span{float:right;color:#333;} .topic .topicContent > p{overflow:hidden;margin:0.8em 0;} .topic .topicContent > p > label{float:left;} .topic .topicContent > p > span{float:right;color:#333;} .topic .topicContent .content-block{margin:1rem 0;} +.topic .topicContent .content-block.content-block01{margin:0;} .topic .button-apply{width:30%;height:2rem;line-height:2rem;float:right;} .tabs .topic{margin-bottom:0.5rem;} -.topic .topicContent .topicContent_top{overflow:hidden;} -.topic .topicContent .topicContent_top .left{float:left;width:50%;} .topic .topicContent .topicContent_top{overflow:hidden;} .topic .topicContent .topicContent_top .left{float:left;width:50%;border-right:solid 1px rgba(255,255,255,0.5);} .topic .topicContent .topicContent_top .right{float:right;width:50%;} -.topic .topicContent .topicContent_top p{overflow:hidden;margin:0.5rem;text-align:center;} -.topic .topicContent .topicContent_top p i{width:10px;height:25px;margin-right:3%;display:inline-block;vertical-align:top;} -.topic .topicContent .topicContent_top p.up i{background:url(../images/up.png) no-repeat center center;background-size:100%;} -.topic .topicContent .topicContent_top p.down i{background:url(../images/down.png) no-repeat center center;background-size:100%;} -.topic .topicContent .topicContent_top p em{font-size:1.3rem;line-height:1.5rem;} -.topic .topicContent .topicContent_top p.up em{color:#ff1100;} -.topic .topicContent .topicContent_top p.down em{color:#22ac38;} -.topic .topicContent .topicContent_top p span{color:#999;text-align:center;} .topic .topicContent .topicContent_top p{overflow:hidden;margin:0;text-align:center;} .topic .topicContent .topicContent_top p i{width:10px;height:25px;margin-right:3%;display:inline-block;vertical-align:top;} .topic .topicContent .topicContent_top p.up i{background:url(../images/up01.png) no-repeat center center;background-size:100%;} @@ -656,9 +603,9 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n .topic .topicContent .topicContent_top p em font{vertical-align:middle;} .topic .topicContent .topicContent_top p span{color:#fff;opacity:0.8;text-align:center;} -.topic .topicContent .topicContent_top01 .left{border-right:solid 1px #e7e7e7;} -.topic .topicContent .topicContent_top01 p.up i{background:url(../images/up.png) no-repeat center center;background-size:100%;} -.topic .topicContent .topicContent_top01 p.down i{background:url(../images/down.png) no-repeat center center;background-size:100%;} +.topic .topicContent .topicContent_top01 .left{border-right:solid 1px #e5e5e5;} +.topic .topicContent .topicContent_top01 p.up i{background:url(../images/up01.png) no-repeat center center;background-size:100%;} +.topic .topicContent .topicContent_top01 p.down i{background:url(../images/down01.png) no-repeat center center;background-size:100%;} .topic .topicContent .topicContent_top01 p.up em{color:#ff1100;} .topic .topicContent .topicContent_top01 p.down em{color:#2cb66a;} .topic .topicContent .topicContent_top01 p span{color:#999;opacity:1;} @@ -669,10 +616,9 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n .icon.icon-right01{font-size:0.6rem;margin-top:-2px;} .topic .topicContent .topicContent_bottom{position:relative;} -.topic .topicContent .topicContent_bottom p{margin-bottom:55px;} -.topic .topicContent .topicContent_bottom p em{color:#2db0fc;} .topic .topicContent .topicContent_bottom p{margin-bottom:55px;font-size:0.8rem;} .topic .topicContent .topicContent_bottom p em{color:#18a2ff;font-size:0.8rem;} +.topic .topicContent .topicContent_bottom p a{float:right;color:#333;} .topic .topicContent .topicContent_bottom font{width:100%;height:16px;background:#eee;border-radius:50px;display:block;margin-top:-10px;} .topic .topicContent .topicContent_bottom font i{display:block;height:16px;background:#45b9fc;border:solid 3px #eee;border-radius:50px;} .topic .topicContent .topicContent_bottom .rankingNote{overflow:hidden;display:block;height:26px;} @@ -684,12 +630,8 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n .topic .topicContent .topicContent_bottom .slider_note img{width:14px;height:6px;position:absolute;bottom:-4px;left:44%;} .topic .topicContent .topicContent_center{overflow:hidden;} -.topic .topicContent .topicContent_center div{float:left;width:33%;border-left:solid 1px #e5e5e5;text-align:center;} -.topic .topicContent .topicContent_center{overflow:hidden;} -.topic .topicContent .topicContent_center div{float:left;width:25%;border-left:solid 1px #e7e7e7;text-align:center;} +.topic .topicContent .topicContent_center div{float:left;width:25%;border-left:solid 1px #e5e5e5;text-align:center;} .topic .topicContent .topicContent_center div:first-child{border-left:none;} -.topic .topicContent .topicContent_center div em{display:block;color:#ff1100;} -.topic .topicContent .topicContent_center div label{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0 auto;} .topic .topicContent .topicContent_center div em{display:block;color:#ff1100;font-size:0.85rem;} .topic .topicContent .topicContent_center div label{display:block;color:#999;font-size:0.65rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0 auto;} .topic .topicContent .topicContent_center div span{display:block;color:#333;font-size:0.75rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0 auto;margin-top:0.2rem;} @@ -709,9 +651,17 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n .topic .topicContent .topicContent_center div .icon.icon-menu04a{background:url(../images/icon-menu04a.png) no-repeat center center;background-size:100%;} .topic .topicContent .topicContent_center div .icon.icon-menu05a{background:url(../images/icon-menu05a.png) no-repeat center center;background-size:100%;} +.topic .topicContent .topicContent_center.home div{width:25%;border-left:none;} + +.topic .topicContent .topicContent_center.home div .icon{width:45px;height:45px;display:block;margin:0 auto;} +.topic .topicContent .topicContent_center.home div .icon.icon-home01{background:url(../images/icon-home01.png) no-repeat center center;background-size:100%;} +.topic .topicContent .topicContent_center.home div .icon.icon-home02{background:url(../images/icon-home02.png) no-repeat center center;background-size:100%;} +.topic .topicContent .topicContent_center.home div .icon.icon-home03{background:url(../images/icon-home03.png) no-repeat center center;background-size:100%;} +.topic .topicContent .topicContent_center.home div .icon.icon-home04{background:url(../images/icon-home04.png) no-repeat center center;background-size:100%;} + .topic .topicContent .topicContent_center01 div{width:29.333333333333332%;background:#fbfbfb;border:solid 1px #eee;border-radius:0.2rem;padding:0.3rem 0;} .topic .topicContent .topicContent_center01 div:first-child{border-left:solid 1px #eee;} -.topic .topicContent .topicContent_center01 div em{display:block;color:#ff1100;font-size:0.85rem;} +.topic .topicContent .topicContent_center01 div em{display:block;color:#ff1100;font-size:0.75rem;} .topic .topicContent .topicContent_center01 div em.riskScore01{color:#ff4500;} .topic .topicContent .topicContent_center01 div em.riskScore02{color:#ffb53e;} .topic .topicContent .topicContent_center01 div em.riskScore03{color:#2db0fc;} @@ -719,6 +669,8 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n .topic .topicContent .topicContent_center01 div em font{font-size:0.7rem;vertical-align:top;} .topic .topicContent .topicContent_center01 div label{font-size:0.75rem;} .example{width:40px;height:40px;background:url(../images/example.png) no-repeat;background-size:100%;position:absolute;top:0;left:0;} +.topic .topicContent .topicContent_center01 div span{margin:0;} +.topic .topicContent .topicContent_center01 div small{display:block;float:none;width:3rem;margin:0 auto;padding:0;} .topic .topicContent .topicContent_center02 p{margin-top:0.5rem;margin-bottom:0;} .topic .topicContent .topicContent_center02 p label{color:#333;} @@ -736,19 +688,42 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n .topic01a .topicContent .topicContent_center div:first-child em font{color:#ffb73a;} .topic01a .topicContent .topicContent_center div label{margin-top:-0.3rem;} -.topic .topicContent .topicContent_bottom01{margin-top:0.5rem;text-align:center;} +.topic .topicContent .topicContent_center em.up{color:#ff1100;} +.topic .topicContent .topicContent_center em.down{color:#2cb66a;} +.topic .topicContent .topicContent_center em i{width:9px;height:14px;display:inline-block;vertical-align:-1px;margin-right:0.1rem;} +.topic .topicContent .topicContent_center em.up i{background:url(../images/up02.png) no-repeat center center;background-size:100%;} +.topic .topicContent .topicContent_center em.down i{background:url(../images/down02.png) no-repeat center center;background-size:100%;} + .topic .topicContent .topicContent_bottom01{text-align:center;} .topic .topicContent .topicContent_bottom01 span{display:block;height:24px;line-height:24px;} -.topic .topicContent .topicContent_bottom01 .icon.icon-right{margin-top:-2px;} .topic .topicContent .topicContent_bottom01 label{color:#666;} .topic .topicContent .topicContent_bottom01 label em{color:#ff1100;margin-left:0.1rem;} +/* 广告 */ +.ad{display:block;margin-bottom:0.5rem;border-top:solid 1px #e5e5e5;border-bottom:solid 1px #e5e5e5;} +.ad img{width:100%;} + /* 图表 */ -.chart{height:200px;} -.chart{width:100%;height:200px;} +.chart{width:100%;height:250px;} .chart tspan{font-size:0.6rem;color:#999;text-shadow:none;} -#chart02{height:300px;} -#chart02{height:280px;} +.scoreBox{height:130px;position:relative;} +.score{width:250px;height:250px;margin:0 auto;margin-top:1rem;} +.scoreText{width:250px;height:150px;position:absolute;top:0;left:50%;margin-left:-125px;} +.scoreText div{position:absolute;font-size:12px;color:#fff;} +.scoreText div:nth-child(1){top:80px;left:8px;} +.scoreText div:nth-child(2){top:6px;left:50%;margin-left:-12px;} +.scoreText div:nth-child(3){top:80px;right:8px;} +.priceBox{margin:0.75rem 0;overflow:hidden;} +.priceBox div{float:left;width:50%;text-align:center;} +.priceBox div label{color:#666;font-size:0.7rem;margin-right:0.3rem;} +.priceBox div font{color:#333;} +.priceBox div em{color:#666;font-size:0.7rem;} +.priceBox div em{color:#ff1100;font-size:0.7rem;} +.priceBox div em.up{color:#ff1100;} +.priceBox div em.down{color:#2cb66a;} +.priceBox div em i{width:12px;height:12px;display:inline-block;vertical-align:-1px;margin-right:0.1rem;} +.priceBox div em.up i{background:url(../images/up.png) no-repeat center center;background-size:100%;} +.priceBox div em.down i{background:url(../images/down.png) no-repeat center center;background-size:100%;} .topic .topicTitle > div.content-block{float:right;margin-top:0.6rem;padding:0;} .topic .date{text-align:right;font-size:0.75rem;color:#ccc;padding-right:0.75rem;margin:0;} @@ -762,8 +737,6 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n .districtTab .buttons-row .button{width:80px;} .assetRisk{width:300px;margin:0 auto;padding-top:1rem;} -.assetRisk .assetRiskTitle{font-size:0.85rem;color:#333;margin-bottom:0.5rem;} -.assetRisk .assetRiskTitle em{font-size:1.2rem;} .riskScore01{color:#ff4500;} .riskScore02{color:#ffb53e;} .riskScore03{color:#2db0fc;} @@ -780,24 +753,40 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n .assetRisk p span{width:70px;float:left;margin-right:1px;text-align:center;line-height:24px;font-size:0.65rem;} .assetRisk p.p01 span{line-height:14px;text-align:left;width:auto;} -.judgment{text-align:center;margin-top:1rem;} -.judgment label{color:#666;font-size:0.7rem;} -.judgment p{color:#333;margin:0;} -.judgment p em{color:#ff1100;font-size:1rem;margin-left:0.1rem;} -.judgment p em font{font-size:0.8rem;} -.judgment a{display:block;text-decoration:underline;margin-top:0.5rem;} .assetRisk .rankingBox{width:283px;height:24px;background:url(../images/scale.png) no-repeat left 10px;background-size:100%;padding-left:2px;margin-left:3px;margin-top:0.5rem;position:relative;} .assetRisk .rankingBox .ranking{position:absolute;left:1px;top:5px;} .assetRisk .rankingBox .ranking font{width:283px;height:5px;} .assetRisk .rankingBox .ranking font i{height:5px;} +/* 行情 */ +.list-block .item-subtitle .updownBox{border-radius:0.2rem;box-shadow:1px 1px 4px rgba(113,113,113,0.35);} +.list-block .item-subtitle .updown_top{background:#fff;border:solid 1px #e5e5e5;border-radius:0.2rem 0.2rem 0 0;text-align:center;line-height:1.8rem;position:relative;} +.list-block .item-subtitle .updown_top span{color:#333;max-width:65%;} +.list-block .item-subtitle .updown_top img{width:20%;position:absolute;top:0;left:0.2rem;} +.list-block .item-subtitle .updown_bottom{width:100%;height:2.8rem;border-radius:0 0 0.2rem 0.2rem;text-align:center;} +.list-block .item-subtitle .updown_bottom em{color:#fff;font-size:0.8rem;padding-top:0.3rem;display:block;} +.list-block .item-subtitle .updown_bottom em i{width:12px;height:12px;display:inline-block;vertical-align:-1px;margin-right:0.2rem;} +.list-block .item-subtitle .updown_bottom em.up i{background:url(../images/up.png) no-repeat center center;background-size:100%;} +.list-block .item-subtitle .updown_bottom em.down i{background:url(../images/down.png) no-repeat center center;background-size:100%;} +.list-block .item-subtitle .updown_bottom small{color:#fff;} + +/* 贷款 */ +.banner{width:100%;height:80px;background:url(../images/banner.png);background-size:100%;margin-bottom:0.5rem;} +.banner .content-block{padding:0 2rem;padding-top:1rem;} +.banner .content-block p{margin:0;} +.banner .content-block p .button.theme{background:#fff;height:1.8rem;line-height:1.7rem;} + +.banner01{width:100%;} +.banner01 a{display:block;margin-bottom:0.5rem;} +.banner01 img{width:100%;} + /* 出售分析 */ .addLink{text-align:center;color:#999;font-size:0.75rem;padding-bottom:1.1em;} .addLink a{text-decoration:underline;font-size:0.75rem;margin-left:0.1rem;} /* 出租管理 */ .buttons-tab01{padding-top:0.5rem;margin-bottom:0.5rem;overflow-x:auto;} -.buttons-tab01 .button{height:2.5rem;line-height:1rem;border-right:solid 1px #e7e7e7;} +.buttons-tab01 .button{height:2.5rem;line-height:1rem;border-right:solid 1px #e5e5e5;} .buttons-tab01 .button label{font-size:0.75rem;display:block;max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0 auto;} .buttons-tab01 .button small{font-size:0.65rem;display:block;margin:0 auto;} @@ -811,24 +800,24 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n .contentSuggest > p{font-size:0.65rem;color:#999;text-align:left;margin-left:0.75rem;} .contentSuggest > p em{font-size:0.65rem;color:#29a1f7;} -.contentSuggest .list-block{position:relative;} +.contentSuggest .selectContainer{position:relative;} -.selectBox{background:#fff;border-top:solid 1px #e7e7e7;text-align:center;line-height:44px;} -.selectBox div a{font-size:0.7rem;color:#333;display:inline-block;} +.selectBox{background:#fff;border-top:solid 1px #e5e5e5;text-align:center;line-height:44px;} +.selectBox div a{font-size:0.7rem;color:#333;display:inline-block;vertical-align:middle;max-width:70%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} .selectBox div i{font-size:0.5rem;color:#999;margin-left:0.3rem;} -.selectContent{width:100%;position:absolute;top:46px;z-index:20000;} +.selectContent{width:100%;position:absolute;z-index:20000;} .selectContent .list-block i{width:16px;margin-right:0.3rem;} #select_filter{margin-bottom:0;} .mask{width:100%;height:100%;background:rgba(0,0,0,0.4);position:absolute;top:47px;z-index:10600;} -.contentSuggest .noData{background:#fff;height:100%;text-align:center;padding-top:5rem;} +.contentSuggest .noData{background:#fff;height:100%;text-align:center;padding-top:8rem;} .contentSuggest .noData img{width:30%;margin:0 auto;} -.contentSuggest .noData p{color:#666;margin-top:0.5rem;margin-bottom:1.5rem;} +.contentSuggest .noData p{color:#999;margin-top:0.75rem;margin-bottom:1.5rem;} .contentSuggest .noData a{text-decoration:underline;} -.topBg02{background:#ecf6ff;border-bottom:solid 1px #e7e7e7;color:#333;text-align:justify;padding-top:1rem;margin-bottom:0.5rem;} +.topBg02{background:#ecf6ff;border-bottom:solid 1px #e5e5e5;color:#333;text-align:justify;padding-top:1rem;margin-bottom:0.5rem;} .topBg02 p{font-size:0.75rem;} .topBg02 p label{color:#999;font-size:0.75rem;} .topBg02 p em{color:#ff1100;font-size:0.75rem;} @@ -838,45 +827,17 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n .icon-collection01{width:16px;height:16px;background:url(../images/icon-collection01.png) no-repeat center center;background-size:100%;display:block;margin:0 auto;margin-bottom:0.1rem;} .icon-collection02{width:16px;height:16px;background:url(../images/icon-collection02.png) no-repeat center center;background-size:100%;display:block;margin:0 auto;margin-bottom:0.1rem;} -.contentSuggest .list-block .item-title.row{margin-left:0;width:100%;} -.contentSuggest .list-block .item-title.row .col-50{margin-left:0;margin-right:4%;} -.contentSuggest .list-block .item-title.row .col-50 p{margin:0;} -.contentSuggest .list-block .item-title.row .col-50 p label{color:#999;font-size:0.75rem;vertical-align:middle;} -.contentSuggest .list-block .item-title.row .col-50 p span{color:#333;font-size:0.75rem;margin-left:-5px;vertical-align:middle;} -.contentSuggest .list-block .item-title.row .col-50 p span.span01{display:inline-block;max-width:160%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} - -.topic .topicContent .topicContent_center em.up{color:#ff1100;} -.topic .topicContent .topicContent_center em.down{color:#2cb66a;} -.topic .topicContent .topicContent_center em i{width:9px;height:14px;display:inline-block;vertical-align:-1px;margin-right:0.1rem;} -.topic .topicContent .topicContent_center em.up i{background:url(../images/up02.png) no-repeat center center;background-size:100%;} -.topic .topicContent .topicContent_center em.down i{background:url(../images/down02.png) no-repeat center center;background-size:100%;} - /* 地图 */ -.districtMap{height:200px;margin-top:0.5rem;} .districtMap{height:200px;} .districtMap01{height:100%;} -.map{height:100%;} -.districtMap02{height:60%;} -.result{background:#fff;border-top:solid 1px #e7e7e7;border-bottom:solid 1px #e7e7e7;padding:0.75rem 0.75rem;text-align:center;} -.result em{color:#ff1100;} .icon-address{width:12px;height:18px;background:url(../images/icon-address.png) no-repeat center center;background-size:100%;margin-right:0.3rem;margin-top:-3px;} /* 周边详情 */ +.contentList .list-block .item-title small{margin-right:0.5rem;} .contentList .list-block .item-after{line-height:2.4rem;font-size:0.75rem;} .contentList .list-block .moreList{margin:0;padding:0.2rem 0;text-align:center;} -.contentList .list-block .moreList, .lessList{margin:0;padding:0.2rem 0;text-align:center;} .contentList .list-block .lessList{margin:0;padding:0.2rem 0;text-align:center;} -.contentList .list-block .item-title.row .col-50 p span.span01{display:inline-block;vertical-align:middle;max-width:160%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} -/* 我的资产 */ -.icon-assets01{width:15px;height:24px;background:url(../images/icon-assets01.png) no-repeat center center;background-size:100%;margin-right:0.75rem;margin-top:-3px;} -.icon-assets02{width:15px;height:24px;background:url(../images/icon-assets02.png) no-repeat center center;background-size:100%;margin-right:0.75rem;margin-top:-3px;} -.icon-assets03{width:15px;height:24px;background:url(../images/icon-assets03.png) no-repeat center center;background-size:100%;margin-right:0.75rem;margin-top:-3px;} -.icon-assets04{width:15px;height:24px;background:url(../images/icon-assets04.png) no-repeat center center;background-size:100%;margin-right:0.75rem;margin-top:-3px;} -.icon-assets05{width:15px;height:24px;background:url(../images/icon-assets05.png) no-repeat center center;background-size:100%;margin-right:0.75rem;margin-top:-3px;} -.icon-assets06{width:15px;height:24px;background:url(../images/icon-assets06.png) no-repeat center center;background-size:100%;margin-right:0.75rem;margin-top:-3px;} -.icon-assets07{width:15px;height:24px;background:url(../images/icon-assets07.png) no-repeat center center;background-size:100%;margin-right:0.75rem;margin-top:-3px;} -.icon-assets08{width:15px;height:24px;background:url(../images/icon-assets08.png) no-repeat center center;background-size:100%;margin-right:0.75rem;margin-top:-3px;} -.icon-assets09{width:15px;height:24px;background:url(../images/icon-assets09.png) no-repeat center center;background-size:100%;margin-right:0.75rem;margin-top:-3px;} + /* 我要贷款 */ .step{background:#fff;overflow:hidden;padding:1rem 0.75rem;} .step img{width:100%;} @@ -891,7 +852,6 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n .contentLoan .topic .topicTitle{border-bottom:none;color:#666;text-align:center;font-size:1rem;margin-top:0.75rem;} .contentLoan .topic .topicContent{padding-top:0;} .contentLoan .buttons-row.theme .button{height:4.8rem;line-height:4.8rem;background:#fbfbfb;border:solid 1px #eee;border-radius:0.1rem;font-size:0.85rem;} -.contentLoan .buttons-row .button:first-child, .buttons-row .button:last-child{border-radius:0.1rem;} .contentLoan .buttons-row .button:last-child{margin-left:0.75rem;} .contentLoan .buttons-row .button.button01{line-height:1.25rem;padding-top:1.1rem;} @@ -910,30 +870,44 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n /* 智能选房 */ .filter_btn{width:15%;position:absolute;right:0.5rem;top:0.5rem;} -.houseNum{width:3.5rem;height:3.5rem;border-radius:100%;background:#f74949;opacity:0.9;position:absolute;left:40%;top:20%;} +.houseNum{width:3.5rem;height:3.5rem;border-radius:100%;background:#f74949;opacity:0.9;border:solid 2px #fff;position:absolute;left:40%;top:20%;} .houseNum p{color:#fff;font-size:0.75rem;text-align:center;line-height:1rem;} -.icon-house{width:30px;height:30px;background:url(../images/icon-house.png) no-repeat center center;background-size:100%;position:absolute;left:45%;bottom:50%;z-index:10000;} -.icon-house01{width:50px;height:80px;background:url(../images/icon-house01.png) no-repeat center center;background-size:100%;position:absolute;left:45%;bottom:50%;z-index:10500;} +.icon-house{width:30px;height:30px;background:url(../images/icon-house.png) no-repeat center center;background-size:100%;position:absolute;left:60%;bottom:50%;z-index:10000;} +.icon-house01{width:50px;height:80px;background:url(../images/icon-house01.png) no-repeat center center;background-size:100%;position:absolute;left:58%;bottom:50%;z-index:10500;} +/* 我的 */ +.iconBox{width:100%;overflow:hidden;padding:0.5rem 0;} +.iconBox a{float:right;margin-right:0.75rem;} +.icon-message{width:20px;height:20px;background:url(../images/icon-message.png) no-repeat center center;background-size:100%;position:relative;} +.icon-message-new{width:7px;height:7px;background:url(../images/icon-message-new.png) no-repeat center center;background-size:100%;position:absolute;top:1px;right:-3px;} +.icon-set{width:20px;height:20px;background:url(../images/icon-set.png) no-repeat center center;background-size:100%;} +.icon-message01{width:24px;height:24px;background:url(../images/icon-message01.png) no-repeat center center;background-size:85%;margin-top:-2.2rem;} +.message01-new .icon-message01{width:24px;height:16px;background:url(../images/icon-message01-new.png) no-repeat center center;background-size:100%;margin-top:-2.5rem;} +.list-block .message01 .item-title{white-space:normal;text-overflow:-o-ellipsis-lastline;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;color:#666;} +.list-block .message01-new .item-title{color:#333;font-weight:bold;} +.list-block .message01 .item-subtitle{margin-top:0.5rem;} +.contentText{background:#fff;} +.topBg01{width:100%;background:url(../images/topBg.png) no-repeat center bottom;background-size:110%;padding:1.2rem 0.75rem;color:#fff;overflow:hidden;position:relative;} +.topBg01 a{color:#fff;text-decoration:underline;} +.topBg01 img{float:left;width:20%;margin-right:0.5rem;} +.topBg01 p{float:left;margin:0;margin-top:0.2rem;} +.topBg01 .icon-right{position:absolute;right:0.6rem;top:2.1rem;} /* 出错页面 */ -.contentError{padding-top:30%;} .contentError{padding-top:30%;background:none;} .contentError img{width:30%;margin:0 auto;} .contentError em{font-size:2rem;text-align:center;color:#666;display:block;} .contentError p{text-align:center;color:#999;margin-top:0;} .contentError a{text-align:center;text-decoration:underline;display:block;margin-top:2rem;} -/* 广告 */ -.ad01{display:block;margin-top:0.75rem;} -.ad01 img{width:100%;} -.ad02{display:block;margin:0.75rem 0;} -.ad02 p{color:#18a2ff;text-align:center;margin:0;} - /* 按钮 */ .content-block{margin:0;} +.content-block01 .row .col-50{width:50%;margin-left:0;} +.content-block01 .row .col-50 .button{border-radius:0;border:solid 1px #18a2ff;} +.content-block01 .row .col-50 .button.button-fill.reset_btn{background:#f7f7f7;color:#333;border:solid 1px #ccc;} + .button.addProperty_btn{background:#fff;border:dashed 1px #18a2ff;color:#2db0fc;} .button.addProperty_btn:active{background:#18a2ff;border:dashed 1px #18a2ff;color:#fff;} .button.addProperty_btn span{width:120px;margin:0 auto;display:block;} @@ -943,28 +917,20 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n .return{width:50px;height:50px;background:#fff;border:solid 1px #aaa;border-radius:100%;font-size:0.62rem;color:#666;text-align:center;position:fixed;left:0.75rem;bottom:0.75rem;} .return i{width:18px;height:18px;background:url(../images/return.png) no-repeat;background-size:100%;display:block;margin:0 auto;margin-top:0.35rem;} -/* 虚拟工具栏 */ -.toolbarImg{position:absolute;bottom:0;z-index:1;} -.toolbarImg img{width:100%;} - /* 弹窗 */ .modal-inner,.modal-button{background:#fff;} -.modal-button{color:#18a2ff;} .modal-button{color:#50a5fc;} .cancel_btn{color:#333;} .modal-text{text-align:justify;} -.modal-no-buttons .modal-text{text-align:center;} .info-container{overflow:hidden;margin-top:0.75rem;} -.info-container label{float:left;width:87px;text-align:right;} -.info-container input{float:left;width:95px;padding:0 0.3rem;} -.info-container font{float:left;margin-left:0.3rem;} .info-container label{float:left;width:87px;text-align:right;line-height:1.4rem;} -.info-container input{float:left;width:95px;padding:0 0.3rem;line-height:1.2rem;} +.info-container input{float:left;width:95px;padding:0 0.3rem;line-height:1.2rem;border:solid 1px #e6e6ea;} .info-container font{float:left;margin-left:0.3rem;line-height:1.4rem;} -.modal-no-buttons .modal-inner{background:rgba(0,0,0,0.8)} -.modal-no-buttons .modal-title{color:#fff;} +.modal-no-buttons{width:8rem;margin-left:-4rem;} .modal-no-buttons .modal-text{text-align:center;} +.modal .preloader.preloader01{animation:none;background-image:url(../images/loading.gif);background-size:100%;width:3rem;height:2.8rem;margin-left:-0.3rem;} +.modal .preloader.preloader01:after{background-image:none;} .modal01 .list-block .item-content{padding:0;} .modal01 .list-block input[type="text"]{width:40%;} @@ -1005,7 +971,7 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n -webkit-transform-origin: 50% 100%; transform-origin: 50% 100%; } -.modal01-overlay,.guideMask { +.modal01-overlay { width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); @@ -1018,41 +984,6 @@ i.loginIcon03{width:14px;height:24px;background:url(../images/loginIcon03.png) n transition-duration: 400ms; } -/* 字体图标 */ -@font-face { - font-family: "iconfont"; - src: url('../font/iconfont.eot?t=1503292782847'); /* IE9*/ - src: url('../font/iconfont.eot?t=1503292782847#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('../font/iconfont.woff?t=1503292782847') format('woff'), /* chrome, firefox */ - url('../font/iconfont.ttf?t=1503292782847') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ - url('../font/iconfont.svg?t=1503292782847#iconfont') format('svg'); /* iOS 4.1- */ -} - -.iconfont { - font-family:"iconfont" !important; - font-size:16px; - font-style:normal; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -.icon-tab03:before { content: "\e60d"; } -.icon-tab01:before { content: "\e60e"; } -.icon-tab02:before { content: "\e60f"; } -.icon-tab04:before { content: "\e610"; } -.icon-addProperty:before { content: "\e612"; } - -.contentSuggest .noData{background:#fff;height:100%;text-align:center;padding-top:5rem;} -.contentSuggest .noData img{width:30%;margin:0 auto;} -.contentSuggest .noData p{color:#666;margin-top:0.5rem;margin-bottom:1.5rem;} -.contentSuggest .noData a{text-decoration:underline;} - - -.contentList .noData{background:#fff;height:100%;text-align:center;padding-top:5rem;} -.contentList .noData img{width:30%;margin:0 auto;} -.contentList .noData p{color:#666;margin-top:0.5rem;margin-bottom:1.5rem;} -.contentList .noData a{text-decoration:underline;} - /* 滑块 */ .rangeBox{width:100%;height:12px;position:relative;} .rangeBg{width:100%;height:12px;background:#eee;border-radius:10px;position:absolute;left:0;top:7px;} @@ -1109,42 +1040,14 @@ input[type=range]::-webkit-slider-thumb { .contentStart img{width:70%;margin:0 auto;margin-top:30%;} .contentStart #test_btn{background:#fff;color:#21a5fe;width:10rem;margin:0 auto;margin-top:1.5rem;} -/* 引导盒 */ -.guideBox{width:100%;height:100%;position:absolute;z-index:11000;} -.guideText{width:74%;position:absolute;top:8.5rem;left:50%;margin-left:-37%;} -.guideKnown{width:40%;position:absolute;top:16rem;left:50%;margin-left:-20%;} -.guideSkip{width:10%;position:absolute;top:0.75rem;right:0.75rem;} -.guideBox02 .guideText{top:14rem;} -.guideBox02 .guideKnown{top:10rem;} - -.guideBox01 .link{color:rgba(255,255,255,0.8);line-height:30px;border:solid 1px rgba(255,255,255,0.8);border-radius:0.2rem;padding:0 0.4rem;float:right;margin-top:7.95em;margin-right:0.75rem;} -.guideBox02 .link{margin-top:18.1rem;padding-left:0.8rem;padding-right:0.5rem;} -.guideBox02 .link ul{border-radius:0.5rem;} -.guideBox02 .link.list-block ul:before{height:0;} - -.guideMask{background:rgba(0,0,0,0.6);} - -/**收藏*/ -.collection{position:absolute;right:0.75rem;top:1.4rem;text-align:center;color:#666;font-size:0.7rem;} -.icon-collection01{width:16px;height:16px;background:url(../images/icon-collection01.png) no-repeat center center;background-size:100%;display:block;margin:0 auto;margin-bottom:0.1rem;} -.icon-collection02{width:16px;height:16px;background:url(../images/icon-collection02.png) no-repeat center center;background-size:100%;display:block;margin:0 auto;margin-bottom:0.1rem;} - -.contentSuggest .list-block .item-title.row{margin-left:0;width:100%;} -.contentSuggest .list-block .item-title.row .col-50{margin-left:0;margin-right:4%;} -.contentSuggest .list-block .item-title.row .col-50 p{margin:0;} -.contentSuggest .list-block .item-title.row .col-50 p label{color:#999;font-size:0.75rem;vertical-align:middle;} -.contentSuggest .list-block .item-title.row .col-50 p span{color:#333;font-size:0.75rem;margin-left:-5px;vertical-align:middle;} -.contentSuggest .list-block .item-title.row .col-50 p span.span01{display:inline-block;max-width:160%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} - - /* 自适应 */ -@media(min-width:414px){ - .inputTwo .item-link .item-inner .inpu{height:26px;line-height:26px;margin:0 8px;} +@media(max-width:414px){ .list-block .item-title span.c3a{max-width:220px;} - .textAlignLeft{left:120px;} + .textAlignLeft{left:88px;} + .textAlignLeft01{left:110px;} label.spacing01{margin-right:41px;} label.spacing02{margin-right:42px;} - small.spacing01a{margin-right:4.5px;} + small.spacing01a{margin-right:3.7px;} .rangeNote span.span01{margin-right:8.5%;} .rangeNote span.span01a{margin-left:8%;} .rangeNote span.span02{margin-right:8%;} @@ -1155,7 +1058,6 @@ input[type=range]::-webkit-slider-thumb { .guideBox01 .link{margin-top:8.5em;} .guideBox02 .link{margin-top:17.7rem;} } -@media(max-width:360px){ @media(max-width:375px){ .list-block .item-title span.c3a{max-width:180px;} label.spacing01{margin-right:11px;} @@ -1169,7 +1071,6 @@ input[type=range]::-webkit-slider-thumb { } @media(max-width:320px){ .list-block .item-title span.c3a{max-width:112px;} - .inputTwo .item-link .item-inner .inpu{width:50px;} label.spacing01{margin-right:11px;} label.spacing02{margin-right:12px;} .priceInfo div div span{width:125px;} @@ -1187,19 +1088,7 @@ input[type=range]::-webkit-slider-thumb { .list-block .item-inner:after{-webkit-transform:scaleY(1);transform:scaleY(1);} } -.mark-icon-box {width:24px;height:30px;position:absolute;z-index:98;} -.mark-icon-box .mark-icon { - width: 20px; - height: 30px; - display: block; - cursor: pointer; - font-size: 14px; - color: #fff; - font-weight: bold; - text-align: center; - line-height: 24px; - background: url(../images/dw.png) no-repeat; -} + diff --git a/fangija-zsyf/images/adImg.png b/fangija-zsyf/images/adImg.png new file mode 100644 index 0000000..857312a Binary files /dev/null and b/fangija-zsyf/images/adImg.png differ diff --git a/fangija-zsyf/images/addHouse.png b/fangija-zsyf/images/addHouse.png new file mode 100644 index 0000000..ffb1e30 Binary files /dev/null and b/fangija-zsyf/images/addHouse.png differ diff --git a/fangija-zsyf/images/addProperty.png b/fangija-zsyf/images/addProperty.png new file mode 100644 index 0000000..6403623 Binary files /dev/null and b/fangija-zsyf/images/addProperty.png differ diff --git a/fangija-zsyf/images/addProperty_active.png b/fangija-zsyf/images/addProperty_active.png new file mode 100644 index 0000000..d4ebbdd Binary files /dev/null and b/fangija-zsyf/images/addProperty_active.png differ diff --git a/fangija-zsyf/images/arrow_note_down.png b/fangija-zsyf/images/arrow_note_down.png new file mode 100644 index 0000000..4e72118 Binary files /dev/null and b/fangija-zsyf/images/arrow_note_down.png differ diff --git a/fangija-zsyf/images/arrow_select.png b/fangija-zsyf/images/arrow_select.png new file mode 100644 index 0000000..7072a5b Binary files /dev/null and b/fangija-zsyf/images/arrow_select.png differ diff --git a/fangija-zsyf/images/banner.png b/fangija-zsyf/images/banner.png new file mode 100644 index 0000000..ffdb36d Binary files /dev/null and b/fangija-zsyf/images/banner.png differ diff --git a/fangija-zsyf/images/banner01.png b/fangija-zsyf/images/banner01.png new file mode 100644 index 0000000..fee3866 Binary files /dev/null and b/fangija-zsyf/images/banner01.png differ diff --git a/fangija-zsyf/images/bottomBg.png b/fangija-zsyf/images/bottomBg.png new file mode 100644 index 0000000..b671c29 Binary files /dev/null and b/fangija-zsyf/images/bottomBg.png differ diff --git a/fangija-zsyf/images/bottomBg01.png b/fangija-zsyf/images/bottomBg01.png new file mode 100644 index 0000000..64f14ee Binary files /dev/null and b/fangija-zsyf/images/bottomBg01.png differ diff --git a/fangija-zsyf/images/cardInfoBg01.png b/fangija-zsyf/images/cardInfoBg01.png new file mode 100644 index 0000000..908e8df Binary files /dev/null and b/fangija-zsyf/images/cardInfoBg01.png differ diff --git a/fangija-zsyf/images/cardInfoBg02.png b/fangija-zsyf/images/cardInfoBg02.png new file mode 100644 index 0000000..ea54c17 Binary files /dev/null and b/fangija-zsyf/images/cardInfoBg02.png differ diff --git a/fangija-zsyf/images/cardInfoBg03.png b/fangija-zsyf/images/cardInfoBg03.png new file mode 100644 index 0000000..4ef34b7 Binary files /dev/null and b/fangija-zsyf/images/cardInfoBg03.png differ diff --git a/fangija-zsyf/images/cardInfoBg04.png b/fangija-zsyf/images/cardInfoBg04.png new file mode 100644 index 0000000..e0afbdc Binary files /dev/null and b/fangija-zsyf/images/cardInfoBg04.png differ diff --git a/fangija-zsyf/images/cardInfoBg05.png b/fangija-zsyf/images/cardInfoBg05.png new file mode 100644 index 0000000..5f374cc Binary files /dev/null and b/fangija-zsyf/images/cardInfoBg05.png differ diff --git a/fangija-zsyf/images/checkImg.png b/fangija-zsyf/images/checkImg.png new file mode 100644 index 0000000..71eca2b Binary files /dev/null and b/fangija-zsyf/images/checkImg.png differ diff --git a/fangija-zsyf/images/checkImg01.png b/fangija-zsyf/images/checkImg01.png new file mode 100644 index 0000000..34d6611 Binary files /dev/null and b/fangija-zsyf/images/checkImg01.png differ diff --git a/fangija-zsyf/images/cityBg.png b/fangija-zsyf/images/cityBg.png new file mode 100644 index 0000000..b7f9073 Binary files /dev/null and b/fangija-zsyf/images/cityBg.png differ diff --git a/fangija-zsyf/images/delete.png b/fangija-zsyf/images/delete.png new file mode 100644 index 0000000..a7aba68 Binary files /dev/null and b/fangija-zsyf/images/delete.png differ diff --git a/fangija-zsyf/images/down.png b/fangija-zsyf/images/down.png new file mode 100644 index 0000000..cf8b1a0 Binary files /dev/null and b/fangija-zsyf/images/down.png differ diff --git a/fangija-zsyf/images/down01.png b/fangija-zsyf/images/down01.png new file mode 100644 index 0000000..b6ca7a5 Binary files /dev/null and b/fangija-zsyf/images/down01.png differ diff --git a/fangija-zsyf/images/down02.png b/fangija-zsyf/images/down02.png new file mode 100644 index 0000000..5a1113b Binary files /dev/null and b/fangija-zsyf/images/down02.png differ diff --git a/fangija-zsyf/images/error404.png b/fangija-zsyf/images/error404.png new file mode 100644 index 0000000..effce91 Binary files /dev/null and b/fangija-zsyf/images/error404.png differ diff --git a/fangija-zsyf/images/error500.png b/fangija-zsyf/images/error500.png new file mode 100644 index 0000000..2e69827 Binary files /dev/null and b/fangija-zsyf/images/error500.png differ diff --git a/fangija-zsyf/images/errorInternet.png b/fangija-zsyf/images/errorInternet.png new file mode 100644 index 0000000..2a0f94a Binary files /dev/null and b/fangija-zsyf/images/errorInternet.png differ diff --git a/fangija-zsyf/images/exchange-step01.png b/fangija-zsyf/images/exchange-step01.png new file mode 100644 index 0000000..8bec048 Binary files /dev/null and b/fangija-zsyf/images/exchange-step01.png differ diff --git a/fangija-zsyf/images/exchange-step02.png b/fangija-zsyf/images/exchange-step02.png new file mode 100644 index 0000000..629cd73 Binary files /dev/null and b/fangija-zsyf/images/exchange-step02.png differ diff --git a/fangija-zsyf/images/filter.png b/fangija-zsyf/images/filter.png new file mode 100644 index 0000000..14c02c6 Binary files /dev/null and b/fangija-zsyf/images/filter.png differ diff --git a/fangija-zsyf/images/grayIcon01.png b/fangija-zsyf/images/grayIcon01.png new file mode 100644 index 0000000..5466f25 Binary files /dev/null and b/fangija-zsyf/images/grayIcon01.png differ diff --git a/fangija-zsyf/images/grayIcon02.png b/fangija-zsyf/images/grayIcon02.png new file mode 100644 index 0000000..3077c5f Binary files /dev/null and b/fangija-zsyf/images/grayIcon02.png differ diff --git a/fangija-zsyf/images/grayIcon03.png b/fangija-zsyf/images/grayIcon03.png new file mode 100644 index 0000000..44080fc Binary files /dev/null and b/fangija-zsyf/images/grayIcon03.png differ diff --git a/fangija-zsyf/images/grayIcon04.png b/fangija-zsyf/images/grayIcon04.png new file mode 100644 index 0000000..0693bf1 Binary files /dev/null and b/fangija-zsyf/images/grayIcon04.png differ diff --git a/fangija-zsyf/images/headPortrait-wx.png b/fangija-zsyf/images/headPortrait-wx.png new file mode 100644 index 0000000..484e528 Binary files /dev/null and b/fangija-zsyf/images/headPortrait-wx.png differ diff --git a/fangija-zsyf/images/headPortrait.png b/fangija-zsyf/images/headPortrait.png new file mode 100644 index 0000000..f1ce268 Binary files /dev/null and b/fangija-zsyf/images/headPortrait.png differ diff --git a/fangija-zsyf/images/houseNote.png b/fangija-zsyf/images/houseNote.png new file mode 100644 index 0000000..c2a4f72 Binary files /dev/null and b/fangija-zsyf/images/houseNote.png differ diff --git a/fangija-zsyf/images/icon-address.png b/fangija-zsyf/images/icon-address.png new file mode 100644 index 0000000..8b49cac Binary files /dev/null and b/fangija-zsyf/images/icon-address.png differ diff --git a/fangija-zsyf/images/icon-address01.png b/fangija-zsyf/images/icon-address01.png new file mode 100644 index 0000000..22f891e Binary files /dev/null and b/fangija-zsyf/images/icon-address01.png differ diff --git a/fangija-zsyf/images/icon-address02.png b/fangija-zsyf/images/icon-address02.png new file mode 100644 index 0000000..e98a46a Binary files /dev/null and b/fangija-zsyf/images/icon-address02.png differ diff --git a/fangija-zsyf/images/icon-around01-active.png b/fangija-zsyf/images/icon-around01-active.png new file mode 100644 index 0000000..af8df41 Binary files /dev/null and b/fangija-zsyf/images/icon-around01-active.png differ diff --git a/fangija-zsyf/images/icon-around01.png b/fangija-zsyf/images/icon-around01.png new file mode 100644 index 0000000..4a7a13c Binary files /dev/null and b/fangija-zsyf/images/icon-around01.png differ diff --git a/fangija-zsyf/images/icon-around02-active.png b/fangija-zsyf/images/icon-around02-active.png new file mode 100644 index 0000000..f72304b Binary files /dev/null and b/fangija-zsyf/images/icon-around02-active.png differ diff --git a/fangija-zsyf/images/icon-around02.png b/fangija-zsyf/images/icon-around02.png new file mode 100644 index 0000000..78bee60 Binary files /dev/null and b/fangija-zsyf/images/icon-around02.png differ diff --git a/fangija-zsyf/images/icon-around03-active.png b/fangija-zsyf/images/icon-around03-active.png new file mode 100644 index 0000000..4fb78a0 Binary files /dev/null and b/fangija-zsyf/images/icon-around03-active.png differ diff --git a/fangija-zsyf/images/icon-around03.png b/fangija-zsyf/images/icon-around03.png new file mode 100644 index 0000000..be5a29d Binary files /dev/null and b/fangija-zsyf/images/icon-around03.png differ diff --git a/fangija-zsyf/images/icon-around04-active.png b/fangija-zsyf/images/icon-around04-active.png new file mode 100644 index 0000000..f8a0fc0 Binary files /dev/null and b/fangija-zsyf/images/icon-around04-active.png differ diff --git a/fangija-zsyf/images/icon-around04.png b/fangija-zsyf/images/icon-around04.png new file mode 100644 index 0000000..063e3fa Binary files /dev/null and b/fangija-zsyf/images/icon-around04.png differ diff --git a/fangija-zsyf/images/icon-around05-active.png b/fangija-zsyf/images/icon-around05-active.png new file mode 100644 index 0000000..7dbfa60 Binary files /dev/null and b/fangija-zsyf/images/icon-around05-active.png differ diff --git a/fangija-zsyf/images/icon-around05.png b/fangija-zsyf/images/icon-around05.png new file mode 100644 index 0000000..4359fff Binary files /dev/null and b/fangija-zsyf/images/icon-around05.png differ diff --git a/fangija-zsyf/images/icon-around06-active.png b/fangija-zsyf/images/icon-around06-active.png new file mode 100644 index 0000000..dbad78f Binary files /dev/null and b/fangija-zsyf/images/icon-around06-active.png differ diff --git a/fangija-zsyf/images/icon-around06.png b/fangija-zsyf/images/icon-around06.png new file mode 100644 index 0000000..11bc20f Binary files /dev/null and b/fangija-zsyf/images/icon-around06.png differ diff --git a/fangija-zsyf/images/icon-around07-active.png b/fangija-zsyf/images/icon-around07-active.png new file mode 100644 index 0000000..251f8ee Binary files /dev/null and b/fangija-zsyf/images/icon-around07-active.png differ diff --git a/fangija-zsyf/images/icon-around07.png b/fangija-zsyf/images/icon-around07.png new file mode 100644 index 0000000..8a32f10 Binary files /dev/null and b/fangija-zsyf/images/icon-around07.png differ diff --git a/fangija-zsyf/images/icon-around08-active.png b/fangija-zsyf/images/icon-around08-active.png new file mode 100644 index 0000000..4f8d459 Binary files /dev/null and b/fangija-zsyf/images/icon-around08-active.png differ diff --git a/fangija-zsyf/images/icon-around08.png b/fangija-zsyf/images/icon-around08.png new file mode 100644 index 0000000..28bdd89 Binary files /dev/null and b/fangija-zsyf/images/icon-around08.png differ diff --git a/fangija-zsyf/images/icon-arrow-green.png b/fangija-zsyf/images/icon-arrow-green.png new file mode 100644 index 0000000..7c57031 Binary files /dev/null and b/fangija-zsyf/images/icon-arrow-green.png differ diff --git a/fangija-zsyf/images/icon-arrow-red.png b/fangija-zsyf/images/icon-arrow-red.png new file mode 100644 index 0000000..b25e3a6 Binary files /dev/null and b/fangija-zsyf/images/icon-arrow-red.png differ diff --git a/fangija-zsyf/images/icon-city.png b/fangija-zsyf/images/icon-city.png new file mode 100644 index 0000000..4483eef Binary files /dev/null and b/fangija-zsyf/images/icon-city.png differ diff --git a/fangija-zsyf/images/icon-collection01.png b/fangija-zsyf/images/icon-collection01.png new file mode 100644 index 0000000..c2804b0 Binary files /dev/null and b/fangija-zsyf/images/icon-collection01.png differ diff --git a/fangija-zsyf/images/icon-collection02.png b/fangija-zsyf/images/icon-collection02.png new file mode 100644 index 0000000..0856fe4 Binary files /dev/null and b/fangija-zsyf/images/icon-collection02.png differ diff --git a/fangija-zsyf/images/icon-collection03.png b/fangija-zsyf/images/icon-collection03.png new file mode 100644 index 0000000..952e82e Binary files /dev/null and b/fangija-zsyf/images/icon-collection03.png differ diff --git a/fangija-zsyf/images/icon-collection03a.png b/fangija-zsyf/images/icon-collection03a.png new file mode 100644 index 0000000..f7302b3 Binary files /dev/null and b/fangija-zsyf/images/icon-collection03a.png differ diff --git a/fangija-zsyf/images/icon-comments-grey.png b/fangija-zsyf/images/icon-comments-grey.png new file mode 100644 index 0000000..47d4c43 Binary files /dev/null and b/fangija-zsyf/images/icon-comments-grey.png differ diff --git a/fangija-zsyf/images/icon-comments-white.png b/fangija-zsyf/images/icon-comments-white.png new file mode 100644 index 0000000..82601e4 Binary files /dev/null and b/fangija-zsyf/images/icon-comments-white.png differ diff --git a/fangija-zsyf/images/icon-history.png b/fangija-zsyf/images/icon-history.png new file mode 100644 index 0000000..186ad54 Binary files /dev/null and b/fangija-zsyf/images/icon-history.png differ diff --git a/fangija-zsyf/images/icon-home01.png b/fangija-zsyf/images/icon-home01.png new file mode 100644 index 0000000..fe9ab9b Binary files /dev/null and b/fangija-zsyf/images/icon-home01.png differ diff --git a/fangija-zsyf/images/icon-home02.png b/fangija-zsyf/images/icon-home02.png new file mode 100644 index 0000000..d4de7c6 Binary files /dev/null and b/fangija-zsyf/images/icon-home02.png differ diff --git a/fangija-zsyf/images/icon-home03.png b/fangija-zsyf/images/icon-home03.png new file mode 100644 index 0000000..aa9f6e3 Binary files /dev/null and b/fangija-zsyf/images/icon-home03.png differ diff --git a/fangija-zsyf/images/icon-home04.png b/fangija-zsyf/images/icon-home04.png new file mode 100644 index 0000000..3520f47 Binary files /dev/null and b/fangija-zsyf/images/icon-home04.png differ diff --git a/fangija-zsyf/images/icon-house.png b/fangija-zsyf/images/icon-house.png new file mode 100644 index 0000000..c41b802 Binary files /dev/null and b/fangija-zsyf/images/icon-house.png differ diff --git a/fangija-zsyf/images/icon-house01.png b/fangija-zsyf/images/icon-house01.png new file mode 100644 index 0000000..3cd27d2 Binary files /dev/null and b/fangija-zsyf/images/icon-house01.png differ diff --git a/fangija-zsyf/images/icon-menu01.png b/fangija-zsyf/images/icon-menu01.png new file mode 100644 index 0000000..f3cf90d Binary files /dev/null and b/fangija-zsyf/images/icon-menu01.png differ diff --git a/fangija-zsyf/images/icon-menu01a.png b/fangija-zsyf/images/icon-menu01a.png new file mode 100644 index 0000000..b17ada7 Binary files /dev/null and b/fangija-zsyf/images/icon-menu01a.png differ diff --git a/fangija-zsyf/images/icon-menu02.png b/fangija-zsyf/images/icon-menu02.png new file mode 100644 index 0000000..f4b44d4 Binary files /dev/null and b/fangija-zsyf/images/icon-menu02.png differ diff --git a/fangija-zsyf/images/icon-menu02a.png b/fangija-zsyf/images/icon-menu02a.png new file mode 100644 index 0000000..882607b Binary files /dev/null and b/fangija-zsyf/images/icon-menu02a.png differ diff --git a/fangija-zsyf/images/icon-menu03.png b/fangija-zsyf/images/icon-menu03.png new file mode 100644 index 0000000..960412b Binary files /dev/null and b/fangija-zsyf/images/icon-menu03.png differ diff --git a/fangija-zsyf/images/icon-menu03a.png b/fangija-zsyf/images/icon-menu03a.png new file mode 100644 index 0000000..cb9c854 Binary files /dev/null and b/fangija-zsyf/images/icon-menu03a.png differ diff --git a/fangija-zsyf/images/icon-menu04.png b/fangija-zsyf/images/icon-menu04.png new file mode 100644 index 0000000..2ade4aa Binary files /dev/null and b/fangija-zsyf/images/icon-menu04.png differ diff --git a/fangija-zsyf/images/icon-menu04a.png b/fangija-zsyf/images/icon-menu04a.png new file mode 100644 index 0000000..5a35d9e Binary files /dev/null and b/fangija-zsyf/images/icon-menu04a.png differ diff --git a/fangija-zsyf/images/icon-menu05a.png b/fangija-zsyf/images/icon-menu05a.png new file mode 100644 index 0000000..9f3725f Binary files /dev/null and b/fangija-zsyf/images/icon-menu05a.png differ diff --git a/fangija-zsyf/images/icon-message-new.png b/fangija-zsyf/images/icon-message-new.png new file mode 100644 index 0000000..e2d22a1 Binary files /dev/null and b/fangija-zsyf/images/icon-message-new.png differ diff --git a/fangija-zsyf/images/icon-message.png b/fangija-zsyf/images/icon-message.png new file mode 100644 index 0000000..d46939e Binary files /dev/null and b/fangija-zsyf/images/icon-message.png differ diff --git a/fangija-zsyf/images/icon-message01-new.png b/fangija-zsyf/images/icon-message01-new.png new file mode 100644 index 0000000..b404693 Binary files /dev/null and b/fangija-zsyf/images/icon-message01-new.png differ diff --git a/fangija-zsyf/images/icon-message01.png b/fangija-zsyf/images/icon-message01.png new file mode 100644 index 0000000..e03912d Binary files /dev/null and b/fangija-zsyf/images/icon-message01.png differ diff --git a/fangija-zsyf/images/icon-note.png b/fangija-zsyf/images/icon-note.png new file mode 100644 index 0000000..8a6f9c9 Binary files /dev/null and b/fangija-zsyf/images/icon-note.png differ diff --git a/fangija-zsyf/images/icon-path.png b/fangija-zsyf/images/icon-path.png new file mode 100644 index 0000000..e98690e Binary files /dev/null and b/fangija-zsyf/images/icon-path.png differ diff --git a/fangija-zsyf/images/icon-path01.png b/fangija-zsyf/images/icon-path01.png new file mode 100644 index 0000000..58af9c5 Binary files /dev/null and b/fangija-zsyf/images/icon-path01.png differ diff --git a/fangija-zsyf/images/icon-praise-grey.png b/fangija-zsyf/images/icon-praise-grey.png new file mode 100644 index 0000000..b3533ad Binary files /dev/null and b/fangija-zsyf/images/icon-praise-grey.png differ diff --git a/fangija-zsyf/images/icon-praise-white.png b/fangija-zsyf/images/icon-praise-white.png new file mode 100644 index 0000000..294953d Binary files /dev/null and b/fangija-zsyf/images/icon-praise-white.png differ diff --git a/fangija-zsyf/images/icon-set.png b/fangija-zsyf/images/icon-set.png new file mode 100644 index 0000000..4e1d0c0 Binary files /dev/null and b/fangija-zsyf/images/icon-set.png differ diff --git a/fangija-zsyf/images/icon-tab01-active.png b/fangija-zsyf/images/icon-tab01-active.png new file mode 100644 index 0000000..3cd5cac Binary files /dev/null and b/fangija-zsyf/images/icon-tab01-active.png differ diff --git a/fangija-zsyf/images/icon-tab01.png b/fangija-zsyf/images/icon-tab01.png new file mode 100644 index 0000000..8f9889b Binary files /dev/null and b/fangija-zsyf/images/icon-tab01.png differ diff --git a/fangija-zsyf/images/icon-tab02-active.png b/fangija-zsyf/images/icon-tab02-active.png new file mode 100644 index 0000000..bddd879 Binary files /dev/null and b/fangija-zsyf/images/icon-tab02-active.png differ diff --git a/fangija-zsyf/images/icon-tab02.png b/fangija-zsyf/images/icon-tab02.png new file mode 100644 index 0000000..3e02478 Binary files /dev/null and b/fangija-zsyf/images/icon-tab02.png differ diff --git a/fangija-zsyf/images/icon-tab03-active.png b/fangija-zsyf/images/icon-tab03-active.png new file mode 100644 index 0000000..e40fd13 Binary files /dev/null and b/fangija-zsyf/images/icon-tab03-active.png differ diff --git a/fangija-zsyf/images/icon-tab03.png b/fangija-zsyf/images/icon-tab03.png new file mode 100644 index 0000000..1deab3d Binary files /dev/null and b/fangija-zsyf/images/icon-tab03.png differ diff --git a/fangija-zsyf/images/icon-tab04-active.png b/fangija-zsyf/images/icon-tab04-active.png new file mode 100644 index 0000000..6a1d0c7 Binary files /dev/null and b/fangija-zsyf/images/icon-tab04-active.png differ diff --git a/fangija-zsyf/images/icon-tab04.png b/fangija-zsyf/images/icon-tab04.png new file mode 100644 index 0000000..471f2e4 Binary files /dev/null and b/fangija-zsyf/images/icon-tab04.png differ diff --git a/fangija-zsyf/images/icon-tab05-active.png b/fangija-zsyf/images/icon-tab05-active.png new file mode 100644 index 0000000..15df7de Binary files /dev/null and b/fangija-zsyf/images/icon-tab05-active.png differ diff --git a/fangija-zsyf/images/icon-tab05.png b/fangija-zsyf/images/icon-tab05.png new file mode 100644 index 0000000..328af7c Binary files /dev/null and b/fangija-zsyf/images/icon-tab05.png differ diff --git a/fangija-zsyf/images/icon-wx.png b/fangija-zsyf/images/icon-wx.png new file mode 100644 index 0000000..89062af Binary files /dev/null and b/fangija-zsyf/images/icon-wx.png differ diff --git a/fangija-zsyf/images/loan-img01.png b/fangija-zsyf/images/loan-img01.png new file mode 100644 index 0000000..10cfc7f Binary files /dev/null and b/fangija-zsyf/images/loan-img01.png differ diff --git a/fangija-zsyf/images/loan-img02.png b/fangija-zsyf/images/loan-img02.png new file mode 100644 index 0000000..cf7c3c7 Binary files /dev/null and b/fangija-zsyf/images/loan-img02.png differ diff --git a/fangija-zsyf/images/loan01.png b/fangija-zsyf/images/loan01.png new file mode 100644 index 0000000..cd8112d Binary files /dev/null and b/fangija-zsyf/images/loan01.png differ diff --git a/fangija-zsyf/images/loan02.png b/fangija-zsyf/images/loan02.png new file mode 100644 index 0000000..96b7d8c Binary files /dev/null and b/fangija-zsyf/images/loan02.png differ diff --git a/fangija-zsyf/images/loan03.png b/fangija-zsyf/images/loan03.png new file mode 100644 index 0000000..a7d83dc Binary files /dev/null and b/fangija-zsyf/images/loan03.png differ diff --git a/fangija-zsyf/images/loginCode.png b/fangija-zsyf/images/loginCode.png new file mode 100644 index 0000000..52315f0 Binary files /dev/null and b/fangija-zsyf/images/loginCode.png differ diff --git a/fangija-zsyf/images/noData.png b/fangija-zsyf/images/noData.png new file mode 100644 index 0000000..f7d9239 Binary files /dev/null and b/fangija-zsyf/images/noData.png differ diff --git a/fangija-zsyf/images/search.png b/fangija-zsyf/images/search.png new file mode 100644 index 0000000..3e65b8d Binary files /dev/null and b/fangija-zsyf/images/search.png differ diff --git a/fangija-zsyf/images/start.png b/fangija-zsyf/images/start.png new file mode 100644 index 0000000..af0b046 Binary files /dev/null and b/fangija-zsyf/images/start.png differ diff --git a/fangija-zsyf/images/topBg.png b/fangija-zsyf/images/topBg.png new file mode 100644 index 0000000..d561d06 Binary files /dev/null and b/fangija-zsyf/images/topBg.png differ diff --git a/fangija-zsyf/images/up.png b/fangija-zsyf/images/up.png new file mode 100644 index 0000000..74f6e32 Binary files /dev/null and b/fangija-zsyf/images/up.png differ diff --git a/fangija-zsyf/images/up01.png b/fangija-zsyf/images/up01.png new file mode 100644 index 0000000..c713783 Binary files /dev/null and b/fangija-zsyf/images/up01.png differ diff --git a/fangija-zsyf/images/up02.png b/fangija-zsyf/images/up02.png new file mode 100644 index 0000000..e2cbd8b Binary files /dev/null and b/fangija-zsyf/images/up02.png differ diff --git a/fangija-zsyf/images/updown_bottom01.png b/fangija-zsyf/images/updown_bottom01.png new file mode 100644 index 0000000..8f372f2 Binary files /dev/null and b/fangija-zsyf/images/updown_bottom01.png differ diff --git a/fangija-zsyf/images/updown_bottom02.png b/fangija-zsyf/images/updown_bottom02.png new file mode 100644 index 0000000..c0783ef Binary files /dev/null and b/fangija-zsyf/images/updown_bottom02.png differ diff --git a/fangija-zsyf/images/updown_bottom03.png b/fangija-zsyf/images/updown_bottom03.png new file mode 100644 index 0000000..3a3cd10 Binary files /dev/null and b/fangija-zsyf/images/updown_bottom03.png differ diff --git a/fangija-zsyf/images/updown_top01.png b/fangija-zsyf/images/updown_top01.png new file mode 100644 index 0000000..aa4653f Binary files /dev/null and b/fangija-zsyf/images/updown_top01.png differ diff --git a/fangija-zsyf/images/updown_top02.png b/fangija-zsyf/images/updown_top02.png new file mode 100644 index 0000000..b72b433 Binary files /dev/null and b/fangija-zsyf/images/updown_top02.png differ diff --git a/fangija-zsyf/images/updown_top03.png b/fangija-zsyf/images/updown_top03.png new file mode 100644 index 0000000..c57d462 Binary files /dev/null and b/fangija-zsyf/images/updown_top03.png differ diff --git a/fangija-zsyf/images/whiteIcon01.png b/fangija-zsyf/images/whiteIcon01.png new file mode 100644 index 0000000..5ffb2f5 Binary files /dev/null and b/fangija-zsyf/images/whiteIcon01.png differ diff --git a/fangija-zsyf/images/whiteIcon02.png b/fangija-zsyf/images/whiteIcon02.png new file mode 100644 index 0000000..f9d0f28 Binary files /dev/null and b/fangija-zsyf/images/whiteIcon02.png differ diff --git a/fangija-zsyf/images/whiteIcon03.png b/fangija-zsyf/images/whiteIcon03.png new file mode 100644 index 0000000..dea2ef7 Binary files /dev/null and b/fangija-zsyf/images/whiteIcon03.png differ diff --git a/fangija-zsyf/images/whiteIcon04.png b/fangija-zsyf/images/whiteIcon04.png new file mode 100644 index 0000000..cdf5730 Binary files /dev/null and b/fangija-zsyf/images/whiteIcon04.png differ diff --git a/fangija-zsyf/images/wx.png b/fangija-zsyf/images/wx.png new file mode 100644 index 0000000..67b1279 Binary files /dev/null and b/fangija-zsyf/images/wx.png differ diff --git a/fangija-zsyf/js/cn.js b/fangija-zsyf/js/cn.js new file mode 100644 index 0000000..848bf40 --- /dev/null +++ b/fangija-zsyf/js/cn.js @@ -0,0 +1,22 @@ +/*! + * ===================================================== + * light7 V0.4.3 - http://light7.org/ + * + * ===================================================== + */ +"use strict"; + +/* global $:true */ ++function ($) { + var modal = $.modal.prototype.defaults; + modal.modalButtonOk = "确定"; + modal.modalButtonCancel = "取消"; + modal.modalPreloaderTitle = "正在加载..."; + + var calendar = $.fn.calendar.prototype.defaults; + + calendar.monthNames = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月' , '九月' , '十月', '十一月', '十二月']; + calendar.monthNamesShort = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月' , '九月' , '十月', '十一月', '十二月']; + calendar.dayNames = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']; + calendar.dayNamesShort = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']; +}($); diff --git a/fangija-zsyf/js/light7.js b/fangija-zsyf/js/light7.js new file mode 100644 index 0000000..b3817db --- /dev/null +++ b/fangija-zsyf/js/light7.js @@ -0,0 +1,5474 @@ +/*! + * ===================================================== + * light7 V0.4.3 - http://light7.org/ + * + * ===================================================== + */ +/* global $:true */ ++function ($) { + "use strict"; + + //全局配置 + var defaults = { + autoInit: false, //自动初始化页面 + showPageLoadingIndicator: true, //push.js加载页面的时候显示一个加载提示 + router: true, //默认使用router + swipePanel: "left", //滑动打开侧栏 + swipePanelOnlyClose: false, //只允许滑动关闭,不允许滑动打开侧栏 + pushAnimationDuration: 400 //不要动这个,这是解决安卓 animationEnd 事件无法触发的bug + }; + + $.smConfig = $.extend(defaults, $.config); + +}($); + +/*=========================== +Device/OS Detection +===========================*/ +/* global $:true */ +;(function ($) { + "use strict"; + var device = {}; + var ua = navigator.userAgent; + + var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); + var ipad = ua.match(/(iPad).*OS\s([\d_]+)/); + var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/); + var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/); + + device.ios = device.android = device.iphone = device.ipad = device.androidChrome = false; + + // Android + if (android) { + device.os = 'android'; + device.osVersion = android[2]; + device.android = true; + device.androidChrome = ua.toLowerCase().indexOf('chrome') >= 0; + } + if (ipad || iphone || ipod) { + device.os = 'ios'; + device.ios = true; + } + // iOS + if (iphone && !ipod) { + device.osVersion = iphone[2].replace(/_/g, '.'); + device.iphone = true; + } + if (ipad) { + device.osVersion = ipad[2].replace(/_/g, '.'); + device.ipad = true; + } + if (ipod) { + device.osVersion = ipod[3] ? ipod[3].replace(/_/g, '.') : null; + device.iphone = true; + } + // iOS 8+ changed UA + if (device.ios && device.osVersion && ua.indexOf('Version/') >= 0) { + if (device.osVersion.split('.')[0] === '10') { + device.osVersion = ua.toLowerCase().split('version/')[1].split(' ')[0]; + } + } + + // Webview + device.webView = (iphone || ipad || ipod) && ua.match(/.*AppleWebKit(?!.*Safari)/i); + + // Minimal UI + if (device.os && device.os === 'ios') { + var osVersionArr = device.osVersion.split('.'); + device.minimalUi = !device.webView && + (ipod || iphone) && + (osVersionArr[0] * 1 === 7 ? osVersionArr[1] * 1 >= 1 : osVersionArr[0] * 1 > 7) && + $('meta[name="viewport"]').length > 0 && $('meta[name="viewport"]').attr('content').indexOf('minimal-ui') >= 0; + } + + // Check for status bar and fullscreen app mode + var windowWidth = $(window).width(); + var windowHeight = $(window).height(); + device.statusBar = false; + if (device.webView && (windowWidth * windowHeight === screen.width * screen.height)) { + device.statusBar = true; + } + else { + device.statusBar = false; + } + + // Classes + var classNames = []; + + // Pixel Ratio + device.pixelRatio = window.devicePixelRatio || 1; + classNames.push('pixel-ratio-' + Math.floor(device.pixelRatio)); + if (device.pixelRatio >= 2) { + classNames.push('retina'); + } + + // OS classes + if (device.os) { + classNames.push(device.os, device.os + '-' + device.osVersion.split('.')[0], device.os + '-' + device.osVersion.replace(/\./g, '-')); + if (device.os === 'ios') { + var major = parseInt(device.osVersion.split('.')[0], 10); + for (var i = major - 1; i >= 6; i--) { + classNames.push('ios-gt-' + i); + } + } + + } + // Status bar classes + if (device.statusBar) { + classNames.push('with-statusbar-overlay'); + } + else { + $('html').removeClass('with-statusbar-overlay'); + } + + // Add html classes + if (classNames.length > 0) $('html').addClass(classNames.join(' ')); + + $.device = device; +})($); + +/* global $:true */ ++ function($) { + "use strict"; + + //比较一个字符串版本号 + //a > b === 1 + //a = b === 0 + //a < b === -1 + $.compareVersion = function(a, b) { + var as = a.split('.'); + var bs = b.split('.'); + if (a === b) return 0; + + for (var i = 0; i < as.length; i++) { + var x = parseInt(as[i]); + if (!bs[i]) return 1; + var y = parseInt(bs[i]); + if (x < y) return -1; + if (x > y) return 1; + } + return 1; + }; + + $.getTouchPosition = function(e) { + e = e.originalEvent || e; //jquery wrap the originevent + if(e.type === 'touchstart' || e.type === 'touchmove' || e.type === 'touchend') { + return { + x: e.targetTouches[0].pageX, + y: e.targetTouches[0].pageY + }; + } else { + return { + x: e.pageX, + y: e.pageY + }; + } + }; + +}($); + +// Zepto.js +// (c) 2010-2015 Thomas Fuchs +// Zepto.js may be freely distributed under the MIT license. ++ function($) { + "use strict"; + function detect(ua, platform) { + var os = this.os = {}, // jshint ignore:line + browser = this.browser = {},// jshint ignore:line + webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/), + android = ua.match(/(Android);?[\s\/]+([\d.]+)?/), + osx = !!ua.match(/\(Macintosh\; Intel /), + ipad = ua.match(/(iPad).*OS\s([\d_]+)/), + ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/), + iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/), + webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/), + win = /Win\d{2}|Windows/.test(platform), + wp = ua.match(/Windows Phone ([\d.]+)/), + touchpad = webos && ua.match(/TouchPad/), + kindle = ua.match(/Kindle\/([\d.]+)/), + silk = ua.match(/Silk\/([\d._]+)/), + blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/), + bb10 = ua.match(/(BB10).*Version\/([\d.]+)/), + rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/), + playbook = ua.match(/PlayBook/), + chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/), + firefox = ua.match(/Firefox\/([\d.]+)/), + firefoxos = ua.match(/\((?:Mobile|Tablet); rv:([\d.]+)\).*Firefox\/[\d.]+/), + ie = ua.match(/MSIE\s([\d.]+)/) || ua.match(/Trident\/[\d](?=[^\?]+).*rv:([0-9.].)/), + webview = !chrome && ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/), + safari = webview || ua.match(/Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/); + + // Todo: clean this up with a better OS/browser seperation: + // - discern (more) between multiple browsers on android + // - decide if kindle fire in silk mode is android or not + // - Firefox on Android doesn't specify the Android version + // - possibly devide in os, device and browser hashes + + if (browser.webkit = !!webkit) browser.version = webkit[1]; // jshint ignore:line + + if (android) os.android = true, os.version = android[2]; + if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.'); + if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.'); + if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null; + if (wp) os.wp = true, os.version = wp[1]; + if (webos) os.webos = true, os.version = webos[2]; + if (touchpad) os.touchpad = true; + if (blackberry) os.blackberry = true, os.version = blackberry[2]; + if (bb10) os.bb10 = true, os.version = bb10[2]; + if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2]; + if (playbook) browser.playbook = true; + if (kindle) os.kindle = true, os.version = kindle[1]; + if (silk) browser.silk = true, browser.version = silk[1]; + if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true; + if (chrome) browser.chrome = true, browser.version = chrome[1]; + if (firefox) browser.firefox = true, browser.version = firefox[1]; + if (firefoxos) os.firefoxos = true, os.version = firefoxos[1]; + if (ie) browser.ie = true, browser.version = ie[1]; + if (safari && (osx || os.ios || win)) { + browser.safari = true; + if (!os.ios) browser.version = safari[1]; + } + if (webview) browser.webview = true; + + os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) || + (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/))); + os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos || blackberry || bb10 || + (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\/([\d.]+)/)) || + (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/)))); + } + + detect.call($, navigator.userAgent, navigator.platform); + // make available to unit tests + $.__detect = detect; + +}($); // jshint ignore:line + +/* global $:true */ +/* global WebKitCSSMatrix:true */ + +(function($) { + "use strict"; + ['width', 'height'].forEach(function(dimension) { + var Dimension = dimension.replace(/./, function(m) { + return m[0].toUpperCase(); + }); + $.fn['outer' + Dimension] = function(margin) { + var elem = this; + if (elem) { + var size = elem[dimension](); + var sides = { + 'width': ['left', 'right'], + 'height': ['top', 'bottom'] + }; + sides[dimension].forEach(function(side) { + if (margin) size += parseInt(elem.css('margin-' + side), 10); + }); + return size; + } else { + return null; + } + }; + }); + + $.noop = function() {}; + + //support + $.support = (function() { + var support = { + touch: !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch) + }; + return support; + })(); + + $.touchEvents = { + start: $.support.touch ? 'touchstart' : 'mousedown', + move: $.support.touch ? 'touchmove' : 'mousemove', + end: $.support.touch ? 'touchend' : 'mouseup' + }; + + $.getTranslate = function (el, axis) { + var matrix, curTransform, curStyle, transformMatrix; + + // automatic axis detection + if (typeof axis === 'undefined') { + axis = 'x'; + } + + curStyle = window.getComputedStyle(el, null); + if (window.WebKitCSSMatrix) { + // Some old versions of Webkit choke when 'none' is passed; pass + // empty string instead in this case + transformMatrix = new WebKitCSSMatrix(curStyle.webkitTransform === 'none' ? '' : curStyle.webkitTransform); + } + else { + transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,'); + matrix = transformMatrix.toString().split(','); + } + + if (axis === 'x') { + //Latest Chrome and webkits Fix + if (window.WebKitCSSMatrix) + curTransform = transformMatrix.m41; + //Crazy IE10 Matrix + else if (matrix.length === 16) + curTransform = parseFloat(matrix[12]); + //Normal Browsers + else + curTransform = parseFloat(matrix[4]); + } + if (axis === 'y') { + //Latest Chrome and webkits Fix + if (window.WebKitCSSMatrix) + curTransform = transformMatrix.m42; + //Crazy IE10 Matrix + else if (matrix.length === 16) + curTransform = parseFloat(matrix[13]); + //Normal Browsers + else + curTransform = parseFloat(matrix[5]); + } + + return curTransform || 0; + }; + $.requestAnimationFrame = function (callback) { + if (window.requestAnimationFrame) return window.requestAnimationFrame(callback); + else if (window.webkitRequestAnimationFrame) return window.webkitRequestAnimationFrame(callback); + else if (window.mozRequestAnimationFrame) return window.mozRequestAnimationFrame(callback); + else { + return window.setTimeout(callback, 1000 / 60); + } + }; + + $.cancelAnimationFrame = function (id) { + if (window.cancelAnimationFrame) return window.cancelAnimationFrame(id); + else if (window.webkitCancelAnimationFrame) return window.webkitCancelAnimationFrame(id); + else if (window.mozCancelAnimationFrame) return window.mozCancelAnimationFrame(id); + else { + return window.clearTimeout(id); + } + }; + + + $.fn.transitionEnd = function(callback) { + var events = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'], + i, dom = this; + + function fireCallBack(e) { + /*jshint validthis:true */ + if (e.target !== this) return; + callback.call(this, e); + for (i = 0; i < events.length; i++) { + dom.off(events[i], fireCallBack); + } + } + if (callback) { + for (i = 0; i < events.length; i++) { + dom.on(events[i], fireCallBack); + } + } + return this; + }; + $.fn.dataset = function() { + var el = this[0]; + if (el) { + var dataset = {}; + if (el.dataset) { + + for (var dataKey in el.dataset) { // jshint ignore:line + dataset[dataKey] = el.dataset[dataKey]; + } + } else { + for (var i = 0; i < el.attributes.length; i++) { + var attr = el.attributes[i]; + if (attr.name.indexOf('data-') >= 0) { + dataset[$.toCamelCase(attr.name.split('data-')[1])] = attr.value; + } + } + } + for (var key in dataset) { + if (dataset[key] === 'false') dataset[key] = false; + else if (dataset[key] === 'true') dataset[key] = true; + else if (parseFloat(dataset[key]) === dataset[key] * 1) dataset[key] = dataset[key] * 1; + } + return dataset; + } else return undefined; + }; + $.fn.data = function(key, value) { + if (typeof value === 'undefined') { + // Get value + if (this[0] && this[0].getAttribute) { + var dataKey = this[0].getAttribute('data-' + key); + + if (dataKey) { + return dataKey; + } else if (this[0].smElementDataStorage && (key in this[0].smElementDataStorage)) { + + + return this[0].smElementDataStorage[key]; + + } else { + return undefined; + } + } else return undefined; + + } else { + // Set value + for (var i = 0; i < this.length; i++) { + var el = this[i]; + if (!el.smElementDataStorage) el.smElementDataStorage = {}; + el.smElementDataStorage[key] = value; + } + return this; + } + }; + $.fn.animationEnd = function(callback) { + var events = ['webkitAnimationEnd', 'OAnimationEnd', 'MSAnimationEnd', 'animationend'], + i, dom = this; + + function fireCallBack(e) { + callback(e); + for (i = 0; i < events.length; i++) { + dom.off(events[i], fireCallBack); + } + } + if (callback) { + for (i = 0; i < events.length; i++) { + dom.on(events[i], fireCallBack); + } + } + return this; + }; + $.fn.transition = function(duration) { + if (typeof duration !== 'string') { + duration = duration + 'ms'; + } + for (var i = 0; i < this.length; i++) { + var elStyle = this[i].style; + elStyle.webkitTransitionDuration = elStyle.MsTransitionDuration = elStyle.msTransitionDuration = elStyle.MozTransitionDuration = elStyle.OTransitionDuration = elStyle.transitionDuration = duration; + } + return this; + }; + $.fn.transform = function(transform) { + for (var i = 0; i < this.length; i++) { + var elStyle = this[i].style; + elStyle.webkitTransform = elStyle.MsTransform = elStyle.msTransform = elStyle.MozTransform = elStyle.OTransform = elStyle.transform = transform; + } + return this; + }; + $.fn.prevAll = function (selector) { + var prevEls = []; + var el = this[0]; + if (!el) return $([]); + while (el.previousElementSibling) { + var prev = el.previousElementSibling; + if (selector) { + if($(prev).is(selector)) prevEls.push(prev); + } + else prevEls.push(prev); + el = prev; + } + return $(prevEls); + }; + $.fn.nextAll = function (selector) { + var nextEls = []; + var el = this[0]; + if (!el) return $([]); + while (el.nextElementSibling) { + var next = el.nextElementSibling; + if (selector) { + if($(next).is(selector)) nextEls.push(next); + } + else nextEls.push(next); + el = next; + } + return $(nextEls); + }; + + //重置zepto的show方法,防止有些人引用的版本中 show 方法操作 opacity 属性影响动画执行 + $.fn.show = function(){ + var elementDisplay = {}; + function defaultDisplay(nodeName) { + var element, display; + if (!elementDisplay[nodeName]) { + element = document.createElement(nodeName); + document.body.appendChild(element); + display = getComputedStyle(element, '').getPropertyValue("display"); + element.parentNode.removeChild(element); + display === "none" && (display = "block"); + elementDisplay[nodeName] = display; + } + return elementDisplay[nodeName]; + } + + return this.each(function(){ + this.style.display === "none" && (this.style.display = ''); + if (getComputedStyle(this, '').getPropertyValue("display") === "none"); + this.style.display = defaultDisplay(this.nodeName); + }); + }; + + $.fn.scrollHeight = function() { + return this[0].scrollHeight; + }; +})($); + +/* global $:true */ +;(function ($) { + 'use strict'; + + /** + * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs. + * + * @codingstandard ftlabs-jsv2 + * @copyright The Financial Times Limited [All Rights Reserved] + * @license MIT License (see LICENSE.txt) + */ + + /*jslint browser:true, node:true, elision:true*/ + /*global Event, Node*/ + + + /** + * Instantiate fast-clicking listeners on the specified layer. + * + * @constructor + * @param {Element} layer The layer to listen on + * @param {Object} [options={}] The options to override the defaults + */ + function FastClick(layer, options) { + var oldOnClick; + + options = options || {}; + + /** + * Whether a click is currently being tracked. + * + * @type boolean + */ + this.trackingClick = false; + + + /** + * Timestamp for when click tracking started. + * + * @type number + */ + this.trackingClickStart = 0; + + + /** + * The element being tracked for a click. + * + * @type EventTarget + */ + this.targetElement = null; + + + /** + * X-coordinate of touch start event. + * + * @type number + */ + this.touchStartX = 0; + + + /** + * Y-coordinate of touch start event. + * + * @type number + */ + this.touchStartY = 0; + + + /** + * ID of the last touch, retrieved from Touch.identifier. + * + * @type number + */ + this.lastTouchIdentifier = 0; + + + /** + * Touchmove boundary, beyond which a click will be cancelled. + * + * @type number + */ + this.touchBoundary = options.touchBoundary || 10; + + + /** + * The FastClick layer. + * + * @type Element + */ + this.layer = layer; + + /** + * The minimum time between tap(touchstart and touchend) events + * + * @type number + */ + this.tapDelay = options.tapDelay || 200; + + /** + * The maximum time for a tap + * + * @type number + */ + this.tapTimeout = options.tapTimeout || 700; + + if (FastClick.notNeeded(layer)) { + return; + } + + // Some old versions of Android don't have Function.prototype.bind + function bind(method, context) { + return function() { return method.apply(context, arguments); }; + } + + + var methods = ['onMouse', 'onClick', 'onTouchStart', 'onTouchMove', 'onTouchEnd', 'onTouchCancel']; + var context = this; + for (var i = 0, l = methods.length; i < l; i++) { + context[methods[i]] = bind(context[methods[i]], context); + } + + // Set up event handlers as required + if (deviceIsAndroid) { + layer.addEventListener('mouseover', this.onMouse, true); + layer.addEventListener('mousedown', this.onMouse, true); + layer.addEventListener('mouseup', this.onMouse, true); + } + + layer.addEventListener('click', this.onClick, true); + layer.addEventListener('touchstart', this.onTouchStart, false); + layer.addEventListener('touchmove', this.onTouchMove, false); + layer.addEventListener('touchend', this.onTouchEnd, false); + layer.addEventListener('touchcancel', this.onTouchCancel, false); + + // Hack is required for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2) + // which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick + // layer when they are cancelled. + if (!Event.prototype.stopImmediatePropagation) { + layer.removeEventListener = function(type, callback, capture) { + var rmv = Node.prototype.removeEventListener; + if (type === 'click') { + rmv.call(layer, type, callback.hijacked || callback, capture); + } else { + rmv.call(layer, type, callback, capture); + } + }; + + layer.addEventListener = function(type, callback, capture) { + var adv = Node.prototype.addEventListener; + if (type === 'click') { + adv.call(layer, type, callback.hijacked || (callback.hijacked = function(event) { + if (!event.propagationStopped) { + callback(event); + } + }), capture); + } else { + adv.call(layer, type, callback, capture); + } + }; + } + + // If a handler is already declared in the element's onclick attribute, it will be fired before + // FastClick's onClick handler. Fix this by pulling out the user-defined handler function and + // adding it as listener. + if (typeof layer.onclick === 'function') { + + // Android browser on at least 3.2 requires a new reference to the function in layer.onclick + // - the old one won't work if passed to addEventListener directly. + oldOnClick = layer.onclick; + layer.addEventListener('click', function(event) { + oldOnClick(event); + }, false); + layer.onclick = null; + } + } + + /** + * Windows Phone 8.1 fakes user agent string to look like Android and iPhone. + * + * @type boolean + */ + var deviceIsWindowsPhone = navigator.userAgent.indexOf("Windows Phone") >= 0; + + /** + * Android requires exceptions. + * + * @type boolean + */ + var deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0 && !deviceIsWindowsPhone; + + + /** + * iOS requires exceptions. + * + * @type boolean + */ + var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent) && !deviceIsWindowsPhone; + + + /** + * iOS 4 requires an exception for select elements. + * + * @type boolean + */ + var deviceIsIOS4 = deviceIsIOS && (/OS 4_\d(_\d)?/).test(navigator.userAgent); + + + /** + * iOS 6.0-7.* requires the target element to be manually derived + * + * @type boolean + */ + var deviceIsIOSWithBadTarget = deviceIsIOS && (/OS [6-7]_\d/).test(navigator.userAgent); + + /** + * BlackBerry requires exceptions. + * + * @type boolean + */ + var deviceIsBlackBerry10 = navigator.userAgent.indexOf('BB10') > 0; + + /** + * Determine whether a given element requires a native click. + * + * @param {EventTarget|Element} target Target DOM element + * @returns {boolean} Returns true if the element needs a native click + */ + FastClick.prototype.needsClick = function(target) { + + switch (target.nodeName.toLowerCase()) { + + // Don't send a synthetic click to disabled inputs (issue #62) + case 'button': + case 'select': + case 'textarea': + if (target.disabled) { + return true; + } + + break; + case 'input': + + // File inputs need real clicks on iOS 6 due to a browser bug (issue #68) + if ((deviceIsIOS && target.type === 'file') || target.disabled) { + return true; + } + + break; + case 'label': + case 'iframe': // iOS8 homescreen apps can prevent events bubbling into frames + case 'video': + return true; + default: + } + + + + + return (/\bneedsclick\b/).test(target.className); + }; + + + /** + * Determine whether a given element requires a call to focus to simulate click into element. + * + * @param {EventTarget|Element} target Target DOM element + * @returns {boolean} Returns true if the element requires a call to focus to simulate native click. + */ + FastClick.prototype.needsFocus = function(target) { + switch (target.nodeName.toLowerCase()) { + case 'textarea': + return true; + case 'select': + return !deviceIsAndroid; + case 'input': + switch (target.type) { + case 'button': + case 'checkbox': + case 'file': + case 'image': + case 'radio': + case 'submit': + return false; + } + + // No point in attempting to focus disabled inputs + return !target.disabled && !target.readOnly; + default: + return (/\bneedsfocus\b/).test(target.className); + } + }; + + + /** + * Send a click event to the specified element. + * + * @param {EventTarget|Element} targetElement + * @param {Event} event + */ + FastClick.prototype.sendClick = function(targetElement, event) { + var clickEvent, touch; + + // On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24) + if (document.activeElement && document.activeElement !== targetElement) { + document.activeElement.blur(); + } + + touch = event.changedTouches[0]; + + // Synthesise a click event, with an extra attribute so it can be tracked + clickEvent = document.createEvent('MouseEvents'); + clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null); + clickEvent.forwardedTouchEvent = true; + targetElement.dispatchEvent(clickEvent); + }; + + FastClick.prototype.determineEventType = function(targetElement) { + + //Issue #159: Android Chrome Select Box does not open with a synthetic click event + if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') { + return 'mousedown'; + } + + return 'click'; + }; + + + /** + * @param {EventTarget|Element} targetElement + */ + FastClick.prototype.focus = function(targetElement) { + var length; + + // Issue #160: on iOS 7, some input elements (e.g. date datetime month) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724. + if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') { + length = targetElement.value.length; + targetElement.setSelectionRange(length, length); + } else { + targetElement.focus(); + } + }; + + + /** + * Check whether the given target element is a child of a scrollable layer and if so, set a flag on it. + * + * @param {EventTarget|Element} targetElement + */ + FastClick.prototype.updateScrollParent = function(targetElement) { + var scrollParent, parentElement; + + scrollParent = targetElement.fastClickScrollParent; + + // Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the + // target element was moved to another parent. + if (!scrollParent || !scrollParent.contains(targetElement)) { + parentElement = targetElement; + do { + if (parentElement.scrollHeight > parentElement.offsetHeight) { + scrollParent = parentElement; + targetElement.fastClickScrollParent = parentElement; + break; + } + + parentElement = parentElement.parentElement; + } while (parentElement); + } + + // Always update the scroll top tracker if possible. + if (scrollParent) { + scrollParent.fastClickLastScrollTop = scrollParent.scrollTop; + } + }; + + + /** + * @param {EventTarget} targetElement + * @returns {Element|EventTarget} + */ + FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) { + + // On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node. + if (eventTarget.nodeType === Node.TEXT_NODE) { + return eventTarget.parentNode; + } + + return eventTarget; + }; + + + /** + * On touch start, record the position and scroll offset. + * + * @param {Event} event + * @returns {boolean} + */ + FastClick.prototype.onTouchStart = function(event) { + var targetElement, touch, selection; + + // Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111). + if (event.targetTouches.length > 1) { + return true; + } + + targetElement = this.getTargetElementFromEventTarget(event.target); + touch = event.targetTouches[0]; + + if (deviceIsIOS) { + + // Only trusted events will deselect text on iOS (issue #49) + selection = window.getSelection(); + if (selection.rangeCount && !selection.isCollapsed) { + return true; + } + + if (!deviceIsIOS4) { + + // Weird things happen on iOS when an alert or confirm dialog is opened from a click event callback (issue #23): + // when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched + // with the same identifier as the touch event that previously triggered the click that triggered the alert. + // Sadly, there is an issue on iOS 4 that causes some normal touch events to have the same identifier as an + // immediately preceeding touch event (issue #52), so this fix is unavailable on that platform. + // Issue 120: touch.identifier is 0 when Chrome dev tools 'Emulate touch events' is set with an iOS device UA string, + // which causes all touch events to be ignored. As this block only applies to iOS, and iOS identifiers are always long, + // random integers, it's safe to to continue if the identifier is 0 here. + if (touch.identifier && touch.identifier === this.lastTouchIdentifier) { + event.preventDefault(); + return false; + } + + this.lastTouchIdentifier = touch.identifier; + + // If the target element is a child of a scrollable layer (using -webkit-overflow-scrolling: touch) and: + // 1) the user does a fling scroll on the scrollable layer + // 2) the user stops the fling scroll with another tap + // then the event.target of the last 'touchend' event will be the element that was under the user's finger + // when the fling scroll was started, causing FastClick to send a click event to that layer - unless a check + // is made to ensure that a parent layer was not scrolled before sending a synthetic click (issue #42). + this.updateScrollParent(targetElement); + } + } + + this.trackingClick = true; + this.trackingClickStart = event.timeStamp; + this.targetElement = targetElement; + + this.touchStartX = touch.pageX; + this.touchStartY = touch.pageY; + + // Prevent phantom clicks on fast double-tap (issue #36) + if ((event.timeStamp - this.lastClickTime) < this.tapDelay) { + event.preventDefault(); + } + + return true; + }; + + + /** + * Based on a touchmove event object, check whether the touch has moved past a boundary since it started. + * + * @param {Event} event + * @returns {boolean} + */ + FastClick.prototype.touchHasMoved = function(event) { + var touch = event.changedTouches[0], boundary = this.touchBoundary; + + if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) { + return true; + } + + return false; + }; + + + /** + * Update the last position. + * + * @param {Event} event + * @returns {boolean} + */ + FastClick.prototype.onTouchMove = function(event) { + if (!this.trackingClick) { + return true; + } + + // If the touch has moved, cancel the click tracking + if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) { + this.trackingClick = false; + this.targetElement = null; + } + + return true; + }; + + + /** + * Attempt to find the labelled control for the given label element. + * + * @param {EventTarget|HTMLLabelElement} labelElement + * @returns {Element|null} + */ + FastClick.prototype.findControl = function(labelElement) { + + // Fast path for newer browsers supporting the HTML5 control attribute + if (labelElement.control !== undefined) { + return labelElement.control; + } + + // All browsers under test that support touch events also support the HTML5 htmlFor attribute + if (labelElement.htmlFor) { + return document.getElementById(labelElement.htmlFor); + } + + // If no for attribute exists, attempt to retrieve the first labellable descendant element + // the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label + return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea'); + }; + + + /** + * On touch end, determine whether to send a click event at once. + * + * @param {Event} event + * @returns {boolean} + */ + FastClick.prototype.onTouchEnd = function(event) { + var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement; + + if (!this.trackingClick) { + return true; + } + + // Prevent phantom clicks on fast double-tap (issue #36) + if ((event.timeStamp - this.lastClickTime) < this.tapDelay) { + this.cancelNextClick = true; + return true; + } + + if ((event.timeStamp - this.trackingClickStart) > this.tapTimeout) { + return true; + } + + // Reset to prevent wrong click cancel on input (issue #156). + this.cancelNextClick = false; + + this.lastClickTime = event.timeStamp; + + trackingClickStart = this.trackingClickStart; + this.trackingClick = false; + this.trackingClickStart = 0; + + // On some iOS devices, the targetElement supplied with the event is invalid if the layer + // is performing a transition or scroll, and has to be re-detected manually. Note that + // for this to function correctly, it must be called *after* the event target is checked! + // See issue #57; also filed as rdar://13048589 . + if (deviceIsIOSWithBadTarget) { + touch = event.changedTouches[0]; + + // In certain cases arguments of elementFromPoint can be negative, so prevent setting targetElement to null + targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement; + targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent; + } + + targetTagName = targetElement.tagName.toLowerCase(); + if (targetTagName === 'label') { + forElement = this.findControl(targetElement); + if (forElement) { + this.focus(targetElement); + if (deviceIsAndroid) { + return false; + } + + targetElement = forElement; + } + } else if (this.needsFocus(targetElement)) { + + // Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through. + // Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37). + if ((event.timeStamp - trackingClickStart) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) { + this.targetElement = null; + return false; + } + + this.focus(targetElement); + this.sendClick(targetElement, event); + + // Select elements need the event to go through on iOS 4, otherwise the selector menu won't open. + // Also this breaks opening selects when VoiceOver is active on iOS6, iOS7 (and possibly others) + if (!deviceIsIOS || targetTagName !== 'select') { + this.targetElement = null; + event.preventDefault(); + } + + return false; + } else { + var parent = targetElement; + while(parent && (parent.tagName.toUpperCase() !== "BODY")) { + if(parent.tagName.toUpperCase() === "LABEL") { + $(parent).find("input").click(); + } + parent = parent.parentNode; + } + } + + if (deviceIsIOS && !deviceIsIOS4) { + + // Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled + // and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42). + scrollParent = targetElement.fastClickScrollParent; + if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) { + return true; + } + } + + // Prevent the actual click from going though - unless the target node is marked as requiring + // real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted. + if (!this.needsClick(targetElement)) { + event.preventDefault(); + this.sendClick(targetElement, event); + } + + return false; + }; + + + /** + * On touch cancel, stop tracking the click. + * + * @returns {void} + */ + FastClick.prototype.onTouchCancel = function() { + this.trackingClick = false; + this.targetElement = null; + }; + + + /** + * Determine mouse events which should be permitted. + * + * @param {Event} event + * @returns {boolean} + */ + FastClick.prototype.onMouse = function(event) { + + // If a target element was never set (because a touch event was never fired) allow the event + if (!this.targetElement) { + return true; + } + + if (event.forwardedTouchEvent) { + return true; + } + + // Programmatically generated events targeting a specific element should be permitted + if (!event.cancelable) { + return true; + } + + // Derive and check the target element to see whether the mouse event needs to be permitted; + // unless explicitly enabled, prevent non-touch click events from triggering actions, + // to prevent ghost/doubleclicks. + if (!this.needsClick(this.targetElement) || this.cancelNextClick) { + + // Prevent any user-added listeners declared on FastClick element from being fired. + if (event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } else { + + // Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2) + event.propagationStopped = true; + } + + // Cancel the event + event.stopPropagation(); + event.preventDefault(); + + return false; + } + + // If the mouse event is permitted, return true for the action to go through. + return true; + }; + + + /** + * On actual clicks, determine whether this is a touch-generated click, a click action occurring + * naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or + * an actual click which should be permitted. + * + * @param {Event} event + * @returns {boolean} + */ + FastClick.prototype.onClick = function(event) { + var permitted; + + // It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early. + if (this.trackingClick) { + this.targetElement = null; + this.trackingClick = false; + return true; + } + + // Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target. + if (event.target.type === 'submit' && event.detail === 0) { + return true; + } + + permitted = this.onMouse(event); + + // Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through. + if (!permitted) { + this.targetElement = null; + } + + // If clicks are permitted, return true for the action to go through. + return permitted; + }; + + + /** + * Remove all FastClick's event listeners. + * + * @returns {void} + */ + FastClick.prototype.destroy = function() { + var layer = this.layer; + + if (deviceIsAndroid) { + layer.removeEventListener('mouseover', this.onMouse, true); + layer.removeEventListener('mousedown', this.onMouse, true); + layer.removeEventListener('mouseup', this.onMouse, true); + } + + layer.removeEventListener('click', this.onClick, true); + layer.removeEventListener('touchstart', this.onTouchStart, false); + layer.removeEventListener('touchmove', this.onTouchMove, false); + layer.removeEventListener('touchend', this.onTouchEnd, false); + layer.removeEventListener('touchcancel', this.onTouchCancel, false); + }; + + + /** + * Check whether FastClick is needed. + * + * @param {Element} layer The layer to listen on + */ + FastClick.notNeeded = function(layer) { + var metaViewport; + var chromeVersion; + var blackberryVersion; + var firefoxVersion; + + // Devices that don't support touch don't need FastClick + if (typeof window.ontouchstart === 'undefined') { + return true; + } + + // Chrome version - zero for other browsers + chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1]; + + if (chromeVersion) { + + if (deviceIsAndroid) { + metaViewport = document.querySelector('meta[name=viewport]'); + + if (metaViewport) { + // Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89) + if (metaViewport.content.indexOf('user-scalable=no') !== -1) { + return true; + } + // Chrome 32 and above with width=device-width or less don't need FastClick + if (chromeVersion > 31 && document.documentElement.scrollWidth <= window.outerWidth) { + return true; + } + } + + // Chrome desktop doesn't need FastClick (issue #15) + } else { + return true; + } + } + + if (deviceIsBlackBerry10) { + blackberryVersion = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/); + + // BlackBerry 10.3+ does not require Fastclick library. + // https://github.com/ftlabs/fastclick/issues/251 + if (blackberryVersion[1] >= 10 && blackberryVersion[2] >= 3) { + metaViewport = document.querySelector('meta[name=viewport]'); + + if (metaViewport) { + // user-scalable=no eliminates click delay. + if (metaViewport.content.indexOf('user-scalable=no') !== -1) { + return true; + } + // width=device-width (or less than device-width) eliminates click delay. + if (document.documentElement.scrollWidth <= window.outerWidth) { + return true; + } + } + } + } + + // IE10 with -ms-touch-action: none or manipulation, which disables double-tap-to-zoom (issue #97) + if (layer.style.msTouchAction === 'none' || layer.style.touchAction === 'manipulation') { + return true; + } + + // Firefox version - zero for other browsers + firefoxVersion = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1]; + + if (firefoxVersion >= 27) { + // Firefox 27+ does not have tap delay if the content is not zoomable - https://bugzilla.mozilla.org/show_bug.cgi?id=922896 + + metaViewport = document.querySelector('meta[name=viewport]'); + if (metaViewport && (metaViewport.content.indexOf('user-scalable=no') !== -1 || document.documentElement.scrollWidth <= window.outerWidth)) { + return true; + } + } + + // IE11: prefixed -ms-touch-action is no longer supported and it's recomended to use non-prefixed version + // http://msdn.microsoft.com/en-us/library/windows/apps/Hh767313.aspx + if (layer.style.touchAction === 'none' || layer.style.touchAction === 'manipulation') { + return true; + } + + return false; + }; + + + /** + * Factory method for creating a FastClick object + * + * @param {Element} layer The layer to listen on + * @param {Object} [options={}] The options to override the defaults + */ + FastClick.attach = function(layer, options) { + return new FastClick(layer, options); + }; + + //直接绑定 + $(function() { + FastClick.attach(document.body); + }); +}($)); + +/*=========================== + Template7 Template engine + ===========================*/ +/* global $:true */ +/* jshint unused:false */ +/* jshint forin:false */ ++function ($) { + "use strict"; + $.Template7 = $.t7 = (function () { + function isArray(arr) { + return Object.prototype.toString.apply(arr) === '[object Array]'; + } + function isObject(obj) { + return obj instanceof Object; + } + function isFunction(func) { + return typeof func === 'function'; + } + var cache = {}; + function helperToSlices(string) { + var helperParts = string.replace(/[{}#}]/g, '').split(' '); + var slices = []; + var shiftIndex, i, j; + for (i = 0; i < helperParts.length; i++) { + var part = helperParts[i]; + if (i === 0) slices.push(part); + else { + if (part.indexOf('"') === 0) { + // Plain String + if (part.match(/"/g).length === 2) { + // One word string + slices.push(part); + } + else { + // Find closed Index + shiftIndex = 0; + for (j = i + 1; j < helperParts.length; j++) { + part += ' ' + helperParts[j]; + if (helperParts[j].indexOf('"') >= 0) { + shiftIndex = j; + slices.push(part); + break; + } + } + if (shiftIndex) i = shiftIndex; + } + } + else { + if (part.indexOf('=') > 0) { + // Hash + var hashParts = part.split('='); + var hashName = hashParts[0]; + var hashContent = hashParts[1]; + if (hashContent.match(/"/g).length !== 2) { + shiftIndex = 0; + for (j = i + 1; j < helperParts.length; j++) { + hashContent += ' ' + helperParts[j]; + if (helperParts[j].indexOf('"') >= 0) { + shiftIndex = j; + break; + } + } + if (shiftIndex) i = shiftIndex; + } + var hash = [hashName, hashContent.replace(/"/g,'')]; + slices.push(hash); + } + else { + // Plain variable + slices.push(part); + } + } + } + } + return slices; + } + function stringToBlocks(string) { + var blocks = [], i, j, k; + if (!string) return []; + var _blocks = string.split(/({{[^{^}]*}})/); + for (i = 0; i < _blocks.length; i++) { + var block = _blocks[i]; + if (block === '') continue; + if (block.indexOf('{{') < 0) { + blocks.push({ + type: 'plain', + content: block + }); + } + else { + if (block.indexOf('{/') >= 0) { + continue; + } + if (block.indexOf('{#') < 0 && block.indexOf(' ') < 0 && block.indexOf('else') < 0) { + // Simple variable + blocks.push({ + type: 'variable', + contextName: block.replace(/[{}]/g, '') + }); + continue; + } + // Helpers + var helperSlices = helperToSlices(block); + var helperName = helperSlices[0]; + var helperContext = []; + var helperHash = {}; + for (j = 1; j < helperSlices.length; j++) { + var slice = helperSlices[j]; + if (isArray(slice)) { + // Hash + helperHash[slice[0]] = slice[1] === 'false' ? false : slice[1]; + } + else { + helperContext.push(slice); + } + } + + if (block.indexOf('{#') >= 0) { + // Condition/Helper + var helperStartIndex = i; + var helperContent = ''; + var elseContent = ''; + var toSkip = 0; + var shiftIndex; + var foundClosed = false, foundElse = false, foundClosedElse = false, depth = 0; + for (j = i + 1; j < _blocks.length; j++) { + if (_blocks[j].indexOf('{{#') >= 0) { + depth ++; + } + if (_blocks[j].indexOf('{{/') >= 0) { + depth --; + } + if (_blocks[j].indexOf('{{#' + helperName) >= 0) { + helperContent += _blocks[j]; + if (foundElse) elseContent += _blocks[j]; + toSkip ++; + } + else if (_blocks[j].indexOf('{{/' + helperName) >= 0) { + if (toSkip > 0) { + toSkip--; + helperContent += _blocks[j]; + if (foundElse) elseContent += _blocks[j]; + } + else { + shiftIndex = j; + foundClosed = true; + break; + } + } + else if (_blocks[j].indexOf('else') >= 0 && depth === 0) { + foundElse = true; + } + else { + if (!foundElse) helperContent += _blocks[j]; + if (foundElse) elseContent += _blocks[j]; + } + + } + if (foundClosed) { + if (shiftIndex) i = shiftIndex; + blocks.push({ + type: 'helper', + helperName: helperName, + contextName: helperContext, + content: helperContent, + inverseContent: elseContent, + hash: helperHash + }); + } + } + else if (block.indexOf(' ') > 0) { + blocks.push({ + type: 'helper', + helperName: helperName, + contextName: helperContext, + hash: helperHash + }); + } + } + } + return blocks; + } + var Template7 = function (template) { + var t = this; + t.template = template; + + function getCompileFn(block, depth) { + if (block.content) return compile(block.content, depth); + else return function () {return ''; }; + } + function getCompileInverse(block, depth) { + if (block.inverseContent) return compile(block.inverseContent, depth); + else return function () {return ''; }; + } + function getCompileVar(name, ctx) { + var variable, parts, levelsUp = 0, initialCtx = ctx; + if (name.indexOf('../') === 0) { + levelsUp = name.split('../').length - 1; + var newDepth = ctx.split('_')[1] - levelsUp; + ctx = 'ctx_' + (newDepth >= 1 ? newDepth : 1); + parts = name.split('../')[levelsUp].split('.'); + } + else if (name.indexOf('@global') === 0) { + ctx = '$.Template7.global'; + parts = name.split('@global.')[1].split('.'); + } + else if (name.indexOf('@root') === 0) { + ctx = 'ctx_1'; + parts = name.split('@root.')[1].split('.'); + } + else { + parts = name.split('.'); + } + variable = ctx; + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + if (part.indexOf('@') === 0) { + if (i > 0) { + variable += '[(data && data.' + part.replace('@', '') + ')]'; + } + else { + variable = '(data && data.' + name.replace('@', '') + ')'; + } + } + else { + if (isFinite(part)) { + variable += '[' + part + ']'; + } + else { + if (part.indexOf('this') === 0) { + variable = part.replace('this', ctx); + } + else { + variable += '.' + part; + } + } + } + } + + return variable; + } + function getCompiledArguments(contextArray, ctx) { + var arr = []; + for (var i = 0; i < contextArray.length; i++) { + if (contextArray[i].indexOf('"') === 0) arr.push(contextArray[i]); + else { + arr.push(getCompileVar(contextArray[i], ctx)); + } + } + return arr.join(', '); + } + function compile(template, depth) { + depth = depth || 1; + template = template || t.template; + if (typeof template !== 'string') { + throw new Error('Template7: Template must be a string'); + } + var blocks = stringToBlocks(template); + if (blocks.length === 0) { + return function () { return ''; }; + } + var ctx = 'ctx_' + depth; + var resultString = '(function (' + ctx + ', data) {\n'; + if (depth === 1) { + resultString += 'function isArray(arr){return Object.prototype.toString.apply(arr) === \'[object Array]\';}\n'; + resultString += 'function isFunction(func){return (typeof func === \'function\');}\n'; + resultString += 'function c(val, ctx) {if (typeof val !== "undefined") {if (isFunction(val)) {return val.call(ctx);} else return val;} else return "";}\n'; + } + resultString += 'var r = \'\';\n'; + var i, j, context; + for (i = 0; i < blocks.length; i++) { + var block = blocks[i]; + // Plain block + if (block.type === 'plain') { + resultString += 'r +=\'' + (block.content).replace(/\r/g, '\\r').replace(/\n/g, '\\n').replace(/'/g, '\\' + '\'') + '\';'; + continue; + } + var variable, compiledArguments; + // Variable block + if (block.type === 'variable') { + variable = getCompileVar(block.contextName, ctx); + resultString += 'r += c(' + variable + ', ' + ctx + ');'; + } + // Helpers block + if (block.type === 'helper') { + if (block.helperName in t.helpers) { + compiledArguments = getCompiledArguments(block.contextName, ctx); + resultString += 'r += ($.Template7.helpers.' + block.helperName + ').call(' + ctx + ', ' + (compiledArguments && (compiledArguments + ', ')) +'{hash:' + JSON.stringify(block.hash) + ', data: data || {}, fn: ' + getCompileFn(block, depth+1) + ', inverse: ' + getCompileInverse(block, depth+1) + ', root: ctx_1});'; + } + else { + if (block.contextName.length > 0) { + throw new Error('Template7: Missing helper: "' + block.helperName + '"'); + } + else { + variable = getCompileVar(block.helperName, ctx); + resultString += 'if (' + variable + ') {'; + resultString += 'if (isArray(' + variable + ')) {'; + resultString += 'r += ($.Template7.helpers.each).call(' + ctx + ', ' + variable + ', {hash:' + JSON.stringify(block.hash) + ', data: data || {}, fn: ' + getCompileFn(block, depth+1) + ', inverse: ' + getCompileInverse(block, depth+1) + ', root: ctx_1});'; + resultString += '}else {'; + resultString += 'r += ($.Template7.helpers.with).call(' + ctx + ', ' + variable + ', {hash:' + JSON.stringify(block.hash) + ', data: data || {}, fn: ' + getCompileFn(block, depth+1) + ', inverse: ' + getCompileInverse(block, depth+1) + ', root: ctx_1});'; + resultString += '}}'; + } + } + } + } + resultString += '\nreturn r;})'; + return eval.call(window, resultString); + } + t.compile = function (template) { + if (!t.compiled) { + t.compiled = compile(template); + } + return t.compiled; + }; + }; + Template7.prototype = { + options: {}, + helpers: { + 'if': function (context, options) { + if (isFunction(context)) { context = context.call(this); } + if (context) { + return options.fn(this, options.data); + } + else { + return options.inverse(this, options.data); + } + }, + 'unless': function (context, options) { + if (isFunction(context)) { context = context.call(this); } + if (!context) { + return options.fn(this, options.data); + } + else { + return options.inverse(this, options.data); + } + }, + 'each': function (context, options) { + var ret = '', i = 0; + if (isFunction(context)) { context = context.call(this); } + if (isArray(context)) { + if (options.hash.reverse) { + context = context.reverse(); + } + for (i = 0; i < context.length; i++) { + ret += options.fn(context[i], {first: i === 0, last: i === context.length - 1, index: i}); + } + if (options.hash.reverse) { + context = context.reverse(); + } + } + else { + for (var key in context) { + i++; + ret += options.fn(context[key], {key: key}); + } + } + if (i > 0) return ret; + else return options.inverse(this); + }, + 'with': function (context, options) { + if (isFunction(context)) { context = context.call(this); } + return options.fn(context); + }, + 'join': function (context, options) { + if (isFunction(context)) { context = context.call(this); } + return context.join(options.hash.delimiter || options.hash.delimeter); + }, + 'js': function (expression, options) { + var func; + if (expression.indexOf('return')>=0) { + func = '(function(){'+expression+'})'; + } + else { + func = '(function(){return ('+expression+')})'; + } + return eval.call(this, func).call(this); + }, + 'js_compare': function (expression, options) { + var func; + if (expression.indexOf('return')>=0) { + func = '(function(){'+expression+'})'; + } + else { + func = '(function(){return ('+expression+')})'; + } + var condition = eval.call(this, func).call(this); + if (condition) { + return options.fn(this, options.data); + } + else { + return options.inverse(this, options.data); + } + } + } + }; + var t7 = function (template, data) { + if (arguments.length === 2) { + var instance = new Template7(template); + var rendered = instance.compile()(data); + instance = null; + return (rendered); + } + else return new Template7(template); + }; + t7.registerHelper = function (name, fn) { + Template7.prototype.helpers[name] = fn; + }; + t7.unregisterHelper = function (name) { + Template7.prototype.helpers[name] = undefined; + delete Template7.prototype.helpers[name]; + }; + + t7.compile = function (template, options) { + var instance = new Template7(template, options); + return instance.compile(); + }; + + t7.options = Template7.prototype.options; + t7.helpers = Template7.prototype.helpers; + return t7; + })(); +}($); + +/* global $:true */ ++ function($) { + "use strict"; + + $.getCurrentPage = function() { + return $(".page")[0] || document.body; + }; +}($); + +/* =============================================================================== +************ Tabs ************ +=============================================================================== */ +/* global $:true */ ++function ($) { + "use strict"; + + var showTab = function (tab, tabLink, force) { + var newTab = $(tab); + + var activeClass = newTab.hasClass("page") ? "page-current" : "active"; + if (arguments.length === 2) { + if (typeof tabLink === 'boolean') { + force = tabLink; + } + } + if (newTab.length === 0) return false; + if (newTab.hasClass(activeClass)) { + if (force) newTab.trigger('show'); + return false; + } + var tabs = newTab.parent('.tabs'); + if (tabs.length === 0) return false; + + // Animated tabs + /*var isAnimatedTabs = tabs.parent().hasClass('tabs-animated-wrap'); + if (isAnimatedTabs) { + tabs.transform('translate3d(' + -newTab.index() * 100 + '%,0,0)'); + }*/ + + // Remove active class from old tabs + var oldTab = tabs.children('.tab.'+activeClass).removeClass(activeClass); + // Add active class to new tab + newTab.addClass(activeClass); + // Trigger 'show' event on new tab + newTab.trigger('show'); + + // Update navbars in new tab + /*if (!isAnimatedTabs && newTab.find('.navbar').length > 0) { + // Find tab's view + var viewContainer; + if (newTab.hasClass(app.params.viewClass)) viewContainer = newTab[0]; + else viewContainer = newTab.parents('.' + app.params.viewClass)[0]; + app.sizeNavbars(viewContainer); + }*/ + + // Find related link for new tab + if (tabLink) tabLink = $(tabLink); + else { + // Search by id + if (typeof tab === 'string') tabLink = $('.tab-link[href="' + tab + '"]'); + else tabLink = $('.tab-link[href="#' + newTab.attr('id') + '"]'); + // Search by data-tab + if (!tabLink || tabLink && tabLink.length === 0) { + $('[data-tab]').each(function () { + if (newTab.is($(this).attr('data-tab'))) tabLink = $(this); + }); + } + } + if (tabLink.length === 0) return; + + // Find related link for old tab + var oldTabLink; + if (oldTab && oldTab.length > 0) { + // Search by id + var oldTabId = oldTab.attr('id'); + if (oldTabId) oldTabLink = $('.tab-link[href="#' + oldTabId + '"]'); + // Search by data-tab + if (!oldTabLink || oldTabLink && oldTabLink.length === 0) { + $('[data-tab]').each(function () { + if (oldTab.is($(this).attr('data-tab'))) oldTabLink = $(this); + }); + } + } + + // Update links' classes + if (tabLink && tabLink.length > 0) tabLink.addClass('active'); + if (oldTabLink && oldTabLink.length > 0) oldTabLink.removeClass('active'); + + return true; + }; + + var old = $.showTab; + $.showTab = showTab; + + $.showTab.noConflict = function () { + $.showTab = old; + return this; + }; + + + $(document).on("click", ".tab-link", function(e) { + e.preventDefault(); + var clicked = $(this); + showTab(clicked.data("tab") || clicked.attr('href'), clicked); + }); +}($); + +/* global $:true */ ++function ($) { + "use strict"; + $(document).on("click", ".tab-item", function(e) { + var $target = $(e.currentTarget); + if(!$target.hasClass("tab-link")) { + $target.parent().find(".active").removeClass("active"); + $target.addClass("active"); + } + }); + + var highlight = function(e, pageId) { + var $tab = $(".bar-tab .tab-item[href='#"+pageId+"']"); + $tab.parent().find(".active").removeClass("active"); + $tab.addClass("active"); + }; + $(document).on("pageInit", highlight); + $(document).on("pageReinit", highlight); + + $.showToolbar = function(show) { + $(document.body)[show ? "removeClass" : "addClass"]("tabbar-hidden"); + }; + +}($); + +/*====================================================== +************ Modals ************ +======================================================*/ +/*jshint unused: false*/ +/* global $:true */ ++function ($) { + "use strict"; + var _modalTemplateTempDiv = document.createElement('div'); + + $.modalStack = []; + var t7 = $.Template7; + + $.modalStackClearQueue = function () { + if ($.modalStack.length) { + ($.modalStack.shift())(); + } + }; + $.modal = function (params) { + params = params || {}; + var modalHTML = ''; + if (defaults.modalTemplate) { + if (!$._compiledTemplates.modal) $._compiledTemplates.modal = t7.compile(defaults.modalTemplate); + modalHTML = $._compiledTemplates.modal(params); + } + else { + var buttonsHTML = ''; + if (params.buttons && params.buttons.length > 0) { + for (var i = 0; i < params.buttons.length; i++) { + buttonsHTML += '' + params.buttons[i].text + ''; + } + } + var titleHTML = params.title ? '' : ''; + var textHTML = params.text ? '' : ''; + var afterTextHTML = params.afterText ? params.afterText : ''; + var noButtons = !params.buttons || params.buttons.length === 0 ? 'modal-no-buttons' : ''; + var verticalButtons = params.verticalButtons ? 'modal-buttons-vertical' : ''; + modalHTML = ''; + } + + _modalTemplateTempDiv.innerHTML = modalHTML; + + var modal = $(_modalTemplateTempDiv).children(); + + $(defaults.modalContainer).append(modal[0]); + + // Add events on buttons + modal.find('.modal-button').each(function (index, el) { + $(el).on('click', function (e) { + if (params.buttons[index].close !== false) $.closeModal(modal); + if (params.buttons[index].onClick) params.buttons[index].onClick(modal, e); + if (params.onClick) params.onClick(modal, index); + }); + }); + $.openModal(modal); + return modal[0]; + }; + $.alert = function (text, title, callbackOk) { + if (typeof title === 'function') { + callbackOk = arguments[1]; + title = undefined; + } + return $.modal({ + text: text || '', + title: typeof title === 'undefined' ? defaults.modalTitle : title, + buttons: [ {text: defaults.modalButtonOk, bold: true, onClick: callbackOk} ] + }); + }; + $.confirm = function (text, title, callbackOk, callbackCancel) { + if (typeof title === 'function') { + callbackCancel = arguments[2]; + callbackOk = arguments[1]; + title = undefined; + } + return $.modal({ + text: text || '', + title: typeof title === 'undefined' ? defaults.modalTitle : title, + buttons: [ + {text: defaults.modalButtonCancel, onClick: callbackCancel}, + {text: defaults.modalButtonOk, bold: true, onClick: callbackOk} + ] + }); + }; + $.prompt = function (text, title, callbackOk, callbackCancel) { + if (typeof title === 'function') { + callbackCancel = arguments[2]; + callbackOk = arguments[1]; + title = undefined; + } + return $.modal({ + text: text || '', + title: typeof title === 'undefined' ? defaults.modalTitle : title, + afterText: '', + buttons: [ + { + text: defaults.modalButtonCancel + }, + { + text: defaults.modalButtonOk, + bold: true + } + ], + onClick: function (modal, index) { + if (index === 0 && callbackCancel) callbackCancel($(modal).find('.modal-text-input').val()); + if (index === 1 && callbackOk) callbackOk($(modal).find('.modal-text-input').val()); + } + }); + }; + $.modalLogin = function (text, title, callbackOk, callbackCancel) { + if (typeof title === 'function') { + callbackCancel = arguments[2]; + callbackOk = arguments[1]; + title = undefined; + } + return $.modal({ + text: text || '', + title: typeof title === 'undefined' ? defaults.modalTitle : title, + afterText: '', + buttons: [ + { + text: defaults.modalButtonCancel + }, + { + text: defaults.modalButtonOk, + bold: true + } + ], + onClick: function (modal, index) { + var username = $(modal).find('.modal-text-input[name="modal-username"]').val(); + var password = $(modal).find('.modal-text-input[name="modal-password"]').val(); + if (index === 0 && callbackCancel) callbackCancel(username, password); + if (index === 1 && callbackOk) callbackOk(username, password); + } + }); + }; + $.modalPassword = function (text, title, callbackOk, callbackCancel) { + if (typeof title === 'function') { + callbackCancel = arguments[2]; + callbackOk = arguments[1]; + title = undefined; + } + return $.modal({ + text: text || '', + title: typeof title === 'undefined' ? defaults.modalTitle : title, + afterText: '', + buttons: [ + { + text: defaults.modalButtonCancel + }, + { + text: defaults.modalButtonOk, + bold: true + } + ], + onClick: function (modal, index) { + var password = $(modal).find('.modal-text-input[name="modal-password"]').val(); + if (index === 0 && callbackCancel) callbackCancel(password); + if (index === 1 && callbackOk) callbackOk(password); + } + }); + }; + $.showPreloader = function (title) { + return $.modal({ + title: title || defaults.modalPreloaderTitle, + text: '
' + }); + }; + $.hidePreloader = function () { + $.closeModal('.modal.modal-in'); + }; + $.showIndicator = function () { + $(defaults.modalContainer).append('
'); + }; + $.hideIndicator = function () { + $('.preloader-indicator-overlay, .preloader-indicator-modal').remove(); + }; + // Action Sheet + $.actions = function (target, params) { + var toPopover = false, modal, groupSelector, buttonSelector; + if (arguments.length === 1) { + // Actions + params = target; + } + else { + // Popover + if ($.device.ios) { + if ($.device.ipad) toPopover = true; + } + else { + if ($(window).width() >= 768) toPopover = true; + } + } + params = params || []; + + if (params.length > 0 && !$.isArray(params[0])) { + params = [params]; + } + var modalHTML; + if (toPopover) { + var actionsToPopoverTemplate = defaults.modalActionsToPopoverTemplate || + '
' + + '
' + + '{{#each this}}' + + '
' + + '
    ' + + '{{#each this}}' + + '{{#if label}}' + + '
  • {{text}}
  • ' + + '{{else}}' + + '
  • {{text}}
  • ' + + '{{/if}}' + + '{{/each}}' + + '
' + + '
' + + '{{/each}}' + + '
' + + '
'; + if (!$._compiledTemplates.actionsToPopover) { + $._compiledTemplates.actionsToPopover = t7.compile(actionsToPopoverTemplate); + } + var popoverHTML = $._compiledTemplates.actionsToPopover(params); + modal = $($.popover(popoverHTML, target, true)); + groupSelector = '.list-block ul'; + buttonSelector = '.list-button'; + } + else { + if (defaults.modalActionsTemplate) { + if (!$._compiledTemplates.actions) $._compiledTemplates.actions = t7.compile(defaults.modalActionsTemplate); + modalHTML = $._compiledTemplates.actions(params); + } + else { + var buttonsHTML = ''; + for (var i = 0; i < params.length; i++) { + for (var j = 0; j < params[i].length; j++) { + if (j === 0) buttonsHTML += '
'; + var button = params[i][j]; + var buttonClass = button.label ? 'actions-modal-label' : 'actions-modal-button'; + if (button.bold) buttonClass += ' actions-modal-button-bold'; + if (button.color) buttonClass += ' color-' + button.color; + if (button.bg) buttonClass += ' bg-' + button.bg; + if (button.disabled) buttonClass += ' disabled'; + buttonsHTML += '' + button.text + ''; + if (j === params[i].length - 1) buttonsHTML += '
'; + } + } + modalHTML = '
' + buttonsHTML + '
'; + } + _modalTemplateTempDiv.innerHTML = modalHTML; + modal = $(_modalTemplateTempDiv).children(); + $(defaults.modalContainer).append(modal[0]); + groupSelector = '.actions-modal-group'; + buttonSelector = '.actions-modal-button'; + } + + var groups = modal.find(groupSelector); + groups.each(function (index, el) { + var groupIndex = index; + $(el).children().each(function (index, el) { + var buttonIndex = index; + var buttonParams = params[groupIndex][buttonIndex]; + var clickTarget; + if (!toPopover && $(el).is(buttonSelector)) clickTarget = $(el); + if (toPopover && $(el).find(buttonSelector).length > 0) clickTarget = $(el).find(buttonSelector); + + if (clickTarget) { + clickTarget.on('click', function (e) { + if (buttonParams.close !== false) $.closeModal(modal); + if (buttonParams.onClick) buttonParams.onClick(modal, e); + }); + } + }); + }); + if (!toPopover) $.openModal(modal); + return modal[0]; + }; + $.popover = function (modal, target, removeOnClose) { + if (typeof removeOnClose === 'undefined') removeOnClose = true; + if (typeof modal === 'string' && modal.indexOf('<') >= 0) { + var _modal = document.createElement('div'); + _modal.innerHTML = modal.trim(); + if (_modal.childNodes.length > 0) { + modal = _modal.childNodes[0]; + if (removeOnClose) modal.classList.add('remove-on-close'); + $(defaults.modalContainer).append(modal); + } + else return false; //nothing found + } + modal = $(modal); + target = $(target); + if (modal.length === 0 || target.length === 0) return false; + if (modal.find('.popover-angle').length === 0) { + modal.append('
'); + } + modal.show(); + + function sizePopover() { + modal.css({left: '', top: ''}); + var modalWidth = modal.width(); + var modalHeight = modal.height(); // 13 - height of angle + var modalAngle = modal.find('.popover-angle'); + var modalAngleSize = modalAngle.width() / 2; + var modalAngleLeft, modalAngleTop; + modalAngle.removeClass('on-left on-right on-top on-bottom').css({left: '', top: ''}); + + var targetWidth = target.outerWidth(); + var targetHeight = target.outerHeight(); + var targetOffset = target.offset(); + var targetParentPage = target.parents('.page'); + if (targetParentPage.length > 0) { + targetOffset.top = targetOffset.top - targetParentPage[0].scrollTop; + } + + var windowHeight = $(window).height(); + var windowWidth = $(window).width(); + + var modalTop = 0; + var modalLeft = 0; + var diff = 0; + // Top Position + var modalPosition = 'top'; + + if ((modalHeight + modalAngleSize) < targetOffset.top) { + // On top + modalTop = targetOffset.top - modalHeight - modalAngleSize; + } + else if ((modalHeight + modalAngleSize) < windowHeight - targetOffset.top - targetHeight) { + // On bottom + modalPosition = 'bottom'; + modalTop = targetOffset.top + targetHeight + modalAngleSize; + } + else { + // On middle + modalPosition = 'middle'; + modalTop = targetHeight / 2 + targetOffset.top - modalHeight / 2; + diff = modalTop; + if (modalTop < 0) { + modalTop = 5; + } + else if (modalTop + modalHeight > windowHeight) { + modalTop = windowHeight - modalHeight - 5; + } + diff = diff - modalTop; + } + // Horizontal Position + if (modalPosition === 'top' || modalPosition === 'bottom') { + modalLeft = targetWidth / 2 + targetOffset.left - modalWidth / 2; + diff = modalLeft; + if (modalLeft < 5) modalLeft = 5; + if (modalLeft + modalWidth > windowWidth) modalLeft = windowWidth - modalWidth - 5; + if (modalPosition === 'top') modalAngle.addClass('on-bottom'); + if (modalPosition === 'bottom') modalAngle.addClass('on-top'); + diff = diff - modalLeft; + modalAngleLeft = (modalWidth / 2 - modalAngleSize + diff); + modalAngleLeft = Math.max(Math.min(modalAngleLeft, modalWidth - modalAngleSize * 2 - 6), 6); + modalAngle.css({left: modalAngleLeft + 'px'}); + } + else if (modalPosition === 'middle') { + modalLeft = targetOffset.left - modalWidth - modalAngleSize; + modalAngle.addClass('on-right'); + if (modalLeft < 5) { + modalLeft = targetOffset.left + targetWidth + modalAngleSize; + modalAngle.removeClass('on-right').addClass('on-left'); + } + if (modalLeft + modalWidth > windowWidth) { + modalLeft = windowWidth - modalWidth - 5; + modalAngle.removeClass('on-right').addClass('on-left'); + } + modalAngleTop = (modalHeight / 2 - modalAngleSize + diff); + modalAngleTop = Math.max(Math.min(modalAngleTop, modalHeight - modalAngleSize * 2 - 6), 6); + modalAngle.css({top: modalAngleTop + 'px'}); + } + + // Apply Styles + modal.css({top: modalTop + 'px', left: modalLeft + 'px'}); + } + sizePopover(); + + $(window).on('resize', sizePopover); + modal.on('close', function () { + $(window).off('resize', sizePopover); + }); + + if (modal.find('.' + defaults.viewClass).length > 0) { + $.sizeNavbars(modal.find('.' + defaults.viewClass)[0]); + } + + $.openModal(modal); + return modal[0]; + }; + $.popup = function (modal, removeOnClose) { + if (typeof removeOnClose === 'undefined') removeOnClose = true; + if (typeof modal === 'string' && modal.indexOf('<') >= 0) { + var _modal = document.createElement('div'); + _modal.innerHTML = modal.trim(); + if (_modal.childNodes.length > 0) { + modal = _modal.childNodes[0]; + if (removeOnClose) modal.classList.add('remove-on-close'); + $(defaults.modalContainer).append(modal); + } + else return false; //nothing found + } + modal = $(modal); + if (modal.length === 0) return false; + modal.show(); + if (modal.find('.' + defaults.viewClass).length > 0) { + $.sizeNavbars(modal.find('.' + defaults.viewClass)[0]); + } + $.openModal(modal); + + return modal[0]; + }; + $.pickerModal = function (pickerModal, removeOnClose) { + if (typeof removeOnClose === 'undefined') removeOnClose = true; + if (typeof pickerModal === 'string' && pickerModal.indexOf('<') >= 0) { + pickerModal = $(pickerModal); + if (pickerModal.length > 0) { + if (removeOnClose) pickerModal.addClass('remove-on-close'); + $(defaults.modalContainer).append(pickerModal[0]); + } + else return false; //nothing found + } + pickerModal = $(pickerModal); + if (pickerModal.length === 0) return false; + pickerModal.show(); + $.openModal(pickerModal); + return pickerModal[0]; + }; + $.loginScreen = function (modal) { + if (!modal) modal = '.login-screen'; + modal = $(modal); + if (modal.length === 0) return false; + modal.show(); + if (modal.find('.' + defaults.viewClass).length > 0) { + $.sizeNavbars(modal.find('.' + defaults.viewClass)[0]); + } + $.openModal(modal); + return modal[0]; + }; + //显示一个消息,会在2秒钟后自动消失 + $.toast = function(msg, time) { + var $toast = $("").appendTo(document.body); + $.openModal($toast); + setTimeout(function() { + $.closeModal($toast); + }, time || 2000); + }; + $.openModal = function (modal) { + if(defaults.closePrevious) $.closeModal(); + modal = $(modal); + var isModal = modal.hasClass('modal'); + if ($('.modal.modal-in:not(.modal-out)').length && defaults.modalStack && isModal) { + $.modalStack.push(function () { + $.openModal(modal); + }); + return; + } + var isPopover = modal.hasClass('popover'); + var isPopup = modal.hasClass('popup'); + var isLoginScreen = modal.hasClass('login-screen'); + var isPickerModal = modal.hasClass('picker-modal'); + var isToast = modal.hasClass('toast'); + if (isModal) { + modal.show(); + modal.css({ + marginTop: - Math.round(modal.outerHeight() / 2) + 'px' + }); + } + if (isToast) { + modal.show(); + modal.css({ + marginLeft: - Math.round(parseInt(window.getComputedStyle(modal[0]).width) / 2) + 'px' // + }); + } + + var overlay; + if (!isLoginScreen && !isPickerModal && !isToast) { + if ($('.modal-overlay').length === 0 && !isPopup) { + $(defaults.modalContainer).append(''); + } + if ($('.popup-overlay').length === 0 && isPopup) { + $(defaults.modalContainer).append(''); + } + overlay = isPopup ? $('.popup-overlay') : $('.modal-overlay'); + } + + //Make sure that styles are applied, trigger relayout; + var clientLeft = modal[0].clientLeft; + + // Trugger open event + modal.trigger('open'); + + // Picker modal body class + if (isPickerModal) { + $(defaults.modalContainer).addClass('with-picker-modal'); + } + + // Classes for transition in + if (!isLoginScreen && !isPickerModal && !isToast) overlay.addClass('modal-overlay-visible'); + modal.removeClass('modal-out').addClass('modal-in').transitionEnd(function (e) { + if (modal.hasClass('modal-out')) modal.trigger('closed'); + else modal.trigger('opened'); + }); + return true; + }; + $.closeModal = function (modal) { + modal = $(modal || '.modal-in'); + if (typeof modal !== 'undefined' && modal.length === 0) { + return; + } + var isModal = modal.hasClass('modal'); + var isPopover = modal.hasClass('popover'); + var isPopup = modal.hasClass('popup'); + var isLoginScreen = modal.hasClass('login-screen'); + var isPickerModal = modal.hasClass('picker-modal'); + + var removeOnClose = modal.hasClass('remove-on-close'); + + var overlay = isPopup ? $('.popup-overlay') : $('.modal-overlay'); + if (isPopup){ + if (modal.length === $('.popup.modal-in').length) { + overlay.removeClass('modal-overlay-visible'); + } + } + else if (!isPickerModal) { + overlay.removeClass('modal-overlay-visible'); + } + + modal.trigger('close'); + + // Picker modal body class + if (isPickerModal) { + $(defaults.modalContainer).removeClass('with-picker-modal'); + $(defaults.modalContainer).addClass('picker-modal-closing'); + } + + if (!isPopover) { + modal.removeClass('modal-in').addClass('modal-out').transitionEnd(function (e) { + if (modal.hasClass('modal-out')) modal.trigger('closed'); + else modal.trigger('opened'); + + if (isPickerModal) { + $(defaults.modalContainer).removeClass('picker-modal-closing'); + } + if (isPopup || isLoginScreen || isPickerModal) { + modal.removeClass('modal-out').hide(); + if (removeOnClose && modal.length > 0) { + modal.remove(); + } + } + else { + modal.remove(); + } + }); + if (isModal && defaults.modalStack ) { + $.modalStackClearQueue(); + } + } + else { + modal.removeClass('modal-in modal-out').trigger('closed').hide(); + if (removeOnClose) { + modal.remove(); + } + } + return true; + }; + function handleClicks(e) { + /*jshint validthis:true */ + var clicked = $(this); + var url = clicked.attr('href'); + + //Collect Clicked data- attributes + var clickedData = clicked.dataset(); + + // Popover + if (clicked.hasClass('open-popover')) { + var popover; + if (clickedData.popover) { + popover = clickedData.popover; + } + else popover = '.popover'; + $.popover(popover, clicked); + } + if (clicked.hasClass('close-popover')) { + $.closeModal('.popover.modal-in'); + } + // Popup + var popup; + if (clicked.hasClass('open-popup')) { + if (clickedData.popup) { + popup = clickedData.popup; + } + else popup = '.popup'; + $.popup(popup); + } + if (clicked.hasClass('close-popup')) { + if (clickedData.popup) { + popup = clickedData.popup; + } + else popup = '.popup.modal-in'; + $.closeModal(popup); + } + + // Close Modal + if (clicked.hasClass('modal-overlay')) { + if ($('.modal.modal-in').length > 0 && defaults.modalCloseByOutside) + $.closeModal('.modal.modal-in'); + if ($('.actions-modal.modal-in').length > 0 && defaults.actionsCloseByOutside) + $.closeModal('.actions-modal.modal-in'); + + if ($('.popover.modal-in').length > 0) $.closeModal('.popover.modal-in'); + } + if (clicked.hasClass('popup-overlay')) { + if ($('.popup.modal-in').length > 0 && defaults.popupCloseByOutside) + $.closeModal('.popup.modal-in'); + } + } + + var defaults = $.modal.prototype.defaults = { + modalButtonOk: 'OK', + modalButtonCancel: 'Cancel', + modalPreloaderTitle: 'Loading...', + modalContainer : document.body, + modalCloseByOutside: true, + actionsCloseByOutside: false, + popupCloseByOutside: true, + closePrevious: true //close all previous modal before open + }; + + $(function() { + $(document).on('click', ' .modal-overlay, .popup-overlay, .close-popup, .open-popup, .open-popover, .close-popover, .close-picker', handleClicks); + defaults.modalContainer = defaults.modalContainer || document.body; //incase some one include js in head + }); +}($); + +/*====================================================== +************ Calendar ************ +======================================================*/ +/* global $:true */ +/*jshint unused: false*/ ++function ($) { + "use strict"; + var rtl = false; + var defaults; + var Calendar = function (params) { + var p = this; + params = params || {}; + for (var def in defaults) { + if (typeof params[def] === 'undefined') { + params[def] = defaults[def]; + } + } + p.params = params; + p.initialized = false; + + // Inline flag + p.inline = p.params.container ? true : false; + + // Is horizontal + p.isH = p.params.direction === 'horizontal'; + + // RTL inverter + var inverter = p.isH ? (rtl ? -1 : 1) : 1; + + // Animating flag + p.animating = false; + + // Should be converted to popover + function isPopover() { + var toPopover = false; + if (!p.params.convertToPopover && !p.params.onlyInPopover) return toPopover; + if (!p.inline && p.params.input) { + if (p.params.onlyInPopover) toPopover = true; + else { + if ($.device.ios) { + toPopover = $.device.ipad ? true : false; + } + else { + if ($(window).width() >= 768) toPopover = true; + } + } + } + return toPopover; + } + function inPopover() { + if (p.opened && p.container && p.container.length > 0 && p.container.parents('.popover').length > 0) return true; + else return false; + } + + // Format date + function formatDate(date) { + date = new Date(date); + var year = date.getFullYear(); + var month = date.getMonth(); + var month1 = month + 1; + var day = date.getDate(); + var weekDay = date.getDay(); + return p.params.dateFormat + .replace(/yyyy/g, year) + .replace(/yy/g, (year + '').substring(2)) + .replace(/mm/g, month1 < 10 ? '0' + month1 : month1) + .replace(/m/g, month1) + .replace(/MM/g, p.params.monthNames[month]) + .replace(/M/g, p.params.monthNamesShort[month]) + .replace(/dd/g, day < 10 ? '0' + day : day) + .replace(/d/g, day) + .replace(/DD/g, p.params.dayNames[weekDay]) + .replace(/D/g, p.params.dayNamesShort[weekDay]); + } + + + // Value + p.addValue = function (value) { + if (p.params.multiple) { + if (!p.value) p.value = []; + var inValuesIndex; + for (var i = 0; i < p.value.length; i++) { + if (new Date(value).getTime() === new Date(p.value[i]).getTime()) { + inValuesIndex = i; + } + } + if (typeof inValuesIndex === 'undefined') { + p.value.push(value); + } + else { + p.value.splice(inValuesIndex, 1); + } + p.updateValue(); + } + else { + p.value = [value]; + p.updateValue(); + } + }; + p.setValue = function (arrValues) { + p.value = arrValues; + p.updateValue(); + }; + p.updateValue = function () { + p.wrapper.find('.picker-calendar-day-selected').removeClass('picker-calendar-day-selected'); + var i, inputValue; + for (i = 0; i < p.value.length; i++) { + var valueDate = new Date(p.value[i]); + p.wrapper.find('.picker-calendar-day[data-date="' + valueDate.getFullYear() + '-' + valueDate.getMonth() + '-' + valueDate.getDate() + '"]').addClass('picker-calendar-day-selected'); + } + if (p.params.onChange) { + p.params.onChange(p, p.value, p.value.map(formatDate)); + } + if (p.input && p.input.length > 0) { + if (p.params.formatValue) inputValue = p.params.formatValue(p, p.value); + else { + inputValue = []; + for (i = 0; i < p.value.length; i++) { + inputValue.push(formatDate(p.value[i])); + } + inputValue = inputValue.join(', '); + } + $(p.input).val(inputValue); + $(p.input).trigger('change'); + } + }; + + // Columns Handlers + p.initCalendarEvents = function () { + var col; + var allowItemClick = true; + var isTouched, isMoved, touchStartX, touchStartY, touchCurrentX, touchCurrentY, touchStartTime, touchEndTime, startTranslate, currentTranslate, wrapperWidth, wrapperHeight, percentage, touchesDiff, isScrolling; + function handleTouchStart (e) { + if (isMoved || isTouched) return; + // e.preventDefault(); + isTouched = true; + var position = $.getTouchPosition(e); + touchStartX = touchCurrentY = position.x; + touchStartY = touchCurrentY = position.y; + touchStartTime = (new Date()).getTime(); + percentage = 0; + allowItemClick = true; + isScrolling = undefined; + startTranslate = currentTranslate = p.monthsTranslate; + } + function handleTouchMove (e) { + if (!isTouched) return; + var position = $.getTouchPosition(e); + touchCurrentX = position.x; + touchCurrentY = position.y; + if (typeof isScrolling === 'undefined') { + isScrolling = !!(isScrolling || Math.abs(touchCurrentY - touchStartY) > Math.abs(touchCurrentX - touchStartX)); + } + if (p.isH && isScrolling) { + isTouched = false; + return; + } + e.preventDefault(); + if (p.animating) { + isTouched = false; + return; + } + allowItemClick = false; + if (!isMoved) { + // First move + isMoved = true; + wrapperWidth = p.wrapper[0].offsetWidth; + wrapperHeight = p.wrapper[0].offsetHeight; + p.wrapper.transition(0); + } + e.preventDefault(); + + touchesDiff = p.isH ? touchCurrentX - touchStartX : touchCurrentY - touchStartY; + percentage = touchesDiff/(p.isH ? wrapperWidth : wrapperHeight); + currentTranslate = (p.monthsTranslate * inverter + percentage) * 100; + + // Transform wrapper + p.wrapper.transform('translate3d(' + (p.isH ? currentTranslate : 0) + '%, ' + (p.isH ? 0 : currentTranslate) + '%, 0)'); + + } + function handleTouchEnd (e) { + if (!isTouched || !isMoved) { + isTouched = isMoved = false; + return; + } + isTouched = isMoved = false; + + touchEndTime = new Date().getTime(); + if (touchEndTime - touchStartTime < 300) { + if (Math.abs(touchesDiff) < 10) { + p.resetMonth(); + } + else if (touchesDiff >= 10) { + if (rtl) p.nextMonth(); + else p.prevMonth(); + } + else { + if (rtl) p.prevMonth(); + else p.nextMonth(); + } + } + else { + if (percentage <= -0.5) { + if (rtl) p.prevMonth(); + else p.nextMonth(); + } + else if (percentage >= 0.5) { + if (rtl) p.nextMonth(); + else p.prevMonth(); + } + else { + p.resetMonth(); + } + } + + // Allow click + setTimeout(function () { + allowItemClick = true; + }, 100); + } + + function handleDayClick(e) { + if (!allowItemClick) return; + var day = $(e.target).parents('.picker-calendar-day'); + if (day.length === 0 && $(e.target).hasClass('picker-calendar-day')) { + day = $(e.target); + } + if (day.length === 0) return; + if (day.hasClass('picker-calendar-day-selected') && !p.params.multiple) return; + if (day.hasClass('picker-calendar-day-disabled')) return; + if (day.hasClass('picker-calendar-day-next')) p.nextMonth(); + if (day.hasClass('picker-calendar-day-prev')) p.prevMonth(); + var dateYear = day.attr('data-year'); + var dateMonth = day.attr('data-month'); + var dateDay = day.attr('data-day'); + if (p.params.onDayClick) { + p.params.onDayClick(p, day[0], dateYear, dateMonth, dateDay); + } + p.addValue(new Date(dateYear, dateMonth, dateDay).getTime()); + if (p.params.closeOnSelect) p.close(); + } + + p.container.find('.picker-calendar-prev-month').on('click', p.prevMonth); + p.container.find('.picker-calendar-next-month').on('click', p.nextMonth); + p.container.find('.picker-calendar-prev-year').on('click', p.prevYear); + p.container.find('.picker-calendar-next-year').on('click', p.nextYear); + p.wrapper.on('click', handleDayClick); + if (p.params.touchMove) { + p.wrapper.on($.touchEvents.start, handleTouchStart); + p.wrapper.on($.touchEvents.move, handleTouchMove); + p.wrapper.on($.touchEvents.end, handleTouchEnd); + } + + p.container[0].f7DestroyCalendarEvents = function () { + p.container.find('.picker-calendar-prev-month').off('click', p.prevMonth); + p.container.find('.picker-calendar-next-month').off('click', p.nextMonth); + p.container.find('.picker-calendar-prev-year').off('click', p.prevYear); + p.container.find('.picker-calendar-next-year').off('click', p.nextYear); + p.wrapper.off('click', handleDayClick); + if (p.params.touchMove) { + p.wrapper.off($.touchEvents.start, handleTouchStart); + p.wrapper.off($.touchEvents.move, handleTouchMove); + p.wrapper.off($.touchEvents.end, handleTouchEnd); + } + }; + + + }; + p.destroyCalendarEvents = function (colContainer) { + if ('f7DestroyCalendarEvents' in p.container[0]) p.container[0].f7DestroyCalendarEvents(); + }; + + // Calendar Methods + p.daysInMonth = function (date) { + var d = new Date(date); + return new Date(d.getFullYear(), d.getMonth() + 1, 0).getDate(); + }; + p.monthHTML = function (date, offset) { + date = new Date(date); + var year = date.getFullYear(), + month = date.getMonth(), + day = date.getDate(); + if (offset === 'next') { + if (month === 11) date = new Date(year + 1, 0); + else date = new Date(year, month + 1, 1); + } + if (offset === 'prev') { + if (month === 0) date = new Date(year - 1, 11); + else date = new Date(year, month - 1, 1); + } + if (offset === 'next' || offset === 'prev') { + month = date.getMonth(); + year = date.getFullYear(); + } + var daysInPrevMonth = p.daysInMonth(new Date(date.getFullYear(), date.getMonth()).getTime() - 10 * 24 * 60 * 60 * 1000), + daysInMonth = p.daysInMonth(date), + firstDayOfMonthIndex = new Date(date.getFullYear(), date.getMonth()).getDay(); + if (firstDayOfMonthIndex === 0) firstDayOfMonthIndex = 7; + + var dayDate, currentValues = [], i, j, + rows = 6, cols = 7, + monthHTML = '', + dayIndex = 0 + (p.params.firstDay - 1), + today = new Date().setHours(0,0,0,0), + minDate = p.params.minDate ? new Date(p.params.minDate).getTime() : null, + maxDate = p.params.maxDate ? new Date(p.params.maxDate).getTime() : null; + + if (p.value && p.value.length) { + for (i = 0; i < p.value.length; i++) { + currentValues.push(new Date(p.value[i]).setHours(0,0,0,0)); + } + } + + for (i = 1; i <= rows; i++) { + var rowHTML = ''; + var row = i; + for (j = 1; j <= cols; j++) { + var col = j; + dayIndex ++; + var dayNumber = dayIndex - firstDayOfMonthIndex; + var addClass = ''; + if (dayNumber < 0) { + dayNumber = daysInPrevMonth + dayNumber + 1; + addClass += ' picker-calendar-day-prev'; + dayDate = new Date(month - 1 < 0 ? year - 1 : year, month - 1 < 0 ? 11 : month - 1, dayNumber).getTime(); + } + else { + dayNumber = dayNumber + 1; + if (dayNumber > daysInMonth) { + dayNumber = dayNumber - daysInMonth; + addClass += ' picker-calendar-day-next'; + dayDate = new Date(month + 1 > 11 ? year + 1 : year, month + 1 > 11 ? 0 : month + 1, dayNumber).getTime(); + } + else { + dayDate = new Date(year, month, dayNumber).getTime(); + } + } + // Today + if (dayDate === today) addClass += ' picker-calendar-day-today'; + // Selected + if (currentValues.indexOf(dayDate) >= 0) addClass += ' picker-calendar-day-selected'; + // Weekend + if (p.params.weekendDays.indexOf(col - 1) >= 0) { + addClass += ' picker-calendar-day-weekend'; + } + // Disabled + if ((minDate && dayDate < minDate) || (maxDate && dayDate > maxDate)) { + addClass += ' picker-calendar-day-disabled'; + } + + dayDate = new Date(dayDate); + var dayYear = dayDate.getFullYear(); + var dayMonth = dayDate.getMonth(); + rowHTML += '
'+dayNumber+'
'; + } + monthHTML += '
' + rowHTML + '
'; + } + monthHTML = '
' + monthHTML + '
'; + return monthHTML; + }; + p.animating = false; + p.updateCurrentMonthYear = function (dir) { + if (typeof dir === 'undefined') { + p.currentMonth = parseInt(p.months.eq(1).attr('data-month'), 10); + p.currentYear = parseInt(p.months.eq(1).attr('data-year'), 10); + } + else { + p.currentMonth = parseInt(p.months.eq(dir === 'next' ? (p.months.length - 1) : 0).attr('data-month'), 10); + p.currentYear = parseInt(p.months.eq(dir === 'next' ? (p.months.length - 1) : 0).attr('data-year'), 10); + } + p.container.find('.current-month-value').text(p.params.monthNames[p.currentMonth]); + p.container.find('.current-year-value').text(p.currentYear); + + }; + p.onMonthChangeStart = function (dir) { + p.updateCurrentMonthYear(dir); + p.months.removeClass('picker-calendar-month-current picker-calendar-month-prev picker-calendar-month-next'); + var currentIndex = dir === 'next' ? p.months.length - 1 : 0; + + p.months.eq(currentIndex).addClass('picker-calendar-month-current'); + p.months.eq(dir === 'next' ? currentIndex - 1 : currentIndex + 1).addClass(dir === 'next' ? 'picker-calendar-month-prev' : 'picker-calendar-month-next'); + + if (p.params.onMonthYearChangeStart) { + p.params.onMonthYearChangeStart(p, p.currentYear, p.currentMonth); + } + }; + p.onMonthChangeEnd = function (dir, rebuildBoth) { + p.animating = false; + var nextMonthHTML, prevMonthHTML, newMonthHTML; + p.wrapper.find('.picker-calendar-month:not(.picker-calendar-month-prev):not(.picker-calendar-month-current):not(.picker-calendar-month-next)').remove(); + + if (typeof dir === 'undefined') { + dir = 'next'; + rebuildBoth = true; + } + if (!rebuildBoth) { + newMonthHTML = p.monthHTML(new Date(p.currentYear, p.currentMonth), dir); + } + else { + p.wrapper.find('.picker-calendar-month-next, .picker-calendar-month-prev').remove(); + prevMonthHTML = p.monthHTML(new Date(p.currentYear, p.currentMonth), 'prev'); + nextMonthHTML = p.monthHTML(new Date(p.currentYear, p.currentMonth), 'next'); + } + if (dir === 'next' || rebuildBoth) { + p.wrapper.append(newMonthHTML || nextMonthHTML); + } + if (dir === 'prev' || rebuildBoth) { + p.wrapper.prepend(newMonthHTML || prevMonthHTML); + } + p.months = p.wrapper.find('.picker-calendar-month'); + p.setMonthsTranslate(p.monthsTranslate); + if (p.params.onMonthAdd) { + p.params.onMonthAdd(p, dir === 'next' ? p.months.eq(p.months.length - 1)[0] : p.months.eq(0)[0]); + } + if (p.params.onMonthYearChangeEnd) { + p.params.onMonthYearChangeEnd(p, p.currentYear, p.currentMonth); + } + }; + p.setMonthsTranslate = function (translate) { + translate = translate || p.monthsTranslate || 0; + if (typeof p.monthsTranslate === 'undefined') p.monthsTranslate = translate; + p.months.removeClass('picker-calendar-month-current picker-calendar-month-prev picker-calendar-month-next'); + var prevMonthTranslate = -(translate + 1) * 100 * inverter; + var currentMonthTranslate = -translate * 100 * inverter; + var nextMonthTranslate = -(translate - 1) * 100 * inverter; + p.months.eq(0).transform('translate3d(' + (p.isH ? prevMonthTranslate : 0) + '%, ' + (p.isH ? 0 : prevMonthTranslate) + '%, 0)').addClass('picker-calendar-month-prev'); + p.months.eq(1).transform('translate3d(' + (p.isH ? currentMonthTranslate : 0) + '%, ' + (p.isH ? 0 : currentMonthTranslate) + '%, 0)').addClass('picker-calendar-month-current'); + p.months.eq(2).transform('translate3d(' + (p.isH ? nextMonthTranslate : 0) + '%, ' + (p.isH ? 0 : nextMonthTranslate) + '%, 0)').addClass('picker-calendar-month-next'); + }; + p.nextMonth = function (transition) { + if (typeof transition === 'undefined' || typeof transition === 'object') { + transition = ''; + if (!p.params.animate) transition = 0; + } + var nextMonth = parseInt(p.months.eq(p.months.length - 1).attr('data-month'), 10); + var nextYear = parseInt(p.months.eq(p.months.length - 1).attr('data-year'), 10); + var nextDate = new Date(nextYear, nextMonth); + var nextDateTime = nextDate.getTime(); + var transitionEndCallback = p.animating ? false : true; + if (p.params.maxDate) { + if (nextDateTime > new Date(p.params.maxDate).getTime()) { + return p.resetMonth(); + } + } + p.monthsTranslate --; + if (nextMonth === p.currentMonth) { + var nextMonthTranslate = -(p.monthsTranslate) * 100 * inverter; + var nextMonthHTML = $(p.monthHTML(nextDateTime, 'next')).transform('translate3d(' + (p.isH ? nextMonthTranslate : 0) + '%, ' + (p.isH ? 0 : nextMonthTranslate) + '%, 0)').addClass('picker-calendar-month-next'); + p.wrapper.append(nextMonthHTML[0]); + p.months = p.wrapper.find('.picker-calendar-month'); + if (p.params.onMonthAdd) { + p.params.onMonthAdd(p, p.months.eq(p.months.length - 1)[0]); + } + } + p.animating = true; + p.onMonthChangeStart('next'); + var translate = (p.monthsTranslate * 100) * inverter; + + p.wrapper.transition(transition).transform('translate3d(' + (p.isH ? translate : 0) + '%, ' + (p.isH ? 0 : translate) + '%, 0)'); + if (transitionEndCallback) { + p.wrapper.transitionEnd(function () { + p.onMonthChangeEnd('next'); + }); + } + if (!p.params.animate) { + p.onMonthChangeEnd('next'); + } + }; + p.prevMonth = function (transition) { + if (typeof transition === 'undefined' || typeof transition === 'object') { + transition = ''; + if (!p.params.animate) transition = 0; + } + var prevMonth = parseInt(p.months.eq(0).attr('data-month'), 10); + var prevYear = parseInt(p.months.eq(0).attr('data-year'), 10); + var prevDate = new Date(prevYear, prevMonth + 1, -1); + var prevDateTime = prevDate.getTime(); + var transitionEndCallback = p.animating ? false : true; + if (p.params.minDate) { + if (prevDateTime < new Date(p.params.minDate).getTime()) { + return p.resetMonth(); + } + } + p.monthsTranslate ++; + if (prevMonth === p.currentMonth) { + var prevMonthTranslate = -(p.monthsTranslate) * 100 * inverter; + var prevMonthHTML = $(p.monthHTML(prevDateTime, 'prev')).transform('translate3d(' + (p.isH ? prevMonthTranslate : 0) + '%, ' + (p.isH ? 0 : prevMonthTranslate) + '%, 0)').addClass('picker-calendar-month-prev'); + p.wrapper.prepend(prevMonthHTML[0]); + p.months = p.wrapper.find('.picker-calendar-month'); + if (p.params.onMonthAdd) { + p.params.onMonthAdd(p, p.months.eq(0)[0]); + } + } + p.animating = true; + p.onMonthChangeStart('prev'); + var translate = (p.monthsTranslate * 100) * inverter; + p.wrapper.transition(transition).transform('translate3d(' + (p.isH ? translate : 0) + '%, ' + (p.isH ? 0 : translate) + '%, 0)'); + if (transitionEndCallback) { + p.wrapper.transitionEnd(function () { + p.onMonthChangeEnd('prev'); + }); + } + if (!p.params.animate) { + p.onMonthChangeEnd('prev'); + } + }; + p.resetMonth = function (transition) { + if (typeof transition === 'undefined') transition = ''; + var translate = (p.monthsTranslate * 100) * inverter; + p.wrapper.transition(transition).transform('translate3d(' + (p.isH ? translate : 0) + '%, ' + (p.isH ? 0 : translate) + '%, 0)'); + }; + p.setYearMonth = function (year, month, transition) { + if (typeof year === 'undefined') year = p.currentYear; + if (typeof month === 'undefined') month = p.currentMonth; + if (typeof transition === 'undefined' || typeof transition === 'object') { + transition = ''; + if (!p.params.animate) transition = 0; + } + var targetDate; + if (year < p.currentYear) { + targetDate = new Date(year, month + 1, -1).getTime(); + } + else { + targetDate = new Date(year, month).getTime(); + } + if (p.params.maxDate && targetDate > new Date(p.params.maxDate).getTime()) { + return false; + } + if (p.params.minDate && targetDate < new Date(p.params.minDate).getTime()) { + return false; + } + var currentDate = new Date(p.currentYear, p.currentMonth).getTime(); + var dir = targetDate > currentDate ? 'next' : 'prev'; + var newMonthHTML = p.monthHTML(new Date(year, month)); + p.monthsTranslate = p.monthsTranslate || 0; + var prevTranslate = p.monthsTranslate; + var monthTranslate, wrapperTranslate; + var transitionEndCallback = p.animating ? false : true; + if (targetDate > currentDate) { + // To next + p.monthsTranslate --; + if (!p.animating) p.months.eq(p.months.length - 1).remove(); + p.wrapper.append(newMonthHTML); + p.months = p.wrapper.find('.picker-calendar-month'); + monthTranslate = -(prevTranslate - 1) * 100 * inverter; + p.months.eq(p.months.length - 1).transform('translate3d(' + (p.isH ? monthTranslate : 0) + '%, ' + (p.isH ? 0 : monthTranslate) + '%, 0)').addClass('picker-calendar-month-next'); + } + else { + // To prev + p.monthsTranslate ++; + if (!p.animating) p.months.eq(0).remove(); + p.wrapper.prepend(newMonthHTML); + p.months = p.wrapper.find('.picker-calendar-month'); + monthTranslate = -(prevTranslate + 1) * 100 * inverter; + p.months.eq(0).transform('translate3d(' + (p.isH ? monthTranslate : 0) + '%, ' + (p.isH ? 0 : monthTranslate) + '%, 0)').addClass('picker-calendar-month-prev'); + } + if (p.params.onMonthAdd) { + p.params.onMonthAdd(p, dir === 'next' ? p.months.eq(p.months.length - 1)[0] : p.months.eq(0)[0]); + } + p.animating = true; + p.onMonthChangeStart(dir); + wrapperTranslate = (p.monthsTranslate * 100) * inverter; + p.wrapper.transition(transition).transform('translate3d(' + (p.isH ? wrapperTranslate : 0) + '%, ' + (p.isH ? 0 : wrapperTranslate) + '%, 0)'); + if (transitionEndCallback) { + p.wrapper.transitionEnd(function () { + p.onMonthChangeEnd(dir, true); + }); + } + if (!p.params.animate) { + p.onMonthChangeEnd(dir); + } + }; + p.nextYear = function () { + p.setYearMonth(p.currentYear + 1); + }; + p.prevYear = function () { + p.setYearMonth(p.currentYear - 1); + }; + + + // HTML Layout + p.layout = function () { + var pickerHTML = ''; + var pickerClass = ''; + var i; + + var layoutDate = p.value && p.value.length ? p.value[0] : new Date().setHours(0,0,0,0); + var prevMonthHTML = p.monthHTML(layoutDate, 'prev'); + var currentMonthHTML = p.monthHTML(layoutDate); + var nextMonthHTML = p.monthHTML(layoutDate, 'next'); + var monthsHTML = '
' + (prevMonthHTML + currentMonthHTML + nextMonthHTML) + '
'; + // Week days header + var weekHeaderHTML = ''; + if (p.params.weekHeader) { + for (i = 0; i < 7; i++) { + var weekDayIndex = (i + p.params.firstDay > 6) ? (i - 7 + p.params.firstDay) : (i + p.params.firstDay); + var dayName = p.params.dayNamesShort[weekDayIndex]; + weekHeaderHTML += '
' + dayName + '
'; + + } + weekHeaderHTML = '
' + weekHeaderHTML + '
'; + } + pickerClass = 'picker-modal picker-calendar ' + (p.params.cssClass || ''); + var toolbarHTML = p.params.toolbar ? p.params.toolbarTemplate.replace(/{{closeText}}/g, p.params.toolbarCloseText) : ''; + if (p.params.toolbar) { + toolbarHTML = p.params.toolbarTemplate + .replace(/{{closeText}}/g, p.params.toolbarCloseText) + .replace(/{{monthPicker}}/g, (p.params.monthPicker ? p.params.monthPickerTemplate : '')) + .replace(/{{yearPicker}}/g, (p.params.yearPicker ? p.params.yearPickerTemplate : '')); + } + + pickerHTML = + '
' + + toolbarHTML + + '
' + + weekHeaderHTML + + monthsHTML + + '
' + + '
'; + + + p.pickerHTML = pickerHTML; + }; + + // Input Events + function openOnInput(e) { + e.preventDefault(); + if (p.opened) return; + p.open(); + if (p.params.scrollToInput && !isPopover()) { + var pageContent = p.input.parents('.page-content'); + if (pageContent.length === 0) return; + + var paddingTop = parseInt(pageContent.css('padding-top'), 10), + paddingBottom = parseInt(pageContent.css('padding-bottom'), 10), + pageHeight = pageContent[0].offsetHeight - paddingTop - p.container.height(), + pageScrollHeight = pageContent[0].scrollHeight - paddingTop - p.container.height(), + newPaddingBottom; + + var inputTop = p.input.offset().top - paddingTop + p.input[0].offsetHeight; + if (inputTop > pageHeight) { + var scrollTop = pageContent.scrollTop() + inputTop - pageHeight; + if (scrollTop + pageHeight > pageScrollHeight) { + newPaddingBottom = scrollTop + pageHeight - pageScrollHeight + paddingBottom; + if (pageHeight === pageScrollHeight) { + newPaddingBottom = p.container.height(); + } + pageContent.css({'padding-bottom': (newPaddingBottom) + 'px'}); + } + pageContent.scrollTop(scrollTop, 300); + } + } + } + function closeOnHTMLClick(e) { + if (inPopover()) return; + if (p.input && p.input.length > 0) { + if (e.target !== p.input[0] && $(e.target).parents('.picker-modal').length === 0) p.close(); + } + else { + if ($(e.target).parents('.picker-modal').length === 0) p.close(); + } + } + + if (p.params.input) { + p.input = $(p.params.input); + if (p.input.length > 0) { + if (p.params.inputReadOnly) p.input.prop('readOnly', true); + if (!p.inline) { + p.input.on("click", function(e) { + openOnInput(e); + //修复部分安卓系统下,即使设置了readonly依然会弹出系统键盘的bug + if (p.params.inputReadOnly) { + this.focus(); + this.blur(); + } + }); + } + if (p.params.inputReadOnly) { + p.input.on('focus mousedown', function (e) { + e.preventDefault(); + }); + } + } + } + + if (!p.inline) $('html').on('click', closeOnHTMLClick); + + // Open + function onPickerClose() { + p.opened = false; + if (p.input && p.input.length > 0) p.input.parents('.page-content').css({'padding-bottom': ''}); + if (p.params.onClose) p.params.onClose(p); + + // Destroy events + p.destroyCalendarEvents(); + } + + p.opened = false; + p.open = function () { + var toPopover = isPopover(); + var updateValue = false; + if (!p.opened) { + // Set date value + if (!p.value) { + if (p.params.value) { + p.value = p.params.value; + updateValue = true; + } + } + + // Layout + p.layout(); + + // Append + if (toPopover) { + p.pickerHTML = '
' + p.pickerHTML + '
'; + p.popover = $.popover(p.pickerHTML, p.params.input, true); + p.container = $(p.popover).find('.picker-modal'); + $(p.popover).on('close', function () { + onPickerClose(); + }); + } + else if (p.inline) { + p.container = $(p.pickerHTML); + p.container.addClass('picker-modal-inline'); + $(p.params.container).append(p.container); + } + else { + p.container = $($.pickerModal(p.pickerHTML)); + $(p.container) + .on('close', function () { + onPickerClose(); + }); + } + + // Store calendar instance + p.container[0].f7Calendar = p; + p.wrapper = p.container.find('.picker-calendar-months-wrapper'); + + // Months + p.months = p.wrapper.find('.picker-calendar-month'); + + // Update current month and year + p.updateCurrentMonthYear(); + + // Set initial translate + p.monthsTranslate = 0; + p.setMonthsTranslate(); + + // Init events + p.initCalendarEvents(); + + // Update input value + if (updateValue) p.updateValue(); + + } + + // Set flag + p.opened = true; + p.initialized = true; + if (p.params.onMonthAdd) { + p.months.each(function () { + p.params.onMonthAdd(p, this); + }); + } + if (p.params.onOpen) p.params.onOpen(p); + }; + + // Close + p.close = function () { + if (!p.opened || p.inline) return; + if (inPopover()) { + $.closeModal(p.popover); + return; + } + else { + $.closeModal(p.container); + return; + } + }; + + // Destroy + p.destroy = function () { + p.close(); + if (p.params.input && p.input.length > 0) { + p.input.off('click focus', openOnInput); + } + $('html').off('click', closeOnHTMLClick); + }; + + if (p.inline) { + p.open(); + } + + return p; + }; + $.fn.calendar = function (params) { + return this.each(function() { + var $this = $(this); + if(!$this[0]) return; + var calendar = $this.data("calendar"); + if(!calendar) { + var p = {}; + if($this[0].tagName.toUpperCase() === "INPUT") { + p.input = $this; + } else { + p.container = $this; + } + $this.data("calendar", new Calendar($.extend(p, params))); + } + }); + }; + + defaults = $.fn.calendar.prototype.defaults = { + monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August' , 'September' , 'October', 'November', 'December'], + monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + firstDay: 1, // First day of the week, Monday + weekendDays: [0, 6], // Sunday and Saturday + multiple: false, + dateFormat: 'yyyy-mm-dd', + direction: 'horizontal', // or 'vertical' + minDate: null, + maxDate: null, + touchMove: true, + animate: true, + closeOnSelect: true, + monthPicker: true, + monthPickerTemplate: + '
' + + '' + + '
' + + '' + + '
', + yearPicker: true, + yearPickerTemplate: + '
' + + '' + + '' + + '' + + '
', + weekHeader: true, + // Common settings + scrollToInput: true, + inputReadOnly: true, + convertToPopover: true, + onlyInPopover: false, + toolbar: true, + toolbarCloseText: 'Done', + toolbarTemplate: + '
' + + '
' + + '{{monthPicker}}' + + '{{yearPicker}}' + + // '{{closeText}}' + + '
' + + '
', + /* Callbacks + onMonthAdd + onChange + onOpen + onClose + onDayClick + onMonthYearChangeStart + onMonthYearChangeEnd + */ + }; + + $.initCalendar = function(content) { + var $content = content ? $(content) : $(document.body); + $content.find("[data-toggle='date']").each(function() { + $(this).calendar(); + }); + }; +}($); + +/*====================================================== +************ Picker ************ +======================================================*/ +/* global $:true */ +/* jshint unused:false */ +/* jshint multistr:true */ ++ function($) { + "use strict"; + var Picker = function (params) { + var p = this; + var defaults = { + updateValuesOnMomentum: false, + updateValuesOnTouchmove: true, + rotateEffect: false, + momentumRatio: 7, + freeMode: false, + // Common settings + scrollToInput: true, + inputReadOnly: true, + convertToPopover: true, + onlyInPopover: false, + toolbar: true, + toolbarCloseText: 'OK', + toolbarTemplate: '
\ + \ +

\ +
', + }; + params = params || {}; + for (var def in defaults) { + if (typeof params[def] === 'undefined') { + params[def] = defaults[def]; + } + } + p.params = params; + p.cols = []; + p.initialized = false; + + // Inline flag + p.inline = p.params.container ? true : false; + + // 3D Transforms origin bug, only on safari + var originBug = $.device.ios || (navigator.userAgent.toLowerCase().indexOf('safari') >= 0 && navigator.userAgent.toLowerCase().indexOf('chrome') < 0) && !$.device.android; + + // Should be converted to popover + function isPopover() { + var toPopover = false; + if (!p.params.convertToPopover && !p.params.onlyInPopover) return toPopover; + if (!p.inline && p.params.input) { + if (p.params.onlyInPopover) toPopover = true; + else { + if ($.device.ios) { + toPopover = $.device.ipad ? true : false; + } + else { + if ($(window).width() >= 768) toPopover = true; + } + } + } + return toPopover; + } + function inPopover() { + if (p.opened && p.container && p.container.length > 0 && p.container.parents('.popover').length > 0) return true; + else return false; + } + + // Value + p.setValue = function (arrValues, transition) { + var valueIndex = 0; + for (var i = 0; i < p.cols.length; i++) { + if (p.cols[i] && !p.cols[i].divider) { + p.cols[i].setValue(arrValues[valueIndex], transition); + valueIndex++; + } + } + }; + p.updateValue = function () { + var newValue = []; + var newDisplayValue = []; + for (var i = 0; i < p.cols.length; i++) { + if (!p.cols[i].divider) { + newValue.push(p.cols[i].value); + newDisplayValue.push(p.cols[i].displayValue); + } + } + if (newValue.indexOf(undefined) >= 0) { + return; + } + p.value = newValue; + p.displayValue = newDisplayValue; + if (p.params.onChange) { + p.params.onChange(p, p.value, p.displayValue); + } + if (p.input && p.input.length > 0) { + $(p.input).val(p.params.formatValue ? p.params.formatValue(p, p.value, p.displayValue) : p.value.join(' ')); + $(p.input).trigger('change'); + } + }; + + // Columns Handlers + p.initPickerCol = function (colElement, updateItems) { + var colContainer = $(colElement); + var colIndex = colContainer.index(); + var col = p.cols[colIndex]; + if (col.divider) return; + col.container = colContainer; + col.wrapper = col.container.find('.picker-items-col-wrapper'); + col.items = col.wrapper.find('.picker-item'); + + var i, j; + var wrapperHeight, itemHeight, itemsHeight, minTranslate, maxTranslate; + col.replaceValues = function (values, displayValues) { + col.destroyEvents(); + col.values = values; + col.displayValues = displayValues; + var newItemsHTML = p.columnHTML(col, true); + col.wrapper.html(newItemsHTML); + col.items = col.wrapper.find('.picker-item'); + col.calcSize(); + col.setValue(col.values[0], 0, true); + col.initEvents(); + }; + col.calcSize = function () { + if (p.params.rotateEffect) { + col.container.removeClass('picker-items-col-absolute'); + if (!col.width) col.container.css({width:''}); + } + var colWidth, colHeight; + colWidth = 0; + colHeight = col.container[0].offsetHeight; + wrapperHeight = col.wrapper[0].offsetHeight; + itemHeight = col.items[0].offsetHeight; + itemsHeight = itemHeight * col.items.length; + minTranslate = colHeight / 2 - itemsHeight + itemHeight / 2; + maxTranslate = colHeight / 2 - itemHeight / 2; + if (col.width) { + colWidth = col.width; + if (parseInt(colWidth, 10) === colWidth) colWidth = colWidth + 'px'; + col.container.css({width: colWidth}); + } + if (p.params.rotateEffect) { + if (!col.width) { + col.items.each(function () { + var item = $(this); + item.css({width:'auto'}); + colWidth = Math.max(colWidth, item[0].offsetWidth); + item.css({width:''}); + }); + col.container.css({width: (colWidth + 2) + 'px'}); + } + col.container.addClass('picker-items-col-absolute'); + } + }; + col.calcSize(); + + col.wrapper.transform('translate3d(0,' + maxTranslate + 'px,0)').transition(0); + + + var activeIndex = 0; + var animationFrameId; + + // Set Value Function + col.setValue = function (newValue, transition, valueCallbacks) { + if (typeof transition === 'undefined') transition = ''; + var newActiveIndex = col.wrapper.find('.picker-item[data-picker-value="' + newValue + '"]').index(); + if(typeof newActiveIndex === 'undefined' || newActiveIndex === -1) { + return; + } + var newTranslate = -newActiveIndex * itemHeight + maxTranslate; + // Update wrapper + col.wrapper.transition(transition); + col.wrapper.transform('translate3d(0,' + (newTranslate) + 'px,0)'); + + // Watch items + if (p.params.updateValuesOnMomentum && col.activeIndex && col.activeIndex !== newActiveIndex ) { + $.cancelAnimationFrame(animationFrameId); + col.wrapper.transitionEnd(function(){ + $.cancelAnimationFrame(animationFrameId); + }); + updateDuringScroll(); + } + + // Update items + col.updateItems(newActiveIndex, newTranslate, transition, valueCallbacks); + }; + + col.updateItems = function (activeIndex, translate, transition, valueCallbacks) { + if (typeof translate === 'undefined') { + translate = $.getTranslate(col.wrapper[0], 'y'); + } + if(typeof activeIndex === 'undefined') activeIndex = -Math.round((translate - maxTranslate)/itemHeight); + if (activeIndex < 0) activeIndex = 0; + if (activeIndex >= col.items.length) activeIndex = col.items.length - 1; + var previousActiveIndex = col.activeIndex; + col.activeIndex = activeIndex; + /* + col.wrapper.find('.picker-selected, .picker-after-selected, .picker-before-selected').removeClass('picker-selected picker-after-selected picker-before-selected'); + + col.items.transition(transition); + var selectedItem = col.items.eq(activeIndex).addClass('picker-selected').transform(''); + var prevItems = selectedItem.prevAll().addClass('picker-before-selected'); + var nextItems = selectedItem.nextAll().addClass('picker-after-selected'); + */ + //去掉 .picker-after-selected, .picker-before-selected 以提高性能 + col.wrapper.find('.picker-selected').removeClass('picker-selected'); + if (p.params.rotateEffect) { + col.items.transition(transition); + } + var selectedItem = col.items.eq(activeIndex).addClass('picker-selected').transform(''); + + if (valueCallbacks || typeof valueCallbacks === 'undefined') { + // Update values + col.value = selectedItem.attr('data-picker-value'); + col.displayValue = col.displayValues ? col.displayValues[activeIndex] : col.value; + // On change callback + if (previousActiveIndex !== activeIndex) { + if (col.onChange) { + col.onChange(p, col.value, col.displayValue); + } + p.updateValue(); + } + } + + // Set 3D rotate effect + if (!p.params.rotateEffect) { + return; + } + var percentage = (translate - (Math.floor((translate - maxTranslate)/itemHeight) * itemHeight + maxTranslate)) / itemHeight; + + col.items.each(function () { + var item = $(this); + var itemOffsetTop = item.index() * itemHeight; + var translateOffset = maxTranslate - translate; + var itemOffset = itemOffsetTop - translateOffset; + var percentage = itemOffset / itemHeight; + + var itemsFit = Math.ceil(col.height / itemHeight / 2) + 1; + + var angle = (-18*percentage); + if (angle > 180) angle = 180; + if (angle < -180) angle = -180; + // Far class + if (Math.abs(percentage) > itemsFit) item.addClass('picker-item-far'); + else item.removeClass('picker-item-far'); + // Set transform + item.transform('translate3d(0, ' + (-translate + maxTranslate) + 'px, ' + (originBug ? -110 : 0) + 'px) rotateX(' + angle + 'deg)'); + }); + }; + + function updateDuringScroll() { + animationFrameId = $.requestAnimationFrame(function () { + col.updateItems(undefined, undefined, 0); + updateDuringScroll(); + }); + } + + // Update items on init + if (updateItems) col.updateItems(0, maxTranslate, 0); + + var allowItemClick = true; + var isTouched, isMoved, touchStartY, touchCurrentY, touchStartTime, touchEndTime, startTranslate, returnTo, currentTranslate, prevTranslate, velocityTranslate, velocityTime; + function handleTouchStart (e) { + if (isMoved || isTouched) return; + e.preventDefault(); + isTouched = true; + var position = $.getTouchPosition(e); + touchStartY = touchCurrentY = position.y; + touchStartTime = (new Date()).getTime(); + + allowItemClick = true; + startTranslate = currentTranslate = $.getTranslate(col.wrapper[0], 'y'); + } + function handleTouchMove (e) { + if (!isTouched) return; + e.preventDefault(); + allowItemClick = false; + var position = $.getTouchPosition(e); + touchCurrentY = position.y; + if (!isMoved) { + // First move + $.cancelAnimationFrame(animationFrameId); + isMoved = true; + startTranslate = currentTranslate = $.getTranslate(col.wrapper[0], 'y'); + col.wrapper.transition(0); + } + e.preventDefault(); + + var diff = touchCurrentY - touchStartY; + currentTranslate = startTranslate + diff; + returnTo = undefined; + + // Normalize translate + if (currentTranslate < minTranslate) { + currentTranslate = minTranslate - Math.pow(minTranslate - currentTranslate, 0.8); + returnTo = 'min'; + } + if (currentTranslate > maxTranslate) { + currentTranslate = maxTranslate + Math.pow(currentTranslate - maxTranslate, 0.8); + returnTo = 'max'; + } + // Transform wrapper + col.wrapper.transform('translate3d(0,' + currentTranslate + 'px,0)'); + + // Update items + col.updateItems(undefined, currentTranslate, 0, p.params.updateValuesOnTouchmove); + + // Calc velocity + velocityTranslate = currentTranslate - prevTranslate || currentTranslate; + velocityTime = (new Date()).getTime(); + prevTranslate = currentTranslate; + } + function handleTouchEnd (e) { + if (!isTouched || !isMoved) { + isTouched = isMoved = false; + return; + } + isTouched = isMoved = false; + col.wrapper.transition(''); + if (returnTo) { + if (returnTo === 'min') { + col.wrapper.transform('translate3d(0,' + minTranslate + 'px,0)'); + } + else col.wrapper.transform('translate3d(0,' + maxTranslate + 'px,0)'); + } + touchEndTime = new Date().getTime(); + var velocity, newTranslate; + if (touchEndTime - touchStartTime > 300) { + newTranslate = currentTranslate; + } + else { + velocity = Math.abs(velocityTranslate / (touchEndTime - velocityTime)); + newTranslate = currentTranslate + velocityTranslate * p.params.momentumRatio; + } + + newTranslate = Math.max(Math.min(newTranslate, maxTranslate), minTranslate); + + // Active Index + var activeIndex = -Math.floor((newTranslate - maxTranslate)/itemHeight); + + // Normalize translate + if (!p.params.freeMode) newTranslate = -activeIndex * itemHeight + maxTranslate; + + // Transform wrapper + col.wrapper.transform('translate3d(0,' + (parseInt(newTranslate,10)) + 'px,0)'); + + // Update items + col.updateItems(activeIndex, newTranslate, '', true); + + // Watch items + if (p.params.updateValuesOnMomentum) { + updateDuringScroll(); + col.wrapper.transitionEnd(function(){ + $.cancelAnimationFrame(animationFrameId); + }); + } + + // Allow click + setTimeout(function () { + allowItemClick = true; + }, 100); + } + + function handleClick(e) { + if (!allowItemClick) return; + $.cancelAnimationFrame(animationFrameId); + /*jshint validthis:true */ + var value = $(this).attr('data-picker-value'); + col.setValue(value); + } + + col.initEvents = function (detach) { + var method = detach ? 'off' : 'on'; + col.container[method]($.touchEvents.start, handleTouchStart); + col.container[method]($.touchEvents.move, handleTouchMove); + col.container[method]($.touchEvents.end, handleTouchEnd); + col.items[method]('click', handleClick); + }; + col.destroyEvents = function () { + col.initEvents(true); + }; + + col.container[0].f7DestroyPickerCol = function () { + col.destroyEvents(); + }; + + col.initEvents(); + + }; + p.destroyPickerCol = function (colContainer) { + colContainer = $(colContainer); + if ('f7DestroyPickerCol' in colContainer[0]) colContainer[0].f7DestroyPickerCol(); + }; + // Resize cols + function resizeCols() { + if (!p.opened) return; + for (var i = 0; i < p.cols.length; i++) { + if (!p.cols[i].divider) { + p.cols[i].calcSize(); + p.cols[i].setValue(p.cols[i].value, 0, false); + } + } + } + $(window).on('resize', resizeCols); + + // HTML Layout + p.columnHTML = function (col, onlyItems) { + var columnItemsHTML = ''; + var columnHTML = ''; + if (col.divider) { + columnHTML += '
' + col.content + '
'; + } + else { + for (var j = 0; j < col.values.length; j++) { + columnItemsHTML += '
' + (col.displayValues ? col.displayValues[j] : col.values[j]) + '
'; + } + columnHTML += '
' + columnItemsHTML + '
'; + } + return onlyItems ? columnItemsHTML : columnHTML; + }; + p.layout = function () { + var pickerHTML = ''; + var pickerClass = ''; + var i; + p.cols = []; + var colsHTML = ''; + for (i = 0; i < p.params.cols.length; i++) { + var col = p.params.cols[i]; + colsHTML += p.columnHTML(p.params.cols[i]); + p.cols.push(col); + } + pickerClass = 'picker-modal picker-columns ' + (p.params.cssClass || '') + (p.params.rotateEffect ? ' picker-3d' : ''); + pickerHTML = + '
' + + (p.params.toolbar ? p.params.toolbarTemplate.replace(/{{closeText}}/g, p.params.toolbarCloseText) : '') + + '
' + + colsHTML + + '
' + + '
' + + '
'; + + p.pickerHTML = pickerHTML; + }; + + // Input Events + function openOnInput(e) { + e.preventDefault(); + if (p.opened) return; + p.open(); + if (p.params.scrollToInput && !isPopover()) { + var pageContent = p.input.parents('.content'); + if (pageContent.length === 0) return; + + var paddingTop = parseInt(pageContent.css('padding-top'), 10), + paddingBottom = parseInt(pageContent.css('padding-bottom'), 10), + pageHeight = pageContent[0].offsetHeight - paddingTop - p.container.height(), + pageScrollHeight = pageContent[0].scrollHeight - paddingTop - p.container.height(), + newPaddingBottom; + var inputTop = p.input.offset().top - paddingTop + p.input[0].offsetHeight; + if (inputTop > pageHeight) { + var scrollTop = pageContent.scrollTop() + inputTop - pageHeight; + if (scrollTop + pageHeight > pageScrollHeight) { + newPaddingBottom = scrollTop + pageHeight - pageScrollHeight + paddingBottom; + if (pageHeight === pageScrollHeight) { + newPaddingBottom = p.container.height(); + } + pageContent.css({'padding-bottom': (newPaddingBottom) + 'px'}); + } + pageContent.scrollTop(scrollTop, 300); + } + } + } + function closeOnHTMLClick(e) { + if (inPopover()) return; + if (p.input && p.input.length > 0) { + if (e.target !== p.input[0] && $(e.target).parents('.picker-modal').length === 0) p.close(); + } + else { + if ($(e.target).parents('.picker-modal').length === 0) p.close(); + } + } + + if (p.params.input) { + p.input = $(p.params.input); + if (p.input.length > 0) { + if (p.params.inputReadOnly) p.input.prop('readOnly', true); + if (!p.inline) { + p.input.on("click", function(e) { + openOnInput(e); + //修复部分安卓系统下,即使设置了readonly依然会弹出系统键盘的bug + if (p.params.inputReadOnly) { + this.focus(); + this.blur(); + } + }); + } + if (p.params.inputReadOnly) { + p.input.on('focus mousedown', function (e) { + e.preventDefault(); + }); + } + } + + } + + if (!p.inline) $('html').on('click', closeOnHTMLClick); + + // Open + function onPickerClose() { + p.opened = false; + if (p.input && p.input.length > 0) p.input.parents('.page-content').css({'padding-bottom': ''}); + if (p.params.onClose) p.params.onClose(p); + + // Destroy events + p.container.find('.picker-items-col').each(function () { + p.destroyPickerCol(this); + }); + } + + p.opened = false; + p.open = function () { + var toPopover = isPopover(); + + if (!p.opened) { + + // Layout + p.layout(); + + // Append + if (toPopover) { + p.pickerHTML = '
' + p.pickerHTML + '
'; + p.popover = $.popover(p.pickerHTML, p.params.input, true); + p.container = $(p.popover).find('.picker-modal'); + $(p.popover).on('close', function () { + onPickerClose(); + }); + } + else if (p.inline) { + p.container = $(p.pickerHTML); + p.container.addClass('picker-modal-inline'); + $(p.params.container).append(p.container); + } + else { + p.container = $($.pickerModal(p.pickerHTML)); + $(p.container) + .on('close', function () { + onPickerClose(); + }); + } + + // Store picker instance + p.container[0].f7Picker = p; + + // Init Events + p.container.find('.picker-items-col').each(function () { + var updateItems = true; + if ((!p.initialized && p.params.value) || (p.initialized && p.value)) updateItems = false; + p.initPickerCol(this, updateItems); + }); + + // Set value + if (!p.initialized) { + if (p.params.value) { + p.setValue(p.params.value, 0); + } + } + else { + if (p.value) p.setValue(p.value, 0); + } + } + + // Set flag + p.opened = true; + p.initialized = true; + + if (p.params.onOpen) p.params.onOpen(p); + }; + + // Close + p.close = function () { + if (!p.opened || p.inline) return; + if (inPopover()) { + $.closeModal(p.popover); + return; + } + else { + $.closeModal(p.container); + return; + } + }; + + // Destroy + p.destroy = function () { + p.close(); + if (p.params.input && p.input.length > 0) { + p.input.off('click focus', openOnInput); + } + $('html').off('click', closeOnHTMLClick); + $(window).off('resize', resizeCols); + }; + + if (p.inline) { + p.open(); + } + + return p; + }; + + $(document).on("click", ".close-picker", function() { + var pickerToClose = $('.picker-modal.modal-in'); + if (pickerToClose.length > 0) { + $.closeModal(pickerToClose); + } + else { + pickerToClose = $('.popover.modal-in .picker-modal'); + if (pickerToClose.length > 0) { + $.closeModal(pickerToClose.parents('.popover')); + } + } + }); + + //修复picker会滚动页面的bug + $(document).on($.touchEvents.move, ".picker-modal-inner", function(e) { + e.preventDefault(); + }); + + $.fn.picker = function(params) { + var args = arguments; + return this.each(function() { + if(!this) return; + var $this = $(this); + + var picker = $this.data("picker"); + if(!picker) { + params = params || {}; + var inputValue = $this.val(); + if(params.value === undefined && inputValue !== "") { + params.value = params.cols.length > 1 ? inputValue.split(" ") : [inputValue]; + } + var p = $.extend({input: this}, params); + picker = new Picker(p); + $this.data("picker", picker); + } + if(typeof params === typeof "a") { + picker[params].apply(picker, Array.prototype.slice.call(args, 1)); + } + }); + }; +}($); + +/* global $:true */ +/* jshint unused:false*/ + ++ function($) { + "use strict"; + + + $.fn.datetimePicker = function(params) { + return this.each(function() { + + if(!this) return; + + var today = new Date(); + + var getDays = function(max) { + var days = []; + for(var i=1; i<= (max||31);i++) { + days.push(i < 10 ? "0"+i : i); + } + return days; + }; + + var getDaysByMonthAndYear = function(month, year) { + var int_d = new Date(year, parseInt(month)+1-1, 1); + var d = new Date(int_d - 1); + return getDays(d.getDate()); + }; + + var formatNumber = function (n) { + return n < 10 ? "0" + n : n; + }; + + var initMonthes = ('01 02 03 04 05 06 07 08 09 10 11 12').split(' '); + + var initYears = (function () { + var arr = []; + for (var i = 1950; i <= 2030; i++) { arr.push(i); } + return arr; + })(); + + + var defaults = { + + rotateEffect: false, //为了性能 + + value: [today.getFullYear(), formatNumber(today.getMonth()+1), today.getDate(), formatNumber(today.getHours()), formatNumber(today.getMinutes())], + + onChange: function (picker, values, displayValues) { + var days = getDaysByMonthAndYear(picker.cols[1].value, picker.cols[0].value); + var currentValue = picker.cols[2].value; + if(currentValue > days.length) currentValue = days.length; + picker.cols[2].setValue(currentValue); + }, + + formatValue: function (p, values, displayValues) { + return displayValues[0] + '-' + values[1] + '-' + values[2] + ' '; + }, + + cols: [ + // Years + { + values: initYears + }, + // Months + { + values: initMonthes + }, + // Days + { + values: getDays() + }, + +// // Space divider +// { +// divider: true, +// content: ' ' +// }, +// // Hours +// { +// values: (function () { +// var arr = []; +// for (var i = 0; i <= 23; i++) { arr.push(formatNumber(i)); } +// return arr; +// })(), +// }, +// // Divider +// { +// divider: true, +// content: ':' +// }, +// // Minutes +// { +// values: (function () { +// var arr = []; +// for (var i = 0; i <= 59; i++) { arr.push(formatNumber(i)); } +// return arr; +// })(), +// } + ] + }; + + params = params || {}; + var inputValue = $(this).val(); + if(params.value === undefined && inputValue !== "") { + params.value = [].concat(inputValue.split(" ")[0].split("-"), inputValue.split(" ")[1].split(":")); + } + + var p = $.extend(defaults, params); + $(this).picker(p); + }); + }; + +}($); + ++ function($) { + 'use strict'; + + $.initPullToRefresh = function(pageContainer) { + var eventsTarget = $(pageContainer); + if (!eventsTarget.hasClass('pull-to-refresh-content')) { + eventsTarget = eventsTarget.find('.pull-to-refresh-content'); + } + if (!eventsTarget || eventsTarget.length === 0) return; + + var isTouched, isMoved, touchesStart = {}, + isScrolling, touchesDiff, touchStartTime, container, refresh = false, + useTranslate = false, + startTranslate = 0, + translate, scrollTop, wasScrolled, triggerDistance, dynamicTriggerDistance; + + container = eventsTarget; + + // Define trigger distance + if (container.attr('data-ptr-distance')) { + dynamicTriggerDistance = true; + } else { + triggerDistance = 44; + } + + function handleTouchStart(e) { + if (isTouched) { + if ($.os.android) { + if ('targetTouches' in e && e.targetTouches.length > 1) return; + } else return; + } + isMoved = false; + isTouched = true; + isScrolling = undefined; + wasScrolled = undefined; + var position = $.getTouchPosition(e); + touchesStart.x = position.x; + touchesStart.y = position.y; + touchStartTime = (new Date()).getTime(); + /*jshint validthis:true */ + container = $(this); + } + + function handleTouchMove(e) { + if (!isTouched) return; + var position = $.getTouchPosition(e); + var pageX = position.x; + var pageY = position.y; + if (typeof isScrolling === 'undefined') { + isScrolling = !!(isScrolling || Math.abs(pageY - touchesStart.y) > Math.abs(pageX - touchesStart.x)); + } + if (!isScrolling) { + isTouched = false; + return; + } + + scrollTop = container[0].scrollTop; + if (typeof wasScrolled === 'undefined' && scrollTop !== 0) wasScrolled = true; + + if (!isMoved) { + /*jshint validthis:true */ + container.removeClass('transitioning'); + if (scrollTop > container[0].offsetHeight) { + isTouched = false; + return; + } + if (dynamicTriggerDistance) { + triggerDistance = container.attr('data-ptr-distance'); + if (triggerDistance.indexOf('%') >= 0) triggerDistance = container[0].offsetHeight * parseInt(triggerDistance, 10) / 100; + } + startTranslate = container.hasClass('refreshing') ? triggerDistance : 0; + if (container[0].scrollHeight === container[0].offsetHeight || !$.os.ios) { + useTranslate = true; + } else { + useTranslate = false; + } + useTranslate = true; + } + isMoved = true; + touchesDiff = pageY - touchesStart.y; + + if (touchesDiff > 0 && scrollTop <= 0 || scrollTop < 0) { + // iOS 8 fix + if ($.os.ios && parseInt($.os.version.split('.')[0], 10) > 7 && scrollTop === 0 && !wasScrolled) useTranslate = true; + + if (useTranslate) { + e.preventDefault(); + translate = (Math.pow(touchesDiff, 0.85) + startTranslate); + container.transform('translate3d(0,' + translate + 'px,0)'); + } else {} + if ((useTranslate && Math.pow(touchesDiff, 0.85) > triggerDistance) || (!useTranslate && touchesDiff >= triggerDistance * 2)) { + refresh = true; + container.addClass('pull-up').removeClass('pull-down'); + } else { + refresh = false; + container.removeClass('pull-up').addClass('pull-down'); + } + } else { + + container.removeClass('pull-up pull-down'); + refresh = false; + return; + } + } + + function handleTouchEnd() { + if (!isTouched || !isMoved) { + isTouched = false; + isMoved = false; + return; + } + if (translate) { + container.addClass('transitioning'); + translate = 0; + } + container.transform(''); + if (refresh) { + container.addClass('refreshing'); + container.trigger('refresh', { + done: function() { + $.pullToRefreshDone(container); + } + }); + } else { + container.removeClass('pull-down'); + } + isTouched = false; + isMoved = false; + } + + // Attach Events + eventsTarget.on($.touchEvents.start, handleTouchStart); + eventsTarget.on($.touchEvents.move, handleTouchMove); + eventsTarget.on($.touchEvents.end, handleTouchEnd); + + + function destroyPullToRefresh() { + eventsTarget.off($.touchEvents.start, handleTouchStart); + eventsTarget.off($.touchEvents.move, handleTouchMove); + eventsTarget.off($.touchEvents.end, handleTouchEnd); + } + eventsTarget[0].destroyPullToRefresh = destroyPullToRefresh; + + }; + $.pullToRefreshDone = function(container) { + container = $(container); + if (container.length === 0) container = $('.pull-to-refresh-content.refreshing'); + container.removeClass('refreshing').addClass('transitioning'); + container.transitionEnd(function() { + container.removeClass('transitioning pull-up pull-down'); + }); + }; + $.pullToRefreshTrigger = function(container) { + container = $(container); + if (container.length === 0) container = $('.pull-to-refresh-content'); + if (container.hasClass('refreshing')) return; + container.addClass('transitioning refreshing'); + container.trigger('refresh', { + done: function() { + $.pullToRefreshDone(container); + } + }); + }; + + $.destroyPullToRefresh = function(pageContainer) { + pageContainer = $(pageContainer); + var pullToRefreshContent = pageContainer.hasClass('pull-to-refresh-content') ? pageContainer : pageContainer.find('.pull-to-refresh-content'); + if (pullToRefreshContent.length === 0) return; + if (pullToRefreshContent[0].destroyPullToRefresh) pullToRefreshContent[0].destroyPullToRefresh(); + }; + +}($); //jshint ignore:line + +/* global $:true */ ++ function($) { + 'use strict'; + + function handleInfiniteScroll() { + /*jshint validthis:true */ + var inf = $(this); + var scrollTop = inf.scrollTop(); + var scrollHeight = inf.scrollHeight(); + var height = inf[0].offsetHeight; + var distance = inf[0].getAttribute('data-distance'); + var virtualListContainer = inf.find('.virtual-list'); + var virtualList; + var onTop = inf.hasClass('infinite-scroll-top'); + if (!distance) distance = 50; + if (typeof distance === 'string' && distance.indexOf('%') >= 0) { + distance = parseInt(distance, 10) / 100 * height; + } + if (distance > height) distance = height; + if (onTop) { + if (scrollTop < distance) { + inf.trigger('infinite'); + } + } else { + if (scrollTop + height >= scrollHeight - distance) { + if (virtualListContainer.length > 0) { + virtualList = virtualListContainer[0].f7VirtualList; + if (virtualList && !virtualList.reachEnd) return; + } + inf.trigger('infinite'); + } + } + + } + $.attachInfiniteScroll = function(infiniteContent) { + $(infiniteContent).on('scroll', handleInfiniteScroll); + }; + $.detachInfiniteScroll = function(infiniteContent) { + $(infiniteContent).off('scroll', handleInfiniteScroll); + }; + + $.initInfiniteScroll = function(pageContainer) { + pageContainer = $(pageContainer); + var infiniteContent = pageContainer.hasClass('infinite-scroll')?pageContainer:pageContainer.find('.infinite-scroll'); + if (infiniteContent.length === 0) return; + $.attachInfiniteScroll(infiniteContent); + + function detachEvents() { + $.detachInfiniteScroll(infiniteContent); + pageContainer.off('pageBeforeRemove', detachEvents); + } + pageContainer.on('pageBeforeRemove', detachEvents); + }; +}($); + +/* =============================================================================== +************ Notification ************ +=============================================================================== */ +/* global $:true */ ++function ($) { + "use strict"; + + var noti, defaults, timeout, start, diffX, diffY; + + var touchStart = function(e) { + var p = $.getTouchPosition(e); + start = p; + diffX = diffY = 0; + noti.addClass("touching"); + }; + var touchMove = function(e) { + if(!start) return false; + e.preventDefault(); + e.stopPropagation(); + var p = $.getTouchPosition(e); + diffX = p.x - start.x; + diffY = p.y - start.y; + if(diffY > 0) { + diffY = Math.sqrt(diffY); + } + + noti.css("transform", "translate3d(0, "+diffY+"px, 0)"); + }; + var touchEnd = function() { + noti.removeClass("touching"); + noti.attr("style", ""); + if(diffY < 0 && (Math.abs(diffY) > noti.height()*0.38)) { + $.closeNotification(); + } + + if(Math.abs(diffX) <= 1 && Math.abs(diffY) <= 1) { + noti.trigger("noti-click"); + } + + start = false; + }; + + var attachEvents = function(el) { + el.on($.touchEvents.start, touchStart); + el.on($.touchEvents.move, touchMove); + el.on($.touchEvents.end, touchEnd); + }; + + $.notification = $.noti = function(params) { + params = $.extend({}, defaults, params); + noti = $(".notification"); + if(!noti[0]) { // create a new notification + noti = $('
').appendTo(document.body); + attachEvents(noti); + } + + noti.off("noti-click"); //the click event is not correct sometime: it will trigger when user is draging. + if(params.onClick) noti.on("noti-click", function() { + params.onClick(params.data); + }); + + noti.html($.t7.compile(params.tpl)(params)); + + noti.show(); + + noti.addClass("notification-in"); + noti.data("params", params); + + var startTimeout = function() { + if(timeout) { + clearTimeout(timeout); + timeout = null; + } + + timeout = setTimeout(function() { + if(noti.hasClass("touching")) { + startTimeout(); + } else { + $.closeNotification(); + } + }, params.time); + }; + + startTimeout(); + + }; + + $.closeNotification = function() { + timeout && clearTimeout(timeout); + timeout = null; + var noti = $(".notification").removeClass("notification-in").transitionEnd(function() { + $(this).remove(); + }); + + if(noti[0]) { + var params = $(".notification").data("params"); + if(params && params.onClose) { + params.onClose(params.data); + } + } + }; + + defaults = $.noti.prototype.defaults = { + title: undefined, + text: undefined, + media: undefined, + time: 4000, + onClick: undefined, + onClose: undefined, + data: undefined, + tpl: '
' + + '{{#if media}}
{{media}}
{{/if}}' + + '
' + + '{{#if title}}
{{title}}
{{/if}}' + + '{{#if text}}
{{text}}
{{/if}}' + + '
' + + '
' + + '
' + }; + +}($); + +/* global $:true */ ++function ($) { + "use strict"; + + var Index = function(params) { + this.params = params; + this.tpl = $.t7(this.params.indexListTemplate).compile(); + }; + + Index.prototype.render = function(list) { + this.list = $(list || ".list"); + this.draw(); + }; + + Index.prototype.draw = function() { + if(this.indexList) this.indexList.remove(); + this.titles = this.list.find(this.params.titleSelector); + var titleTexts = this.titles.map(function(i, t) { + return $(t).data("index") || $(t).text(); + }).toArray(); + + this.indexList = $("").appendTo(this.list.parents(".page")); + this.indexList.html(this.tpl({indexes: titleTexts})); + this.indexList.on($.touchEvents.start, $.proxy(this.touchStart, this)); + this.indexList.on($.touchEvents.start + " " + $.touchEvents.move, $.proxy(this.touchMove, this)); + this.indexList.on($.touchEvents.end, $.proxy(this.touchEnd, this)); + + this.content = this.list.parents(".content"); + }; + + Index.prototype.touchStart = function() { + this.pageOffsetTop = this.content.offset().top; + this.touching = true; + }; + + Index.prototype.touchMove = function(e) { + if(!this.touching) return; + e.preventDefault(); + var li = this.getElementOnTouch($.getTouchPosition(e)); + if(!li) return; + var title = this.titles.eq(li.data("index")); + var titleTop = title.parent().offset().top; // if a element has class list-group-title, it will be sticky in safari, so it's offset is not correct + var top = titleTop - this.pageOffsetTop + this.content.scrollTop(); + this.content.scrollTop(top); + }; + + Index.prototype.touchEnd = function() { + this.touching = false; + }; + + Index.prototype.getElementOnTouch = function(position) { + var result = null; + this.indexList.find("li").each(function() { + if(result) return; + var $this = $(this); + var offset = $this.offset(); + if(offset.top < position.y && offset.top + $this.outerHeight() > position.y) { + result = $this; + } + }); + return result; + }; + + $.fn.indexList = function(params) { + return this.each(function() { + if(!this) return; + + var list = $(this); + + var index = list.data("index"); + + if(!index) { + params = $.extend({}, $.fn.indexList.prototype.defaults, params); + index = new Index(params).render(list); + list.data("index", index); + } + + return index; + + }); + }; + + + $.fn.indexList.prototype.defaults = { + titleSelector: ".list-group-title", + indexListTemplate: "{{#indexes}}
  • {{this}}
  • {{/indexes}}" + }; + + $.initIndexList = function(selector) { + var container = $(selector); + if(container.hasClass(".contacts-block")) { + container.indexList(); + } else { + container.find(".contacts-block").indexList(); + } + }; + +}($); + +/* global $:true */ ++function ($) { + "use strict"; + $(function() { + $(document).on("focus", ".searchbar input", function(e) { + var $input = $(e.target); + $input.parents(".searchbar").addClass("searchbar-active"); + }); + $(document).on("click", ".searchbar-cancel", function(e) { + var $btn = $(e.target); + $btn.parents(".searchbar").removeClass("searchbar-active"); + }); + $(document).on("blur", ".searchbar input", function(e) { + var $input = $(e.target); + $input.parents(".searchbar").removeClass("searchbar-active"); + }); + }); +}($); + +/*====================================================== +************ Panels ************ +======================================================*/ +/* global $:true */ +/*jshint unused: false*/ ++function ($) { + "use strict"; + $.allowPanelOpen = true; + $.openPanel = function (panel) { + if (!$.allowPanelOpen) return false; + if(panel === 'left' || panel === 'right') panel = ".panel-" + panel; //可以传入一个方向 + panel = panel ? $(panel) : $(".panel").eq(0); + var direction = panel.hasClass("panel-right") ? "right" : "left"; + if (panel.length === 0 || panel.hasClass('active')) return false; + $.closePanel(); // Close if some panel is opened + $.allowPanelOpen = false; + var effect = panel.hasClass('panel-reveal') ? 'reveal' : 'cover'; + panel.css({display: 'block'}).addClass('active'); + panel.trigger('open'); + + // Trigger reLayout + var clientLeft = panel[0].clientLeft; + + // Transition End; + var transitionEndTarget = effect === 'reveal' ? $($.getCurrentPage()) : panel; + var openedTriggered = false; + + function panelTransitionEnd() { + transitionEndTarget.transitionEnd(function (e) { + if (e.target === transitionEndTarget[0]) { + if (panel.hasClass('active')) { + panel.trigger('opened'); + } + else { + panel.trigger('closed'); + } + $.allowPanelOpen = true; + } + else panelTransitionEnd(); + }); + } + panelTransitionEnd(); + + $(document.body).addClass('with-panel-' + direction + '-' + effect); + return true; + }; + $.closePanel = function () { + var activePanel = $('.panel.active'); + if (activePanel.length === 0) return false; + var effect = activePanel.hasClass('panel-reveal') ? 'reveal' : 'cover'; + var panelPosition = activePanel.hasClass('panel-left') ? 'left' : 'right'; + activePanel.removeClass('active'); + var transitionEndTarget = effect === 'reveal' ? $('.page') : activePanel; + activePanel.trigger('close'); + $.allowPanelOpen = false; + + transitionEndTarget.transitionEnd(function () { + if (activePanel.hasClass('active')) return; + activePanel.css({display: ''}); + activePanel.trigger('closed'); + $('body').removeClass('panel-closing'); + $.allowPanelOpen = true; + }); + + $('body').addClass('panel-closing').removeClass('with-panel-' + panelPosition + '-' + effect); + }; + + $(document).on("click", ".open-panel", function(e) { + var panel = $(e.target).data(panel); + $.openPanel(panel); + }); + $(document).on("click", ".close-panel, .panel-overlay", function(e) { + $.closePanel(); + }); + /*====================================================== + ************ Swipe panels ************ + ======================================================*/ + $.initSwipePanels = function () { + var panel, side; + var swipePanel = $.smConfig.swipePanel; + var swipePanelOnlyClose = $.smConfig.swipePanelOnlyClose; + var swipePanelCloseOpposite = true; + var swipePanelActiveArea = false; + var swipePanelThreshold = 2; + var swipePanelNoFollow = false; + + if(!(swipePanel || swipePanelOnlyClose)) return; + + var panelOverlay = $('.panel-overlay'); + var isTouched, isMoved, isScrolling, touchesStart = {}, touchStartTime, touchesDiff, translate, opened, panelWidth, effect, direction; + var currentPage = $($.getCurrentPage()); + + function handleTouchStart(e) { + currentPage = $($.getCurrentPage()); //page may changed + if (!$.allowPanelOpen || (!swipePanel && !swipePanelOnlyClose) || isTouched) return; + if ($('.modal-in, .photo-browser-in').length > 0) return; + if (!(swipePanelCloseOpposite || swipePanelOnlyClose)) { + if ($('.panel.active').length > 0 && !panel.hasClass('active')) return; + } + var position = $.getTouchPosition(e); + touchesStart.x = position.x; + touchesStart.y = position.y; + if (swipePanelCloseOpposite || swipePanelOnlyClose) { + if ($('.panel.active').length > 0) { + side = $('.panel.active').hasClass('panel-left') ? 'left' : 'right'; + } + else { + if (swipePanelOnlyClose) return; + side = swipePanel; + } + if (!side) return; + } + panel = $('.panel.panel-' + side); + if(!panel[0]) return; + opened = panel.hasClass('active'); + if (swipePanelActiveArea && !opened) { + if (side === 'left') { + if (touchesStart.x > swipePanelActiveArea) return; + } + if (side === 'right') { + if (touchesStart.x < window.innerWidth - swipePanelActiveArea) return; + } + } + isMoved = false; + isTouched = true; + isScrolling = undefined; + + touchStartTime = (new Date()).getTime(); + direction = undefined; + } + function handleTouchMove(e) { + if (!isTouched) return; + if(!panel[0]) return; + if (e.f7PreventPanelSwipe) return; + var position = $.getTouchPosition(e); + var pageX = position.x; + var pageY = position.y; + if (typeof isScrolling === 'undefined') { + isScrolling = !!(isScrolling || Math.abs(pageY - touchesStart.y) > Math.abs(pageX - touchesStart.x)); + } + if (isScrolling) { + isTouched = false; + return; + } + if (!direction) { + if (pageX > touchesStart.x) { + direction = 'to-right'; + } + else { + direction = 'to-left'; + } + + if ( + side === 'left' && + ( + direction === 'to-left' && !panel.hasClass('active') + ) || + side === 'right' && + ( + direction === 'to-right' && !panel.hasClass('active') + ) + ) + { + isTouched = false; + return; + } + } + + if (swipePanelNoFollow) { + var timeDiff = (new Date()).getTime() - touchStartTime; + if (timeDiff < 300) { + if (direction === 'to-left') { + if (side === 'right') $.openPanel(side); + if (side === 'left' && panel.hasClass('active')) $.closePanel(); + } + if (direction === 'to-right') { + if (side === 'left') $.openPanel(side); + if (side === 'right' && panel.hasClass('active')) $.closePanel(); + } + } + isTouched = false; + isMoved = false; + return; + } + + if (!isMoved) { + effect = panel.hasClass('panel-cover') ? 'cover' : 'reveal'; + if (!opened) { + panel.show(); + panelOverlay.show(); + } + panelWidth = panel[0].offsetWidth; + panel.transition(0); + /* + if (panel.find('.' + app.params.viewClass).length > 0) { + if (app.sizeNavbars) app.sizeNavbars(panel.find('.' + app.params.viewClass)[0]); + } + */ + } + + isMoved = true; + + e.preventDefault(); + var threshold = opened ? 0 : -swipePanelThreshold; + if (side === 'right') threshold = -threshold; + + touchesDiff = pageX - touchesStart.x + threshold; + + if (side === 'right') { + translate = touchesDiff - (opened ? panelWidth : 0); + if (translate > 0) translate = 0; + if (translate < -panelWidth) { + translate = -panelWidth; + } + } + else { + translate = touchesDiff + (opened ? panelWidth : 0); + if (translate < 0) translate = 0; + if (translate > panelWidth) { + translate = panelWidth; + } + } + if (effect === 'reveal') { + currentPage.transform('translate3d(' + translate + 'px,0,0)').transition(0); + panelOverlay.transform('translate3d(' + translate + 'px,0,0)'); + //app.pluginHook('swipePanelSetTransform', currentPage[0], panel[0], Math.abs(translate / panelWidth)); + } + else { + panel.transform('translate3d(' + translate + 'px,0,0)').transition(0); + //app.pluginHook('swipePanelSetTransform', currentPage[0], panel[0], Math.abs(translate / panelWidth)); + } + } + function handleTouchEnd(e) { + if (!isTouched || !isMoved) { + isTouched = false; + isMoved = false; + return; + } + isTouched = false; + isMoved = false; + var timeDiff = (new Date()).getTime() - touchStartTime; + var action; + var edge = (translate === 0 || Math.abs(translate) === panelWidth); + + if (!opened) { + if (translate === 0) { + action = 'reset'; + } + else if ( + timeDiff < 300 && Math.abs(translate) > 0 || + timeDiff >= 300 && (Math.abs(translate) >= panelWidth / 2) + ) { + action = 'swap'; + } + else { + action = 'reset'; + } + } + else { + if (translate === -panelWidth) { + action = 'reset'; + } + else if ( + timeDiff < 300 && Math.abs(translate) >= 0 || + timeDiff >= 300 && (Math.abs(translate) <= panelWidth / 2) + ) { + if (side === 'left' && translate === panelWidth) action = 'reset'; + else action = 'swap'; + } + else { + action = 'reset'; + } + } + if (action === 'swap') { + $.allowPanelOpen = true; + if (opened) { + $.closePanel(); + if (edge) { + panel.css({display: ''}); + $('body').removeClass('panel-closing'); + } + } + else { + $.openPanel(side); + } + if (edge) $.allowPanelOpen = true; + } + if (action === 'reset') { + if (opened) { + $.allowPanelOpen = true; + $.openPanel(side); + } + else { + $.closePanel(); + if (edge) { + $.allowPanelOpen = true; + panel.css({display: ''}); + } + else { + var target = effect === 'reveal' ? currentPage : panel; + $('body').addClass('panel-closing'); + target.transitionEnd(function () { + $.allowPanelOpen = true; + panel.css({display: ''}); + $('body').removeClass('panel-closing'); + }); + } + } + } + if (effect === 'reveal') { + currentPage.transition(''); + currentPage.transform(''); + } + panel.transition('').transform(''); + panelOverlay.css({display: ''}).transform(''); + } + $(document).on($.touchEvents.start, handleTouchStart); + $(document).on($.touchEvents.move, handleTouchMove); + $(document).on($.touchEvents.end, handleTouchEnd); + }; + + $.initSwipePanels(); +}($); + +// jshint ignore: start +/* + * 路由器 + */ ++function ($) { + "use strict"; + + if (!window.CustomEvent) { + window.CustomEvent = function (type, config) { + var e = document.createEvent('CustomEvent'); + e.initCustomEvent(type, config.bubbles, config.cancelable, config.detail, config.id); + return e; + }; + } + + var Router = function() { + this.state = sessionStorage; + this.state.setItem("stateid", parseInt(this.state.getItem("stateid") || 1)+1); + this.state.setItem("currentStateID", this.state.getItem("stateid")); + this.stack = sessionStorage; + this.stack.setItem("back", "[]"); //返回栈, {url, pageid, stateid} + this.stack.setItem("forward", "[]"); //前进栈, {url, pageid, stateid} + this.extras = {}; //page extra: popup, panel... + this.init(); + this.xhr = null; + } + + Router.prototype.defaults = { + transition: true + }; + + Router.prototype.init = function() { + var currentPage = this.getCurrentPage(); + if(!currentPage[0]) currentPage = $(".page").eq(0).addClass("page-current"); + var hash = location.hash; + if(currentPage[0] && !currentPage[0].id) currentPage[0].id = (hash ? hash.slice(1) : this.genRandomID()); + + if(!currentPage[0]) throw new Error("can't find .page element"); + var newCurrentPage = $(hash); + + + if(newCurrentPage[0] && (!currentPage[0] || hash.slice(1) !== currentPage[0].id)) { + currentPage.removeClass("page-current"); + newCurrentPage.addClass("page-current"); + currentPage = newCurrentPage; + } + + //第一次加载的时候,初识话当前页面的state + var state = history.state; + if(!state) { + var id = this.genStateID(); + this.replaceState(location.href, id); + this.setCurrentStateID(id); + } + + + var self = this; + window.addEventListener('load', function() { + //解决safari的一个bug,safari会在首次加载页面的时候触发 popstate 事件,通过setTimeout 做延迟来忽略这个错误的事件。 + //参考 https://github.com/visionmedia/page.js/pull/239/files + setTimeout(function() { + window.addEventListener('popstate', $.proxy(self.onpopstate, self)); + }, 0); + }, false); + } + + //load new page, and push to history + Router.prototype.loadPage = function(url, noAnimation, replace, reload) { + + var param = url; + + if(noAnimation === undefined) { + noAnimation = !this.defaults.transition; + } + + if(typeof url === typeof "a") { + param = { + url: url, + noAnimation: noAnimation, + replace: replace + } + } + + var url = param.url, noAnimation = param.noAnimation, replace = param.replace; + + this.getPage(url, function(page, extra) { + + var currentPage = this.getCurrentPage(); + + var pageid = currentPage[0].id; + + var action = "pushBack"; + if(replace) action = "replaceBack"; + if(reload) action = "reloadBack"; + this[action]({ + url: location.href, + pageid: "#"+ pageid, + id: this.getCurrentStateID(), + animation: !noAnimation + }); + + //remove all forward page + var forward = JSON.parse(this.state.getItem("forward") || "[]"); + var self = this; + for(var i=0;i this.getCurrentStateID(); + if(forward) this._forward(); + else this._back(); + } + + + //根据url获取页面的DOM,如果是一个内联页面,则直接返回,否则用ajax加载 + Router.prototype.getPage = function(url, callback) { + if(url[0] === "#") return callback.apply(this, [$(url)]); + + this.dispatch("pageLoadStart"); + + if(this.xhr && this.xhr.readyState < 4) { + this.xhr.onreadystatechange = $.noop; + this.xhr.abort(); + this.dispatch("pageLoadCancel"); + } + + var self = this; + + this.xhr = $.ajax({ + url: url, + success: $.proxy(function(data, s, xhr) { + var html = this.parseXHR(xhr); + var $page = html[0]; + var $extra = html[1]; + if(!$page[0].id) $page[0].id = this.genRandomID(); + $page.data("page-remote", 1); + callback.apply(this, [$page, $extra]); + }, this), + error: function() { + self.dispatch("pageLoadError"); + }, + complete: function() { + self.dispatch("pageLoadComplete"); + } + }); + } + Router.prototype.parseXHR = function(xhr) { + var response = xhr.responseText; + var body = response.match(/]*>([\s\S.]*)<\/body>/i); + var html = body ? body[1] : response; + html = "
    "+html+"
    "; + var tmp = $(html); + + var $extra = tmp.find(".popup, .popover, .panel, .panel-overlay"); + + var $page = tmp.find(".page"); + if(!$page[0]) $page = tmp.addClass("page"); + return [$page, $extra]; + } + + Router.prototype.genStateID = function() { + var id = parseInt(this.state.getItem("stateid")) + 1; + this.state.setItem("stateid", id); + return id; + } + Router.prototype.getCurrentStateID = function() { + return parseInt(this.state.getItem("currentStateID")); + } + Router.prototype.setCurrentStateID = function(id) { + this.state.setItem("currentStateID", id); + } + Router.prototype.genRandomID = function() { + return "page-"+(+new Date()); + } + + Router.prototype.popBack = function() { + var stack = JSON.parse(this.stack.getItem("back")); + if(!stack.length) return null; + var h = stack.splice(stack.length-1, 1)[0]; + this.stack.setItem("back", JSON.stringify(stack)); + return h; + } + Router.prototype.pushBack = function(h) { + var stack = JSON.parse(this.stack.getItem("back")); + stack.push(h); + this.stack.setItem("back", JSON.stringify(stack)); + } + Router.prototype.replaceBack = function(h) { + var stack = JSON.parse(this.stack.getItem("back")); + stack.pop(); + stack.push(h); + this.stack.setItem("back", JSON.stringify(stack)); + } + Router.prototype.reloadBack = function(h) { + //do nothing; + return; + } + Router.prototype.popForward = function() { + var stack = JSON.parse(this.stack.getItem("forward")); + if(!stack.length) return null; + var h = stack.splice(stack.length-1, 1)[0]; + this.stack.setItem("forward", JSON.stringify(stack)); + return h; + } + Router.prototype.pushForward = function(h) { + var stack = JSON.parse(this.stack.getItem("forward")); + stack.push(h); + this.stack.setItem("forward", JSON.stringify(stack)); + } + + Router.prototype.dispatch = function (event) { + var e = new CustomEvent(event, { + bubbles: true, + cancelable: true + }); + + window.dispatchEvent(e); + }; + + + $(function() { + if(!$.smConfig.router) return; + + var router = $.router = new Router(); + router.defaults = Router.prototype.defaults; + + $(document).on("click", "a", function(e) { + var $target = $(e.currentTarget); + if($target.hasClass("external") || + $target[0].hasAttribute("external") || + $target.hasClass("tab-link") || + $target.hasClass("open-popup") || + $target.hasClass("open-panel") + ) return; + e.preventDefault(); + var url = $target.attr("href"); + if($target.hasClass("back")) { + router.back(url); + return; + } + + if(!url || url === "#" || /javascript:.*;/.test(url)) return; + router.loadPage(url, $target.hasClass("no-transition") ? true : undefined, $target.hasClass("replace") ? true : undefined); //undefined is different to false + }) + }); +}($); +// jshint ignore: end + +/* global $:true */ +/*jshint unused: false*/ ++function ($) { + "use strict"; + + var getPage = function() { + var $page = $(".page-current"); + if(!$page[0]) $page = $(".page").addClass("page-current"); + return $page; + }; + + //初始化页面中的JS组件 + $.initPage = function(page) { + var $page = page ? $(page) : getPage(); + if(!$page[0]) $page = $(document.body); + var $content = $page.hasClass("content") ? $page : $page.find(".content"); + + $.initPullToRefresh($content); + $.initInfiniteScroll($content); + $.initCalendar($content); + $.initIndexList($content); + + //extend + if($.initSwiper) $.initSwiper($content); + if($.initSwipeout) $.initSwipeout(); // don't pass $content because the swipeout element is not $content + }; + + + if($.smConfig.showPageLoadingIndicator) { + //这里的 以 push 开头的是私有事件,不要用 + $(window).on("pageLoadStart", function() { + $.showIndicator(); + }); + $(document).on("pageAnimationStart", function() { + $.hideIndicator(); + }); + $(window).on("pageLoadCancel", function() { + $.hideIndicator(); + }); + $(window).on("pageLoadError", function() { + $.hideIndicator(); + $.toast("加载失败"); + }); + } + + + + $.init = function() { + var $page = getPage(); + var id = $page[0].id; + if($page.hasClass("page-inited")) { + $page.trigger("pageReinit", [id, $page]); + } else { + $.initPage(); + $page.addClass("page-inited"); + $page.trigger("pageInit", [id, $page]); + } + }; + + $(function() { + if($.smConfig.autoInit) { + $.init(); + } + + $(document).on("pageInitInternal", function(e, id, $page) { + $.init(); + }); + }); + + +}($); diff --git a/fangija-zsyf/yfindex.html b/fangija-zsyf/yfindex.html index af76b49..6180e06 100644 --- a/fangija-zsyf/yfindex.html +++ b/fangija-zsyf/yfindex.html @@ -1,54 +1,1707 @@ - - - - - - -
    - {{ message }} - -
      -
    • - {{ item.name }} -
    • -
    - - + + + +首页 + + + + + + + + + + + + + + + + +
    +
    + +
    +
    - - - - - + + + + + + + - - - - + $('.modal').remove(); + $('.modal-overlay').remove(); + $.toast('提交成功,我们会尽快完善信息'); + } + } + ] + }) +}); + +/* 选择-选择区域 */ +$("#region").picker({ + toolbarTemplate: '
    \ + \ +

    选择区域

    \ +
    ', + cols: [ + { + textAlign: "center", + values: ["黄浦", "长宁", "徐汇", "普陀", "静安"] + } + ] +}); + +/* 获取#region字数,截取#region前4字,并添加... */ +$(document).ready(function () { + regionChange(); +}); +$("#region").change(function () { + regionChange(); +}); +function regionChange(){ + var text = $("#region").val(); + var length = $("#region").val().length; + var textStr = ""; + if(length > 4){ + textStr = text.substr(0,4); + $("#region").val(textStr + "..."); + $("#region").css("width","3.8rem"); + } + if(length == 4){ + $("#region").css("width","3.2rem"); + } + if(length == 3){ + $("#region").css("width","2.4rem"); + } + if(length == 2){ + $("#region").css("width","1.8rem"); + } +}; + +/* 获取当前小区名称字数,截取当前小区名称前6字,并添加... */ +$(document).ready(function () { + var text = $(".content-block-title.cardNearbyName span").text(); + var length = $(".content-block-title.cardNearbyName span").text().length; + var textStr = ""; + if(length > 6){ + textStr = text.substr(0,6); + $(".content-block-title.cardNearbyName span").text(textStr + "..."); + } +}); + +/* 获取附近小区名称字数,截取附近小区名称前5字,并添加... */ +$(document).ready(function () { + var text = $(".cardNearby .card-header").text(); + var length = $(".cardNearby .card-header").text().length; + var textStr = ""; + if(length > 5){ + textStr = text.substr(0,5); + $(".cardNearby .card-header").text(textStr + "..."); + } +}); + +/* 筛选条件切换 */ +$(".region").on("click", function(){ + $("#select_region").show(); + $("#select_price").hide(); + $("#select_filter").hide(); + $("#select_order").hide(); + $(".region").addClass("active"); + $(".region i").addClass("icon-up"); + $(".price").removeClass("active"); + $(".price i").removeClass("icon-up"); + $(".filter").removeClass("active"); + $(".filter i").removeClass("icon-up"); + $(".order").removeClass("active"); + $(".order i").removeClass("icon-up"); +}); + +$(".price").on("click", function () { + $("#select_region").hide(); + $("#select_price").show(); + $("#select_filter").hide(); + $("#select_order").hide(); + $(".region").removeClass("active"); + $(".region i").removeClass("icon-up"); + $(".price").addClass("active"); + $(".price i").addClass("icon-up"); + $(".filter").removeClass("active"); + $(".filter i").removeClass("icon-up"); + $(".order").removeClass("active"); + $(".order i").removeClass("icon-up"); +}); + +$(".filter").on("click", function () { + $("#select_region").hide(); + $("#select_price").hide(); + $("#select_filter").show(); + $("#select_order").hide(); + $(".region").removeClass("active"); + $(".region i").removeClass("icon-up"); + $(".price").removeClass("active"); + $(".price i").removeClass("icon-up"); + $(".filter").addClass("active"); + $(".filter i").addClass("icon-up"); + $(".order").removeClass("active"); + $(".order i").removeClass("icon-up"); +}); + +$(".order").on("click", function () { + $("#select_region").hide(); + $("#select_price").hide(); + $("#select_filter").hide(); + $("#select_order").show(); + $(".region").removeClass("active"); + $(".region i").removeClass("icon-up"); + $(".price").removeClass("active"); + $(".price i").removeClass("icon-up"); + $(".filter").removeClass("active"); + $(".filter i").removeClass("icon-up"); + $(".order").addClass("active"); + $(".order i").addClass("icon-up"); +}); + +/* 区域 */ +$("#select_region .button").on("click", function () { + $(this).parents(".topic").find(".button").removeClass("active"); + $(this).addClass("active"); + var text = $("#select_region .button").eq(0).hasClass("active"); + if(text){ + $(".region a").text("区域"); + }else{ + $(".region a").text($(this).text()); + } + $(".mask").hide(); + $("#select_region").hide(); + $(".region").removeClass("active"); + $(".region i").removeClass("icon-up"); +}); + +/* 均价 */ +$("#select_price li").on("click", function () { + $(this).parents("#select_price").find(".item-title").removeClass("active"); + $(this).parents("#select_price").find(".item-title i").removeClass("icon-check"); + $(this).find(".item-title").addClass("active"); + $(this).find(".item-title i").addClass("icon-check"); + var index = $("#select_price li").index(this); + if(index < 8){ + var text = $("#select_price li").eq(0).find(".item-title").hasClass("active"); + if(text){ + $(".price a").text("均价"); + }else{ + $(".price a").text($(this).text()); + } + $("#select_price").hide(); + $(".price").removeClass("active"); + $(".price i").removeClass("icon-up"); + } +}); +$("#select_price #confirm_btn").on("click", function () { + $(".price a").text($("#minPrice").val() + "-" + $("#maxPrice").val() + "万"); + $("#select_price").hide(); + $(".price").removeClass("active"); + $(".price i").removeClass("icon-up"); +}); + +/* 标签 */ +$(".reset_btn").on("click", function () { + $("#select_filter .button").removeClass("active"); +}); +$(".confirm_btn").on("click", function () { + $(".mask").hide(); + $("#select_filter").hide(); + $(".filter").removeClass("active"); + $(".filter i").removeClass("icon-up"); +}); +$("#select_filter .button").on("click", function () { + if($(this).hasClass("active")){ + $(this).removeClass("active"); + }else{ + $(this).addClass("active"); + } +}); + +/* 智能排序 */ +$("#select_order li").on("click", function () { + $(this).parents("#select_order").find(".item-title").removeClass("active"); + $(this).parents("#select_order").find(".item-title i").removeClass("icon-check"); + $(this).find(".item-title").addClass("active"); + $(this).find(".item-title i").addClass("icon-check"); + $(".order a").text($(this).text()); + $("#select_order").hide(); + $(".order").removeClass("active"); + $(".order i").removeClass("icon-up"); +}); + + + + + \ No newline at end of file