import{_ as t}from"./su-tabs.251eecb0.js";import{C as a,p as o,D as e,o as s,e as n,w as i,s as l,_ as p,b as r,i as c,f as m,h as d,F as u,k as _,d as g,m as f}from"./index-520dfaee.js";import{_ as y}from"./s-empty.b6c95127.js";import{_ as j}from"./uni-load-more.ba4f287c.js";import{a as b}from"./s-layout.5146c957.js";import{c as x}from"./comment-item.4d4387d7.js";import{_ as I}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css                                                                */import"./uni-rate.b2e08c50.js";import"./su-image.ba5fb633.js";const k=I({__name:"list",setup(I){const k={data:[],current_page:1,total:1,last_page:1},w=a({list:[],type:[],currentTab:0,pagination:{data:[],current_page:1,total:1,last_page:1},commentId:0,code:"all"});function S(t){w.pagination=k,w.currentTab=t.index,w.code=t.code,v(w.commentId,t.code)}async function v(t,a,o=1,e=6){w.loadStatus="loading";let s=await l.$api.goods.comment(t,{type:a,list_rows:e,page:o});if(1===s.code){let t=p.concat(w.pagination.data,s.data.data);w.pagination={...s.data,data:t},w.pagination.current_page<w.pagination.last_page?w.loadStatus="more":w.loadStatus="noMore"}}function T(){"noMore"!==w.loadStatus&&v(w.commentId,w.code,w.pagination.current_page+1)}return o((t=>{w.commentId=t.id,async function(t){const{code:a,data:o}=await l.$api.goods.getType(t);1===a&&(w.type=o)}(w.commentId),v(w.commentId)})),e((()=>{T()})),(a,o)=>{const e=r(g("su-tabs"),t),l=f,p=r(g("s-empty"),y),I=r(g("uni-load-more"),j),k=r(g("s-layout"),b);return s(),n(k,{title:"全部评价"},{default:i((()=>[c(e,{list:w.type,scrollable:!1,onChange:S,current:w.currentTab},null,8,["list","current"]),c(l,{class:"ss-m-t-20"},{default:i((()=>[(s(!0),m(u,null,d(w.pagination.data,(t=>(s(),n(l,{class:"list-item",key:t},{default:i((()=>[c(x,{item:t},null,8,["item"])])),_:2},1024)))),128))])),_:1}),0===w.pagination.total?(s(),n(p,{key:0,text:"暂无数据",icon:"/static/data-empty.png"})):_("",!0),w.pagination.total>0?(s(),n(I,{key:1,status:w.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:T},null,8,["status"])):_("",!0)])),_:1})}}},[["__scopeId","data-v-f70d8a81"]]);export{k as default};
