PageSourceSearch

https://b-link.net.cn/static/website/blink/js/news.js?v=1776763186

js b-link.net.cn collected 2026-10-07 16:12:51 UTC 14,993 bytes, 351 lines download raw bytes

1
2import('./vue.js').then(()=>{
3    console.log('vue.js is just imported from the module/classic.js');
4    Vue.config.productionTip =false;
5    var mewsApp = new Vue({
6        el: '#news-mainer',
7        data(){
8            return{
9                isLoadingShow:false,
10                ismainLoadingShow:false,
11                iscateShow:false,
12                islistNewsShow:false,   
13                isNewsInfoShow:false,
14                
15                mobile_flag:false,
16                dataList:[],             //所有数据
17                listNews:[],            //当前list数据 
18               // NewsInfo:[],            //视频弹窗数据
19                cateList:[],
20                newsinfo:[],
21                newsurl:'',
22                mtitle:'',
23                newspathLength:307.919,
24                strokeDasharray:0,
25                strokeDashoffset:0,
26
27            }
28        },
29        mounted() {
30            // wow初始化
31            
32            this.$nextTick(() => {
33              const wow = new WOW({
34                boxClass: 'wow', // default
35                animateClass: 'animated', // default
36                offset: 0, // default
37                mobile: true, // default
38                live: false,
39                // live为true时,控制台会提示:MutationObserver is not supported by your browser. & WOW.js cannot detect dom mutations, please call .sync() after loading new content.
40                callback: function (box) {
41                  console.log("WOW: animating <" + box.tagName.toLowerCase() + ">")
42                }
43              });
44              wow.init();
45             
46                // //监听这个dom的scroll事件
47                // this.xqBox.onscroll = () => {
48                //   console.log("on scroll");
49                //   this.handleScroll();
50                // };
51                //监听这个dom的scroll事件
52                
53                this.ismainLoadingShow=false;
54                
55            }); 
56        },
57        methods:{
58            isMobile:function() {
59                var userAgentInfo = navigator.userAgent;
60                
61                var mobileAgents = [ "Android", "iPhone", "SymbianOS", "Windows Phone", "iPad","iPod"];
62                
63                this.mobile_flag = false;
64                
65                //根据userAgent判断是否是手机
66                for (var v = 0; v < mobileAgents.length; v++) {
67                    if (userAgentInfo.indexOf(mobileAgents[v]) > 0) {
68                        this.mobile_flag = true;
69                        break;
70                    }
71                }
72                var screen_width = window.screen.width;
73                var screen_height = window.screen.height;   
74                //console.log(userAgentInfo,screen_width,screen_height)
75                
76                //根据屏幕分辨率判断是否是手机
77                if(screen_width < 500 && screen_height < 800){
78                    this.mobile_flag = true;
79                }
80                
81                //return mobile_flag;
82            },
83            changeView:function(){
84                /*
85                var mainer_height = $("#news-mainer").height();
86                var menu_height = $("#news-nav-menu").height();
87                var main_height = $("#news-main").height();
88                var _window_height = $(window).height();  
89                var _document_height = $(document).height();
90                var footer_height = $(".footer").height();
91                var _height=_window_height-footer_height-78-50;
92                if(mainer_height<_window_height-footer_height){
93                    if(_height>main_height){
94                        console.log("footer靠下")
95                        $("#news-main").css({
96                            'min-height':_height
97                        })
98                    // $(".footer").addClass("footer-fixed-bottom");
99                    
100                    
101                    }else{
102                        console.log("footer正常")
103                        $("#news-main").css({
104                            'min-height':none
105                        })
106                   //  $(".footer").removeClass("footer-fixed-bottom");
107                    }
108                }
109                */
110                
111                //console.log(_height,main_height,_document_height,_window_height,footer_height,menu_height)
112            },
113            getData:function(){
114                
115                this.isLoadingShow = true;
116                var url="/get/news";
117               // var self = $(event.currentTarget);
118               // $(".category-detail span").removeClass("active");
119                //self.addClass("active");
120                //$("#txtModelkey").val(curvalue);
121                //var cid = $.trim(self.data("id"));
122                var cid = "2";
123                var postData = 'cateid='+cid;
124                axios.post(url,postData,{
125                    headers: {
126                        'Content-Type': 'application/x-www-form-urlencoded'
127                    },
128                }).then((response)=>{
129                    var _dataList = [];
130                    //console.log(response);
131                    if(response.status == "200"){
132                        //console.log(response);
133                        //this.dutyChange();
134                        if(typeof response.data == "object"){
135                            //console.log("response.data-------->",response.data['downlist']);
136                            
137                            this.isLoadingShow = true;
138                            this.islisNewsShow = false;
139                            
140                            //this.isNullResult = false;
141                            _dataList = response.data['list'];
142                            //console.log(_dataList)
143                            for(var i=0;i<this.dataList.length;i++){
144
145                            }
146                            console.log(_dataList);
147                            this.dataList=_dataList;
148                            //this.listVideo = this.dataList;
149                            this.setListNews('6');
150                            _catelist = response.data['cate'];
151                            
152                            for(var i=0;i<_catelist.length;i++){
153                                if(_catelist[i]['id']==6){
154                                    //console.log(i,'这个id=',_catelist[i]['id'])
155                                    _catelist[i]['active']='active';
156                                    this.mtitle=_catelist[i]['catename'];
157                                }
158                            }
159                            //console.log(_catelist);
160                            //_catelist['active']='active';
161                            this.cateList = _catelist;
162                            
163                            this.iscateShow = true;
164                            // $("footer").removeClass("footer-hide");
165                         //   let newArr = this.dataList.filter(item => item['cateid']==47)
166                           
167                           // this.isListDownShow = true;
168                            //this.isDownLoading = false;
169                            //console.log(this.dataList,newArr);
170                        }else{
171                           // this.isNullResult = true;
172                            //console.log(response.data);
173                            console.log(typeof response.data);
174                        }
175                    }else{
176                        //this.isNullResult = true;
177                        console.log(response.status);
178                    }
179                }).catch((Error)=>{
180                    console.log(Error);
181                });
182            },
183            setListNews:function(cateid){
184               // $("footer").addClass("footer-hide");
185                this.$forceUpdate();
186                if(cateid.length){
187                    let newArr = this.dataList.filter(item => item['cateid']==cateid);
188                    this.listNews = newArr;
189                    //console.log('newArr--------------->',newArr)
190                }else{
191                    this.listNews=this.dataList;
192                }
193                
194               
195               this.isLoadingShow = false;
196                this.islistNewsShow = true;
197                
198                
199                 
200                this.changeView();
201            },
202            clickCate:function(event){
203                
204               // $("footer").addClass("footer-hide");
205                this.islistNewsoShow = false;
206                this.listNews=[];
207                var self = $(event.currentTarget);
208                var cateid = $.trim(self.data("href"));
209                //console.log('cateid',cateid);
210                this.setListNews(cateid);
211                $("footer").addClass("fonter-fadeIn");
212                 //$("footer").removeClass("footer-hide");
213               // console.log(this.listVideo)
214                $(".category-detail span").removeClass("active");
215                self.addClass("active");
216                this.mtitle=self.html();
217                if($("#news-nav-menu").hasClass("open")){
218                    $("#news-nav-menu").removeClass("open");
219                }
220                
221            },
222            clickCateTitle:function(event){
223                $("#news-nav-menu").toggleClass('open');
224            },
225            openNewsInfo:function(event){
226                //this.$forceUpdate();
227                var self = $(event.currentTarget);
228                var id = $.trim(self.data("href"));
229                this.isNewsInfoShow=true;
230                
231                if(id.length>0){
232                    //console.log('newsinfo',this.listNews)
233                    let _newsinfo = this.listNews.filter(item => item['id']==id);
234                    //console.log('newsinfo',_newsinfo);
235                    that=this;
236                    that.newsinfo = _newsinfo['0'];
237                    //console.log(' this.newsourl--->', this.newsinfo['content']);
238                    //this.videourl = this.videoinfo['url'];
239                }
240                //this.$refs.newsBox.addEventListener('scroll',this.scrollToTop);
241                
242                //var newsprogressPath = document.querySelector('.news-progress-wrap path');
243                var newsprogressPath = $('.news-progress-wrap path');
244                //var progresslength = newsprogressPath.getTotalLength();
245                console.log('newsprogressPath=>',newsprogressPath);
246        		//var newspathLength = newsprogressPath.getTotalLength();
247        		//var newspathLength = 0;
248        		/*
249        		var newspathLength = this.newspathLength;
250        		
251        		newsprogressPath.style.transition = newsprogressPath.style.WebkitTransition = '
251none';
252        		newsprogressPath.style.strokeDasharray = newspathLength + ' ' + newspathLength;
253        		newsprogressPath.style.strokeDashoffset = newspathLength;
254        		newsprogressPath.getBoundingClientRect();
255        		newsprogressPath.style.transition = newsprogressPath.style.WebkitTransition = 'stroke-dashoffset 10ms linear';	
256        		*/
257        		var strokeDasharray = this.newspathLength + ' ' + this.newspathLength;
258        		newsprogressPath.css({
259                    'transition':'stroke-dashoffset 10ms linear',
260                    '-Webkit-transition':'stroke-dashoffset 10ms linear',
261        		    'stroke-dasharray':strokeDasharray,
262        		    'stroke-dashoffset':this.newspathLength
263        		});
264        		//console.log('newspathLength->',newspathLength)
265        		
266        		this.updateProgress();
267            },
268            resetAll:function(){
269            },
270            closeNewsInfo:function(){
271                
272                this.isNewsInfoShow=false;
273               // window.removeEventListener('scroll', this.handleScroll);
274                //this.videoHtml="";
275               // myPlayer.src("");
276               // this.videourl="";
277               
278            },
279            updateProgress:function(){
280                var scroll = $('#newsinfo').scrollTop();
281    			var height = $('#newsinfo .newsbox').height() - $(window).height() + 171;
282    			var progress = this.newspathLength - (scroll * this.newspathLength / height);
283    			//var newsprogressPath = document.querySelector('.news-progress-wrap path');
284    			var newsprogressPath = $('.news-progress-wrap path');
285    			//newsprogressPath.style.strokeDashoffset = progress;
286    			newsprogressPath.css({
287        		    'stroke-dashoffset':progress,
288        		});
289    			
290                console.log('scroll->',scroll,'<br />#newsinfo.height=',$('#newsinfo .newsbox').height(),'<br />window.height=',$(window).height(),'document.height=',$(document).height(),'<br />height->',height,'progress->',progress,'this.newspathLength->',this.newspathLength );
291            },
292            handleScroll:function(event){
293                //获取dom滚动距离
294                //const scrollTop = this.scrollTop;
295                //获取可视区高度
296               // const offsetHeight = this.offsetHeight;
297                //获取滚动条总高度
298               // const scrollHeight = this.scrollHeight;
299               /**/
300               
301                
302    			
303    			if ($('#newsinfo').scrollTop() > 50) {
304    				jQuery('.news-progress-wrap').addClass('active-progress');
305    			} else {
306    				jQuery('.news-progress-wrap').removeClass('active-progress');
307    				if($('#newsinfo').scrollTop()<2){
308    				    var newsprogressPath = $('.news-progress-wrap path');
309    				    var strokeDasharray = this.newspathLength + ' ' + this.newspathLength;
310                		newsprogressPath.css({
311                            'transition':'stroke-dashoffset 10ms linear',
312                            '-Webkit-transition':'stroke-dashoffset 10ms linear',
313                		    'stroke-dasharray':strokeDasharray,
314                		    'stroke-dashoffset':this.newspathLength
315                		});
316    				}
317    				
318    			}
319    			this.updateProgress();
320            },
321            scrollTotop:function(event){
322               // console.log("这是不是方法")
323               //event.preventDefault();
324		        $('#newsinfo').animate({scrollTop: 0}, 550);
325    			//$('#newsinfo').scrollTop(0)
326    			//return false;
327            },
328            
329        },
330        created(){
331           // this.$vux.loading.show({text:"正在加载......"});
332           
333           this.isMobile();
334           //this.changeView();
335          // $("footer").addClass("footer-hide");
336           this.getData();
337           
338            
339           
340           // console.log(_document_height-footer_height)
341                     //  console.log('video_mainer_height--->',height,'document_height--->',document_height);
342            
343        }
344    })
345});
346
347	$(window).load(function () {
348	    if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))) {
349	        //new WOW().init();
350	    }
351	})

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.