1import{a as L,q as y,ak as w,cd as S,cc as z,dk as k,bW as N,b as D,am as P}from"./2IVcBEvn.js";import{u as x,b as B}from"./MnK3tiZ7.js";import{I as M}from"./BaVixOtI.js";import{I as U}from"./7ErN5zLn.js";import{S as I}from"./C1UAHYBq.js";import{R as O}from"./BzSgFW8C.js";import{a as T}from"./miGJeqPk.js";import{S as r}from"./BVWy7x8N.js";import{P as E}from"./Byrc-fgZ.js";import{J as F,K as H}from"./BFqoTG8u.js";import{y as _,C as e,U as i,j}from"./DF_IX-sE.js";import{C as q}from"./wRDk9fNZ.js";import"./B4PuJuc4.js";const G="commentMobile",K="pageContent",V="head",$="title",J="appName",W="appBrief",Q="appIcon",X="skeletonIcon",Y="skeletonName",Z="skeletonBrief",ee="rateRow",te="rateLabel",ne="rating",ae="ratingIcon",oe="skeletonRateLabel",se="skeletonRateInput",ce="content",le="input",re="skeletonInput",ie="footer",pe="button",me="confirm",ue="loadingIcon",t={commentMobile:G,pageContent:K,head:V,title:$,appName:J,appBrief:W,appIcon:Q,skeletonIcon:X,skeletonName:Y,skeletonBrief:Z,rateRow:ee,rateLabel:te,rating:ne,ratingIcon:ae,skeletonRateLabel:oe,skeletonRateInput:se,content:ce,input:le,skeletonInput:re,footer:ie,button:pe,confirm:me,loadingIcon:ue},p={delayDisplayTime:0,style:{transitionDuration:"50ms"}},de=Object.assign(_({props:{packageId:{type:String,required:!0}},setup(g){const u=L(),d=g.packageId,v=y(),{t:o}=w(),{toast:b}=T(),n=j({rating:0,content:""}),{data:h,isLoading:A}=x(q.getAppData(d)),{execute:R,isLoading:f}=S(F.postCommentApp(d),{method:"POST"},{immediate:!1}),C=async s=>{if(!s)return;const a=await k.getToken();if(console.log("cookie token",a),!a){u.callHook("login:show");return}const m=new k({baseURL:"https://account.api.lazycat.cloud/api"});try{await m.current()}catch(l){if(l.errorCode===0){u.callHook("login:show");return}}return await s()},c={è¯è®ºå
容ä¸å¾ä¸ºç©º:o("lzc_as_m.runtime.components.screens.app.detail.comment_content_not_empty","è¯è®ºå
容ä¸å¾ä¸ºç©º"),comment_failed:s=>o("lzc_as_m.runtime.components.screens.app.detail.comment_failed","è¯è®ºå¤±è´¥ {error}",{error:s}),æäº¤:o("lzc_as_m.runtime.components.screens.app.detail.submit","æäº¤"),æªç¥åºç¨:o("lzc_as_m.runtime.components.screens.app.detail.unknown_app","æªç¥åºç¨"),å
¶ä»æ¥æº:o("lzc_as_m.runtime.components.screens.app.detail.other_sources","å
¶ä»æ¥æº"),说ç¹ä»ä¹å¢:o("lzc_as_m.runtime.components.screens.app.detail.what_should_i_say","说ç¹ä»ä¹å¢~"),æå¡å¨é误:o("lzc_as_m.runtime.components.screens.app.detail.server_error","ï¼æå¡é误"),ç¹å»è¯å:o("lzc_as_m.runtime.components.screens.app.detail.click_to_rate","ç¹å»è¯å")};return()=>{const s=h.value;return e("div",{class:["page_container",t.commentMobile]},[e(E,null,null),e(H,null,null),A.value?e("div",{class:t.pageContent},[e("div",{class:t.head},[e("div",{class:t.appIcon},[e(r,i(p,{class:t.skeletonIcon}),null)]),e("div",{class:t.title},[e(r,i(p,{class:t.skeletonName}),null),e(r,i(p,{class:t.skeletonBrief}),null)])]),e(I,null,null),e("div",{class:t.rateRow},[e(r,i(p,{class:t.skeletonRateLabel}),null),e(r,i(p,{class:t.skeletonRateInput}),null)]),e("div",{class:t.content},[e(r,i(p,{class:t.skeletonInput}),null)])]):e("div",{class:t.pageContent},[e("div",{class:t.head},[e("div",{class:t.appIcon},[e("img",{src:B(s?.version?.icon_path)??M},null)]),e("div",{class:t.title},[e("p",{class:t.appName},[s?.information?.name??c.æªç¥åºç¨]),e("p",{class:t.appBrief},[s?.information?.brief||"--"])])]),e(I,null,null),e("div",{class:t.rateRow},[e("div",{class:t.rateLabel},[c.ç¹å»è¯å]),e("div",{class:t.rating},[e(O,{class:t.ratingIcon,value:n.value.rating??0,readonly:!1,color:"#4A77FF",secondaryColor:"#D5D5DA",onChangeValue:a=>n.value.rating=a},null)])]),e("div",{class:t.content},[e("textarea",{class:t.input,placeholder:c.说ç¹ä»ä¹å¢,value:n.value.content??"",onInput:a=>{const{value:m=""}=a.target;n.value.content=m}},null)])]),e("div",{class:t.footer},[e("button",{disabled:f.value||n.value.content.length<=0||n.value.rating<=0,class:[t.button,t.confirm],onClick:()=>C(async()=>{const{content:a="",rating:m=0}=n.value;try{if(!a)throw new Error(c.è¯è®ºå
容ä¸å¾ä¸ºç©º);await R({data:{score:m,content:a}}),n.value.rating=0,n.value.content="",v.replace(N(`/detail/${d}`))}catch(l){console.error("add comment failed",l),b(c.comment_failed(l?.response?.data?.message??l?.message??l??c.æå¡å¨é误),"error")}})},[c.æäº¤,f.value&&e(z,{class:t.loadingIcon,src:U,size:"0.8rem"},null)])])])}}}),{__name:"LzcAsScreensAppComment"}),we=_({setup(){const u=D().params.package;return()=>e("div",null,[e(P,{name:"secondary"},{default:()=>[e(de,{packageId:u},null)]})])}});
1export{we as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.