import{_ as t}from"./su-tabs.DxDBdwpZ.js";import{v as a,o,x as n,r as i,e,f as s,w as l,j as p,k as r,l as m,m as u,F as g,g as c,i as d}from"./index-CWyPMHxb.js";import{_ as f}from"./s-empty.Bcpb-H16.js";import{_ as y}from"./uni-load-more.jm2vzrn1.js";import{S as _}from"./s-layout.CUgh1tQ8.js";import{C as j,c as b}from"./comment-item.DMFu4owD.js";import{_ as S}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{l as x}from"./lodash.default.DzSjahpS.js";import"./uni-rate.BXeuATfq.js";import"./su-image.CIjDVZiE.js";import"./min.DNgEVQjj.js";const k=S({__name:"list",setup(S){const k=a({id:0,type:[{type:0,name:"全部"},{type:1,name:"好评"},{type:2,name:"中评"},{type:3,name:"差评"}],currentTab:0,loadStatus:"",pagination:{list:[],total:0,pageNo:1,pageSize:8}});function h(t){k.currentTab=t.index,k.pagination.pageNo=1,k.pagination.list=[],k.pagination.total=0,C()}async function C(){k.loadStatus="loading";let t=await j.getCommentPage(k.id,k.pagination.pageNo,k.pagination.pageSize,k.type[k.currentTab].type);0===t.code&&(k.pagination.list=x.concat(k.pagination.list,t.data.list),k.pagination.total=t.data.total,k.loadStatus=k.pagination.list.length<k.pagination.total?"more":"noMore")}function N(){"noMore"!==k.loadStatus&&(k.pagination.pageNo++,C())}return o((t=>{k.id=t.id,C()})),n((()=>{N()})),(a,o)=>{const n=i(e("su-tabs"),t),j=d,S=i(e("s-empty"),f),x=i(e("uni-load-more"),y),C=i(e("s-layout"),_);return p(),s(C,{title:"全部评论"},{default:l((()=>[r(n,{list:k.type,scrollable:!1,onChange:h,current:k.currentTab},null,8,["list","current"]),r(j,{class:"ss-m-t-20"},{default:l((()=>[(p(!0),m(g,null,u(k.pagination.list,(t=>(p(),s(j,{class:"list-item",key:t},{default:l((()=>[r(b,{item:t},null,8,["item"])])),_:2},1024)))),128))])),_:1}),0===k.pagination.total?(p(),s(S,{key:0,text:"暂无数据",icon:"/static/data-empty.png"})):c("",!0),k.pagination.total>0?(p(),s(x,{key:1,"icon-type":"auto",status:k.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:N},null,8,["status"])):c("",!0)])),_:1})}}},[["__scopeId","data-v-fef98b1e"]]);export{k as default};
