1 |
- import{_ as t}from"./su-tabs.a383f815.js";import{y as a,o as n,z as o,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-b48a414d.js";import{_ as y}from"./s-empty.6d3471cc.js";import{_ as f}from"./uni-load-more.647920f4.js";import{_ as j}from"./s-layout.d6dcdc81.js";import{C as b,c as x}from"./comment-item.90dd3105.js";import{_ as S}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uni-badge.78cdef34.js";/* empty css */import"./phone-international-input.feef99c7.js";import"./uni-rate.ae6b2b33.js";import"./su-image.900c884d.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 h(t){k.currentTab=t.index,k.pagination.pageNo=1,k.pagination.list=[],k.pagination.total=0,v()}async function v(){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 w(){"noMore"!==k.loadStatus&&(k.pagination.pageNo++,v())}return n((t=>{k.id=t.id,v()})),o((()=>{w()})),(a,n)=>{const o=p(d("su-tabs"),t),l=_,b=p(d("s-empty"),y),S=p(d("uni-load-more"),f),v=p(d("s-layout"),j);return e(),i(v,{title:"全部评价"},{default:s((()=>[r(o,{list:k.type,scrollable:!1,onChange:h,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:w},null,8,["status"])):c("",!0)])),_:1})}}},[["__scopeId","data-v-8e4f777b"]]);export{k as default};
|