|
@@ -0,0 +1,77 @@
|
|
|
+import 'css/newMenu/public.css';
|
|
|
+import 'css/newMenu/header.css'
|
|
|
+import 'css/search.css';
|
|
|
+import '../css/videoDetail.css';
|
|
|
+import './public.js';
|
|
|
+
|
|
|
+$(function(){
|
|
|
+ "use strict";
|
|
|
+ init();
|
|
|
+ function init(){
|
|
|
+ share();
|
|
|
+ search();
|
|
|
+ }
|
|
|
+ //分享
|
|
|
+ function share(){
|
|
|
+ $('.share div>span').hover(function(){
|
|
|
+ $('.share ul').show(100).addClass('active');
|
|
|
+ })
|
|
|
+ $('.share').mouseleave(function(){
|
|
|
+ $(this).find('ul').hide(100).removeClass('active')
|
|
|
+ })
|
|
|
+ //好友
|
|
|
+ document.querySelector('.qqHy').onclick=function(){
|
|
|
+ let title = $('.videoList li.active .txt h4').text(),
|
|
|
+ img=$('.videoList li.active img').attr('src');
|
|
|
+ shareQQ_friend(title, window.location.href, img)
|
|
|
+ };
|
|
|
+ //qq
|
|
|
+ document.querySelector('.qqKj').onclick=function(){
|
|
|
+ let title = $('.videoList li.active .txt h4').text(),
|
|
|
+ img=$('.videoList li.active img').attr('src');
|
|
|
+ shareToQq(title, window.location.href, img)
|
|
|
+ };
|
|
|
+ //微博
|
|
|
+ document.querySelector('.xlWb').onclick=function(){
|
|
|
+ let title = $('.videoList li.active .txt h4').text(),
|
|
|
+ img=$('.videoList li.active img').attr('src');
|
|
|
+ shareToXl(title,window.location.href,img)
|
|
|
+ };
|
|
|
+ }
|
|
|
+ //搜索
|
|
|
+ function search(){
|
|
|
+ $('.searchBtn').click(function(){
|
|
|
+ let val = $('.demandSearch').val();
|
|
|
+ window.location.href= globalConfig.context+'/portal/video.html?name='+escape(val);
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ //防止下载
|
|
|
+ $('#videoDe').hover(function(){
|
|
|
+ document.oncontextmenu=function(e){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ },function(){
|
|
|
+ document.oncontextmenu=function(e){
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //分享
|
|
|
+ function shareToQq(title, url, picurl) {
|
|
|
+ var shareqqzonestring = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?summary=' + encodeURIComponent(title) + '&url=' +
|
|
|
+ encodeURIComponent(url) + '&pics=' + encodeURIComponent(picurl)+'&title='+title;
|
|
|
+ window.open(shareqqzonestring);
|
|
|
+ }
|
|
|
+ //微博
|
|
|
+ function shareToXl(title,url,picurl){
|
|
|
+ var sharesinastring='http://v.t.sina.com.cn/share/share.php?title='+title+'&url='+url+'&content=utf-8&sourceUrl='+url+'&pic='+picurl;
|
|
|
+ window.open(sharesinastring);
|
|
|
+ }
|
|
|
+ //qq好友
|
|
|
+ function shareQQ_friend(_title,_url,picurl){
|
|
|
+ var _shareUrl = 'https://connect.qq.com/widget/shareqq/iframe_index.html?';
|
|
|
+ _shareUrl += 'url=' + encodeURIComponent(_url); //分享的链接
|
|
|
+ _shareUrl += '&title=' + encodeURIComponent(_title); //分享的标题
|
|
|
+ _shareUrl+='&pics=' + encodeURIComponent(picurl)
|
|
|
+ window.open(_shareUrl,'_blank');
|
|
|
+ }
|
|
|
+})
|