import{_ as a}from"./uv-navbar.59911b60.js";import{l as e,g as s,o as t,c as l,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 _,n as v,i as m,d as f,f as y,K as k}from"./index-d76b1e7a.js";import{r as x,o as j,u as g}from"./useRouter.2bdb47a0.js";import{_ as b}from"./uv-rate.c2fbb69c.js";import{u as C}from"./useImage.4a4e6b12.js";import{_ as w}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as h}from"./layout.f8e9d577.js";import{r as I}from"./api.9246a192.js";import{E as S}from"./index.81294ba6.js";import{e as E}from"./icon-dpj.9a812dc8.js";import"./uv-status-bar.66ab7702.js";/* empty css                                                                      */import"./uv-icon.5730d4d2.js";import"./uv-navbar.vue_vue_type_style_index_0_scoped_8d8b32e4_lang.3fde2b65.js";const F=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=m,C=f,w=x(s("uv-rate"),b);return t(),l(C,{class:v({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?(t(),l(C,{key:0,class:"reply-pic flex flex-ai__center"},{default:r((()=>[(t(!0),n(d,null,p(c(k).pics,((a,e)=>(t(),l(j,{key:e,class:"image",src:a,onClick:a=>g(e,c(k).pics)},null,8,["src","onClick"])))),128))])),_:1})):_("",!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 m=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(),T=async a=>{let e={id:C.value};var s;a&&(e.type=a),m.value=await(s=e,I.get(`/product/reply/list/${s.id}`,s,{login:!1})),m.value.records.map((a=>(a.sku=a.sku.split(",").join("+"),a))),a||(b.value=m.value.total)};return j((a=>{const e=P(a);C.value=e.id,T()})),(e,y)=>{const j=x(s("uv-navbar"),a),g=k,C=f,I=x(s("reply"),F),P=x(s("layout"),h);return t(),l(P,{class:"replys"},{default:r((()=>[u(j,{fixed:!1,title:"评价","left-arrow":"",onLeftClick:c(R)},null,8,["onLeftClick"]),u(C,{class:"tabs"},{default:r((()=>[(t(!0),n(d,null,p(L.value,(a=>(t(),l(C,{class:v(["item",a.id===w.value&&"on"]),key:a.id,onClick:e=>{return s=a.id,w.value=s,void T(s);var s}},{default:r((()=>[o(i(a.text)+" ",1),0===a.id?(t(),l(g,{key:0},{default:r((()=>[o("("+i(b.value)+")",1)])),_:1})):_("",!0)])),_:2},1032,["class","onClick"])))),128))])),_:1}),m.value.records&&m.value.records.length>0?(t(),l(C,{key:0,class:"reply-card"},{default:r((()=>[(t(!0),n(d,null,p(m.value.records,((a,e)=>(t(),l(I,{key:e,data:a},null,8,["data"])))),128))])),_:1})):(t(),l(S,{key:1,iconSrc:c(E)},{default:r((()=>[o(" 暂无评论~ ")])),_:1},8,["iconSrc"]))])),_:1})}}},[["__scopeId","data-v-c77ef617"]]);export{L as default};
