index.html 4.22 KB
Newer Older
xd's avatar
xd committed
1 2 3 4 5
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
xd's avatar
xd committed
6
  <title>专柜首页</title>
xd's avatar
xd committed
7 8 9 10 11 12 13 14 15
  <link rel="stylesheet" href="../css/swiper.css" />
  <link rel="stylesheet" href="../css/iconfont.css">
  <script src="../js/jquery-3.4.1.min.js"></script>
  <script src="../js/swiper.min.js" type="text/javascript" charset="utf-8"></script>
  <style>
    body {
      padding: 0;
      margin: 0;
    }
xd's avatar
xd committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29
    .center {
      display: flex;
      justify-content: start;
      flex-direction: column;
      width: 100%;
    }
    .swiper-container {
      height: 500px;
      width: 100%;
    } 
    .swiper-container img {
      height: 500px;
      width: 100%;
    }
xd's avatar
xd committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
    .list {
      height: auto;
      width: 100%;
      background-color: #fff;
      display: flex;
      justify-content: flex-start;
      border-bottom: 1px solid rgba(238, 238, 238, 1);
      box-shadow: 0px 2px 4px 0px rgba(221, 221, 221, 1);
      border-radius: 4px;
      z-index: 100;
    }

    .left {
      width: 30%;
    }

    .left img {
      width: 160px;
    }

    .right {
      width: 76%;
      padding: 20px;
      background-color: #fff;
      height: auto;
    }
    .flex {
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .title {
      font-size: 28px;
      font-weight: bold;
      color: rgba(45, 71, 106, 1);
    }

    .txt {
      margin-top: 20px;
      font-size: 24px;
      color: rgba(45, 71, 106, 0.8);
    }
xd's avatar
xd committed
72 73 74 75
    .fwb {
      width: 100%;
      padding: 30px !important;
    }
xd's avatar
xd committed
76 77 78 79
  </style>
</head>

<body>
xd's avatar
xd committed
80 81 82 83
  <div class="center">
    <div class="swiper-container">
      <div class="swiper-wrapper" id="slider"></div>
      <div class="swiper-pagination"></div>
xd's avatar
xd committed
84
    </div>
xd's avatar
xd committed
85 86 87
    <div class="list">
      <div class="left flex">
        <img id="logo" src="" alt="" />
xd's avatar
xd committed
88
      </div>
xd's avatar
xd committed
89 90 91 92 93 94 95 96 97 98
      <div class="right">
        <div class="title">欧亚一号专柜</div>
        <div class="txt">
          <i class="iconfont icon-dianhua" style="font-size: 16px;"></i>
          <span id="phone">18888888888</span>
        </div>
        <div class="txt">
          <i class="iconfont icon-dizhi" style="font-size: 16px;"></i>
          <span id="address">欧亚商场一楼181号</span>
        </div>
xd's avatar
xd committed
99 100
      </div>
    </div>
xd's avatar
xd committed
101 102
    <div id="fwb" style="padding: 40px;" >
    </div>
xd's avatar
xd committed
103
  </div>
xd's avatar
xd committed
104
  
xd's avatar
xd committed
105
  <script>
xd's avatar
xd committed
106
    // 获取店铺code
xd's avatar
xd committed
107 108 109 110 111 112 113 114 115 116
    function GetQueryString(name) {
      var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
      var r = window.location.search.substr(1).match(reg)
      var context = ""
      if (r != null)
        context = r[2]
      reg = null
      r = null
      return context == null || context == "" || context == "undefined" ? "" : context;
    }
xd's avatar
xd committed
117
    const oyStallCode = GetQueryString("oyStallCode")
xd's avatar
xd committed
118 119 120 121 122 123 124
    /* swiper轮播组件 */
    var swiper = new Swiper('.swiper-container', {
      autoplay: true,
      pagination: {
        el: '.swiper-pagination',
      },
    })
xd's avatar
xd committed
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
    $(function () {
      showQRInfo()
    })
    const showQRInfo = () => {
      $.ajax({
          type: 'GET',
          url: `http://139.155.48.151:8084/admin/auth/stall/getByOyStallCode?oyStallCode=${oyStallCode}`,
          success: function (data) {
            console.log(data,'data')           
            var str = "";
            for (i = 0; i < data.data.carousel.length; i++) {             
              var _data = data.data.carousel[i]
              str += '<div class="swiper-slide"><img src="'+ _data + '" alt=""></div>'                           
            }
            $("#slider").append(str)
              var mySwiper = new Swiper('.swiper-container', {
              loop: true,
              autoplay: true,
              pagination: '.swiper-pagination',
            })
            let info = data.data.stallInfo
            $("#logo").attr('src',info.logo)            
            let content = info.summary.replace(/<img/g,'<img style="width:100%;"')            
            $("#address").text(info.location)
            $("#fwb").html(content)
          }
       })
    }
        
    /*鼠标移入停止轮播,鼠标离开 继续轮播*/
    // $('.swiper-container').mouseenter(function () {
    //   swiper.stopAutoplay();
    // }).mouseleave(function () {
    //   swiper.startAutoplay();
xd's avatar
xd committed
159
    // })
xd's avatar
xd committed
160 161

    
xd's avatar
xd committed
162 163 164 165
  </script>
</body>

</html>