pages-goods-comment-list.j3ZnEZP4.js 2.5 KB

1
  1. import{_ as t}from"./su-tabs.C9zIko73.js";import{v as a,t as e,o,m as i,a as n,b as s,d as l,w as p,ak as r,_ as u,e as m,f as _,y as d,z as g,F as c,x as y,i as f}from"./index-X8PNMhkS.js";import{_ as j}from"./s-empty.kT6kTO2c.js";import{_ as v}from"./uni-load-more.BvhdfHnf.js";import{_ as b}from"./s-layout.CabBKdO3.js";import{c as x}from"./comment-item.n8RFmnN7.js";import{_ as w}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-badge.CrHuTAki.js";/* empty css */import"./s-menu-tools.ArsIXUlO.js";import"./s-layout.vue_vue_type_style_index_0_scoped_d5f7c468_lang.B2C9lkVq.js";import"./phone-international-input.vue_vue_type_style_index_0_scoped_a793e264_lang.Btmcxmrw.js";import"./s-tabbar.CBBx4PGk.js";import"./useGoods.B3RWw6_i.js";import"./phone-international-input.BNFSuQBr.js";import"./uni-rate.BQiN-_s9.js";import"./su-image.D5OmdPZj.js";const S=w({__name:"list",setup(w){const S=a({id:0,type:[{type:0,name:e("common.all")},{type:1,name:e("review.positive")},{type:2,name:e("review.neutral")},{type:3,name:e("review.negative")}],currentTab:0,loadStatus:"",pagination:{list:[],total:0,pageNo:1,pageSize:10}});function h(t){S.currentTab=t.index,S.pagination.pageNo=1,S.pagination.list=[],S.pagination.total=0,k()}async function k(){S.loadStatus="loading";let t=await r.getCommentPage(S.id,S.pagination.pageNo,S.pagination.pageSize,S.type[S.currentTab].type);0===t.code&&(console.log(t),S.pagination.list=u.concat(S.pagination.list,t.data.list),S.pagination.total=t.data.total,S.loadStatus=S.pagination.list.length<S.pagination.total?"more":"noMore")}function N(){"noMore"!==S.loadStatus&&(S.pagination.pageNo++,k())}return o((t=>{S.id=t.id,k()})),i((()=>{N()})),(a,e)=>{const o=n(s("su-tabs"),t),i=f,r=n(s("s-empty"),j),u=n(s("uni-load-more"),v),w=n(s("s-layout"),b);return m(),l(w,{title:a.$t("review.all_reviews")},{default:p((()=>[_(o,{list:S.type,scrollable:!1,onChange:h,current:S.currentTab},null,8,["list","current"]),_(i,{class:"ss-m-t-20"},{default:p((()=>[(m(!0),d(c,null,g(S.pagination.list,(t=>(m(),l(i,{class:"list-item",key:t},{default:p((()=>[_(x,{item:t},null,8,["item"])])),_:2},1024)))),128))])),_:1}),0===S.pagination.total?(m(),l(r,{key:0,text:"暂无数据",icon:"/static/data-empty.png"})):y("",!0),S.pagination.total>0?(m(),l(u,{key:1,status:S.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:N},null,8,["status"])):y("",!0)])),_:1},8,["title"])}}},[["__scopeId","data-v-4387382f"]]);export{S as default};