import{_ as e}from"./s-goods-item.cceb2670.js";import{C as t,p as s,s as o,o as a,e as l,w as i,b as m,i as n,f as d,h as r,F as u,y as c,d as p,m as _,B as f,z as g,k as x}from"./index-520dfaee.js";import{_ as b}from"./uni-rate.b2e08c50.js";import{g as h,b as y,a as L}from"./s-layout.5146c957.js";import{_ as v}from"./s-uploader.026e8b76.js";import{_ as k}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css                                                                     */const V=k({__name:"add",setup(k){const V=t({orderInfo:{},commentList:[]}),j={1:"糟糕",2:"差评",3:"一般",4:"良好",5:"好评"};async function w(){const{code:e}=await o.$api.order.comment(V.orderInfo.id,{comments:V.commentList});1===e&&o.$router.back()}return s((async e=>{let t="";e.orderSN&&(t=e.orderSN),e.id&&(t=e.id);const{data:s,code:a}=await o.$api.order.detail(t);if(1===a&&s.btns.includes("comment"))return V.orderInfo=s,void V.orderInfo.items.forEach((e=>{e.btns.includes("comment")&&V.commentList.push({item_id:e.id,level:5,content:"",images:[]})}));o.$helper.toast("无待评价订单")})),(t,s)=>{const o=m(p("s-goods-item"),e),k=_,I=m(p("uni-rate"),b),U=m(p("uni-easyinput"),h),S=m(p("s-uploader"),v),$=f,B=m(p("su-fixed"),y),M=m(p("s-layout"),L);return a(),l(M,{title:"评价"},{default:i((()=>[n(k,null,{default:i((()=>[(a(!0),d(u,null,r(V.orderInfo.items,((e,t)=>(a(),l(k,{key:e.id},{default:i((()=>[e.btns.includes("comment")?(a(),l(k,{key:0},{default:i((()=>[n(k,{class:"commont-from-wrap"},{default:i((()=>[n(o,{img:e.goods_image,title:e.goods_title,skuText:e.goods_sku_text,price:e.goods_price,num:e.goods_num},null,8,["img","title","skuText","price","num"])])),_:2},1024),n(k,{class:"form-item"},{default:i((()=>[n(k,{class:"star-box ss-flex ss-col-center"},{default:i((()=>[n(k,{class:"star-title ss-m-r-40"},{default:i((()=>[c(g(j[V.commentList[t].level]),1)])),_:2},1024),n(I,{modelValue:V.commentList[t].level,"onUpdate:modelValue":e=>V.commentList[t].level=e},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1024),n(k,{class:"area-box"},{default:i((()=>[n(U,{inputBorder:!1,type:"textarea",maxlength:"120",autoHeight:"",modelValue:V.commentList[t].content,"onUpdate:modelValue":e=>V.commentList[t].content=e,placeholder:"宝贝满足你的期待吗？说说你的使用心得，分享给想买的他们吧~"},null,8,["modelValue","onUpdate:modelValue"]),n(k,{class:"img-box"},{default:i((()=>[n(S,{url:V.commentList[t].images,"onUpdate:url":e=>V.commentList[t].images=e,fileMediatype:"image",limit:"9",mode:"grid",imageStyles:{width:"168rpx",height:"168rpx"}},null,8,["url","onUpdate:url"])])),_:2},1024)])),_:2},1024)])),_:2},1024)])),_:2},1024)):x("",!0)])),_:2},1024)))),128))])),_:1}),n(B,{bottom:"",placeholder:""},{default:i((()=>[n(k,{class:"foot_box ss-flex ss-row-center ss-col-center"},{default:i((()=>[n($,{class:"ss-reset-button post-btn ui-BG-Main-Gradient ui-Shadow-Main",onClick:w},{default:i((()=>[c(" 发布 ")])),_:1})])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-eefcb8e9"]]);export{V as default};
