Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
wtdmw committed Dec 26, 2018
1 parent 25a490e commit 118012c
Show file tree
Hide file tree
Showing 8 changed files with 393 additions and 18 deletions.
42 changes: 42 additions & 0 deletions api/pbl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

$qblsl=$_GET['qblsl'];

if($_GET['qbllx'] =="sj"){
//服务器地址
$severname="10.3.143.81";
//登陆用户名
$username="mgj_com";
//登陆密码
$password="63PWznc6a5pi7NFD";
//数据库名字
$dbname="mgj_com";

//创建链接
$con=new mysqli($severname,$username,$password,$dbname);
//检擦是否链接成功
if($con->connect_error){
exit("链接失败:".$con->connect_error);
}
//数据库查询语句
$sql = "select * from syfx limit ".($qblsl*6-6).",6";
$result = $con->query($sql);


//创建一个数组接受转存数据库的值
$fhsz = array();
//逐条取出集中的值,并加入数组
while($row = $result->fetch_assoc()) {
$fhsz[] = $row;
// echo json_encode($row,JSON_UNESCAPED_UNICODE);
}
// echo $result;
// echo json_encode($results,JSON_UNESCAPED_UNICODE);

//关闭数据库链接
$con->close();
//返回数据
echo json_encode($fhsz,JSON_UNESCAPED_UNICODE);
};

?>
4 changes: 2 additions & 2 deletions css/pbl.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

.body_pblbox_l{
width: 282px;
min-height: 600px;
/* min-height:200px; */
/* background-color: aliceblue; */
flex: 1;
margin-right: 20px;
Expand All @@ -25,7 +25,7 @@
}
.body_pblbox_l_g {
width: 100%;
min-height: 40px;
min-height: 60px;
/* background-color: aqua; */
box-shadow: 0 0 18px 0 rgba(0, 0, 0, .05);
border-radius: 10px;
Expand Down
5 changes: 5 additions & 0 deletions css/yhfx.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.yhfx_body{
width: 100%;
min-height: 200px;
margin-top: 153px;
}
246 changes: 246 additions & 0 deletions html/yhfx.html

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ <h3>流行话题</h3>
<!-- 1 -->
<div class="body_pblbox_l">

<div class="body_pblbox_l_g">
<!-- <div class="body_pblbox_l_g">
<div class="body_pblbox_l_g_sc">
<span><img src="img/181029_7j68l3gif51i6973854b675elkile_52x52.png" alt=""></span>
<span><img src="img/181207_3ki7d4c2di2j4ea4c69afdfl39370_50x50.png" alt=""></span>
Expand All @@ -228,12 +228,12 @@ <h3>流行话题</h3>
<div class="body_pblbox_l_g_wz">冬天保暖必备了今天佩戴了一个发带比较ins风的感觉
长袜更是保命穿搭也会比较显腿长。加上比较复古风的斜挎包包严严实实好看的出门了~</div>
</a>
</div>
</div> -->

</div>
<!-- 2 -->
<div class="body_pblbox_l">
<div class="body_pblbox_l_g">
<!-- <div class="body_pblbox_l_g">
<div class="body_pblbox_l_g_sc">
<span><img src="img/181029_7j68l3gif51i6973854b675elkile_52x52.png" alt=""></span>
<span><img src="img/181207_3ki7d4c2di2j4ea4c69afdfl39370_50x50.png" alt=""></span>
Expand All @@ -244,11 +244,11 @@ <h3>流行话题</h3>
<div class="body_pblbox_l_g_wz">冬天保暖必备了今天佩戴了一个发带比较ins风的感觉
长袜更是保命穿搭也会比较显腿长。加上比较复古风的斜挎包包严严实实好看的出门了~</div>
</a>
</div>
</div> -->
</div>
<!-- 3 -->
<div class="body_pblbox_l">
<div class="body_pblbox_l_g">
<!-- <div class="body_pblbox_l_g">
<div class="body_pblbox_l_g_sc">
<span><img src="img/181029_7j68l3gif51i6973854b675elkile_52x52.png" alt=""></span>
<span><img src="img/181207_3ki7d4c2di2j4ea4c69afdfl39370_50x50.png" alt=""></span>
Expand All @@ -259,11 +259,11 @@ <h3>流行话题</h3>
<div class="body_pblbox_l_g_wz">冬天保暖必备了今天佩戴了一个发带比较ins风的感觉
长袜更是保命穿搭也会比较显腿长。加上比较复古风的斜挎包包严严实实好看的出门了~</div>
</a>
</div>
</div> -->
</div>
<!-- 4 -->
<div class="body_pblbox_l">
<div class="body_pblbox_l_g">
<!-- <div class="body_pblbox_l_g">
<div class="body_pblbox_l_g_sc">
<span><img src="img/181029_7j68l3gif51i6973854b675elkile_52x52.png" alt=""></span>
<span><img src="img/181207_3ki7d4c2di2j4ea4c69afdfl39370_50x50.png" alt=""></span>
Expand All @@ -274,12 +274,12 @@ <h3>流行话题</h3>
<div class="body_pblbox_l_g_wz">冬天保暖必备了今天佩戴了一个发带比较ins风的感觉
长袜更是保命穿搭也会比较显腿长。加上比较复古风的斜挎包包严严实实好看的出门了~</div>
</a>
</div>
</div> -->
</div>

<!-- 轮播 -->
<div class="body_pblbox_lb">

</div>
</div>
</div>
Expand Down
90 changes: 86 additions & 4 deletions js/pbl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,89 @@
// console.log(1)
//向第插入第一个
var zb='<div class="body_pblbox_l_g"><a href="" class="body_pblbox_l_g_tp"><img src="img/181121_1b2gfjkjblfl8d187908i2gd7fag3_564x640.gif" alt=""></a></div>';
$("#body_pblbox .body_pblbox_l:nth-child(1)").prepend(zb);
var sc='<div class="body_pblbox_l_g"><a href="" class="body_pblbox_l_g_tp"><img src="img/181031_1jeaf9caahj2162802dlha9hje64k_564x1052.jpg" alt=""></a></div>';
$("#body_pblbox .body_pblbox_l:nth-child(4)").prepend(sc);
var pbl_zb = '<div class="body_pblbox_l_g"><a href="" class="body_pblbox_l_g_tp"><img src="img/181121_1b2gfjkjblfl8d187908i2gd7fag3_564x640.gif" alt=""></a></div>';
$("#body_pblbox .body_pblbox_l:nth-child(1)").prepend(pbl_zb);
var pbl_sc = '<div class="body_pblbox_l_g"><a href="" class="body_pblbox_l_g_tp"><img src="img/181031_1jeaf9caahj2162802dlha9hje64k_564x1052.jpg" alt=""></a></div>';
$("#body_pblbox .body_pblbox_l:nth-child(4)").prepend(pbl_sc);
var pbl_sys = [
"img/fx/1.webp",
"img/fx/2.webp",
"img/fx/3.webp",
"img/fx/4.webp",
"img/fx/5.webp",
"img/fx/6.webp"
]
//请求次数
var qqcs=0;
//数据填充
function pbl_sjtc() {

// console.log(sl)
var arr = [];
//发送请求
qqcs++
$.get("../api/pbl.php", {
qbllx: "sj",
qblsl: qqcs
},
function (data) {
// console.log(data);
arr = JSON.parse(data);
// console.log(arr);
sjts()
});


//循环数据数值
function sjts() {
$.each(arr, function (i, n) {
var sz = [];
//获取所有列最后一个子元素的位置
$.each($(".body_pblbox_l>div:last-child"), function (i, n) {
// console.log($(".body_pblbox_l>div:last-child")[i])
// console.log(n)
var $n = $(n);
var tops = $n.offset();
sz.push(tops.top);
});
// console.log(sz)
//选出最小的
//最小的下标
var zxxb = 0;

var min = sz[0];

for (var i = 1; i < sz.length; i++) {
var cur = sz[i];
if (cur < min) {
min = cur;
zxxb = i;
}
}

// console.log(min);
// console.log($("#body_pblbox .body_pblbox_l:nth-child("+(zxxb+1)+")"))
$("#body_pblbox .body_pblbox_l:nth-child(" + (zxxb + 1) + ")").append(`<div class="body_pblbox_l_g" fxif=${n.id}>
<div class="body_pblbox_l_g_sc">
<span><img src="img/181029_7j68l3gif51i6973854b675elkile_52x52.png" alt=""></span>
<span><img src="img/181207_3ki7d4c2di2j4ea4c69afdfl39370_50x50.png" alt=""></span>
</div>
<div></div>
<a href="" class="body_pblbox_l_g_tp">
<img src="${n.imgurl}" alt="">
<div class="body_pblbox_l_g_wz">冬天保暖必备了今天佩戴了一个发带比较ins风的感觉
长袜更是保命穿搭也会比较显腿长。加上比较复古风的斜挎包包严严实实好看的出门了~</div>
</a>
</div>`)
});
}

}

pbl_sjtc();

$(window).scroll(function (event) {
if ($(document).height() - $(document).scrollTop() < 1900) {
pbl_sjtc();
}

});
6 changes: 3 additions & 3 deletions js/top.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ $("#nav_ssl_sk_tc").hover(

function kz(x) {
clearInterval(dsgb);
console.log(x)
// console.log(x)
if (x == 1) {
clearInterval(dsgb);
}
Expand Down Expand Up @@ -122,9 +122,9 @@ $(document).ready(function () {
});
};
});

// console.log("http://"+window.location.host+"img/tx.png")
if (JSON.parse(Cooke.ccdq('dlzt')) == "ydl") {
$("#nav_dl img").attr("src", "img/tx.png");
$("#nav_dl img").attr("src", "http://"+window.location.host+"/img/tx.png");
$("#nav_dl span").html(JSON.parse(Cooke.ccdq('dlyh')) + "∨");
$("#nav_dl>a").attr("href", "javascript:;");
$("#nav_dl").append('<div class="nav_dl_tc"><ul><li><a href="">我的订单</a></li><li><a href="javascript:;">个人设置</a></li><li><a href="javascript:;">退出</a></li></ul></div>')
Expand Down
Empty file added js/yhfx.js
Empty file.

0 comments on commit 118012c

Please sign in to comment.