acdr-ui/dist/build/mp-weixin/modules/mall/goods/components/detail/detail-comment-card.js

2 lines
1.3 KiB
JavaScript
Raw Normal View History

2024-09-19 07:20:14 +08:00
"use strict";const t=require("../../../../../common/vendor.js"),e=require("../../../../../sheep/index.js"),o=require("../../../../../sheep/api/product/comment.js");if(!Array){t.resolveComponent("s-empty")()}Math||(n+(()=>"../../../../../sheep/components/s-empty/s-empty.js"))();const n=()=>"./comment-item.js",m={__name:"detail-comment-card",props:{goodsId:{type:[Number,String],default:0}},setup(n){const m=n,s=t.reactive({commentList:[],total:0});function c(t){return e=this,n=null,m=function*(){const{data:e}=yield o.CommentApi.getCommentPage(t,1,3,0);s.commentList=e.list,s.total=e.total},new Promise(((t,o)=>{var s=t=>{try{r(m.next(t))}catch(e){o(e)}},c=t=>{try{r(m.throw(t))}catch(e){o(e)}},r=e=>e.done?t(e.value):Promise.resolve(e.value).then(s,c);r((m=m.apply(e,n)).next())}));var e,n,m}return t.onBeforeMount((()=>{c(m.goodsId)})),(o,m)=>t.e({a:t.t(s.total),b:s.commentList.length>0},s.commentList.length>0?{c:t.o((o=>t.unref(e.sheep).$router.go("/modules/mall/goods/comment/list",{id:n.goodsId})))}:{},{d:t.f(s.commentList,((e,o,n)=>({a:"010319b9-0-"+n,b:t.p({item:e}),c:e.id}))),e:0===s.commentList.length},0===s.commentList.length?{f:t.p({paddingTop:"0",icon:"/static/comment-empty.png",text:"期待您的第一个评价"})}:{})}},s=t._export_sfc(m,[["__scopeId","data-v-010319b9"]]);wx.createComponent(s);