|
@@ -224,11 +224,12 @@ window.onload = function () {
|
224
|
224
|
})
|
225
|
225
|
.then(function (response) {
|
226
|
226
|
var res = response.data, data = null, html = '', imgList = [], swiperStr = '', pointStr = '', len = 0;
|
227
|
|
- var swiper = document.querySelector('.swiper-wrapper .swiper-item'),
|
|
227
|
+ var swiper = document.querySelector('.swiper-container .swiper-wrapper'),
|
228
|
228
|
point = document.querySelector('.swiper-wrapper .swiper-point'),
|
229
|
229
|
detailsWrapper = document.querySelector('.details-wrapper'),
|
230
|
230
|
copy_2 = document.getElementById("copy_2"),
|
231
|
|
- copy_1 = document.getElementById("copy_1")
|
|
231
|
+ copy_1 = document.getElementById("copy_1"),
|
|
232
|
+ toast = document.getElementById("toast")
|
232
|
233
|
;
|
233
|
234
|
console.log(swiper);
|
234
|
235
|
if (res.errno == 0) {
|
|
@@ -237,14 +238,8 @@ window.onload = function () {
|
237
|
238
|
len = imgList.length;
|
238
|
239
|
if (len > 0) {
|
239
|
240
|
for (var i = 0; i < len; i++) {
|
240
|
|
- swiperStr += '<li><a href="javascript: ;"><img src="'+ imgList[i] +'"></a></li>';
|
241
|
|
- if (i === 0) {
|
242
|
|
- pointStr += '<li class="now"></li>';
|
243
|
|
- }else{
|
244
|
|
- pointStr += '<li></li>';
|
245
|
|
- }
|
|
241
|
+ swiperStr += '<div class="swiper-slide"><img src="'+ imgList[i] +'"></div>';
|
246
|
242
|
}
|
247
|
|
- swiperStr += '<li><a href="javascript: ;"><img src="'+ imgList[0] +'"></a></li>';
|
248
|
243
|
}
|
249
|
244
|
if (is_coupon == 1) {
|
250
|
245
|
html = '<h5 class="price"><span>券后 ¥</span><em>'+ data.discount_price +'</em><span class="icon icon-price">券 '+ data.coupon_price
|
|
@@ -256,8 +251,12 @@ window.onload = function () {
|
256
|
251
|
|
257
|
252
|
detailsWrapper.innerHTML = html;
|
258
|
253
|
swiper.innerHTML = swiperStr;
|
259
|
|
- point.innerHTML = pointStr;
|
260
|
|
- startSwiper(len);
|
|
254
|
+
|
|
255
|
+ var mySwiper = new Swiper ('.swiper-container', {
|
|
256
|
+ autoplay: 3000,
|
|
257
|
+ loop: true,
|
|
258
|
+ pagination: '.swiper-pagination',
|
|
259
|
+ })
|
261
|
260
|
}
|
262
|
261
|
})
|
263
|
262
|
.catch(function (error) {
|
|
@@ -277,8 +276,12 @@ window.onload = function () {
|
277
|
276
|
console.log(copy_1);
|
278
|
277
|
copy_1.value = data;
|
279
|
278
|
btn.addEventListener('click', function () {
|
280
|
|
- console.log('test');
|
281
|
|
- toCopy();
|
|
279
|
+ // console.log('test');
|
|
280
|
+ toCopy();
|
|
281
|
+ toast.classList.add('show');
|
|
282
|
+ setTimeout(function () {
|
|
283
|
+ toast.classList.remove('show').add('hide');
|
|
284
|
+ }, 2000)
|
282
|
285
|
}, false)
|
283
|
286
|
}
|
284
|
287
|
})
|