(function(window, $, undefined) {
/**guid='09b829cd-185b-429e-b73a-fff9e965720e' componentAlias='323afefd-96dd-46bc-8003-8fb98c9357aa' jumpNameRepeatHack='false' collectToRender='true' jumpName='vEUVZjHtOeuZ' type='text/javascript'**/
/*id='u_6951c51a7795443c83be992b536fbd15' guid='u_6951c51a7795443c83be992b536fbd15' pm_script='sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840' jumpTo='vEUVZjHtOeuZ' type='text/javascript'*/
try{
$(function() {
var mousePlayer = '';
if(mousePlayer == '1') {
priviewVideo();
}
//关联产品请求
function prodAjax(encodePkId){
$.ajax({
url: '/phoenix/admin/videoExpand/getDetail?videoId='+encodePkId,
type: 'get',
success: function(xhr) {
var data = JSON.parse(xhr);
console.log('data',data)
//标题
if(data.video.videoName){
$('.windowPlayWrapProd .prodDiv .prod-title').text(data.video.videoName)
}
//描述
if(data.video.videoDesc){
$('.windowPlayWrapProd .prodDiv .prod-desc').html(data.video.videoDesc)
}else {
$('.windowPlayWrapProd .prodDiv .prod-desc').addClass('hide');
}
if(data.products && data.products.length > 0){
$('.prod-list').html(prodHtmlrender(data))
}
phoenixSite.payCoinExchange.handleElement($('.windowPlayWrapProd'));
}
})
}
//视频弹窗产品html渲染
function prodHtmlrender(data) {
var tempHtml = ''
data.products.forEach(function(el){
var buybtn = '';
var priceHide='';
if(data.funcPayAuth && (el.isProdTradeEnabled || (data.solutionName && data.solutionName == 'b2c'))){
buybtn = $('.sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840 #buynow').text();
priceHide = '';
}else {
buybtn = $('.sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840 #inquire').text();
priceHide='hide';
}
if(el.isSkuProd && el.isSkuProd == '1'){
if(el.shopProdPrice != el.shopProdPriceMax){
tempHtml += '
'
}
}else {
if(el.prodDiscountPrice && el.prodDiscountPrice != el.prodPrice){
tempHtml += '
'
}
}
});
return tempHtml;
}
function priviewVideo(){
var player;
$(".sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840.sitewidget-atlasList .atlasList-item").mouseover(function(){
try{
var _that = $(this).find(".video_detail_play_view").find("source");
if(_that.length > 0){
var _videoSrc = $(_that).attr("data-video-src");
var _this = $(this);
if(!$(_that).attr("src")){
$(_that).attr("src",_videoSrc);
player = videojs($(_this).find(".video_detail_play_view")[0],{ muted: true,controls: false,});
}else{
player = videojs($(_this).find(".video_detail_play_view")[0]);
};
player.on('loadstart',function () {
console.log('loadstart------------')
player.play();
});
player.on('loadedmetadata',function () {
console.log('loadedmetadata---视频源数据加载完成----')
player.play();
});
setTimeout(function(){
player.play();
},1000)
setTimeout(function(){
$(_this).find(".video-js").css("z-index",6);
$(_this).find(".addPriviewVideo").find("img").css("display","none");
},50)
}
}catch(e){
console.log(e);
}
});
$(".sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840.sitewidget-atlasList .atlasList-item").mouseout(function(){
try{
var _that = $(this).find(".video_detail_play_view").find("source");
if(_that.length > 0){
var _this = $(this);
setTimeout(function(){
$(_this).find(".addPriviewVideo").find("img").css("display","block");
$(_this).find(".video-js").css("z-index",-1);
},50);
if(player){
setTimeout(function(){
player.pause();
},1000)
}
}
}catch(e){
console.log(e);
}
});
}
var playMode = 'windowPlayer';
var videoProdState = 0;
$('.item-desc a').click(function(){
$(this).parents('.atlasList-item').find('.item-box>a').click();
})
$('.sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840 .playCircle').each(function(index) {
var thirdPartyLink = $(this).attr('thirdPartyLink');
var videoSource = $(this).attr('videoSource');
var encodeVideoId = $(this).attr('encodeVideoId');
var encodePkId = $(this).attr('encodePkId');
var _this = $(this);
if ('0' == videoSource || '' == videoSource) {
var url = ' /phoenix/admin/video/url?photoId=' + encodeVideoId;
if(playMode == 'windowPlayer'){
(function(index){
$.ajax({
url: url,
type: 'get',
success: function(xhr) {
var data = JSON.parse(xhr);
if (data.video_url) {
var httpU1 = data.video_url.substring(0, 2);
var httpU2 = data.video_url.substring(0, 4);
var httpU3 = data.video_url.substring(0, 5);
var endVideoUrl = '';
if (httpU1 == '//' || 'http' == httpU2 || 'https' == httpU3) {
_this.attr('href', data.video_url);
var endVideoUrl = data.video_url;
} else {
_this.attr('href', '//' + data.video_url);
var endVideoUrl = '//' + data.video_url;
}
var isM3u8Video = Boolean(endVideoUrl.indexOf('mediaType=m3u8') > -1);
var videoHtml = '';
var ua = navigator.userAgent.toLowerCase();
var urlHref;
if(_this.nextAll('video').attr('data-video-mp4Url') != '') {
urlHref = _this.nextAll('video').attr('data-video-mp4Url');
}else{
urlHref = _this.nextAll('video').attr('data-video-public');
}
if(ua.match(/MicroMessenger/i)=="micromessenger"){
videoHtml = '
';
}else if(isM3u8Video){
videoHtml = '
';
}else{
if(videoProdState == '1'){
videoHtml = '
';
}else{
videoHtml = '
';
}
}
var VideoPlayerMuted = true;
var maxWidth = '700px';
var maxHeight = '500px';
var opacity = 0.9;
if(0 == "0"){
VideoPlayerMuted = true;
}else{
VideoPlayerMuted = false
}
var className = 'videoBoxPlayWrap windowPlayWrap'
if(videoProdState == '1'){
maxWidth = '1200px';
maxHeight = '490px';
opacity= 0.74;
className = 'videoBoxPlayWrap windowPlayWrap windowPlayWrapProd'
}
$($(".sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840 .item-box")[index]).find('.playCircle').colorbox({
opacity: opacity,
maxWidth: maxWidth,
maxHeight: maxHeight,
width: "100%",
height: "100%",
//iframe: isM3u8Video?null:true,
iframe: false,
//html:isM3u8Video?videoHtml:null,
html:videoHtml,
fixed: true,
className: className,
onComplete:function(){
var m3u8Id = "video-list-"+index;
videojs(m3u8Id,{
muted: VideoPlayerMuted,autoplay: true,
})
if(videoProdState == '1'){
//插入产品列表ajax请求
prodAjax(encodePkId)
}
},
onClosed:function(){
var player = videojs("video-list-"+index);
player.dispose();
}
});
}
}
});
})(index)
}else{
(function(index){
console.log("=====")
})()
}
} else {
if(playMode == 'windowPlayer'){
_this.attr('href', thirdPartyLink);
var videoHtml = '';
var iframeState = true;
var className = 'videoBoxPlayWrap windowPlayWrap'
var maxWidth = '700px';
var maxHeight = '500px';
var opacity = 0.9;
if(videoProdState == '1'){
maxWidth = '1200px';
maxHeight = '490px';
opacity= 0.74;
className = 'videoBoxPlayWrap windowPlayWrap windowPlayWrapProd';
iframeState = false;
videoHtml = '
';
}else {
videoHtml = '
';
}
try {
$($(".sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840 .item-box")[index]).find('.playCircle').colorbox({
opacity: opacity,
maxWidth: maxWidth,
maxHeight: maxHeight,
width: "100%",
height: "100%",
iframe: iframeState,
html:videoHtml,
fixed: true,
className: className,
onComplete:function(){
if(videoProdState == '1'){
//插入产品列表ajax请求
prodAjax(encodePkId)
}
},
onClosed:function(){
// 在清理前移除iframe
$('.cboxIframe').remove();
}
});
} catch(e) {
console.log('清理iframe时出错:', e);
}
}
}
$('.sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840 .playCircle').show()
});
});
}catch(e){try{console && console.log && console.log(e);}catch(e){}}
/*id='u_bf4bb6281cef4252b288660741db6721' guid='u_bf4bb6281cef4252b288660741db6721' pm_script='sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840' jumpTo='vEUVZjHtOeuZ' type='text/javascript'*/
try{
(function(window, $, undefined) { $(function() {
var categoryIdPagination = "-1";
if (categoryIdPagination == '-1') {
$.cookie('PFGC', '', {
expires: -1
});
} else {
$.cookie('PFGC', 'infoGroupId_' + categoryIdPagination, {
expires: 24 * 60 * 60,
path: '/'
});
}
});
function is_weixn(){
var ua = navigator.userAgent.toLowerCase();
if(ua.match(/MicroMessenger/i)=="micromessenger") {
$('.sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840.sitewidget-atlasList .atlasList-item').each(function(){
if($(this).find('video').attr('data-video-mp4Url') != ''){
$(this).find('.addPriviewVideo').attr('data-prod_url',$(this).find('video').attr('data-video-mp4Url'));
$(this).find('video source').attr('data-video-src',$(this).find('video').attr('data-video-mp4Url'));
$(this).find('video source').attr('type','video/mp4');
}
})
}
}
is_weixn();
})(window, jQuery)
}catch(e){try{console && console.log && console.log(e);}catch(e){}}
/*id='u_11964676537541299f0460d99a73528e' guid='u_11964676537541299f0460d99a73528e' pm_script='sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840' jumpTo='vEUVZjHtOeuZ' type='text/javascript'*/
try{
(function(window, $, undefined){
})(window, jQuery);
}catch(e){try{console && console.log && console.log(e);}catch(e){}}
/*id='u_6468133d484340ab8465b896b61cd443' guid='u_6468133d484340ab8465b896b61cd443' pm_script='sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840' jumpTo='vEUVZjHtOeuZ' type='text/javascript'*/
try{
(function(window,$,undefined){
$(function(){
phoenixSite.commentListMy.getUserReview('sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840');
onloadHack(function(){
$('.'+'sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840').find(".pagination").click(function(){
var _offsetTop = $('.'+'sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840').offset().top;
_offsetTop -= 100;
if (_offsetTop) {
scrollTo(0,_offsetTop);
}
});
$('.'+'sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840').find(".paging").click(function(){
var _offsetTop = $('.'+'sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840').offset().top;
_offsetTop -= 100;
if (_offsetTop) {
scrollTo(0,_offsetTop);
}
});
});
//设置图片
function setPhotoImg(){
$('.'+'sitewidget-323afefd-96dd-46bc-8003-8fb98c9357aa-20210919234840').find(".atlasList-item").each(function(){
var _videoSrc = $(this).find(".item-box a.playCircle").attr("thirdpartylink");
if (!!_videoSrc){
var _formatSrc = _videoSrc.split(".");
_formatSrc = _formatSrc[_formatSrc.length - 1];
if (_formatSrc == 'mp4' || _formatSrc == 'm3u8') {
var _photoImgSrc = $(this).find(".item-box a.atlasList_img source").attr("srcset");
var _imgSrc = $(this).find(".item-box a.atlasList_img img").attr("src");
if (_photoImgSrc.indexOf("no_pic") > 0 || _imgSrc.indexOf("no_pic") > 0){
var imgSrc = _videoSrc + "?vframe/jpg/offset/1";
$(this).find(".item-box a.atlasList_img source").attr("srcset", imgSrc);
$(this).find(".item-box a.atlasList_img img").attr("src", imgSrc);
}
}
}
});
}
});
})(window,jQuery)
}catch(e){try{console && console.log && console.log(e);}catch(e){}} })(window, $);