|
@@ -30,7 +30,11 @@ export default class App {
|
30
|
30
|
}
|
31
|
31
|
if (item.nodeName == "VIDEO") {
|
32
|
32
|
console.log(item, 'item---2')
|
33
|
|
- item.setAttribute("src", item.dataset.src);
|
|
33
|
+ if(isMob){item.setAttribute("src", item.dataset.srcm);}
|
|
34
|
+ else{
|
|
35
|
+ item.setAttribute("src", item.dataset.src);
|
|
36
|
+ }
|
|
37
|
+ // item.setAttribute("src", item.dataset.src);
|
34
|
38
|
// item.load();
|
35
|
39
|
}
|
36
|
40
|
});
|
|
@@ -245,7 +249,6 @@ export default class App {
|
245
|
249
|
},
|
246
|
250
|
on:{
|
247
|
251
|
slideChange: function(){
|
248
|
|
- console.log(this.realIndex);
|
249
|
252
|
let index0=this.realIndex;
|
250
|
253
|
scrollLeft(index0)
|
251
|
254
|
productCks.forEach((item,index)=>{
|
|
@@ -277,6 +280,9 @@ export default class App {
|
277
|
280
|
let fillLine = document.querySelector(".fillLine");
|
278
|
281
|
allNum.textContent=historySlides.length;
|
279
|
282
|
let historySwiper = null;
|
|
283
|
+ let defaultYear=2020;
|
|
284
|
+ let yearLin=0;
|
|
285
|
+ let hisSlides=[];
|
280
|
286
|
if(isMob){
|
281
|
287
|
let rightDiv=document.querySelector(".rightDiv").offsetWidth;
|
282
|
288
|
let fillLineWidth=parseFloat(rightDiv/historySlides.length);
|
|
@@ -311,10 +317,30 @@ export default class App {
|
311
|
317
|
nextEl: '.btn-nextH1',
|
312
|
318
|
prevEl: '.btn-prevH1',
|
313
|
319
|
},
|
|
320
|
+ on:{
|
|
321
|
+ slideChange: function(e,v){
|
|
322
|
+ let nowSwiper=e.activeIndex;
|
|
323
|
+ let year=parseInt(historySlides[nowSwiper].querySelector(".hisTime").textContent);
|
|
324
|
+ let direction = nowSwiper > yearLin ? 'right' : 'left'; // 判断滑动方向
|
|
325
|
+ console.log(direction, 'direction', yearLin, nowSwiper);
|
|
326
|
+
|
|
327
|
+ yearLin=nowSwiper;
|
|
328
|
+ if(direction=='left'&&year<defaultYear){
|
|
329
|
+ let yearNew=defaultYear-10;
|
|
330
|
+ defaultYear=yearNew;
|
|
331
|
+ hisCk2(yearNew)
|
|
332
|
+ }else if(direction=='right'&&year>defaultYear+10){
|
|
333
|
+ let yearNew=defaultYear+10;
|
|
334
|
+ defaultYear=yearNew;
|
|
335
|
+ hisCk2(yearNew)
|
|
336
|
+ }
|
|
337
|
+
|
|
338
|
+ },
|
|
339
|
+ },
|
314
|
340
|
});
|
315
|
341
|
}
|
316
|
342
|
|
317
|
|
- let hisSlides=[];
|
|
343
|
+
|
318
|
344
|
historyTits.forEach((item,index)=>{
|
319
|
345
|
item.addEventListener("click", (e) => {
|
320
|
346
|
historyTits.forEach(item2=>{
|
|
@@ -322,6 +348,7 @@ export default class App {
|
322
|
348
|
});
|
323
|
349
|
item.classList.add("active");
|
324
|
350
|
let year=item.textContent.substring(0,4)*1;
|
|
351
|
+ defaultYear=year;
|
325
|
352
|
hisCk(year)
|
326
|
353
|
});
|
327
|
354
|
});
|
|
@@ -365,7 +392,32 @@ export default class App {
|
365
|
392
|
historySwiper.setTransition(1000);//设定过渡的时间
|
366
|
393
|
historySwiper.setTranslate(moveN);//设定位移,可以为正数
|
367
|
394
|
}
|
368
|
|
-
|
|
395
|
+ }
|
|
396
|
+ function hisCk2(year){
|
|
397
|
+ console.log(year,'year');
|
|
398
|
+ let maxYear = null;
|
|
399
|
+ let num=0;
|
|
400
|
+ let swNum=0;
|
|
401
|
+ hisSlides.forEach((item,index)=>{
|
|
402
|
+ if(item.year>=year&&item.year<year+10){
|
|
403
|
+ historySlides[index].classList.add("activeShow");
|
|
404
|
+ swNum++;
|
|
405
|
+ if (maxYear === null || item.year >= maxYear) {
|
|
406
|
+ maxYear = item.year;
|
|
407
|
+ num=item.num;
|
|
408
|
+ }
|
|
409
|
+ }else{
|
|
410
|
+ historySlides[index].classList.remove("activeShow");
|
|
411
|
+ }
|
|
412
|
+ });
|
|
413
|
+ historyTits.forEach((item,index)=>{
|
|
414
|
+ let yearT=item.textContent.substring(0,4)*1;
|
|
415
|
+ if(yearT==year){
|
|
416
|
+ item.classList.add("active");
|
|
417
|
+ }else{
|
|
418
|
+ item.classList.remove("active");
|
|
419
|
+ }
|
|
420
|
+ });
|
369
|
421
|
|
370
|
422
|
}
|
371
|
423
|
//企业文化
|