Commit 49b6b46d by libai

测试

parent afe0b41d
......@@ -164,10 +164,18 @@ function loginGo(){
html+='<img class="search-icon" src="https://www.footseen.xyz/yazhaiTest/images/front/search2.png">'
$(".neck-nav-content").append(html)
$(".search-icon").on("click",function(event){
if(localStorage.uid==undefined){
loginLayer()
return;
}
window.location.href="https://www.footseen.xyz/yazhaiTest/search/index.html?search="+$(".search-input").val()+""
})
$(".search-input").on("keydown",function(event){
if(localStorage.uid==undefined){
loginLayer()
return;
}
if (event.keyCode == "13") {
if($(".search-input").val()==''||$(".search-input").val().split(" ").join("").length == 0){
layer.msg("請輸入要搜索的內容")
......
......@@ -31,7 +31,7 @@
<li data-type="4"><span>影片</span> <img src="images/front/nack-icon.png" alt=""></li>
<li data-type="5"><span>圖檔</span> <img src="images/front/nack-icon.png" alt=""></li>
<li data-type="6"><span>約會</span> <img src="images/front/nack-icon.png" alt=""></li>
<a target="_blank" href="https://www.footseen.xyz/yazhaiTest/reg/index.html"><li data-type="7"><span>儲值</span> <img src="https://www.footseen.xyz/yazhaiTest/images/front/nack-icon.png" alt=""></li></a>
<a href="https://www.footseen.xyz/yazhaiTest/reg/index.html"><li data-type="7"><span>儲值</span> <img src="https://www.footseen.xyz/yazhaiTest/images/front/nack-icon.png" alt=""></li></a>
</ul>
<a href="https://www.footseen.xyz/yazhaiTest/pc.html"><img class="logo" src="images/logo.png" alt=""></a>
<div class="nav-login-big-box">
......
......@@ -227,3 +227,16 @@ body::-webkit-scrollbar {
margin-top: 15px;
margin-bottom: 14px;
}
.like-no-box {
text-align: center;
padding-top: 100px;
}
.like-no-box > img {
width: 150px;
position: static;
}
.like-no-box > p {
color: #aaa;
font-size: 18px;
padding-top: 20px;
}
......@@ -224,3 +224,16 @@ body::-webkit-scrollbar {
margin-top: 15px;
margin-bottom: 14px;
}
.like-no-box {
text-align: center;
padding-top: 100px;
>img{
width: 150px;
position: static;
}
> p {
color: #aaa;
font-size: 18px;
padding-top: 20px;
}
}
\ No newline at end of file
......@@ -106,6 +106,7 @@
</a>
</ul>
</div>
<div style="display: none;" class="like-no-box"><img src="https://www.footseen.xyz/yazhaiTest/images/front/no-icon.png"><p>暫無搜索結果</p></div>
<div style="height:60px;"></div>
</div>
<div class="login-content"></div>
......@@ -118,11 +119,14 @@
<script>
$(function(){
if(localStorage.canvasCode==undefined)window.location.href='../pc.html'
if(localStorage.uid==undefined)window.location.href='../pc.html'
var noVideo=false;
var noUser=false;
var noImg=false;
loginGo()
if(data.search!=undefined){
var searchData=decodeURI(location.href.split("search=")[1])
$(".search-input").val(searchData)
searchGoUser(searchData,3)
searchGoVideo(searchData,12)
}
......@@ -131,24 +135,48 @@ $(function(){
$(".search-top-box div").removeClass("search-top-click")
_self.addClass("search-top-click")
if(_self.attr("data-type")==1){
searchGoUser($(".search-input").val(),3)
searchGoVideo($(".search-input").val(),12)
searchGoUser(searchData,3)
searchGoVideo(searchData,12)
$(".images-box").hide()
if(noVideo==true&&noUser==true){
$(".like-no-box p").text('找到'+searchData+'相關內容 0 個,相關用戶 0 人')
$(".like-no-box").show()
return;
}
$(".like-no-box").hide()
}
else if(_self.attr("data-type")==2){
searchGoUser($(".search-input").val(),30)
searchGoUser(searchData,30)
$(".video-box").hide()
$(".images-box").hide()
if(noUser==true){
$(".like-no-box p").text('找到'+searchData+'相關用戶 0 人')
$(".like-no-box").show()
return
}
$(".like-no-box").hide()
}
else if(_self.attr("data-type")==3){
searchGoVideo($(".search-input").val(),24)
searchGoVideo(searchData,24)
$(".search-user-box").hide()
$(".images-box").hide()
if(noVideo==true){
$(".like-no-box p").text('找到'+searchData+'相關內容 0 個')
$(".like-no-box").show()
return
}
$(".like-no-box").hide()
}
else if(_self.attr("data-type")==4){
searchGoImages($(".search-input").val(),24)
searchGoImages(searchData,24)
$(".search-user-box").hide()
$(".video-box").hide()
if(noImg==true){
$(".like-no-box p").text('找到'+searchData+'相關內容 0 個')
$(".like-no-box").show()
return
}
$(".like-no-box").hide()
}
})
function searchGoUser(e,pageNum){
......@@ -165,6 +193,10 @@ $(function(){
success:function(data){
console.log('搜索用户',data)
var html=[];
if(data.data.length==0){
noUser=true;
return;
}
for(var i=0;i<data.data.length;i++){
var list=data.data[i];
html+='<li>';
......@@ -196,6 +228,10 @@ $(function(){
success:function(data){
console.log('搜索视频',data)
var html=[];
if(data.dataList.length==0){
noVideo=true;
return;
}
for(var i=0;i<data.dataList.length;i++){
var list=data.dataList[i];
var videoList=JSON.parse(list.content)
......@@ -240,6 +276,10 @@ $(function(){
success:function(data){
console.log('搜索帖子',data)
var html=[];
if(data.dataList.length==0){
noImg=true;
return;
}
for(var i=0;i<data.dataList.length;i++){
var list=data.dataList[i];
var imgList=JSON.parse(list.content)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment