1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
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
159
160
161
162
163
164
165
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>专柜首页</title>
<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;
}
.center {
display: flex;
justify-content: start;
flex-direction: column;
width: 100%;
}
.swiper-container {
height: 500px;
width: 100%;
}
.swiper-container img {
height: 500px;
width: 100%;
}
.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);
}
.fwb {
width: 100%;
padding: 30px !important;
}
</style>
</head>
<body>
<div class="center">
<div class="swiper-container">
<div class="swiper-wrapper" id="slider"></div>
<div class="swiper-pagination"></div>
</div>
<div class="list">
<div class="left flex">
<img id="logo" src="" alt="" />
</div>
<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>
</div>
</div>
<div id="fwb" style="padding: 40px;" >
</div>
</div>
<script>
// 获取店铺code
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;
}
const oyStallCode = GetQueryString("oyStallCode")
/* swiper轮播组件 */
var swiper = new Swiper('.swiper-container', {
autoplay: true,
pagination: {
el: '.swiper-pagination',
},
})
$(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();
// })
</script>
</body>
</html>