import{t as e,G as a,H as s,o as l,j as t,w as r,h as c,i as o,I as u,l as i,e as n,F as p,k as d,z as m,f as _,m as f,p as v,B as y,a as k,O as j,u as x,A as g}from"./index-d4baa715.js";import{_ as h}from"./uv-rate.37db139e.js";import{u as C}from"./useImage.bf0418c3.js";import{_ as b}from"./_plugin-vue_export-helper.1b428a4d.js";import{r as S}from"./goods.bed5081e.js";import{H as w}from"./index.704ebef3.js";import{E as I}from"./index.7dcbea25.js";import{a7 as R}from"./images.f0a6f614.js";import{R as z}from"./index.51e1f7e9.js";import{u as B}from"./useScroll.dcb46f58.js";import"./uv-icon.b5ddbe11.js";import"./uv-icon.vue_vue_type_style_index_0_scoped_23936b10_lang.7145f5b2.js";import"./utils.052a93d2.js";import"./config.6730da78.js";const H=b({__name:"reply",props:["data"],setup(k){const j=k,{data:x}=e(j),{preview:g}=C();function b(e,a){g({current:e,urls:a})}return(e,k)=>{var j;const g=v,C=y,S=a(s("uv-rate"),h);return l(),t(C,{class:f({reply:!0,noPic:!(null==(j=o(x))?void 0:j.pics)})},{default:r((()=>[c(C,{class:"reply-content"},{default:r((()=>[c(C,{class:"reply-warp"},{default:r((()=>[c(C,{class:"reply-user"},{default:r((()=>[c(C,{class:"reply-user-pic"},{default:r((()=>[c(g,{class:"img",src:o(x).avatar,onClick:k[0]||(k[0]=e=>b(0,[o(x).avatar]))},null,8,["src"])])),_:1}),c(C,{class:"reply-user-name"},{default:r((()=>[c(C,{class:"name"},{default:r((()=>[u(i(o(x).nickname),1)])),_:1}),c(C,{class:"productScore"},{default:r((()=>[c(S,{count:"5",value:o(x).productScore,readonly:"",size:"26rpx",gutter:"1","active-color":"#ee6d46","inactive-color":"#999999"},null,8,["value"])])),_:1})])),_:1})])),_:1}),c(C,{class:"reply-time"},{default:r((()=>[u(i(o(x).createTime),1)])),_:1})])),_:1}),c(C,{class:"reply-text"},{default:r((()=>[u(i(o(x).comment),1)])),_:1}),o(x).pics&&o(x).pics.filter((e=>!!e)).length>0?(l(),t(C,{key:0,class:"reply-pic flex flex-ai__center"},{default:r((()=>[(l(!0),n(p,null,d(o(x).pics.filter((e=>!!e)),((e,a)=>(l(),t(g,{key:a,class:"image",src:e,onClick:e=>b(a,o(x).pics)},null,8,["src","onClick"])))),128))])),_:1})):m("",!0),c(C,{class:"reply-sku"},{default:r((()=>[u("规格："+i(o(x).sku),1)])),_:1}),o(x).merchantReplyContent?(l(),t(C,{key:1,class:"reply-merchant"},{default:r((()=>[_("b",null,"商家回复："),u(i(o(x).merchantReplyContent),1)])),_:1})):m("",!0)])),_:1})])),_:1},8,["class"])}}},[["__scopeId","data-v-a380bc2f"]]),P=b({__name:"goodsReply",setup(e){const{scrollTop:_}=B(),v=k([]),h=k(0),C=k(0),b=k(0),P=k([{id:0,text:"全部"},{id:1,text:"好评"},{id:2,text:"中评"},{id:3,text:"差评"},{id:4,text:"有图"}]),{getParams:T,goBack:A}=x(),E=async e=>{let a={id:C.value};e&&(a.type=e),v.value=await S(a),v.value.records.map((e=>(e.sku=e.sku.split(",").join("+"),e))),e||(h.value=v.value.total)};return j((e=>{const a=T(e);C.value=a.id,E()})),(e,k)=>{const j=g,x=y,C=a(s("reply"),H);return l(),n(p,null,[c(w,{"scroll-top":o(_)},{default:r((()=>[u("评价")])),_:1},8,["scroll-top"]),c(x,{class:"replys"},{default:r((()=>[c(x,{class:"tabs"},{default:r((()=>[(l(!0),n(p,null,d(P.value,(e=>(l(),t(x,{class:f(["item",e.id===b.value&&"on"]),key:e.id,onClick:a=>{return s=e.id,b.value=s,void E(s);var s}},{default:r((()=>[u(i(e.text)+" ",1),0===e.id?(l(),t(j,{key:0},{default:r((()=>[u("("+i(h.value)+")",1)])),_:1})):m("",!0)])),_:2},1032,["class","onClick"])))),128))])),_:1}),v.value.records&&v.value.records.length>0?(l(),t(x,{key:0,class:"reply-card"},{default:r((()=>[(l(!0),n(p,null,d(v.value.records,((e,a)=>(l(),t(C,{key:a,data:e},null,8,["data"])))),128))])),_:1})):(l(),t(I,{key:1,iconSrc:o(R)},{default:r((()=>[u(" 暂无评论~ ")])),_:1},8,["iconSrc"]))])),_:1}),c(z,{"scroll-top":o(_)},null,8,["scroll-top"])],64)}}},[["__scopeId","data-v-58ab3cee"]]);export{P as default};
