You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
17 KiB

1 year ago
  1. var t=Object.defineProperty,e=Object.prototype.hasOwnProperty,o=Object.getOwnPropertySymbols,m=Object.prototype.propertyIsEnumerable,n=(e,o,m)=>o in e?t(e,o,{enumerable:!0,configurable:!0,writable:!0,value:m}):e[o]=m,c=(t,c)=>{for(var i in c||(c={}))e.call(c,i)&&n(t,i,c[i]);if(o)for(var i of o(c))m.call(c,i)&&n(t,i,c[i]);return t};import{p as i,m as l,x as a,v as s,K as A,T as d,G as p,c as I,t as h,u as g,s as r,F as w,q as C,y as R,L as E,B as G,w as u,r as b,o as B}from"./vendor.269b2875.js";import{c as k,a as N}from"./tool.8db46c9c.js";import{_ as U,a as M}from"./dushu-yizan@2x.b53044a0.js";import{_ as S}from"./kongzhuangtai-xiaoxi@2x.a1460c5e.js";const T={name:"readComment",components:{},props:{readCommentAddShow:Boolean,commentListAddShow:Boolean,ResourceId:String,cmtPath:String,topH:Number},setup(t){const{proxy:e}=G(),o=a({ebookId:"",commentTotalRows:0,commentList:[],isUpdatedate:[],commentType:1,commentTxtShow:!1,cmtPath:"",commentContent:"",textareaShow:!1,autoFocus:!1,contlength:0,reportPopShow:!1,reportIndex:0,pageIndex:1,hasNextPage:!1,iphonex:!1,isEmpty:!1,totalPages:0});s((()=>{if(o.ebookId=e.$route.query.id,"ResourceComment"===e.$route.name){const t=e.$route.query.commentId;n(t,10)}else{const t=e.$route.query.id;n(t,2)}})),A((()=>o.commentContent),(t=>{o.contlength=t.length}));let m=()=>{if("ResourceComment"===e.$route.name){const t=e.$route.query.commentId;n(t,10)}else{const t=e.$route.query.id;n(t,2)}},n=(o,m)=>{const n=e;n.$http.get(e.$API.GETCOMMENTPAGES,{params:{Id:o,Where:"",Order:"Date_desc",pageIndex:n.pageIndex,pageSize:m}}).then((e=>{if(200==e.type){let o=t.topH;document.querySelector(".listWrap")&&(document.querySelector(".listWrap").style.paddingTop=o+"px",document.querySelector(".listWrap").style.height=window.screen.height-o+"px"),window.scrollTo(0,0);let m=e.data;if(n.isEmpty=!1,n.hasNextPage=e.hasNextPage,n.totalPages=e.pages,0==m.length)return n.isEmpty=!0,n.hasNextPage=!0,!1;n.isEmpty=!1,n.pageIndex<=1?(n.commentList=m,m.length<20&&(n.hasNextPage=!0)):n.commentList=n.commentList.concat(m),n.commentTotalRows=e.totalRows,n.commentList.forEach(((t,e)=>{n.isUpdatedate.push(k(t.isUpdatedate))}))}else d(e.content)})).catch((t=>{}))},i=o=>{const n=e;if(N(e,e.$dialog),null==t.cmtPath)return d("评论类型不能为空"),!1;let c={model:{CmtPath:t.cmtPath,CmtType:0,BelongId:n.ebookId,CmtContent:n.commentContent,Source:1},BelongId:t.ResourceId};n.$http.post(e.$API.ADDCOMMENT,c,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((t=>{200==t.type?(n.commentContent="",n.pageIndex=1,n.commentList=[],n.commentTxtShow=!1,m(),d("评论成功")):d(t.content)})).catch((t=>{}))},l=()=>{const o=e;if(N(e,e.$dialog),null==t.cmtPath)return d("评论类型不能为空"),!1;let n={model:{CmtPath:t.cmtPath,Source:0,CmtType:1,BelongId:o.commentList[o.commentIndex].belongId,CmtContent:o.commentContent,CmtLinkId:o.commentList[o.commentIndex].id,CmtLinkContent:o.commentList[o.commentIndex].cmtContent,CmtLinkClnt:o.commentList[o.commentIndex].clntId,CmtLinkCust:o.commentList[o.commentIndex].custId}};o.$http.post(e.$API.ADDCOMMENTBACK,n,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((t=>{200==t.type&&(o.commentContent="",o.commentList=[],o.pageIndex=1,o.commentTxtShow=!1,m(),d("评论成功"))})).catch((t=>{}))},I=()=>{const t=e;let o={model:{BelongId:t.commentList[t.reportIndex].id,RepPath:"comment"}};t.$http.post(e.$API.ADDREPORT,o,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((t=>{200==t.type&&d("举报成功")})).catch((t=>{}))};return c(c({},p(o)),{GetCommentPages:n,commentTxtPopup:(t,o)=>{const m=e;N(e,e.$dialog),m.commentTxtShow=!0,m.textareaShow=!1,m.commentType=t,0==t&&(m.commentIndex=o),m.$nextTick((()=>{m.textareaShow=!0,m.autoFocus=!0}))},AddComment:i,newAddComment:()=>{const t=e;if(N(e,e.$dialog),""==t.commentContent)return d("评论内容不能为空"),!1;t.commentType?("ResourceComment"===e.$route.name?t.ebookId=e.$route.query.commentId:t.ebookId=e.$route.query.id,i(t.ebookId)):l()},AddCommentBack:l,openPopup:t=>{const o=e;N(e,e.$dialog),o.repo