ka.php 11 KB

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