import{_ as a}from"./uv-navbar.31c484ad.js";import{l as e,g as s,o as l,c as t,w as r,a as u,u as c,h as o,t as i,b as n,F as d,r as p,m as f,n as m,i as v,d as _,f as y,B as k}from"./index-3714412c.js";import{r as x,o as j,u as g}from"./useRouter.f44141c1.js";import{_ as b}from"./uv-rate.c26b1e64.js";import{u as C}from"./useImage.b2ecb083.js";import{_ as w}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as h}from"./layout.99605750.js";import{r as I}from"./api.966d6934.js";import{E as S}from"./index.573aa2d3.js";import{e as B}from"./icon-dpj.9a812dc8.js";import"./uv-status-bar.b515a02d.js";import"./uv-icon.c593f91d.js";const E=w({__name:"reply",props:["data"],setup(a){const y=a,{data:k}=e(y),{preview:j}=C();function g(a,e){j({current:a,urls:e})}return(a,e)=>{var y;const j=v,C=_,w=x(s("uv-rate"),b);return l(),t(C,{class:m({reply:!0,noPic:!(null==(y=c(k))?void 0:y.pics)})},{default:r((()=>[u(C,{class:"reply-content"},{default:r((()=>[u(C,{class:"reply-warp"},{default:r((()=>[u(C,{class:"reply-user"},{default:r((()=>[u(C,{class:"reply-user-pic"},{default:r((()=>[u(j,{class:"img",src:c(k).avatar,onClick:e[0]||(e[0]=a=>g(0,[c(k).avatar]))},null,8,["src"])])),_:1}),u(C,{class:"reply-user-name"},{default:r((()=>[u(C,{class:"name"},{default:r((()=>[o(i(c(k).nickname),1)])),_:1}),u(C,{class:"productScore"},{default:r((()=>[u(w,{count:"5",value:c(k).productScore,readonly:"",size:"26rpx",gutter:"1","active-color":"#ee6d46","inactive-color":"#999999"},null,8,["value"])])),_:1})])),_:1})])),_:1}),u(C,{class:"reply-time"},{default:r((()=>[o(i(c(k).createTime),1)])),_:1})])),_:1}),u(C,{class:"reply-text"},{default:r((()=>[o(i(c(k).comment),1)])),_:1}),c(k).pics&&c(k).pics.length>0?(l(),t(C,{key:0,class:"reply-pic flex flex-ai__center"},{default:r((()=>[(l(!0),n(d,null,p(c(k).pics,((a,e)=>(l(),t(j,{key:e,class:"image",src:a,onClick:a=>g(e,c(k).pics)},null,8,["src","onClick"])))),128))])),_:1})):f("",!0),u(C,{class:"reply-sku"},{default:r((()=>[o("规格："+i(c(k).sku),1)])),_:1})])),_:1})])),_:1},8,["class"])}}},[["__scopeId","data-v-b03bba9e"]]);const L=w({__name:"goodsReply",setup(e){const v=y([]),b=y(0),C=y(0),w=y(0),L=y([{id:0,text:"全部"},{id:1,text:"好评"},{id:2,text:"中评"},{id:3,text:"差评"},{id:4,text:"有图"}]),{getParams:P,goBack:R}=g(),z=async a=>{let e={id:C.value};var s;a&&(e.type=a),v.value=await(s=e,I.get(`/product/reply/list/${s.id}`,s,{login:!1})),v.value.records.map((a=>(a.sku=a.sku.split(",").join("+"),a))),a||(b.value=v.value.total)};return j((a=>{const e=P(a);C.value=e.id,z()})),(e,y)=>{const j=x(s("uv-navbar"),a),g=k,C=_,I=x(s("reply"),E),P=x(s("layout"),h);return l(),t(P,{class:"replys"},{default:r((()=>[u(j,{fixed:!1,title:"评价","left-arrow":"",onLeftClick:c(R)},null,8,["onLeftClick"]),u(C,{class:"tabs"},{default:r((()=>[(l(!0),n(d,null,p(L.value,(a=>(l(),t(C,{class:m(["item",a.id===w.value&&"on"]),key:a.id,onClick:e=>{return s=a.id,w.value=s,void z(s);var s}},{default:r((()=>[o(i(a.text)+" ",1),0===a.id?(l(),t(g,{key:0},{default:r((()=>[o("("+i(b.value)+")",1)])),_:1})):f("",!0)])),_:2},1032,["class","onClick"])))),128))])),_:1}),v.value.records&&v.value.records.length>0?(l(),t(C,{key:0,class:"reply-card"},{default:r((()=>[(l(!0),n(d,null,p(v.value.records,((a,e)=>(l(),t(I,{key:e,data:a},null,8,["data"])))),128))])),_:1})):(l(),t(S,{key:1,iconSrc:c(B)},{default:r((()=>[o(" 暂无评论~ ")])),_:1},8,["iconSrc"]))])),_:1})}}},[["__scopeId","data-v-04415fb1"]]);export{L as default};
