pages-goods-comment-list.ab68c2ef.js 2.2 KB

1
  1. import{_ as t}from"./su-tabs.cd675673.js";import{z as a,o,A as n,f as i,g as e,w as s,ai as l,_ as p,m as r,k as m,l as u,r as g,F as c,i as d,n as _,j as y}from"./index-a116b7fa.js";import{_ as f}from"./s-empty.4d7f5239.js";import{_ as j}from"./uni-load-more.2682655d.js";import{_ as b}from"./s-layout.4ae51839.js";import{c as x}from"./comment-item.a0333778.js";import{_ as S}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uni-badge.9d757a16.js";/* empty css */import"./phone-international-input.b9f6c8e6.js";import"./useGoods.6b315a78.js";import"./uni-rate.540043c1.js";import"./su-image.cf5517c4.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,h()}async function h(){k.loadStatus="loading";let t=await l.getCommentPage(k.id,k.pagination.pageNo,k.pagination.pageSize,k.type[k.currentTab].type);0===t.code&&(console.log(t),k.pagination.list=p.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 z(){"noMore"!==k.loadStatus&&(k.pagination.pageNo++,h())}return o((t=>{k.id=t.id,h()})),n((()=>{z()})),(a,o)=>{const n=r(_("su-tabs"),t),l=y,p=r(_("s-empty"),f),S=r(_("uni-load-more"),j),h=r(_("s-layout"),b);return i(),e(h,{title:"全部评价"},{default:s((()=>[m(n,{list:k.type,scrollable:!1,onChange:v,current:k.currentTab},null,8,["list","current"]),m(l,{class:"ss-m-t-20"},{default:s((()=>[(i(!0),u(c,null,g(k.pagination.list,(t=>(i(),e(l,{class:"list-item",key:t},{default:s((()=>[m(x,{item:t},null,8,["item"])])),_:2},1024)))),128))])),_:1}),0===k.pagination.total?(i(),e(p,{key:0,text:"暂无数据",icon:"/static/data-empty.png"})):d("",!0),k.pagination.total>0?(i(),e(S,{key:1,status:k.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:z},null,8,["status"])):d("",!0)])),_:1})}}},[["__scopeId","data-v-8e4f777b"]]);export{k as default};