|
@@ -1186,6 +1186,12 @@ $(function(){
|
|
|
//window.location.href = '/jyapp/free/transfer?url='+encodeURIComponent($(this).attr("href"));
|
|
|
JyObj.openExternalLink($(this).attr("href"),"查看原文");
|
|
|
});
|
|
|
+ //深度阅读
|
|
|
+ $.post("/jyapp/info/shareTip",{id:{{.T.obj._id}}},function(r){
|
|
|
+ if(r.status){
|
|
|
+ deepReading();
|
|
|
+ }
|
|
|
+ });
|
|
|
})
|
|
|
function isFollow(){
|
|
|
$.post("/jyapp/follow/checkCStatus",{pcname:{{.T.obj.projectname}},pccode:{{.T.obj.projectcode}}},function(fd){
|
|
@@ -1208,6 +1214,78 @@ function openAttachment(o){
|
|
|
event.preventDefault();
|
|
|
}
|
|
|
}
|
|
|
+function deepReading(){
|
|
|
+ var infoOffsetTop = $(".info").offset().top;
|
|
|
+ //正文高度
|
|
|
+ var contentHeight = $(".content").height() + $(".content").offset().top - $(".info").offset().top;
|
|
|
+ //窗口高度
|
|
|
+ var windowHeight = $(window).height();
|
|
|
+ //可视区域高度
|
|
|
+ var clientHeight = document.body.clientHeight - $(".app-layout-header").outerHeight();
|
|
|
+ //总屏数
|
|
|
+ var countScreen = Math.floor(contentHeight / clientHeight);
|
|
|
+ //console.info("countScreen---"+countScreen)
|
|
|
+ if(contentHeight <= 0){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var screenObj = {};
|
|
|
+ var depthReadTime = setInterval(function(){
|
|
|
+ var thisScrollTop = $(window).scrollTop();
|
|
|
+ var currentScreen = -1;
|
|
|
+ for(var i=1;i<=countScreen;i++){
|
|
|
+ if(thisScrollTop >= i-1*clientHeight && thisScrollTop <= i*clientHeight){
|
|
|
+ currentScreen = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(currentScreen == -1){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(typeof(screenObj[currentScreen]) == "undefined"){
|
|
|
+ screenObj[currentScreen] = 1;
|
|
|
+ }else{
|
|
|
+ screenObj[currentScreen] = screenObj[currentScreen] + 1;
|
|
|
+ }
|
|
|
+ var isPassShow = false;
|
|
|
+ var gtTenCount = 0;
|
|
|
+ for(var i=1;i<=countScreen;i++){
|
|
|
+ if(typeof(screenObj[i]) == "undefined" || screenObj[i] <= 3){
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ //如果只有一屏,30秒
|
|
|
+ if(countScreen == 1){
|
|
|
+ if(screenObj[i] < 30){
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }else if(countScreen == 2){
|
|
|
+ if(screenObj[i] < 10){
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(screenObj[i] >= 10){
|
|
|
+ gtTenCount++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //
|
|
|
+ if(i == countScreen){
|
|
|
+ if(countScreen <= 2){
|
|
|
+ isPassShow = true;
|
|
|
+ }else{
|
|
|
+ if(screenObj[i] >= 10 && gtTenCount >= Math.ceil(countScreen / 2)){
|
|
|
+ isPassShow = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //console.info(screenObj)
|
|
|
+ //console.info(gtTenCount+"----"+countScreen)
|
|
|
+ if(isPassShow){
|
|
|
+ clearInterval(depthReadTime);
|
|
|
+ $.post("/jyapp/info/shareTip",{reqType:"save",id:{{.T.obj._id}}});
|
|
|
+ alert("分享");
|
|
|
+ }
|
|
|
+ },1000);
|
|
|
+}
|
|
|
</script>
|
|
|
{{include "/common/baiducc.html"}}
|
|
|
</body>
|