channel.php 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <?php
  2. include_once("untils/conn.php");
  3. $sql = "SELECT * FROM system";
  4. $result = mysqli_query($con, $sql);
  5. if ($result->num_rows > 0) {
  6. // 输出数据
  7. while($row = $result->fetch_assoc()) {
  8. // 获取每个字段的值
  9. $banner = $row["banner"];
  10. $link = $row["link"];
  11. $banner_one = $row["banner_one"];
  12. $link_one = $row["link_one"];
  13. $banner_two = $row["banner_two"];
  14. $link_two = $row["link_two"];
  15. }
  16. } else {
  17. // echo "未找到匹配的记录";
  18. }
  19. ?>
  20. <!DOCTYPE html>
  21. <html lang="en">
  22. <head>
  23. <meta charset="UTF-8">
  24. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  25. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  26. <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maxi-mum-scale=1.0,user-scalable=no" name="viewport" />
  27. <title>号卡中心</title>
  28. <link rel="stylesheet" href="other/main.css">
  29. </head>
  30. <body>
  31. <div class="focus">
  32. <ul>
  33. <li><a href="<?php echo $link ?>" target="_blank"><img src="<?php echo $banner ?>" ></a></li>
  34. <li><a href="<?php echo $link_one ?>" target="_blank"><img src="<?php echo $banner_one ?>"></a></li>
  35. <li><a href="<?php echo $link_two ?>" target="_blank"><img src="<?php echo $banner_two ?>"></a></li>
  36. <li><a href="<?php echo $link ?>" target="_blank"><img src="<?php echo $banner ?>"></a></li>
  37. <li><a href="<?php echo $link_one ?>" target="_blank"><img src="<?php echo $banner_one ?>"></a></li>
  38. </ul>
  39. <!-- 小圆点 -->
  40. <ol>
  41. <li class="current"></li>
  42. <li></li>
  43. <li></li>
  44. </ol>
  45. </div>
  46. <!--公告-->
  47. <div class="gonggao">
  48. <div class="gonggao-left">
  49. <img src="img/gonggao.png">
  50. </div>
  51. <div class="gonggao-right">
  52. 所有套餐需激活首充固定金额才可以享受优惠政策 </div>
  53. <div class="clear"></div>
  54. </div>
  55. <!--导航-->
  56. <?php
  57. include_once("untils/conn.php");
  58. $sql = "SELECT * FROM kefu";
  59. $result = mysqli_query($con, $sql);
  60. if ($result->num_rows > 0) {
  61. // 输出数据
  62. while($row = $result->fetch_assoc()) {
  63. // 获取每个字段的值
  64. $chaxun = $row["chaxun"];
  65. }
  66. } else {
  67. // echo "未找到匹配的记录";
  68. }
  69. ?>
  70. <!--查询导航-->
  71. <div class="dh" style="height:100px;margin-top:8px; display: flex;">
  72. <a href="odersearch.php" style="float:left; flex: 1;">
  73. <img style="float:right; margin-top:40px;width:80px" src="img/cx.png">
  74. <div class="bthcx"style="color: #fff;">订单查询
  75. <div calss="xian" style="width:40px; height:5px; border-radius: 10px; background:#fff"></div>
  76. <div style="margin-top:20px;width: 70px;height: 22px;text-align: center;border-radius: 20px;background: rgba(255, 255, 255, 1); color:#366EF6; font-size: 10px;padding-top: 3px;">立即查询</div>
  77. <!--<img style="float:right;" src="img/cx.png">-->
  78. </div>
  79. </a>
  80. <a href="kf.php" style="float:left; flex: 1;">
  81. <img style="float:right; margin-top:40px;width:80px;margin-right:10px ;" src="img/kf.png">
  82. <div class="bthkf"style="">在线客服
  83. <div calss="xian" style="width:40px; height:5px; border-radius: 10px; background:#fff"></div>
  84. <div style="margin-top:20px;width: 70px;height: 22px;text-align: center;border-radius: 20px;background: rgba(255, 255, 255, 1); color:#366EF6; font-size: 10px;padding-top: 3px;">立即联系</div>
  85. </div>
  86. </a>
  87. </div>
  88. <!--分类-->
  89. <div class="height" style="margin-top: -3px;"></div>
  90. <div class="fenlei">
  91. <div class="banner">限量领取<a class="right" style="float:right">流量领不停 免费送到家</a></div>
  92. <div class="navall">
  93. <?php
  94. include_once("untils/conn.php");
  95. mysqli_query($con, "set names utf8");
  96. $yysname = $_GET['yys'];
  97. $channel_id = $_GET['channel_id'];
  98. if ($con) {
  99. if ($db) {
  100. $sql = "select * from list where yys='$yysname' and (channel='$channel_id' or channel_one='$channel_id' or channel_two='$channel_id') ORDER BY xuhao DESC";
  101. $sortsql = "select * from sort ORDER BY sortid DESC";
  102. $data = mysqli_query($con, $sql);
  103. $sortdata = mysqli_query($con, $sortsql);
  104. ?> <ul class="box">
  105. <?php
  106. while ($sortrow = mysqli_fetch_array($sortdata)) {
  107. $dqid = $sortrow["yys"];
  108. ?>
  109. <li class="cat_child">
  110. <a href="?yys=<?php echo $sortrow["yys"] ?>&channel_id=<?php echo $channel_id ?>" class="<?php echo $yysname == $dqid ? 'active' : '' ?>"><?php echo $sortrow["yys"] ?></a>
  111. </li>
  112. <?php
  113. }
  114. ?>
  115. </ul>
  116. <?php
  117. while ($row = mysqli_fetch_array($data)) {
  118. ?>
  119. <div class="alllist">
  120. <img class="alllistl" src="<?php echo $row["zhutu"] ?>" onclick="javascript:location.href='links.php?id=<?php echo $row["id"]?>&channel_id=<?php echo $channel_id ?>'" />
  121. <div class="alllistc" onclick="javascript:location.href='links.php?id=<?php echo $row["id"]?>&channel_id=<?php echo $channel_id ?>'">
  122. <div class="listc1 ellipse1"><span class="shouquan">授权专营</span><?php echo $row["name"] ?></div>
  123. <div class="listc1 ellipse1"><?php echo $row["name"] ?><time><?php echo $row["ltime"] ?></time>
  124. <empty><?php echo $row["xuanhao"] ?></empty>
  125. </div>
  126. <div class="listc2 ellipse1"><span><?php echo $row["jieshao"] ?></span></div>
  127. <div class="pull-left"><span class="baoyou"><?php echo $row["baoyou"] ?></div>
  128. </div>
  129. <div class="alllistr1" onclick="javascript:location.href='links.php?id=<?php echo $row["id"]?>&channel_id=<?php echo $channel_id ?>'">
  130. 立即领取</div>
  131. </div>
  132. <?php
  133. }
  134. }
  135. }
  136. ?>
  137. </div>
  138. </div>
  139. <input type="hidden" id="is_login" value="-1">
  140. <div class="bottom1">
  141. <div class="height1"></div>
  142. </div>
  143. </body>
  144. <script>
  145. /** @format */
  146. window.addEventListener('load', function() {
  147. // alert(1);
  148. // 1. 获取元素
  149. var focus = document.querySelector('.focus');
  150. var ul = focus.children[0];
  151. // 获得focus 的宽度
  152. var w = focus.offsetWidth;
  153. var ol = focus.children[1];
  154. // 2. 利用定时器自动轮播图图片
  155. var index = 0;
  156. var timer = setInterval(function() {
  157. index++;
  158. var translatex = -index * w;
  159. ul.style.transition = 'all .3s';
  160. ul.style.transform = 'translateX(' + translatex + 'px)';
  161. }, 2000);
  162. // 等着我们过渡完成之后,再去判断 监听过渡完成的事件 transitionend
  163. ul.addEventListener('transitionend', function() {
  164. // 无缝滚动
  165. if (index >= 3) {
  166. index = 0;
  167. // console.log(index);
  168. // 去掉过渡效果 这样让我们的ul 快速的跳到目标位置
  169. ul.style.transition = 'none';
  170. // 利用最新的索引号乘以宽度 去滚动图片
  171. var translatex = -index * w;
  172. ul.style.transform = 'translateX(' + translatex + 'px)';
  173. } else if (index < 0) {
  174. index = 2;
  175. ul.style.transition = 'none';
  176. // 利用最新的索引号乘以宽度 去滚动图片
  177. var translatex = -index * w;
  178. ul.style.transform = 'translateX(' + translatex + 'px)';
  179. }
  180. // 3. 小圆点跟随变化
  181. // 把ol里面li带有current类名的选出来去掉类名 remove
  182. ol.querySelector('.current').classList.remove('current');
  183. // 让当前索引号 的小li 加上 current add
  184. ol.children[index].classList.add('current');
  185. });
  186. // 4. 手指滑动轮播图
  187. // 触摸元素 touchstart: 获取手指初始坐标
  188. var startX = 0;
  189. var moveX = 0; // 后面我们会使用这个移动距离所以要定义一个全局变量
  190. var flag = false;
  191. ul.addEventListener('touchstart', function(e) {
  192. startX = e.targetTouches[0].pageX;
  193. // 手指触摸的时候就停止定时器
  194. clearInterval(timer);
  195. });
  196. // 移动手指 touchmove: 计算手指的滑动距离, 并且移动盒子
  197. ul.addEventListener('touchmove', function(e) {
  198. // 计算移动距离
  199. moveX = e.targetTouches[0].pageX - startX;
  200. // 移动盒子: 盒子原来的位置 + 手指移动的距离
  201. var translatex = -index * w + moveX;
  202. // 手指拖动的时候,不需要动画效果所以要取消过渡效果
  203. ul.style.transition = 'none';
  204. ul.style.transform = 'translateX(' + translatex + 'px)';
  205. flag = true; // 如果用户手指移动过我们再去判断否则不做判断效果
  206. e.preventDefault(); // 阻止滚动屏幕的行为
  207. });
  208. // 手指离开 根据移动距离去判断是回弹还是播放上一张下一张
  209. ul.addEventListener('touchend', function(e) {
  210. if (flag) {
  211. // (1) 如果移动距离大于50像素我们就播放上一张或者下一张
  212. if (Math.abs(moveX) > 50) {
  213. // 如果是右滑就是 播放上一张 moveX 是正值
  214. if (moveX > 0) {
  215. index--;
  216. } else {
  217. // 如果是左滑就是 播放下一张 moveX 是负值
  218. index++;
  219. }
  220. var translatex = -index * w;
  221. ul.style.transition = 'all .3s';
  222. ul.style.transform = 'translateX(' + translatex + 'px)';
  223. } else {
  224. // (2) 如果移动距离小于50像素我们就回弹
  225. var translatex = -index * w;
  226. ul.style.transition = 'all .1s';
  227. ul.style.transform = 'translateX(' + translatex + 'px)';
  228. }
  229. }
  230. // 手指离开的时候就重新开启定时器
  231. clearInterval(timer);
  232. timer = setInterval(function() {
  233. index++;
  234. var translatex = -index * w;
  235. ul.style.transition = 'all .3s';
  236. ul.style.transform = 'translateX(' + translatex + 'px)';
  237. }, 2000);
  238. });
  239. });
  240. </script>
  241. </html>