import{C as e,E as t,M as n,O as r,T as i,_ as a,a as o,b as s,c,f as l,g as u,k as d,l as f,m as p,o as m,s as h,w as g,x as _,y as v}from"./index-vhvNh9F8.js";var y={class:`page`},b={class:`card`,style:{"margin-top":`0`,"border-radius":`0`}},x={class:`card-body`},S={key:0,style:{"font-size":`14px`,"font-weight":`600`,"margin-bottom":`8px`}},C={key:1},w={style:{flex:`1`}},T={style:{"font-size":`13px`,"font-weight":`500`}},E=h({__name:`FollowUp`,setup(h){let E=c(),D=f(),O=r(localStorage.getItem(`token`)||``),k=r(null),A=r(``),j=r(!1);async function M(){if(!A.value.trim()){alert(`请填写追评内容`);return}j.value=!0;try{let e=await o.post(`/review/follow-up`,{order_no:k.value?.order_no,content:A.value},{headers:{Authorization:`Bearer `+O.value}});e.code===0?(alert(`追评成功`),D.push(`/orders`)):alert(e.message||`提交失败`)}catch{alert(`网络错误`)}j.value=!1}return _(async()=>{let e=E.query.order_no;if(!(!e||!O.value))try{let t=await o.get(`/order/list`,{params:{order_no:e},headers:{Authorization:`Bearer `+O.value}});if(t.code===0){let e=t.data.list||[];e.length>0&&(k.value=e[0])}}catch{}}),(r,o)=>{let c=i(`van-image`),f=i(`van-field`),h=i(`van-button`);return e(),a(`div`,y,[s(m,{title:`追加评价`,onBack:o[0]||=e=>d(D).push(`/orders`)}),p(`div`,b,[p(`div`,x,[k.value?(e(),a(`div`,S,`追评订单: `+n(k.value.order_no),1)):u(``,!0),k.value?(e(),a(`div`,C,[(e(!0),a(l,null,g(k.value.items,r=>(e(),a(`div`,{key:r.id,style:{display:`flex`,gap:`10px`,"align-items":`flex-start`,"margin-bottom":`12px`,"padding-bottom":`8px`,"border-bottom":`1px solid #f0f0f0`}},[s(c,{src:r.image,style:{width:`50px`,height:`50px`,"border-radius":`4px`,"flex-shrink":`0`},"lazy-load":``},{error:t(()=>[...o[2]||=[p(`div`,{class:`img-placeholder`,style:{width:`50px`,height:`50px`,"border-radius":`4px`,"font-size":`12px`}},`📷`,-1)]]),_:1},8,[`src`]),p(`div`,w,[p(`div`,T,n(r.product_name),1),s(f,{modelValue:A.value,"onUpdate:modelValue":o[1]||=e=>A.value=e,type:`textarea`,rows:`3`,placeholder:`说说使用感受...`,style:{"margin-top":`6px`}},null,8,[`modelValue`])])]))),128)),s(h,{round:``,block:``,class:`primary-btn`,style:{"margin-top":`12px`},onClick:M,loading:j.value},{default:t(()=>[...o[3]||=[v(`提交追评`,-1)]]),_:1},8,[`loading`])])):u(``,!0)])])])}}},[[`__scopeId`,`data-v-afc6f3ea`]]);export{E as default};