import{_ as t}from"./su-tabs.801f7709.js";import{y as a,o,z as n,e,f as i,w as s,_ as l,l as p,j as r,k as m,r as u,F as g,g as c,m as d,i as _}from"./index-9aa72eed.js";import{_ as y}from"./s-empty.3adf8b58.js";import{_ as f}from"./uni-load-more.93dce372.js";import{_ as j}from"./s-layout.bffb18b8.js";import{C as b,c as x}from"./comment-item.effae27b.js";import{_ as S}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uni-badge.cc270d88.js";/* empty css                                                                */import"./form.c66b5271.js";import"./uni-rate.2f50b1a4.js";import"./su-image.b9800e15.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:10}});function v(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 b.getCommentPage(k.id,k.pagination.pageNo,k.pagination.pageSize,k.type[k.currentTab].type);0===t.code&&(console.log(t),k.pagination.list=l.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=p(d("su-tabs"),t),l=_,b=p(d("s-empty"),y),S=p(d("uni-load-more"),f),C=p(d("s-layout"),j);return e(),i(C,{title:"全部评价"},{default:s((()=>[r(n,{list:k.type,scrollable:!1,onChange:v,current:k.currentTab},null,8,["list","current"]),r(l,{class:"ss-m-t-20"},{default:s((()=>[(e(!0),m(g,null,u(k.pagination.list,(t=>(e(),i(l,{class:"list-item",key:t},{default:s((()=>[r(x,{item:t},null,8,["item"])])),_:2},1024)))),128))])),_:1}),0===k.pagination.total?(e(),i(b,{key:0,text:"暂无数据",icon:"/static/data-empty.png"})):c("",!0),k.pagination.total>0?(e(),i(S,{key:1,status:k.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:N},null,8,["status"])):c("",!0)])),_:1})}}},[["__scopeId","data-v-8e4f777b"]]);export{k as default};
