import{_ as e}from"./s-goods-item.DVomrksC.js";import{v as t,o as s,s as a,a0 as o,r as l,e as n,f as i,w as r,j as m,k as d,l as u,m as c,F as p,p as f,i as _,D as x,ap as h,G as g,aq as y}from"./index-CWyPMHxb.js";import{_ as L}from"./uni-rate.BXeuATfq.js";import{f as b,_ as V,S}from"./s-layout.CUgh1tQ8.js";import{_ as U}from"./s-uploader.Ch1s-STy.js";import{_ as j}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./useGoods.BQLkjza8.js";import"./index.gxKvznCa.js";const k=j({__name:"add",setup(j){const k=t({orderInfo:{},commentList:[],id:null});async function v(){for(const e of k.commentList)await o.createOrderItemComment(e);a.$router.back()}return s((async e=>{if(!e.id)return void a.$helper.toast("缺少订单信息，请检查");k.id=e.id;const{code:t,data:s}=await o.getOrderDetail(k.id);0===t?(s.items.forEach((e=>{k.commentList.push({anonymous:!1,orderItemId:e.id,descriptionScores:5,benefitScores:5,content:"",picUrls:[]})})),k.orderInfo=s):a.$helper.toast("无待评价订单")})),(t,s)=>{const a=l(n("s-goods-item"),e),o=_,j=l(n("uni-rate"),L),w=l(n("uni-easyinput"),b),I=l(n("s-uploader"),U),C=h,G=g,M=y,$=x,B=l(n("su-fixed"),V),D=l(n("s-layout"),S);return m(),i(D,{title:"评价"},{default:r((()=>[d(o,null,{default:r((()=>[(m(!0),u(p,null,c(k.orderInfo.items,((e,t)=>(m(),i(o,{key:e.id},{default:r((()=>[d(o,null,{default:r((()=>[d(o,{class:"commont-from-wrap"},{default:r((()=>[d(a,{img:e.picUrl,title:e.spuName,skuText:e.properties.map((e=>e.valueName)).join(" "),price:e.payPrice,num:e.count},null,8,["img","title","skuText","price","num"])])),_:2},1024),d(o,{class:"form-item"},{default:r((()=>[d(o,{class:"star-box ss-flex ss-col-center"},{default:r((()=>[d(o,{class:"star-title ss-m-r-40"},{default:r((()=>[f("商品质量")])),_:1}),d(j,{modelValue:k.commentList[t].descriptionScores,"onUpdate:modelValue":e=>k.commentList[t].descriptionScores=e},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1024),d(o,{class:"star-box ss-flex ss-col-center"},{default:r((()=>[d(o,{class:"star-title ss-m-r-40"},{default:r((()=>[f("服务态度")])),_:1}),d(j,{modelValue:k.commentList[t].benefitScores,"onUpdate:modelValue":e=>k.commentList[t].benefitScores=e},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1024),d(o,{class:"area-box"},{default:r((()=>[d(w,{inputBorder:!1,type:"textarea",maxlength:"120",autoHeight:"",modelValue:k.commentList[t].content,"onUpdate:modelValue":e=>k.commentList[t].content=e,placeholder:"宝贝满足你的期待吗？说说你的使用心得，分享给想买的他们吧~"},null,8,["modelValue","onUpdate:modelValue"]),d(o,{class:"img-box"},{default:r((()=>[d(I,{url:k.commentList[t].images,"onUpdate:url":e=>k.commentList[t].images=e,fileMediatype:"image",limit:"9",mode:"grid",imageStyles:{width:"168rpx",height:"168rpx"},onSuccess:e=>{return s=t,void(k.commentList[s].picUrls=k.commentList[s].images);var s}},null,8,["url","onUpdate:url","onSuccess"])])),_:2},1024)])),_:2},1024),d(o,{class:"checkbox-container"},{default:r((()=>[d(M,{onChange:e=>function(e,t){k.commentList[e].anonymous="anonymousChecked"===t.detail.value[0]}(t,e)},{default:r((()=>[d(G,null,{default:r((()=>[d(C,{value:"anonymousChecked"}),f(" 匿名评论 ")])),_:1})])),_:2},1032,["onChange"])])),_:2},1024)])),_:2},1024)])),_:2},1024)])),_:2},1024)))),128))])),_:1}),d(B,{bottom:"",placeholder:""},{default:r((()=>[d(o,{class:"foot_box ss-flex ss-row-center ss-col-center"},{default:r((()=>[d($,{class:"ss-reset-button post-btn ui-BG-Main-Gradient ui-Shadow-Main",onClick:v},{default:r((()=>[f(" 发布 ")])),_:1})])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-144ad3d4"]]);export{k as default};
