mirror of
https://github.com/HiddenStrawberry/Crawler_Illegal_Cases_In_China.git
synced 2024-03-22 13:11:36 +08:00
1653 lines
57 KiB
JavaScript
1653 lines
57 KiB
JavaScript
define("pages/qqmusic_ctrl.js",["biz_common/utils/monitor.js","pages/player_adaptor.js","biz_wap/jsapi/log.js","biz_wap/utils/ajax.js","pages/musicUrlReport.js"],function(e){
|
||
"use strict";
|
||
function r(e,r){
|
||
if(/^http(s)?:\/\//i.test(e.albumurl)){
|
||
for(var t,a=[/^http(s)?:\/\/imgcache\.qq\.com([\/?].*)*$/i,/^http(s)?:\/\/y\.gtimg\.cn([\/?].*)*$/i],s=!1,o=0;t=a[o++];)if(t.test(e.albumurl)){
|
||
s=!0;
|
||
break;
|
||
}
|
||
s||(e.albumurl="");
|
||
}else{
|
||
var i=e.albumurl.split("/");
|
||
try{
|
||
i=i[i.length-1],i=i.split(".")[0];
|
||
}catch(n){
|
||
i="";
|
||
}
|
||
e.albumurl=i?u.imgroot2.replace("#mid#",i):u.imgroot+e.albumurl;
|
||
}
|
||
return e.albumurl=e.albumurl.replace("mid_album_68","mid_album_90").replace("68x68","90x90"),
|
||
e.musicIcon=u.musicIcon,e.type=1*r.scene===0?0:1*r.scene===1?1:8,c.inQMClient?(e.allowPause=!0,
|
||
e.detailUrl="",e.pauseCss="qqmusic_playing_pause",e.webUrl=e.detailUrl):(e.allowPause=!1,
|
||
e.pauseCss="",e.detailUrl=["http://i.y.qq.com/v8/playsong.html?referFrom=music.qq.com&songid=",e.musicid,"&songmid=",e.media_id,,"&ADTAG=weixin_gzh#wechat_redirect"].join(""),
|
||
e.webUrl=e.detailUrl),e;
|
||
}
|
||
function t(e,r){
|
||
var t=e,a=u.cache[t.songId];
|
||
return c.inQMClient?void r.callback({
|
||
canplay:!0,
|
||
play_url:"https://www.qq.com"
|
||
}):a&&"function"==typeof r.callback&&(a.canplay||!a.canplay&&!a.retry)?(a.in_cache=!0,
|
||
void r.callback(a)):void(u.submiting[t.songId]!==!0&&(u.submiting[t.songId]=!0,a&&(i.setSum(u.reportId,122,1),
|
||
i.send()),s({
|
||
id:t.songId,
|
||
mid:t.mid,
|
||
onSuc:function(e){
|
||
u.submiting[t.songId]=!1,u.cache[t.songId]&&!u.cache[t.songId].canplay&&e.canplay&&(i.setSum(u.reportId,123,1),
|
||
i.send()),u.cache[t.songId]=e,"function"==typeof r.callback&&r.callback(e);
|
||
},
|
||
onError:function(){
|
||
u.submiting[t.songId]=!1,"function"==typeof r.callback&&r.callback({
|
||
canplay:!1,
|
||
msg:"系统繁忙,请稍后再试。",
|
||
status:-1,
|
||
play_url:"",
|
||
duration:0
|
||
});
|
||
}
|
||
})));
|
||
}
|
||
function a(e){
|
||
var r=!0,t=!1,a="";
|
||
switch(1*e){
|
||
case 0:
|
||
r=!0;
|
||
break;
|
||
|
||
case 1:
|
||
r=!1,a="因版权限制,音乐无法播放。";
|
||
break;
|
||
|
||
case 2:
|
||
r=!1,a="因版权限制,音乐无法播放。";
|
||
break;
|
||
|
||
case 3:
|
||
r=!1,a="因版权限制,音乐无法播放。";
|
||
break;
|
||
|
||
case 4:
|
||
r=!1,a="当前区域因版权限制,音乐无法播放。";
|
||
break;
|
||
|
||
case 5:
|
||
r=!1,t=!0,a="播放失败,请稍后再试。";
|
||
break;
|
||
|
||
case 6:
|
||
r=!1,t=!0,a="系统错误,请稍后再试。";
|
||
break;
|
||
|
||
case 7:
|
||
r=!1,t=!0,a="系统错误,请稍后再试。";
|
||
break;
|
||
|
||
case 8:
|
||
r=!0,a="该音乐为付费音乐,当前为你播放试听片段。";
|
||
break;
|
||
|
||
default:
|
||
r=!1,a="系统错误,请稍后再试。";
|
||
}
|
||
return{
|
||
canplay:r,
|
||
msg:a,
|
||
retry:t
|
||
};
|
||
}
|
||
function s(e){
|
||
i.setSum(u.reportId,18,1),i.send();
|
||
var r=+new Date,t="//mp.weixin.qq.com/mp/qqmusic?action=get_song_info&song_mid=#mid#";
|
||
t=t.replace("#mid#",e.mid),m({
|
||
url:t,
|
||
type:"GET",
|
||
dataType:"json",
|
||
success:function(t){
|
||
var s=+new Date-r;
|
||
if(200==t.http_code){
|
||
setTimeout(function(){
|
||
p.reportRespData({
|
||
type:1,
|
||
songid:e.id,
|
||
musicid:e.mid,
|
||
responseData:t.resp_data||""
|
||
});
|
||
},0);
|
||
var i={};
|
||
try{
|
||
i=JSON.parse(t.resp_data);
|
||
}catch(c){
|
||
var m=1;
|
||
return o({
|
||
type:"error",
|
||
time:s,
|
||
code:m
|
||
}),"function"==typeof e.onError&&e.onError({
|
||
errcode:m
|
||
}),void n.info("qqmusic_checkCopyright_parsefail mid:"+e.mid+", repsponeData:"+t.resp_data);
|
||
}
|
||
if("undefined"==typeof i.ret||0!=i.ret||0!=i.sub_ret||0==i.songlist.length){
|
||
var m=1;
|
||
return o({
|
||
type:"error",
|
||
time:s,
|
||
code:m
|
||
}),"function"==typeof e.onError&&e.onError({
|
||
errcode:m
|
||
}),void n.info("qqmusic_checkCopyright_dataerror mid:"+e.mid+", repsponeData:"+t.resp_data);
|
||
}
|
||
var u,l=i.songlist[0],d=l.song_play_url,b=l.song_play_time||0;
|
||
if(l.playable)u=d?0:6;else if(l.try_playable)l.try_file_size>0&&l.try_30s_url?(u=8,
|
||
d=l.try_30s_url,b=30):u=7;else switch(1*l.unplayable_code){
|
||
case 1:
|
||
u=1;
|
||
break;
|
||
|
||
case 2:
|
||
u=2;
|
||
break;
|
||
|
||
case 3:
|
||
u=3;
|
||
break;
|
||
|
||
case 4:
|
||
u=4;
|
||
break;
|
||
|
||
case 5:
|
||
u=5;
|
||
break;
|
||
|
||
default:
|
||
u=5;
|
||
}
|
||
o({
|
||
type:"success",
|
||
time:s,
|
||
code:u
|
||
});
|
||
var y=a(1*u);
|
||
e.onSuc({
|
||
canplay:y.canplay,
|
||
retry:y.retry,
|
||
msg:y.msg,
|
||
status:u,
|
||
play_url:d||"",
|
||
duration:b
|
||
}),y.canplay||n.info("qqmusic_checkCopyright_cannotplay mid:"+e.mid+", repsponeData:"+t.resp_data);
|
||
}else{
|
||
var m=4;
|
||
switch(t.http_code){
|
||
case 200:
|
||
break;
|
||
|
||
case 400:
|
||
m=2;
|
||
break;
|
||
|
||
case 500:
|
||
m=3;
|
||
break;
|
||
|
||
default:
|
||
m=4;
|
||
}
|
||
o({
|
||
type:"error",
|
||
time:s,
|
||
code:m
|
||
}),"function"==typeof e.onError&&e.onError({
|
||
errcode:m
|
||
});
|
||
}
|
||
},
|
||
error:function(){
|
||
"function"==typeof e.onError&&e.onError({
|
||
errcode:4
|
||
});
|
||
}
|
||
});
|
||
}
|
||
function o(e){
|
||
var r=Math.max(e.time,0);
|
||
if(r=Math.min(r,6e4),e.time>=0&&e.time<200?i.setSum(u.reportId,24,1):e.time>=200&&e.time<500?i.setSum(u.reportId,25,1):e.time>=500&&e.time<1e3?i.setSum(u.reportId,26,1):e.time>=1e3&&e.time<2e3?i.setSum(u.reportId,27,1):e.time>=2e3&&e.time<1e4?i.setSum(u.reportId,28,1):e.time>=1e4&&i.setSum(u.reportId,29,1),
|
||
i.setAvg(u.reportId,23,r),"error"==e.type){
|
||
switch(1*e.code){
|
||
case 1:
|
||
i.setSum(u.reportId,9,1);
|
||
break;
|
||
|
||
case 2:
|
||
i.setSum(u.reportId,10,1);
|
||
break;
|
||
|
||
case 3:
|
||
i.setSum(u.reportId,11,1);
|
||
break;
|
||
|
||
case 4:
|
||
i.setSum(u.reportId,12,1);
|
||
}
|
||
i.setSum(u.reportId,19,1);
|
||
}else if("success"==e.type){
|
||
switch(1*e.code){
|
||
case 1:
|
||
i.setSum(u.reportId,8,1);
|
||
break;
|
||
|
||
case 0:
|
||
i.setSum(u.reportId,17,1);
|
||
break;
|
||
|
||
case 2:
|
||
i.setSum(u.reportId,13,1);
|
||
break;
|
||
|
||
case 3:
|
||
i.setSum(u.reportId,14,1);
|
||
break;
|
||
|
||
case 4:
|
||
i.setSum(u.reportId,15,1);
|
||
break;
|
||
|
||
case 5:
|
||
i.setSum(u.reportId,16,1);
|
||
break;
|
||
|
||
case 6:
|
||
i.setSum(u.reportId,47,1);
|
||
break;
|
||
|
||
case 7:
|
||
i.setSum(u.reportId,120,1);
|
||
break;
|
||
|
||
case 8:
|
||
i.setSum(u.reportId,121,1);
|
||
}
|
||
i.setSum(u.reportId,20,1);
|
||
}
|
||
i.send();
|
||
}
|
||
var i=e("biz_common/utils/monitor.js"),c=e("pages/player_adaptor.js"),n=e("biz_wap/jsapi/log.js"),m=e("biz_wap/utils/ajax.js"),p=e("pages/musicUrlReport.js"),u={
|
||
imgroot:"https://imgcache.qq.com/music/photo/mid_album_90",
|
||
imgroot2:"https://y.gtimg.cn/music/photo_new/T002R90x90M000#mid#.jpg",
|
||
reportId:"28306",
|
||
musicIcon:window.icon_qqmusic_source||"",
|
||
cache:{},
|
||
submiting:{}
|
||
};
|
||
return{
|
||
initData:r,
|
||
getPlayUrl:t
|
||
};
|
||
});define("pages/voice_component.js",["biz_common/dom/event.js","biz_common/tmpl.js","pages/music_player.js","pages/player_adaptor.js","biz_common/dom/class.js","pages/report.js","biz_common/utils/monitor.js","pages/music_report_conf.js","pages/player_tips.js","biz_wap/jsapi/leaveReport.js","biz_wap/utils/mmversion.js","biz_wap/utils/ajax.js","biz_wap/utils/openUrl.js","pages/qqmusic_ctrl.js","pages/kugoumusic_ctrl.js"],function(e){
|
||
"use strict";
|
||
function t(){
|
||
j.hasInit||(n(),r(),s(),j.hasInit=!0);
|
||
}
|
||
function a(e){
|
||
t(),this._o={
|
||
protocal:"",
|
||
wxIndex:0,
|
||
type:0,
|
||
comment_id:"",
|
||
src:"",
|
||
jsapi2Src:"",
|
||
mid:"",
|
||
songId:"",
|
||
otherid:"",
|
||
albumid:"",
|
||
jumpurlkey:"",
|
||
autoPlay:!1,
|
||
duration:0,
|
||
needVioceMutex:!0,
|
||
appPlay:!0,
|
||
title:"",
|
||
allowPause:!1,
|
||
singer:"",
|
||
epname:"",
|
||
coverImgUrl:"",
|
||
webUrl:[location.protocol,"//mp.weixin.qq.com/s?referFrom=#referFrom#&songid=#songId#&__biz=",window.biz,"&mid=",window.mid,"&idx=",window.idx,"&sn=",window.sn,"#wechat_redirect"].join(""),
|
||
musicbar_url:"",
|
||
playingCss:"",
|
||
pauseCss:"",
|
||
playCssDom:"",
|
||
playArea:"",
|
||
progress:"",
|
||
detailUrl:"",
|
||
detailArea:"",
|
||
fileSize:0,
|
||
playtimeDom:"",
|
||
loadingDom:"",
|
||
bufferDom:"",
|
||
playdotDom:"",
|
||
seekRange:"",
|
||
seekContainer:""
|
||
},this._init(e),j.allComponent.push(this);
|
||
}
|
||
function o(e,t,a,o){
|
||
j.num++,t.musicSupport=j.musicSupport,t.show_not_support=!1,j.musicSupport||1!=j.num||(t.show_not_support=!0);
|
||
var r=document.createElement("div"),n="";
|
||
if(n=y.tmpl(e,t),r.innerHTML=n,o===!0)a.appendChild(r.children[0]);else{
|
||
var i=a.parentNode;
|
||
if(!i)return;
|
||
i.lastChild===a?i.appendChild(r.children[0]):i.insertBefore(r.children[0],a.nextSibling);
|
||
}
|
||
}
|
||
function r(){
|
||
j.hasInit||f.inQMClient&&i("QMClient_pv",1);
|
||
}
|
||
function n(){
|
||
window.reportMid=[],window.reportVoiceid=[];
|
||
for(var e in w)if(w.hasOwnProperty(e)){
|
||
var t=w[e],a=t.split("_");
|
||
j.reportData2[e]={
|
||
id:a[0],
|
||
key:a[1],
|
||
count:0
|
||
};
|
||
}
|
||
}
|
||
function i(e,t){
|
||
j.reportData2[e]&&(t=t||1,j.reportData2[e].count+=t,j.debug&&console.log("addpv:"+e+" count:"+j.reportData2[e].count));
|
||
}
|
||
function s(){
|
||
b.gtVersion("7.0.6")?x.addSpecificReport("music_data",p):g.on(window,"unload",function(){
|
||
for(var e=p(),t=JSON.parse(e.report_list),a=0;a<t.length;a++)I({
|
||
type:"POST",
|
||
url:"/mp/musicreport?#wechat_redirect",
|
||
timeout:2e4,
|
||
async:!0,
|
||
data:t[a]
|
||
});
|
||
});
|
||
}
|
||
function p(){
|
||
m.triggerUnloadPlaying(),l();
|
||
for(var e,t={},a=0,o=j.allComponent.length;o>a;a++){
|
||
var r=j.allComponent[a];
|
||
r.player&&"function"==typeof r.player.getPlayTotalTime&&(j.reportData[r._o.type].play_last_time[r._g.posIndex]=parseInt(1e3*r.player.getPlayTotalTime())),
|
||
"number"!=typeof r._status||1!==r._status&&4!==r._status||(e=r._o.songId);
|
||
}
|
||
e&&(t.current_musicid=e);
|
||
var i=[];
|
||
for(var a in j.reportData)i=i.concat(D.musicreport({
|
||
data:j.reportData[a]
|
||
}));
|
||
t.report_list=JSON.stringify(i),n();
|
||
for(var a=0,o=j.allComponent.length;o>a;a++){
|
||
var r=j.allComponent[a];
|
||
r&&"function"==typeof r._initReportData&&r._initReportData(),r.player&&"function"==typeof r.player.resetPlayTotalTime&&r.player.resetPlayTotalTime();
|
||
}
|
||
return t;
|
||
}
|
||
function l(){
|
||
for(var e in j.reportData2)if(j.reportData2.hasOwnProperty(e)){
|
||
var t=j.reportData2[e];
|
||
t.count>0&&v.setSum(t.id,t.key,t.count);
|
||
}
|
||
v.send();
|
||
}
|
||
function c(e){
|
||
return new a(e);
|
||
}
|
||
function d(e){
|
||
if(isNaN(e))return"00:00";
|
||
e=Math.floor(e);
|
||
var t=Math.floor(e/3600),a=Math.floor((e-3600*t)/60),o=e-3600*t-60*a;
|
||
return 0!=t?(10>t&&(t="0"+t),t+=":"):t="",10>a&&(a="0"+a),10>o&&(o="0"+o),t+a+":"+o;
|
||
}
|
||
function u(e){
|
||
return e=(e||"").replace(/`/g,"`").replace(/=/g,"=").replace(/'/g,"'").replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&");
|
||
}
|
||
function _(e){
|
||
return e=(e||"").replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,""").replace(/'/g,"'").replace(/=/g,"=").replace(/`/g,"`");
|
||
}
|
||
var g=e("biz_common/dom/event.js"),y=e("biz_common/tmpl.js"),m=e("pages/music_player.js"),f=e("pages/player_adaptor.js"),h=e("biz_common/dom/class.js"),D=e("pages/report.js"),v=e("biz_common/utils/monitor.js"),w=e("pages/music_report_conf.js"),k=e("pages/player_tips.js"),x=e("biz_wap/jsapi/leaveReport.js"),b=e("biz_wap/utils/mmversion.js"),I=e("biz_wap/utils/ajax.js"),C=e("biz_wap/utils/openUrl.js").openUrlWithExtraWebview,j={
|
||
allComponent:[],
|
||
hasInit:!1,
|
||
reportId:"28306",
|
||
musicSupport:m.getSurportType(),
|
||
debug:location.href.indexOf("vconsole=1")>0||document.cookie&&document.cookie.indexOf("vconsole_open=1")>-1?!0:!1,
|
||
reportData:{},
|
||
posIndex:{},
|
||
num:0,
|
||
reportData2:{},
|
||
adapter:{
|
||
m:e("pages/qqmusic_ctrl.js"),
|
||
k:e("pages/kugoumusic_ctrl.js")
|
||
}
|
||
};
|
||
return a.prototype._init=function(e){
|
||
this._extend(e),this._g={
|
||
posIndex:void 0,
|
||
tag:"",
|
||
canDragBar:!1,
|
||
barDraging:!1,
|
||
canGoDetail:!0
|
||
},5==this._o.type||6==this._o.type||9==this._o.type?this._g.tag="k":this._o.type>=2&&this._o.type<=4?this._g.tag="v":7==this._o.type?this._g.tag="a":(0==this._o.type||1==this._o.type||8==this._o.type)&&(this._g.tag="m"),
|
||
this._initData(),this._initQQmusicLyric(),this._initReportData(),this._initPlayer();
|
||
},a.prototype._initData=function(){},a.prototype._initQQmusicLyric=function(){
|
||
var e=this._o,t=this._g;
|
||
e.webUrl="m"==t.tag?e.webUrl.replace("#songId#",e.songId||"").replace("#referFrom#","music.qq.com"):e.webUrl.replace("#songId#","").replace("#referFrom#","");
|
||
},a.prototype._initReportData=function(){
|
||
var e=this._o,t=this._g;
|
||
"v"==t.tag?window.reportVoiceid.push(e.songId):"m"==t.tag&&window.reportMid.push(e.songId),
|
||
"undefined"==typeof j.reportData[e.type]&&(j.reportData[e.type]=D.getMusicReportData(e),
|
||
j.posIndex[e.type]=0),"undefined"==typeof t.posIndex&&(t.posIndex=j.posIndex[e.type]++);
|
||
var a=j.reportData[e.type];
|
||
a.musicid[t.posIndex]=e.songId,a.commentid[t.posIndex]=e.comment_id,a.hasended[t.posIndex]=0,
|
||
a.mtitle[t.posIndex]=e.title,a.detail_click[t.posIndex]=0,a.duration2[t.posIndex]=parseInt(1e3*e.duration),
|
||
a.errorcode[t.posIndex]=0,a.play_duration2[t.posIndex]=0,a.seek[t.posIndex]=0,a.seek_position[t.posIndex]=[],
|
||
a.play_last_time[t.posIndex]=0,a.local_time[t.posIndex]=0,a.seek_loaded[t.posIndex]=[];
|
||
},a.prototype._initPlayer=function(){
|
||
if(j.musicSupport){
|
||
var e=this,t=this._o,a=this._g.tag;
|
||
t.onStatusChange=this._statusChangeCallBack(),t.onTimeupdate=this._timeupdateCallBack(),
|
||
t.onError=this._errorCallBack(),t.onUpdateSeekRange=this._onUpdateSeekRange(),t.onAndroidForceH5=function(){
|
||
i("force_h5",1);
|
||
},t.onH5Begin2Play=function(){
|
||
i(a+"_pv",1),i(a+"_h5_pv",1);
|
||
},t.onH5Error=function(t,o){
|
||
i(a+"_h5_err_total",1),i(a+"_h5_err_"+o.code,1),e._reportH5Error({
|
||
type:1,
|
||
code:o.code
|
||
});
|
||
},t.onJsapi1Begin2Play=function(){
|
||
i(a+"_pv",1),i(a+"_wx_pv",1),i(a+"_wx_pv_1",1);
|
||
},t.onJsapi2Begin2Play=function(e,o){
|
||
i(a+"_pv",1),i(a+"_wx_pv",1),i(a+"_wx_pv_2",1),t.jsapi2Src&&t.jsapi2Src!=t.src&&i("aac_pv",1),
|
||
t.musicPlayerOnJsapi2Begin2Play&&t.musicPlayerOnJsapi2Begin2Play(o);
|
||
},t.onJsapi2PlaySuccess=function(e,a){
|
||
t.musicPlayerOnJsapi2PlaySuccess&&t.musicPlayerOnJsapi2PlaySuccess(a);
|
||
},t.onJsapi2Begin2PlayErr=function(){
|
||
if(i(a+"_wx_err_1",1),t.jsapi2Src&&t.jsapi2Src!=t.src){
|
||
var e="acc_start_error;type:#type#;uin:"+(window.user_uin||"")+";playurl:"+t.jsapi2Src+";pageurl:"+location.href;
|
||
m.isAndroid?(D.logReport("",e.replace("#type#","android"),"ajax"),i("android_aac_err_1",1)):(D.logReport("",e.replace("#type#","ios"),"ajax"),
|
||
i("ios_aac_err_1",1));
|
||
}
|
||
},t.onJsapi2PlayingErr=function(){
|
||
if(i(a+"_wx_err_2",1),t.jsapi2Src&&t.jsapi2Src!=t.src){
|
||
var e="acc_ing_error;type:#type#;uin:"+(window.user_uin||"")+";playurl:"+t.jsapi2Src+";pageurl:"+location.href;
|
||
m.isAndroid?(D.logReport("",e.replace("#type#","android"),"ajax"),i("android_aac_err_2",1)):(D.logReport("",e.replace("#type#","ios"),"ajax"),
|
||
i("ios_aac_err_2",1));
|
||
}
|
||
},t.onJsapi2PlayingStop=function(){
|
||
var e=a+"_stoped_";
|
||
e+=m.isAndroid?"android":"ios",i(e,1);
|
||
},t.onJsapi2PlayingPause=function(){
|
||
var e=a+"_paused_";
|
||
e+=m.isAndroid?"android":"ios",i(e,1);
|
||
},t.onSeekErr=function(){
|
||
if(i(a+"_seek_err",1),t.jsapi2Src&&t.jsapi2Src!=t.src){
|
||
var e="acc_seek_error;type:#type#;uin:"+(window.user_uin||"")+";playurl:"+t.jsapi2Src+";pageurl:"+location.href;
|
||
m.isAndroid?(D.logReport("",e.replace("#type#","android"),"ajax"),i("android_aac_err_3",1)):(D.logReport("",e.replace("#type#","ios"),"ajax"),
|
||
i("ios_aac_err_3",1));
|
||
}
|
||
},t.onUnloadPlaying=function(){
|
||
i(a+"_unload_wx_pv",1);
|
||
},t.onQMClientPlay=function(){
|
||
i("QMClient_play",1);
|
||
},t.onSeekNeed2Load=function(){
|
||
if(e.player&&e.player.surportSeekRange()&&t.playdotDom){
|
||
var a=j.reportData[e._o.type],o=a.seek_position[e._g.posIndex].length;
|
||
o>0&&(a.seek_loaded[e._g.posIndex][o-1]=1);
|
||
}
|
||
},t.onSeekNotNeed2Load=function(){
|
||
if(e.player&&e.player.surportSeekRange()&&t.playdotDom){
|
||
var a=j.reportData[e._o.type],o=a.seek_position[e._g.posIndex].length;
|
||
o>0&&(a.seek_loaded[e._g.posIndex][o-1]=0);
|
||
}
|
||
},f.create(this._o,{
|
||
callback:function(t){
|
||
e.player=t,e.afterCreatePlayer();
|
||
}
|
||
});
|
||
}
|
||
},a.prototype.afterCreatePlayer=function(){
|
||
this._playEvent();
|
||
},a.prototype.isInSeekrang=function(e){
|
||
var t=this._o.seekRange;
|
||
if(!t)return!1;
|
||
if(t===e)return!0;
|
||
for(var a=t.getElementsByTagName("*"),o=0,r=a.length;r>o;o++)if(a[o]===e)return!0;
|
||
return!1;
|
||
},a.prototype._playEvent=function(){
|
||
var e=this,t=this._o,a=this._g;
|
||
if(t.detailUrl&&t.detailArea&&g.on(t.detailArea,"click",function(o){
|
||
if(!a.barDraging&&a.canGoDetail){
|
||
var r=o.target||o.srcElement;
|
||
r&&e.isInSeekrang(r)||("v"==a.tag?(j.reportData[t.type].detail_click[a.posIndex]=1,
|
||
window.__second_open__?C(t.detailUrl):window.location.href=t.detailUrl):("m"==a.tag||"k"==a.tag)&&j.adapter[a.tag].getPlayUrl(t,{
|
||
callback:function(e){
|
||
e.canplay?(j.reportData[t.type].detail_click[a.posIndex]=1,window.__second_open__?C(t.detailUrl):window.location.href=t.detailUrl):e.msg&&new k({
|
||
msg:e.msg
|
||
});
|
||
}
|
||
}));
|
||
}
|
||
}),j.musicSupport){
|
||
var o=0,r=4,n=5;
|
||
switch(1*t.type){
|
||
case 0:
|
||
o=1;
|
||
break;
|
||
|
||
case 1:
|
||
o=13;
|
||
break;
|
||
|
||
case 8:
|
||
o=14;
|
||
break;
|
||
|
||
case 2:
|
||
o=3;
|
||
break;
|
||
|
||
case 3:
|
||
o=6;
|
||
break;
|
||
|
||
case 4:
|
||
o=7;
|
||
break;
|
||
|
||
case 5:
|
||
o=10;
|
||
break;
|
||
|
||
case 6:
|
||
o=15;
|
||
break;
|
||
|
||
case 7:
|
||
o=11;
|
||
break;
|
||
|
||
case 9:
|
||
o=12;
|
||
}
|
||
var i="";
|
||
i=t.allowPause?t.pauseCss||t.playingCss:t.playingCss,g.tap(t.playArea,function(){
|
||
return console.log("click playArea",h.hasClass(t.playCssDom,i)),h.hasClass(t.playCssDom,i)?(t.allowPause?e.player.pause():e.player.stop(),
|
||
D.report({
|
||
type:o,
|
||
comment_id:t.comment_id,
|
||
voiceid:t.songId,
|
||
action:n
|
||
})):"v"==a.tag||"a"==a.tag?e._playMusic(o,r):j.adapter[a.tag].getPlayUrl(t,{
|
||
callback:function(n){
|
||
n.canplay&&n.play_url?(n.duration&&(t.duration=n.duration,e.player.setDuration(t.duration),
|
||
j.reportData[t.type].duration2[a.posIndex]=parseInt(1e3*t.duration)),e.player.setSrc(n.play_url),
|
||
8!=n.status||n.in_cache?e._playMusic(o,r):new k({
|
||
msg:"该音乐为付费音乐,当前为你播放试听片段",
|
||
onClick:function(){
|
||
e._playMusic(o,r);
|
||
}
|
||
})):n.msg&&new k({
|
||
msg:n.msg
|
||
});
|
||
}
|
||
}),!1;
|
||
}),e._dragEvent();
|
||
}
|
||
},a.prototype._dragEvent=function(){
|
||
var e=this,t=this._o,a=this._g,o=t.seekRange;
|
||
if(o){
|
||
var r=0,n=o,i=!1,s=window.__zoom||1;
|
||
for(1!=s&&(i=!0);n&&n!=document.body;)r+=i?n.offsetLeft*s:n.offsetLeft,"page-content"==n.id&&(i=!1),
|
||
n=n.offsetParent;
|
||
var p=e.player.getDuration();
|
||
a.seekData={
|
||
zoom:s,
|
||
offsetLeft:r,
|
||
duration:p,
|
||
rangeWidth:o.offsetWidth,
|
||
startTime:0,
|
||
dragTime:0,
|
||
downX:0,
|
||
moveX:0
|
||
},g.on(o,"mousedown",function(t){
|
||
a.canDragBar&&(e._pointerDownHandler({
|
||
x:t.pageX||t.clientX
|
||
}),t.preventDefault());
|
||
}),g.on(t.seekContainer,"mousemove",function(t){
|
||
a.canDragBar&&a.barDraging&&(e._pointerMoveHandler({
|
||
x:t.pageX||t.clientX
|
||
}),t.preventDefault(),t.stopPropagation());
|
||
}),g.on(document.body,"mouseup",function(t){
|
||
return a.canDragBar&&a.barDraging?(e._pointerUpHandler({
|
||
x:t.pageX||t.clientX
|
||
}),t.preventDefault(),t.stopPropagation(),!1):void 0;
|
||
}),g.on(o,"touchstart",function(t){
|
||
a.canDragBar&&(e._pointerDownHandler({
|
||
x:t.changedTouches[0].clientX
|
||
}),t.preventDefault());
|
||
}),g.on(o,"touchmove",function(t){
|
||
return a.canDragBar&&a.barDraging?(e._pointerMoveHandler({
|
||
x:t.changedTouches[0].clientX
|
||
}),t.preventDefault(),void t.stopPropagation()):void console.log("no can drag",a.canDragBar,a.barDraging);
|
||
}),g.on(o,"touchend",function(t){
|
||
return a.canDragBar&&a.barDraging?(e._pointerUpHandler({
|
||
x:t.changedTouches[0].clientX
|
||
}),t.preventDefault(),t.stopPropagation(),!1):void console.log("no can drag",a.canDragBar,a.barDraging);
|
||
});
|
||
}
|
||
},a.prototype._pointerDownHandler=function(e){
|
||
var t=this._g;
|
||
t.barDraging=!0,t.canGoDetail=!1,t.seekData.downX=e.x,t.seekData.startTime=this.player.getCurTime();
|
||
},a.prototype._pointerMoveHandler=function(e){
|
||
var t=this._g,a=t.seekData;
|
||
a.moveX=e.x;
|
||
var o=(a.moveX-a.offsetLeft)/a.zoom/a.rangeWidth;
|
||
o=Math.min(o,1),o=Math.max(o,0),a.dragTime=o*a.duration,a.dragTime!=a.startTime&&this._updateProgressBar(a.dragTime);
|
||
},a.prototype._pointerUpHandler=function(e){
|
||
var t=this._g,a=t.seekData;
|
||
a.dragTime||this._pointerMoveHandler({
|
||
x:e.x
|
||
}),console.log("up dragging",a.dragTime),t.barDraging=!1,this.player.seek(a.dragTime),
|
||
j.reportData[this._o.type].seek[t.posIndex]=1,j.reportData[this._o.type].seek_position[t.posIndex].push(parseInt(1e3*a.startTime)+","+parseInt(1e3*a.dragTime));
|
||
var o=j.reportData[this._o.type].seek_position[t.posIndex].length;
|
||
j.reportData[this._o.type].seek_loaded[t.posIndex][o-1]=0,t.seekData.startTime=0,
|
||
t.seekData.dragTime=0,t.seekData.downX=0,t.seekData.moveX=0,setTimeout(function(){
|
||
t.canGoDetail=!0;
|
||
},1e3);
|
||
},a.prototype._playMusic=function(e,t){
|
||
var a=this._o,o=this._g;
|
||
this.player.play(),j.reportData[a.type].hasended[o.posIndex]=1,0==j.reportData[a.type].local_time[o.posIndex]&&(j.reportData[a.type].local_time[o.posIndex]=parseInt(+new Date/1e3)),
|
||
D.report({
|
||
type:e,
|
||
comment_id:a.comment_id,
|
||
voiceid:a.songId,
|
||
action:t
|
||
});
|
||
},a.prototype._extend=function(e){
|
||
for(var t in e)this._o[t]=e[t];
|
||
},a.prototype._onUpdateSeekRange=function(){
|
||
var e=this,t=e._o,a=e._g;
|
||
return function(e){
|
||
this.surportSeekRange()&&t.bufferDom&&t.playdotDom?(a.canDragBar=!0,t.playdotDom.style.display="block",
|
||
t.bufferDom.style.width=1*e+"%"):(a.canDragBar=!1,t.playdotDom&&(t.playdotDom.style.display="none"));
|
||
};
|
||
},a.prototype._statusChangeCallBack=function(){
|
||
var e=this;
|
||
return function(t,a){
|
||
e._status=a,e._updatePlayerCss(this,a),e._o.musicPlayerStatusChange&&e._o.musicPlayerStatusChange(a);
|
||
};
|
||
},a.prototype._timeupdateCallBack=function(){
|
||
var e=this,t=this._o,a=this._g;
|
||
return function(o,r){
|
||
e._updateProgress(r),0!=r&&(j.reportData[t.type].play_duration2[a.posIndex]=parseInt(1e3*r));
|
||
};
|
||
},a.prototype._errorCallBack=function(){
|
||
var e=this,t=this._o,a=this._g;
|
||
return function(o,r){
|
||
j.reportData[t.type].errorcode[a.posIndex]=r.code,e._updatePlayerCss(this,3);
|
||
};
|
||
},a.prototype._reportH5Error=function(e){
|
||
if("mp.weixin.qq.com"==location.host&&1==e.type||j.debug){
|
||
var t=["code:",e.code,";type:",this._o.type,";url:",window.location.href];
|
||
this.player&&t.push(";src:"+this.player.getSrc());
|
||
var a=new Image;
|
||
a.src=["https://badjs.weixinbridge.com/badjs?level=4&id=112&msg=",encodeURIComponent(t.join("")),"&uin=",window.uin||"","&from=",this._o.type].join("");
|
||
}
|
||
},a.prototype._updatePlayerCss=function(e,t){
|
||
!!j.debug&&console.log("status:"+t);
|
||
{
|
||
var a=this._o,o=a.playCssDom;
|
||
a.progress;
|
||
}
|
||
2==t?(h.removeClass(o,a.playingCss),a.pauseCss&&h.removeClass(o,a.pauseCss),a.playdotDom&&(e.surportSeekRange()?(a.playdotDom.style.display="block",
|
||
this._g.canDragBar=!0):(a.playdotDom.style.display="none",this._g.canDragBar=!1))):3==t?(h.removeClass(o,a.playingCss),
|
||
a.pauseCss&&h.removeClass(o,a.pauseCss),a.playdotDom&&(a.playdotDom.style.display="none",
|
||
this._g.canDragBar=!1),this._updateProgress(0)):(1==t||4==t)&&(a.allowPause?h.addClass(o,a.pauseCss||a.playingCss):h.addClass(o,a.playingCss),
|
||
a.playdotDom&&(e.surportSeekRange()?(a.playdotDom.style.display="block",this._g.canDragBar=!0):(a.playdotDom.style.display="none",
|
||
this._g.canDragBar=!1))),a.loadingDom&&(a.loadingDom.style.display=4==t?"block":"none");
|
||
},a.prototype._updateProgress=function(e){
|
||
return this._g.barDraging?void console.log("no dragging return",e):void this._updateProgressBar(e);
|
||
},a.prototype._updateProgressBar=function(e){
|
||
var t=this._o,a=this.player,o=a.getDuration();
|
||
if(o){
|
||
var r=this._countProgress(o,e);
|
||
t.progress&&(t.progress.style.width=r),t.playtimeDom&&e>=0&&(t.playtimeDom.innerHTML=d(e)),
|
||
t.playdotDom&&(t.playdotDom.style.left=r);
|
||
}
|
||
},a.prototype._countProgress=function(e,t){
|
||
return Math.min(t/e*100,100)+"%";
|
||
},a.prototype.destory=function(){
|
||
this.player&&this.player.destory();
|
||
},a.prototype.setOption=function(e){
|
||
e.duration&&(this._g.seekData.duration=e.duration),this._extend(e);
|
||
},a.prototype.setMusicPlayerOption=function(e){
|
||
e.duration&&this._g&&this._g.seekData&&(this._g.seekData.duration=e.duration),this.player&&this.player.setOption(e);
|
||
},a.prototype.getBackgroundAudioState=function(e){
|
||
return this.player.getBackgroundAudioState(e);
|
||
},{
|
||
init:c,
|
||
renderPlayer:o,
|
||
formatTime:d,
|
||
decodeStr:u,
|
||
encodeStr:_
|
||
};
|
||
});define("pages/qqmusic_tpl.html.js",[],function(){
|
||
return'<span id="qqmusic_main_<#=musicid#>_<#=posIndex#>" class="db qqmusic_area <#if(!musicSupport){#> unsupport<#}#>">\n <span class="tc tips_global unsupport_tips" <#if(show_not_support!==true){#>style="display:none;"<#}#>>\n 当前浏览器不支持播放音乐或语音,请在微信或其他浏览器中播放 </span>\n <span class="db qqmusic_wrp appmsg_card_context appmsg_card_active">\n <span class="db qqmusic_bd">\n <span id="qqmusic_play_<#=musicid#>_<#=posIndex#>" class="play_area">\n <i class="icon_qqmusic_switch"></i>\n <img src="<#=window.icon_qqmusic_default#>" alt="" class="pic_qqmusic_default">\n <img src="<#=albumurl#>" data-autourl="<#=audiourl#>" data-musicid="<#=musicid#>" class="qqmusic_thumb" alt="">\n </span>\n <a id="qqmusic_home_<#=musicid#>_<#=posIndex#>" class="access_area">\n <span class="qqmusic_songname"><#=music_name#></span>\n <span class="qqmusic_singername"><#=singer#></span>\n <span class="qqmusic_source"><img src="<#=musicIcon#>" alt=""></span>\n </a>\n </span>\n </span> \n</span>\n';
|
||
});define("new_video/ctl.js",["biz_wap/utils/ajax.js"],function(e){
|
||
"use strict";
|
||
var i;
|
||
if(parent==window)i=window;else try{
|
||
{
|
||
parent.window.location.href;
|
||
}
|
||
i=parent.window;
|
||
}catch(n){
|
||
i=window;
|
||
}
|
||
var t=i.user_uin,r=Math.floor(i.user_uin/100)%20;
|
||
t||(r=-1);
|
||
var a=function(){
|
||
return r>=0;
|
||
};
|
||
i.__webviewid||(i.__webviewid=+new Date+"_"+Math.ceil(1e3*Math.random()));
|
||
var d=function(){
|
||
var e=i.mid,n=i.idx,r="";
|
||
r=e&&n?e+"_"+n:"";
|
||
var a=i.__webviewid,d=[t,r,a].join("_");
|
||
return d;
|
||
},o=function(i){
|
||
if(20>r)try{
|
||
var n=i.vid||"",t={};
|
||
t.__biz=parent.window.biz||"",t.vid=n,t.clienttime=+new Date;
|
||
var o=parent.window.mid,s=parent.window.idx,w="";
|
||
w=o&&s?o+"_"+s:n,t.type="undefined"!=typeof i.type?i.type:o&&s?1:2,t.id=w,t.hit_bizuin=i.hit_bizuin||"",
|
||
t.hit_vid=i.hit_vid||"",t.webviewid=d(),t.step=i.step||0,t.orderid=i.orderid||0,
|
||
t.ad_source=i.ad_source||0,t.traceid=i.traceid||0,t.ext1=i.ext1||"",t.ext2=i.ext2||"",
|
||
t.r=Math.random(),t.devicetype=parent.window.devicetype,t.version=parent.window.clientversion,
|
||
t.is_gray=a()?1:0,t.mid=o||"",t.idx=s||"",t.url=parent.window.location.href,t.screen_num=i.screen_num||0,
|
||
t.screen_height=i.screen_height||0,t.ori_status=i.ori_status||3,t.fromid=i.fromid||0,
|
||
t.sessionid=window.sessionid||"",t.appmsg_scene=window.source||(window.cgiData?window.cgiData.scene:0)||0,
|
||
!t.appmsg_scene&&t.fromid?t.appmsg_scene=t.fromid:!t.fromid&&t.appmsg_scene&&(t.fromid=t.appmsg_scene),
|
||
t.total_range=i.total_range||0,t.current_range=i.current_range||0,t.duration=i.duration||0;
|
||
var _=e("biz_wap/utils/ajax.js");
|
||
_({
|
||
url:"/mp/ad_video_report?action=user_action",
|
||
type:"post",
|
||
data:t
|
||
});
|
||
}catch(c){}
|
||
};
|
||
return{
|
||
report:o,
|
||
getWebviewid:d,
|
||
showAd:a
|
||
};
|
||
});define("pages/utils.js",["appmsg/appmsg_report.js","biz_common/utils/emoji_data.js","pages/version4video.js","biz_wap/utils/mmversion.js","biz_wap/jsapi/core.js","biz_common/dom/event.js"],function(e){
|
||
"use strict";
|
||
var i=e("appmsg/appmsg_report.js"),o=e("biz_common/utils/emoji_data.js"),t=e("pages/version4video.js"),n=e("biz_wap/utils/mmversion.js"),a=e("biz_wap/jsapi/core.js"),r=e("biz_common/dom/event.js"),c={
|
||
inWechat:t.device.inWechat,
|
||
windowWechat:/WindowsWechat/i.test(navigator.userAgent),
|
||
macWechat:/wechat.*mac os/i.test(navigator.userAgent),
|
||
emojiImg:'<img src="https://res.wx.qq.com/mpres/zh_CN/htmledition/comm_htmledition/images/pic/common/pic_blank.gif" class="icon_emotion_single #style#" alt="#name#">',
|
||
emojiDataMap:{}
|
||
};
|
||
!function(){
|
||
for(var e=0,i=o.length;i>e;e++){
|
||
var t=o[e];
|
||
t.cn&&!c.emojiDataMap[t.cn]&&(c.emojiDataMap[t.cn]={
|
||
index:e
|
||
}),t.hk&&!c.emojiDataMap[t.hk]&&(c.emojiDataMap[t.hk]={
|
||
index:e
|
||
}),t.us&&!c.emojiDataMap[t.us]&&(c.emojiDataMap[t.us]={
|
||
index:e
|
||
});
|
||
}
|
||
}();
|
||
var s=function(e){
|
||
return/\[[^\[\]]+\]/.test(e)?e.replace(/\[[^\[\]]+\]/g,function(e){
|
||
if(c.emojiDataMap[e]&&o[c.emojiDataMap[e].index]){
|
||
var i=o[c.emojiDataMap[e].index];
|
||
return c.emojiImg.replace("#name#",e).replace("#style#",i.style);
|
||
}
|
||
return e;
|
||
}):e;
|
||
},m=function(e,i){
|
||
c.inWechat?c.windowWechat||c.macWechat?i===!0?window.parent.open(e):window.parent.location.href=e:a.invoke("openUrlWithExtraWebview",{
|
||
url:e,
|
||
openType:1
|
||
},function(o){
|
||
-1==o.err_msg.indexOf("ok")&&(i===!0?window.parent.open(e):window.parent.location.href=e);
|
||
}):i===!0?window.open(e):location.href=e;
|
||
},p=function(){
|
||
!c.inWechat||c.windowWechat||c.macWechat?window.close():a.invoke("closeWindow",function(e){
|
||
-1==e.err_msg.indexOf("ok")&&window.close();
|
||
});
|
||
},l=function(e){
|
||
return document.getElementById(e);
|
||
},u=function(e){
|
||
return e.replace(/^\s+|\s+$/g,"");
|
||
},d=function(e,i){
|
||
return(i||document).querySelector(e);
|
||
},f=function(e,i){
|
||
return(i||document).querySelectorAll(e);
|
||
},w=function(e){
|
||
var o=e.$container;
|
||
o&&!n.isInMiniProgram&&r.on(o,"tap",".js_go_profile",function(o){
|
||
var t=o.delegatedTarget;
|
||
if(t){
|
||
var n=t.getAttribute("data-biz")||e.biz||window.biz||"";
|
||
if("function"==typeof e.beforeGo2Profile&&e.beforeGo2Profile(t),1==window.isprofileblock)a.invoke("openUrlWithExtraWebview",{
|
||
url:"https://mp.weixin.qq.com/mp/profileblock?__biz="+n+"#wechat_redirect",
|
||
openType:1
|
||
},function(e){
|
||
-1==e.err_msg.indexOf("ok")&&(location.href="https://mp.weixin.qq.com/mp/profileblock?__biz="+n+"#wechat_redirect");
|
||
});else{
|
||
var r=t.getAttribute("data-scene")||e.profile_scene||"";
|
||
i.profileReport({
|
||
isnew:0,
|
||
title:e.title||"",
|
||
item_show_type:e.item_show_type||""
|
||
}),a.invoke("profile",{
|
||
username:e.user_name,
|
||
profileReportInfo:"",
|
||
scene:r
|
||
},function(){});
|
||
}
|
||
}
|
||
});
|
||
};
|
||
return{
|
||
jumpUrl:m,
|
||
closeWin:p,
|
||
trim:u,
|
||
getId:l,
|
||
qs:d,
|
||
qsAll:f,
|
||
inWechat:c.inWechat,
|
||
windowWechat:c.windowWechat,
|
||
macWechat:c.macWechat,
|
||
emojiFormat:s,
|
||
go2ProfileEvent:w
|
||
};
|
||
});define("appmsg/open_url_with_webview.js",["biz_wap/jsapi/core.js"],function(e){
|
||
"use strict";
|
||
var r=e("biz_wap/jsapi/core.js"),n=-1!=navigator.userAgent.indexOf("WindowsWechat"),i=function(e,i){
|
||
if(n)return location.href=e,!1;
|
||
i=i||{};
|
||
var o=i.sample||0;
|
||
o*=1e3;
|
||
var t=window.user_uin||0,s=0!==t&&Math.floor(t/100)%1e3<o;
|
||
return s?void r.invoke("openUrlWithExtraWebview",{
|
||
url:e,
|
||
openType:i.openType||1,
|
||
scene:i.scene||"",
|
||
bizUsername:i.user_name||""
|
||
},function(e){
|
||
e&&"openUrlWithExtraWebview:ok"===e.err_msg?i.resolve&&i.resolve():i.reject&&i.reject();
|
||
}):void(i.reject&&i.reject());
|
||
};
|
||
return i;
|
||
});define("appmsg/more_read.js",["biz_common/utils/string/html.js","biz_common/tmpl.js","biz_wap/utils/ajax.js","appmsg/more_read_tpl.html.js","biz_wap/utils/openUrl.js","biz_common/dom/event.js","biz_common/utils/monitor.js","common/utils.js"],function(n){
|
||
"use strict";
|
||
function i(n){
|
||
for(var i=c.getInnerHeight(),e=document.documentElement.clientWidth||window.innerWidth,t=document.body.scrollHeight||document.body.offsetHeight,s=document.body.scrollTop||document.documentElement.scrollTop,m=[],d=0;d<l.length;d++){
|
||
var w=[l[d].bizuin||window.biz||"",l[d].mid||"",l[d].idx||""].join("_");
|
||
m.push(w);
|
||
}
|
||
m=m.join("#");
|
||
var h=r[n.index].getBoundingClientRect(),p="fans_read_cnt="+l[n.index].fans_read_cnt,g={
|
||
act:n.action||0,
|
||
bizuin:window.biz||"",
|
||
msgid:window.mid||"",
|
||
idx:window.idx||"",
|
||
scene:window.source||"",
|
||
sub_scene:window.subscene||"",
|
||
get_a8_key_scene:window.ascene||"",
|
||
screen_height:i,
|
||
screen_width:e,
|
||
screen_num:Math.ceil(t/i),
|
||
action_screen_num:Math.ceil((h.top+h.height+s)/i),
|
||
start_time_ms:_,
|
||
action_time_ms:Date.now(),
|
||
more_msg:m,
|
||
a_bizuin:l[n.index].bizuin||window.biz||"",
|
||
a_msgid:l[n.index].mid||"",
|
||
a_idx:l[n.index].idx||"",
|
||
rank:n.index+1,
|
||
tip:p,
|
||
session_id:u
|
||
};
|
||
o({
|
||
url:"/mp/appmsgreport?action=more_read",
|
||
type:"POST",
|
||
data:g,
|
||
timeout:2e3,
|
||
async:!1,
|
||
mayAbort:!0
|
||
});
|
||
var b=1===n.action?4:5;
|
||
a.setSum(110809,b,1).send();
|
||
}
|
||
function e(){
|
||
if(l){
|
||
for(var n=0,t=c.getInnerHeight(),o=0;o<r.length;o++)if(r[o].dataset.show)n++;else{
|
||
var s=r[o].getBoundingClientRect();
|
||
s.top+s.height<t&&(r[o].dataset.show=1,i({
|
||
action:1,
|
||
index:o
|
||
}));
|
||
}
|
||
n>=r.length&&d.off(window,"scroll",e);
|
||
}
|
||
}
|
||
n("biz_common/utils/string/html.js");
|
||
var t=n("biz_common/tmpl.js"),o=n("biz_wap/utils/ajax.js"),s=n("appmsg/more_read_tpl.html.js"),m=n("biz_wap/utils/openUrl.js"),d=n("biz_common/dom/event.js"),a=n("biz_common/utils/monitor.js"),c=n("common/utils.js"),l=null,r=null,_=Date.now(),u=""+_+"_"+Math.random().toString(36).substring(2);
|
||
return d.on(window,"scroll",e),function(n,e){
|
||
l=e,n.innerHTML=t.tmpl(s,{
|
||
list:l
|
||
}),r=n.getElementsByClassName("more_read_link");
|
||
for(var o=0;o<r.length;o++)d.on(r[o],"click",function(n){
|
||
return function(){
|
||
window.__second_open__?m.openUrlWithExtraWebview(l[n].link.htmlDecode()):window.location.href=l[n].link.htmlDecode(),
|
||
i({
|
||
action:2,
|
||
index:n
|
||
});
|
||
};
|
||
}(o));
|
||
n.style.display="";
|
||
};
|
||
});define("appmsg/like.js",["biz_common/dom/event.js","biz_common/dom/class.js","biz_wap/utils/ajax.js","biz_common/base64.js","appmsg/log.js","complain/tips.js","appmsg/retry_ajax.js","biz_wap/jsapi/core.js","biz_wap/utils/mmversion.js","common/utils.js","appmsg/i18n.js","biz_wap/utils/device.js"],function(require,exports,module,alert){
|
||
"use strict";
|
||
function qs(e){
|
||
return document.getElementById(e);
|
||
}
|
||
function showAppToast(e,i){
|
||
JSAPI.invoke("handleMPPageAction",{
|
||
action:"showToast",
|
||
wording:e||"",
|
||
status:i||"success"
|
||
});
|
||
}
|
||
function initLikeEvent(opt){
|
||
function show(e){
|
||
e.style.display="";
|
||
}
|
||
function hide(e){
|
||
e.style.display="none";
|
||
}
|
||
function vShow(e){
|
||
e.style.visibility="visible";
|
||
}
|
||
function vHide(e){
|
||
e.style.visibility="hidden";
|
||
}
|
||
function clear(e){
|
||
e.value="";
|
||
}
|
||
function showLoading(){
|
||
commonUtils.isNativePage()?showAppToast("发送中","loading"):show(qs("js_loading"));
|
||
}
|
||
function hideLoading(){
|
||
commonUtils.isNativePage()?showAppToast("","dismissloading"):hide(qs("js_loading"));
|
||
}
|
||
function showToast(e){
|
||
commonUtils.isNativePage()?showAppToast(e):(el_toastMsg.innerHTML=e,show(el_likeToast),
|
||
setTimeout(function(){
|
||
hide(el_likeToast);
|
||
},1e3));
|
||
}
|
||
function newAlert(e){
|
||
el_alertContent.innerHTML=e,el_alertPanel.style.display="";
|
||
}
|
||
function alert2(e){
|
||
"0"===window.item_show_type?newAlert(e):alert(e);
|
||
}
|
||
function failAlert(e){
|
||
return e&&e.length>maxLikeCommentWord?void alert2("想法不可以超过%s字".replace("%s",maxLikeCommentWord)):void alert2("网络异常,请稍后重试");
|
||
}
|
||
var scrollTop,el_like=opt.likeAreaDom,el_likeNum=opt.likeNumDom,showType=opt.showType,prompted=opt.prompted,haokanLock=!1,startY,jumpWowLock=!1,el_likeToast=qs("js_like_toast"),el_likeBtn=qs("js_like_btn"),el_toastMsg=qs("js_toast_msg"),el_likeEducate=qs("js_like_educate"),el_friend_like=qs("js_friend_like_area"),el_go_wow=qs("js_go_wow"),el_likeComment=qs("js_like_comment"),el_bcommentPanel2=qs("js_comment_panel"),el_likeCommentShare=qs("js_like_comment_share"),el_likeCommentText=qs("js_comment_text"),el_commentCancel=qs("js_comment_cancel"),el_commentConfirm=qs("js_comment_confirm"),el_commentErrorMsg=qs("js_like_comment_msg"),el_commentCurrentCount=qs("js_like_current_cnt"),el_commentArea=qs("js_comment_area"),el_wowClosePanel=qs("wow_close_inform"),el_wowCloseAck=qs("wow_close_ack"),el_alertPanel=qs("js_alert_panel"),el_alertContent=qs("js_alert_content"),el_alertConfirm=qs("js_alert_confirm");
|
||
if(el_like&&el_likeNum){
|
||
var img=new Image;
|
||
window.appmsg_like_type&&2===window.appmsg_like_type?img.src=location.protocol+"//mp.weixin.qq.com/mp/jsmonitor?idkey=114217_0_1":window.appmsg_like_type&&1===window.appmsg_like_type&&(img.src=location.protocol+"//mp.weixin.qq.com/mp/jsmonitor?idkey=114217_1_1");
|
||
var like_report=function(){
|
||
log("[Appmsg] click like");
|
||
var e=el_like.getAttribute("like"),i=el_likeNum.innerHTML,o=parseInt(e)?parseInt(e):0,t=o?0:1,n=parseInt(i)?parseInt(i):0,s=opt.appmsgid||opt.mid,l=opt.itemidx||opt.idx;
|
||
if(o){
|
||
if(1!==appmsg_like_type)return void sendRecommendAjax(0);
|
||
Class.removeClass(el_like,opt.className),el_like.setAttribute("like",0),n>0&&"100000+"!==i&&(el_likeNum.innerHTML=n-1==0?"赞":n-1);
|
||
}else if(1===appmsg_like_type)el_like.setAttribute("like",1),Class.addClass(el_like,opt.className),
|
||
"100000+"!==i&&(el_likeNum.innerHTML=n+1);else if(2===appmsg_like_type)return void initRecommendPanel();
|
||
RetryAjax({
|
||
url:"/mp/appmsg_like?__biz="+opt.biz+"&mid="+opt.mid+"&idx="+opt.idx+"&like="+t+"&f=json&appmsgid="+s+"&itemidx="+l,
|
||
data:{
|
||
is_temp_url:opt.is_temp_url||0,
|
||
scene:window.source,
|
||
subscene:window.subscene,
|
||
appmsg_like_type:window.appmsg_like_type,
|
||
item_show_type:parseInt(window.item_show_type,10),
|
||
client_version:window.clientversion,
|
||
action_type:t?1:2,
|
||
device_type:window.devicetype
|
||
},
|
||
type:"POST"
|
||
});
|
||
},initRecommendPanel=function(){
|
||
sendRecommendAjax(1,"",1);
|
||
},isBeenUnvisible=function(e){
|
||
return e.offsetTop-document.body.scrollTop>=commonUtils.getInnerHeight()-60?!0:!1;
|
||
},disableMove=function(){
|
||
document.addEventListener("touchmove",preventMove,{
|
||
passive:!1
|
||
}),el_likeCommentText.addEventListener("touchstart",getTouchStart,{
|
||
passive:!1
|
||
}),el_likeCommentText.addEventListener("touchmove",preventText,!1);
|
||
},enableMove=function(){
|
||
document.removeEventListener("touchmove",preventMove,{
|
||
passive:!1
|
||
}),el_likeCommentText.removeEventListener("touchstart",getTouchStart,{
|
||
passive:!1
|
||
}),el_likeCommentText.removeEventListener("touchmove",preventText,!1);
|
||
},preventMove=function(e){
|
||
var i=e.target;
|
||
"TEXTAREA"!==i.tagName&&"BUTTON"!==i.tagName&&(e.preventDefault(),e.stopPropagation());
|
||
},getTouchStart=function(e){
|
||
var i=e.targetTouches||[];
|
||
if(i.length>0){
|
||
var o=i[0]||{};
|
||
startY=o.clientY;
|
||
}
|
||
},preventText=function(e){
|
||
var i=!1,o=e.changedTouches,t=this.scrollTop,n=this.offsetHeight,s=this.scrollHeight;
|
||
if(o.length>0){
|
||
var l=o[0]||{},a=l.clientY;
|
||
i=a>startY&&0>=t?!1:startY>a&&t+n>=s?!1:!0,i||e.preventDefault();
|
||
}
|
||
},isShow=function(e){
|
||
return"none"===e.style.display||"hidden"===e.style.visibility?!1:""===e.style.display||"block"===e.style.display||"visible"===e.style.visibility?!0:void 0;
|
||
},validataComment=function(e,i){
|
||
var o=e.value.replace(/^\s+|\s+$/g,"");
|
||
sendRecommendAjax(1,o,i);
|
||
},showEducatePanel=function(e,i,o){
|
||
show(el_likeComment);
|
||
var t=window.source||window.cgiData&&window.cgiData.source||0;
|
||
return t&&(t=parseInt(t,10),94===t)?void(e&&5===e&&hide(el_likeComment)):void(i||(show(el_likeEducate),
|
||
o&&o>0&&(el_friend_like.innerHTML="%s位朋友也在看,".replace("%s",o),document.getElementById("js_friend_like_word").innerText="前往“发现”-“看一看”浏览",
|
||
show(el_friend_like)),1===showType&&(hide(el_go_wow),hide(el_likeCommentShare)),
|
||
isBeenUnvisible(el_likeComment)&&scrollToShow(el_likeComment),educateExpose()));
|
||
},setBtnLike=function(){
|
||
el_like.setAttribute("like",1),Class.addClass(el_likeBtn,opt.className),realLikeNum+=1;
|
||
var e=el_likeNum.innerHTML;
|
||
"10万+"!==e&&(el_likeNum.innerHTML=dealLikeReadShow(realLikeNum));
|
||
},setLike2Status=function(e,i,o){
|
||
var t="在看";
|
||
switch(showType){
|
||
case 1:
|
||
switch(prompted){
|
||
case 0:
|
||
showEducatePanel(e,i,o),show(el_likeComment),prompted=1;
|
||
break;
|
||
|
||
case 1:
|
||
hide(el_likeEducate),showToast(t);
|
||
}
|
||
setBtnLike();
|
||
break;
|
||
|
||
case 2:
|
||
switch(hide(el_bcommentPanel2),clear(el_likeCommentText),prompted){
|
||
case 0:
|
||
showEducatePanel(e,i,o),5===e&&hide(el_likeCommentShare);
|
||
break;
|
||
|
||
case 1:
|
||
(4===e||5===e)&&showToast(4===e?"已发送":t);
|
||
}
|
||
5!==e&&(4===e&&"none"!==el_likeEducate.style.display?hide(el_likeCommentShare):4===e?hide(el_likeComment):(show(el_commentArea),
|
||
show(el_likeCommentShare),1===prompted&&hide(el_likeEducate),show(el_likeComment),
|
||
isBeenUnvisible(el_likeComment)&&scrollToShow(el_likeComment))),4!==e&&setBtnLike(),
|
||
prompted=1;
|
||
}
|
||
enableMove(),commonUtils.isNativePage()&&JSAPI.invoke("handleHaokanAction",{
|
||
action:"closeComment"
|
||
});
|
||
},unsetLike2Status=function(e){
|
||
1===e?setTimeout(function(){
|
||
alert2(" 已取消,想法已同步删除");
|
||
},20):showToast("已取消"),2===showType&&isShow(el_likeComment)&&hide(el_likeComment);
|
||
var i=el_likeNum.innerHTML;
|
||
Class.removeClass(el_likeBtn,opt.className),el_like.setAttribute("like",0),el_likeComment&&hide(el_likeComment),
|
||
realLikeNum-=1,realLikeNum>=0&&"10万+"!==i&&(el_likeNum.innerHTML=dealLikeReadShow(realLikeNum));
|
||
},sendRecommendAjax=function sendRecommendAjax(like,comment,type,clientType){
|
||
if(!haokanLock){
|
||
showLoading();
|
||
var appmsgid=opt.appmsgid||opt.mid,itemidx=opt.itemidx||opt.idx;
|
||
haokanLock=!0;
|
||
var action_type;
|
||
action_type=like?type:2,ajax({
|
||
url:"/mp/appmsg_like?__biz="+opt.biz+"&mid="+opt.mid+"&idx="+opt.idx+"&like="+like+"&f=json&appmsgid="+appmsgid+"&itemidx="+itemidx,
|
||
data:{
|
||
is_temp_url:opt.is_temp_url||0,
|
||
scene:window.source,
|
||
subscene:window.subscene,
|
||
appmsg_like_type:window.appmsg_like_type,
|
||
item_show_type:parseInt(window.item_show_type,10),
|
||
client_version:window.clientversion,
|
||
comment:comment?comment:"",
|
||
prompted:1,
|
||
style:clientType||showType,
|
||
action_type:action_type,
|
||
passparam:window.passparam,
|
||
request_id:(new Date).getTime(),
|
||
device_type:window.devicetype
|
||
},
|
||
type:"POST",
|
||
success:function success(res){
|
||
haokanLock=!1;
|
||
var data=eval("("+res+")");
|
||
hideLoading(),0==data.base_resp.ret?(like?setLike2Status(type,data.is_eu_user,data.friend_like_num):unsetLike2Status(data.has_comment),
|
||
connectWithApp(like,comment,clientType)):failAlert(comment);
|
||
},
|
||
error:function(){
|
||
hideLoading(),failAlert(),haokanLock=!1;
|
||
}
|
||
});
|
||
}
|
||
};
|
||
JSAPI.on("menu:haokan",function(e){
|
||
var i=0===parseInt(e.recommend)?0:1;
|
||
if(0===i)sendRecommendAjax(i,"",2,clientShowType);else{
|
||
var o="";
|
||
o=e.comment;
|
||
var t=1===e.scene?4:5;
|
||
sendRecommendAjax(i,o,t,clientShowType);
|
||
}
|
||
});
|
||
var connectWithApp=function(e,i){
|
||
var o={
|
||
origin:"mp",
|
||
isLike:e?1:0,
|
||
url:encodeURIComponent(msg_link.html(!1)),
|
||
content:i?i:""
|
||
};
|
||
JSAPI.invoke("handleHaokanAction",{
|
||
action:actionString,
|
||
recommend:e?1:0,
|
||
server_data:JSON.stringify(o)
|
||
},function(e){
|
||
console.log("handleHaokanAction",e);
|
||
}),JSAPI.invoke("handleHaokanAction",{
|
||
action:actionForClient,
|
||
permission:1,
|
||
recommend:e?1:0
|
||
},function(e){
|
||
console.log("handleHaokanAction for client",e);
|
||
});
|
||
},goWoW=function(){
|
||
jumpWowLock||(jumpToWowClickReport(),jumpWowLock=!0,JSAPI.invoke("handleHaokanAction",{
|
||
action:"jumpToWow",
|
||
extParams:JSON.stringify({
|
||
autoDropLoad:!0
|
||
})
|
||
},function(e){
|
||
jumpWowLock=!1,console.log("jumpToWow",e),e.err_msg&&"handleHaokanAction:fail_entrance_not_open"===e.err_msg?show(el_wowClosePanel):"handleHaokanAction:fail action not support"===e.err_msg||"handleHaokanAction:fail, action not support"===e.err_msg?alert2("微信版本过低,暂不支持该操作"):"handleHaokanAction:ok"===e.err_msg&&hide(el_likeComment),
|
||
JSAPI.invoke("handleHaokanAction",{
|
||
action:actionString,
|
||
server_data:JSON.stringify({
|
||
origin:"mp",
|
||
autoDropLoad:!0
|
||
})
|
||
},function(e){
|
||
console.log("sendAutoDropLoad",e);
|
||
});
|
||
}));
|
||
},likeClickReport=function(){
|
||
ajax({
|
||
url:"/mp/appmsgreport?action=appmsglikeclickcomment&__biz="+opt.biz+"&mid="+opt.mid+"&idx="+opt.idx+"&f=json&appmsgid="+appmsgid+"&itemidx="+itemidx,
|
||
data:{
|
||
is_temp_url:opt.is_temp_url||0,
|
||
scene:window.source,
|
||
subscene:window.subscene,
|
||
appmsg_like_type:window.appmsg_like_type,
|
||
item_show_type:parseInt(window.item_show_type,10),
|
||
client_version:window.clientversion,
|
||
device_type:window.devicetype
|
||
},
|
||
type:"POST"
|
||
});
|
||
},likeExpose=function e(){
|
||
var i=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,o=qs("like3").offsetTop,t=opt.appmsgid||opt.mid,n=opt.itemidx||opt.idx;
|
||
i+commonUtils.getInnerHeight()>o&&o>=i&&(ajax({
|
||
url:"/mp/appmsgreport?action=appmsglikeexposure&__biz="+opt.biz+"&mid="+opt.mid+"&idx="+opt.idx+"&f=json&appmsgid="+t+"&itemidx="+n,
|
||
data:{
|
||
is_temp_url:opt.is_temp_url||0,
|
||
scene:window.source,
|
||
subscene:window.subscene,
|
||
appmsg_like_type:window.appmsg_like_type,
|
||
item_show_type:parseInt(window.item_show_type,10),
|
||
client_version:window.clientversion,
|
||
device_type:window.devicetype
|
||
},
|
||
type:"POST"
|
||
}),DomEvent.off(window,"scroll",e));
|
||
},educateExpose=function i(){
|
||
var e=(document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,
|
||
opt.appmsgid||opt.mid),o=opt.itemidx||opt.idx,t=window.item_show_type,n=window.enterid||window.cgiData&&window.cgiData.enterid||"";
|
||
el_likeEducate&&"none"!=el_likeEducate.style.display&&commonUtils.getInnerHeight()>el_likeEducate.getBoundingClientRect().top&&el_likeEducate.getBoundingClientRect().top+el_likeEducate.getBoundingClientRect().height>0&&(ajax({
|
||
url:"/mp/webcommreport?action=report&report_useruin=1&__biz="+window.biz,
|
||
type:"POST",
|
||
data:{
|
||
logid:18266,
|
||
buffer:["",Base64.decode(opt.biz),e,o,window.source,window.subscene,1,t,sessionid,n]
|
||
},
|
||
async:!1,
|
||
timeout:2e3
|
||
}),DomEvent.off(window,"scroll",i));
|
||
},jumpToWowClickReport=function(){
|
||
var e=opt.appmsgid||opt.mid,i=opt.itemidx||opt.idx,o=window.enterid||window.cgiData&&window.cgiData.enterid||"";
|
||
ajax({
|
||
url:"/mp/webcommreport?action=report&report_useruin=1&__biz="+window.biz,
|
||
type:"POST",
|
||
data:{
|
||
logid:18266,
|
||
buffer:["",Base64.decode(opt.biz),e,i,window.source,window.subscene,2,window.item_show_type,sessionid,o]
|
||
},
|
||
async:!1,
|
||
timeout:2e3
|
||
});
|
||
};
|
||
DomEvent.on(el_alertConfirm,"click",function(){
|
||
el_alertPanel.style.display="none";
|
||
}),DomEvent.on(el_like,"click",function(e){
|
||
return like_report(e),!1;
|
||
}),DomEvent.on(el_wowCloseAck,"click",function(){
|
||
hide(el_wowClosePanel);
|
||
}),DomEvent.on(qs("js_mask_2"),"mousedown",function(){
|
||
hide(el_bcommentPanel2),clear(el_likeCommentText),vHide(el_commentErrorMsg),enableMove();
|
||
}),DomEvent.on(el_commentConfirm,"mousedown",function(){
|
||
validataComment(el_likeCommentText,4);
|
||
}),DomEvent.on(el_commentCancel,"mousedown",function(){
|
||
hide(el_bcommentPanel2),clear(el_likeCommentText),vHide(el_commentErrorMsg),enableMove();
|
||
}),DomEvent.on(el_likeCommentShare,"click",function(){
|
||
return commonUtils.isNativePage()?void JSAPI.invoke("handleHaokanAction",{
|
||
action:"writeComment",
|
||
style:"8"===item_show_type||"5"===item_show_type?"black":"white"
|
||
}):(scrollTop=document.body.scrollTop||document.documentElement.scrollTop,show(el_bcommentPanel2),
|
||
el_likeCommentText.focus(),el_commentConfirm.setAttribute("disabled","disabled"),
|
||
disableMove(),void likeClickReport());
|
||
}),DomEvent.on(el_likeCommentText,"focus",function(){}),DomEvent.on(el_likeCommentText,"blur",function(){
|
||
window.scrollTo(0,scrollTop);
|
||
}),DomEvent.on(window,"scroll",likeExpose),DomEvent.on(window,"scroll",educateExpose),
|
||
DomEvent.on(el_go_wow,"click",goWoW);
|
||
var scrollToShow=function(e){
|
||
e.scrollIntoView(!1);
|
||
};
|
||
DomEvent.on(el_likeCommentText,"input",function(e){
|
||
var i=el_likeCommentText.value.replace(/^\s+|\s+$/g,"");
|
||
i.length>maxLikeCommentWord?(el_commentCurrentCount.innerHTML=i.length,vShow(el_commentErrorMsg)):vHide(el_commentErrorMsg),
|
||
i.length>0&&i.length<=maxLikeCommentWord?el_commentConfirm.removeAttribute("disabled"):el_commentConfirm.setAttribute("disabled","disabled"),
|
||
Device.os.ios&&e.data&&doubleInputChar.indexOf(e.data)>-1&&(focusTag=!0);
|
||
}),DomEvent.on(el_likeCommentText,"click",function(){
|
||
Device.os.ios&&focusTag&&(el_likeCommentText.blur(),el_likeCommentText.focus(),focusTag=!1);
|
||
});
|
||
}
|
||
}
|
||
function showLikeNum(e){
|
||
var i=e||{};
|
||
if(i.show){
|
||
var o=i.likeAreaDom,t=i.likeNumDom,n=document.getElementById("js_like_btn");
|
||
o&&(o.style.display=i.likeAreaDisplayValue,o.style.visibility="",i.liked&&(1===appmsg_like_type?Class.addClass(o,i.className):Class.addClass(n,i.className)),
|
||
o.setAttribute("like",i.liked?"1":"0"));
|
||
var s=1===appmsg_like_type?"赞":"";
|
||
realLikeNum=i.likeNum||s,1===appmsg_like_type?(parseInt(realLikeNum)>1e5?realLikeNum="100000+":"",
|
||
t&&(t.innerHTML=realLikeNum)):2===appmsg_like_type&&(t.innerHTML=dealLikeReadShow(realLikeNum));
|
||
}
|
||
}
|
||
function dealLikeReadShow(e){
|
||
if("en"==LANG)return i18n.dealLikeReadShow_en(e);
|
||
var i="";
|
||
if(parseInt(e)>1e5)i="10万+";else if(parseInt(e)>1e4&&parseInt(e)<=1e5){
|
||
var o=""+parseInt(e)/1e4,t=o.indexOf(".");
|
||
i=-1===t?o+"万":o.substr(0,t)+"."+o.charAt(t+1)+"万";
|
||
}else i=0===parseInt(e)?"":e;
|
||
return i;
|
||
}
|
||
function showReadNum(e){
|
||
var i=e||{};
|
||
if(i.show){
|
||
var o=i.readAreaDom,t=i.readNumDom;
|
||
o&&(o.style.display=i.readAreaDisplayValue);
|
||
var n=i.readNum||1,s=window.ori_send_time||window.cgiData&&window.cgiData.ori_send_time||0,l=/(WindowsNT)|(Windows NT)|(Macintosh)/i.test(navigator.userAgent),a=1566025200,m=1565971200,r=Device.os.ios||l?a:m;
|
||
parseInt(s,10)>r&&window.item_show_type&&"5"===window.item_show_type&&("en"!=LANG&&(document.getElementById("readTxt").innerText="播放"),
|
||
n=i.videouv||0),1===appmsg_like_type?(parseInt(n)>1e5?n="100000+":"",t&&(t.innerHTML=n)):2===appmsg_like_type&&(t.innerHTML=dealLikeReadShow(n),
|
||
""===t.innerHTML&&(t.innerHTML="0"));
|
||
}
|
||
}
|
||
var DomEvent=require("biz_common/dom/event.js"),Class=require("biz_common/dom/class.js"),ajax=require("biz_wap/utils/ajax.js"),Base64=require("biz_common/base64.js"),log=require("appmsg/log.js"),Tips=require("complain/tips.js"),RetryAjax=require("appmsg/retry_ajax.js"),JSAPI=require("biz_wap/jsapi/core.js"),actionString="submitMsgToTL",actionForClient="update_recommend_status",mmversion=require("biz_wap/utils/mmversion.js"),commonUtils=require("common/utils.js"),realLikeNum,clientShowType=5,i18n=require("appmsg/i18n.js"),Device=require("biz_wap/utils/device.js"),maxLikeCommentWord=200,focusTag=!1,doubleInputChar=["“”","‘’","()","《》","〈〉","「」","『』","〔〕","【】","[]","[]","{}","{}","()","<>"];
|
||
return i18n.setLikeRead_en(document.getElementById("readTxt")),{
|
||
initLikeEvent:initLikeEvent,
|
||
showLikeNum:showLikeNum,
|
||
showReadNum:showReadNum
|
||
};
|
||
});define("appmsg/share_tpl.html.js",[],function(){
|
||
return'<div class="rich_media_extra">\n <a href="<#= url #>" class="share_appmsg_container appmsg_card_context flex_context">\n <div class="flex_hd">\n <i class="share_appmsg_icon"> </i>\n </div>\n <div class="flex_bd">\n <div class="share_appmsg_title">分享给订阅用户</div>\n <p class="share_appmsg_desc">可快速分享原创文章给你的公众号订阅用户</p>\n </div>\n </a>\n</div>\n';
|
||
});define("appmsg/appmsgext.js",["appmsg/log.js","biz_wap/utils/ajax.js","rt/appmsg/getappmsgext.rt.js","biz_common/utils/monitor.js"],function(e){
|
||
"use strict";
|
||
function t(e){
|
||
function t(e){
|
||
for(var t=window.location.href,s=t.indexOf("?"),i=t.substr(s+1),n=i.split("&"),_=0;_<n.length;_++){
|
||
var a=n[_].split("=");
|
||
if(a[0].toUpperCase()==e.toUpperCase())return a[1];
|
||
}
|
||
return"";
|
||
}
|
||
var o={
|
||
biz:"",
|
||
appmsg_type:"",
|
||
mid:"",
|
||
sn:"",
|
||
idx:"",
|
||
scene:"",
|
||
title:"",
|
||
ct:"",
|
||
abtest_cookie:"",
|
||
devicetype:"",
|
||
version:"",
|
||
is_need_ticket:0,
|
||
is_need_ad:0,
|
||
comment_id:"",
|
||
is_need_reward:0,
|
||
both_ad:0,
|
||
reward_uin_count:0,
|
||
send_time:"",
|
||
msg_daily_idx:"",
|
||
is_original:0,
|
||
is_only_read:0,
|
||
req_id:"",
|
||
pass_ticket:"",
|
||
is_temp_url:0,
|
||
more_read_type:0,
|
||
rtId:"",
|
||
rtKey:"",
|
||
appmsg_like_type:1,
|
||
related_video_sn:"",
|
||
vid:"",
|
||
onSuccess:function(){},
|
||
onError:function(){}
|
||
};
|
||
for(var r in e)e.hasOwnProperty(r)&&(o[r]=e[r]);
|
||
console.info("[(评论、点赞、赞赏) 发送请求]: ",new Date),i({
|
||
url:"/mp/getappmsgext?f=json&mock="+t("mock"),
|
||
data:{
|
||
r:Math.random(),
|
||
__biz:o.biz,
|
||
appmsg_type:o.appmsg_type,
|
||
mid:o.mid,
|
||
sn:o.sn,
|
||
idx:o.idx,
|
||
scene:o.scene,
|
||
title:encodeURIComponent(o.title.htmlDecode()),
|
||
ct:o.ct,
|
||
abtest_cookie:o.abtest_cookie,
|
||
devicetype:o.devicetype.htmlDecode(),
|
||
version:o.version.htmlDecode(),
|
||
is_need_ticket:o.is_need_ticket,
|
||
is_need_ad:o.is_need_ad,
|
||
comment_id:o.comment_id,
|
||
is_need_reward:o.is_need_reward,
|
||
both_ad:o.both_ad,
|
||
reward_uin_count:o.is_need_reward?o.reward_uin_count:0,
|
||
send_time:o.send_time,
|
||
msg_daily_idx:o.msg_daily_idx,
|
||
is_original:o.is_original,
|
||
is_only_read:o.is_only_read,
|
||
req_id:o.req_id,
|
||
pass_ticket:o.pass_ticket,
|
||
is_temp_url:o.is_temp_url,
|
||
item_show_type:o.item_show_type,
|
||
tmp_version:1,
|
||
more_read_type:o.more_read_type,
|
||
appmsg_like_type:o.appmsg_like_type,
|
||
related_video_sn:o.related_video_sn,
|
||
vid:o.vid
|
||
},
|
||
type:"POST",
|
||
dataType:"json",
|
||
rtId:o.rtId,
|
||
rtKey:o.rtKey,
|
||
rtDesc:n,
|
||
async:!0,
|
||
success:function(e){
|
||
if(console.info("[(评论、点赞、赞赏) 响应请求]: ",new Date,e),s("[Appmsg] success get async data"),
|
||
"function"==typeof o.onSuccess&&o.onSuccess(e),a||"5"!==window.item_show_type||(_.setAvg(112287,34,Date.now()-window.logs.pagetime.page_begin),
|
||
_.send(),a=!0),e)try{
|
||
s("[Appmsg] success get async data, async data is: "+JSON.stringify(e));
|
||
}catch(t){}else s("[Appmsg] success get async data, async data is empty");
|
||
},
|
||
error:function(){
|
||
s("[Appmsg] error get async data, biz="+o.biz+", mid="+o.mid),"function"==typeof o.onError&&o.onError();
|
||
}
|
||
});
|
||
}
|
||
var s=e("appmsg/log.js"),i=e("biz_wap/utils/ajax.js"),n=e("rt/appmsg/getappmsgext.rt.js"),_=e("biz_common/utils/monitor.js"),a=void 0;
|
||
return{
|
||
getData:t
|
||
};
|
||
});define("appmsg/img_copyright_tpl.html.js",[],function(){
|
||
return'<span class="original_img_wrp"> \n <span class="tips_global">来自: <#=source_nickname#></span>\n</span> ';
|
||
});define("pages/video_ctrl.js",[],function(){
|
||
"use strict";
|
||
function n(n){
|
||
n=n||window;
|
||
var i=n.cgiData;
|
||
return i&&2==i.ori_status&&1==i.is_mp_video&&(i.nick_name||i.hit_username)?!0:!1;
|
||
}
|
||
function i(n){
|
||
return n=n||window,!1;
|
||
}
|
||
function e(){
|
||
return-1!=r.indexOf("&vl=1")?!1:"54"==parent.window.appmsg_type?!1:!0;
|
||
}
|
||
function t(){
|
||
return-1!=r.indexOf("&dd=1")?!1:"54"==parent.window.appmsg_type?!1:!0;
|
||
}
|
||
function o(){
|
||
var n;
|
||
if(parent==window)n=window;else try{
|
||
{
|
||
parent.window.__videoDefaultRatio;
|
||
}
|
||
n=parent.window;
|
||
}catch(i){
|
||
n=window;
|
||
}
|
||
var e=n.__videoDefaultRatio||16/9;
|
||
return"54"==n.appmsg_type?e:e;
|
||
}
|
||
var r=window.location.href;
|
||
return{
|
||
showPauseTips:t,
|
||
showVideoLike:e,
|
||
showVideoDetail:i,
|
||
showReprint:n,
|
||
getRatio:o
|
||
};
|
||
});define("pages/create_txv.js",["biz_common/utils/monitor.js","biz_wap/utils/ajax_load_js.js","pages/loadscript.js"],function(e){
|
||
"use strict";
|
||
function n(){
|
||
"function"!=typeof window.__createTxVideo&&(window.__createTxVideo=function(e){
|
||
o(e);
|
||
});
|
||
}
|
||
function o(e){
|
||
var n=function(){},o=function(){};
|
||
"function"==typeof e.onSuccess&&(o=e.onSuccess),"function"==typeof e.onError&&(n=e.onError),
|
||
r.Load({
|
||
url:c.jsUrl,
|
||
version:c.jsVersion,
|
||
useCache:!0,
|
||
win:e.win,
|
||
onSuccess:function(s){
|
||
2!=s.code&&3!=s.code||0!=s.queueIndex||(i.setSum("64728","111",1),i.setSum("64728","112",1));
|
||
var u=e.win||window,a=!0;
|
||
if(u.Txp&&"function"==typeof u.Txp.Player?(a=!0,0==s.queueIndex&&(2==s.code?i.setSum("64728","116",1):3==s.code&&i.setSum("64728","117",1),
|
||
i.send())):(a=!1,0==s.queueIndex&&(2==s.code?i.setSum("64728","114",1):3==s.code&&i.setSum("64728","115",1),
|
||
i.send())),a){
|
||
var d=t({
|
||
win:u,
|
||
options:e
|
||
});
|
||
o({
|
||
player:d
|
||
});
|
||
}else r.ClearCache({
|
||
win:u,
|
||
version:c.jsVersion,
|
||
url:c.jsUrl
|
||
}),n();
|
||
},
|
||
onError:function(n){
|
||
0==n.queueIndex&&(i.setSum("64728","111",1),i.setSum("64728","118",1),51==n.code?i.setSum("64728","119",1):52==n.code?i.setSum("64728","120",1):53==n.code&&i.setSum("64728","121",1),
|
||
i.send()),s(e);
|
||
}
|
||
});
|
||
}
|
||
function t(e){
|
||
var n=e.win||window,o=e.options,t=new n.Txp.Player({
|
||
containerId:o.containerId,
|
||
vid:o.vid,
|
||
width:o.width,
|
||
height:o.height,
|
||
autoplay:o.autoplay===!0?!0:!1,
|
||
allowFullScreen:o.allowFullScreen===!0?!0:!1
|
||
});
|
||
return t;
|
||
}
|
||
function s(e){
|
||
var n=function(){},o=function(){};
|
||
"function"==typeof e.onSuccess&&(o=e.onSuccess),"function"==typeof e.onError&&(n=e.onError);
|
||
var s=c.jsUrl;
|
||
s+=-1==s.indexOf("?")?"?"+c.customerParam+"="+c.jsVersion:"&"+c.customerParam+"="+c.jsVersion,
|
||
u({
|
||
win:e.win,
|
||
url:s,
|
||
timeout:1e4,
|
||
type:"JS",
|
||
callback:function(){
|
||
i.setSum("64728","122",1);
|
||
var s=e.win||window;
|
||
if(s.Txp&&"function"==typeof s.Txp.Player){
|
||
i.setSum("64728","124",1),i.send();
|
||
var r=t({
|
||
win:e.win,
|
||
options:e
|
||
});
|
||
o({
|
||
player:r
|
||
});
|
||
}else i.setSum("64728","123",1),i.send(),n();
|
||
},
|
||
onerror:function(e){
|
||
switch(i.setSum("64728","122",1),1*e){
|
||
case 400:
|
||
c.jsLoadState=4,i.setSum("64728","125",1);
|
||
break;
|
||
|
||
case 500:
|
||
c.jsLoadState=5,i.setSum("64728","126",1);
|
||
break;
|
||
|
||
default:
|
||
c.jsLoadState=6,i.setSum("64728","127",1);
|
||
}
|
||
i.send(),n();
|
||
}
|
||
});
|
||
}
|
||
var i=e("biz_common/utils/monitor.js"),r=e("biz_wap/utils/ajax_load_js.js"),u=e("pages/loadscript.js"),c={
|
||
customerParam:"wxv",
|
||
jsUrl:"//vm.gtimg.cn/tencentvideo/txp/js/iframe/api.js?",
|
||
jsVersion:"v1"
|
||
};
|
||
return{
|
||
createTxVideo:o,
|
||
createGlobalFunc:n
|
||
};
|
||
});define("appmsg/comment_utils.js",["appmsg/comment.js"],function(n){
|
||
"use strict";
|
||
function m(m){
|
||
1==m.comment_enabled&&(window.can_fans_comment_only=m.only_fans_can_comment,window.comment_count=m.comment_count,
|
||
window._is_fans=m.is_fans,window._logo_url=m.logo_url,window._nick_name=m.nick_name,
|
||
window.friend_comment_enabled=m.friend_comment_enabled,n("appmsg/comment.js"));
|
||
}
|
||
return{
|
||
initCommentByExtData:m
|
||
};
|
||
});define("appmsg/reward_utils.js",["appmsg/reward_entry.js","biz_wap/utils/mmversion.js","biz_common/dom/class.js","biz_common/dom/event.js"],function(e,r,n,a){
|
||
"use strict";
|
||
var i=e("appmsg/reward_entry.js"),t=e("biz_wap/utils/mmversion.js"),d=e("biz_common/dom/class.js"),s=e("biz_common/dom/event.js"),o=window.navigator.userAgent,_={
|
||
perLine:0,
|
||
hasBindResize:!1,
|
||
hasInit:!1,
|
||
pageContainerId:"img-content",
|
||
rewardInnerId:"js_reward_inner"
|
||
},w=function(e){
|
||
return document.getElementById(e);
|
||
},m=function(){
|
||
var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],r=e.pageContainerId||_.pageContainerId,n=e.rewardInnerId||_.rewardInnerId,a=window.innerWidth||document.documentElement.clientWidth;
|
||
try{
|
||
var i=w(r).getBoundingClientRect();
|
||
i.width&&(a=i.width);
|
||
}catch(t){}
|
||
var d=36;
|
||
_.perLine=Math.floor(.8*a/d);
|
||
var s=w(n);
|
||
return s&&(s.style.width=_.perLine*d+"px"),_.perLine;
|
||
},u=function(){
|
||
var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],r=e.pageContainerId||_.pageContainerId,n=e.rewardInnerId||_.rewardInnerId;
|
||
return e.can_reward&&w(r)&&w(n)?(_.hasBindResize||!function(){
|
||
_.hasBindResize=!0;
|
||
var r=window.innerWidth;
|
||
s.on(window,"resize",function(){
|
||
window.innerWidth!==r&&(r=window.innerWidth,m(e),_.hasInit&&i.render(_.perLine));
|
||
});
|
||
}(),_.perLine||m(e),_.perLine):0;
|
||
},p=function(e,r){
|
||
_.hasInit=!0;
|
||
var n=e.author_id||window.author_id;
|
||
e.reward_head_imgs=e.reward_head_imgs||[];
|
||
var m=w("js_author_name");
|
||
if(r.reward_entrance_enable_for_preview)if(t.isInMiniProgram)t.isInMiniProgram&&m&&d.removeClass(m,"rich_media_meta_link");else{
|
||
if(n||t.isAndroid){
|
||
var p=w("js_preview_reward_author");
|
||
p&&(p.style.display="block");
|
||
var h=w("js_preview_reward_author_wording");
|
||
r.reward_wording&&h&&(h.innerText=r.reward_wording,h.style.display="block");
|
||
var c=w("js_preview_reward_author_link");
|
||
c&&s.on(c,"tap",function(e){
|
||
e.preventDefault(),a("预览状态下无法操作");
|
||
});
|
||
}
|
||
if(n){
|
||
var l=w("js_preview_reward_author_avatar"),v=w("js_preview_reward_author_head");
|
||
r.reward_author_head&&l&&v&&(v.setAttribute("src",r.reward_author_head),l.style.display="block");
|
||
var g=w("js_preview_reward_link_text");
|
||
g&&(g.innerText="喜欢作者");
|
||
}else t.isAndroid&&(w("js_preview_reward_author_name").style.display="none");
|
||
}else!t.isInMiniProgram&&(o.indexOf("WindowsWechat")>-1||t.isIOS||t.isAndroid)?(i.handle(e,u({
|
||
pageContainerId:r.pageContainerId,
|
||
rewardInnerId:r.rewardInnerId,
|
||
can_reward:1==e.can_reward?!0:!1
|
||
})),m&&e.rewardsn&&e.timestamp&&(m.setAttribute("data-rewardsn",e.rewardsn),m.setAttribute("data-timestamp",e.timestamp),
|
||
m.setAttribute("data-canreward",e.can_reward)),m&&!e.can_reward&&d.removeClass(m,"rich_media_meta_link")):m&&d.removeClass(m,"rich_media_meta_link");
|
||
};
|
||
return{
|
||
init:p,
|
||
getCountPerLine:u
|
||
};
|
||
});define("biz_common/ui/imgonepx.js",[],function(){
|
||
"use strict";
|
||
return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkJDQzA1MTVGNkE2MjExRTRBRjEzODVCM0Q0NEVFMjFBIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkJDQzA1MTYwNkE2MjExRTRBRjEzODVCM0Q0NEVFMjFBIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QkNDMDUxNUQ2QTYyMTFFNEFGMTM4NUIzRDQ0RUUyMUEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QkNDMDUxNUU2QTYyMTFFNEFGMTM4NUIzRDQ0RUUyMUEiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6p+a6fAAAAD0lEQVR42mJ89/Y1QIABAAWXAsgVS/hWAAAAAElFTkSuQmCC";
|
||
}); |