index.html 4.52 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
  <link rel="stylesheet" href="../css/swiper.css" />
xd's avatar
xd committed
8
  <link rel="stylesheet" href="../css/quill.snow.css" />
xd's avatar
xd committed
9 10 11 12 13 14 15 16
  <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
17 18 19 20 21 22 23 24 25 26 27 28 29 30
    .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
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 72
    .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
73
    .fwb {
xd's avatar
xd committed
74
      /* width: 100%; */
xd's avatar
xd committed
75 76
      padding: 30px !important;
    }
xd's avatar
xd committed
77 78 79 80
  </style>
</head>

<body>
xd's avatar
xd committed
81 82 83 84
  <div class="center">
    <div class="swiper-container">
      <div class="swiper-wrapper" id="slider"></div>
      <div class="swiper-pagination"></div>
xd's avatar
xd committed
85
    </div>
xd's avatar
xd committed
86 87 88
    <div class="list">
      <div class="left flex">
        <img id="logo" src="" alt="" />
xd's avatar
xd committed
89
      </div>
xd's avatar
xd committed
90 91 92 93 94 95 96 97 98 99
      <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
100 101
      </div>
    </div>
xd's avatar
xd committed
102 103 104 105 106
    <!-- <div class="ql-container ql-snow">
      <div class="fwb ql-editor">
      </div>
    </div> -->
    <div id="fwb"></div>
xd's avatar
xd committed
107
  </div>
xd's avatar
xd committed
108
  <script src="../js/quill.min.js"></script>
xd's avatar
xd committed
109
  <script>
xd's avatar
xd committed
110
    var options = [];
xd's avatar
xd committed
111
    // 获取店铺code
xd's avatar
xd committed
112 113 114 115 116 117 118 119 120 121
    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
122
    const oyStallCode = GetQueryString("oyStallCode")
xd's avatar
xd committed
123 124 125 126 127 128 129
    /* swiper轮播组件 */
    var swiper = new Swiper('.swiper-container', {
      autoplay: true,
      pagination: {
        el: '.swiper-pagination',
      },
    })
xd's avatar
xd committed
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
    $(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
xd's avatar
xd committed
151 152
            $("#logo").attr('src',info.logo) 
            $(".title").text(info.name)           
xd's avatar
xd committed
153 154
            let content = info.summary.replace(/<img/g,'<img style="width:100%;"')            
            $("#address").text(info.location)
xd's avatar
xd committed
155 156 157 158 159 160 161 162 163
            $("#phone").text(info.phone)
             var html = content  //这个是通过quill获取到的html
            var quill = new Quill('#fwb', {
              modules: {
                toolbar: options
              },
            })
            quill.container.firstChild.innerHTML = html
            quill.enable(false)
xd's avatar
xd committed
164 165 166 167 168
          }
       })
    }

    
xd's avatar
xd committed
169 170 171 172
  </script>
</body>

</html>