import{_ as e,m as a,r as l,h as s,f as t,y as i,o as u,c as o,d,a as n,b as r,F as c,g as p,v as m,W as v,t as f,aF as g,p as b,q as _,e as k,n as h,E as y,dF as x,k as j,l as w,j as C,Y as q,dG as P}from"./index-BhrLSE9x.js";import{b as V}from"./el-overlay-C6ddMYf0.js";import{a as U,E as F}from"./el-form-DT7MBZet.js";import"./el-form-item-l0sNRNKZ.js";import{R as G}from"./rightList-DiSMi6RH.js";import{l as L,j as z}from"./mine-C07ZGTvJ.js";import"./vnode-dKTAikk0.js";import"./el-skeleton-item-dCUXQ5Di.js";const E={class:"opinionFeedback relative z-10"},J={class:"opinion_left"},M={class:"formMain"},B={class:"imgUp"},D={class:"up_txt_r"},I={class:"upload-area"},N={class:"upload"},T=["src"],$={class:"box"},A=["src","alt"],R={class:"el-upload-list__item-actions w-100px! h-100px!"},S=["onClick"],W=["onClick"],Y=["src"],H=e({__name:"index",setup(e){const{theme:H}=a(),K=l([]),O=l(""),Q=l({fileList:[],feedbackContent:"",faq:"",showFaq:!1,problemType:0,pictureUrls:""}),X=l(!1),Z=l(!1),ee=l([{id:31,name:"充值问题"},{id:32,name:"提款问题"},{id:33,name:"游戏问题"},{id:34,name:"优惠问题"},{id:35,name:"登录问题"},{id:36,name:"APP问题"},{id:37,name:"其他问题"}]),ae=l([]),le=s((()=>""===Q.value.feedbackContent||""===Q.value.faq)),se=l([]),te=async e=>["image/jpeg","image/png","image/jpg"].includes(e.type)?!(e.size/1024/1024>10)||(y.error("图片大小不能超过10MB"),!1):(y.error("文件格式只能是：PNG、JPG、JPEG。"),!1),ie=async e=>{const a=await x(e);if(1!==a.code)return y.error(a.message);se.value.push(a.data.imageUrl)},ue=async()=>{le.value||X.value||(X.value=!0,await L({problemType:Q.value.faq,feedbackContent:Q.value.feedbackContent,pictureUrls:se.value.length>0?se.value.join(","):""}),X.value=!1,y.success("反馈成功"),Q.value={fileList:[],faq:"",feedbackContent:""},se.value=[],K.value=[],oe())},oe=async()=>{const e=await z();ae.value=e??[]};return t((()=>{oe()})),(e,a)=>{const l=j,s=w,t=U,y=C,x=F,L=q,z=i("zoom-in"),X=i("Delete"),oe=P,de=V;return u(),o("div",E,[d("div",J,[a[6]||(a[6]=d("div",{class:"title"},"意见反馈",-1)),d("div",M,[n(x,{"label-position":"top","label-width":"80px",model:Q.value},{default:r((()=>[n(t,{label:"问题类型",required:""},{default:r((()=>[n(s,{modelValue:Q.value.faq,"onUpdate:modelValue":a[0]||(a[0]=e=>Q.value.faq=e),placeholder:"请选择您的问题",size:"large",clearable:"",teleported:!1},{default:r((()=>[(u(!0),o(c,null,p(ee.value,(e=>(u(),m(l,{key:e.id,label:e.name,value:e.id},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),n(t,{label:"问题描述",required:"","show-message":!1,class:"mt-20px"},{default:r((()=>[n(y,{type:"textarea",maxlength:"500",height:"170","show-word-limit":"",placeholder:"请详细描述您遇到的问题（必填）",modelValue:Q.value.feedbackContent,"onUpdate:modelValue":a[1]||(a[1]=e=>Q.value.feedbackContent=e)},null,8,["modelValue"])])),_:1})])),_:1},8,["model"]),d("div",B,[a[4]||(a[4]=d("div",{class:"up_txt_l"},[v("问题截图"),d("span",null,"文件格式为：PNG、JPG、JPEG，大小不超过10MB")],-1)),d("div",D,f(se.value.length)+"/3",1)]),d("div",I,[d("div",N,[n(oe,{"file-list":K.value,"onUpdate:fileList":a[2]||(a[2]=e=>K.value=e),accept:".jpg,.jpeg,.png",limit:3,"list-type":"picture-card","before-upload":te,"auto-upload":!0,"http-request":ie,disabled:3===K.value.length},{file:r((({file:e,index:l})=>[d("div",$,[se.value[l]?(u(),o("img",{key:0,class:"el-upload-list__item-thumbnail",src:se.value[l],alt:l},null,8,A)):(u(),o("div",{key:1,class:"img-loading",style:g([{background:`url(${e.url}) center center no-repeat`},{backgroundSize:"100% 100%"}])},a[5]||(a[5]=[d("div",{class:"my-loading-mask"},[d("div",{class:"loader"}),d("p",{class:"loading-text"},"上传中")],-1)]),4)),d("span",R,[d("span",{class:"el-upload-list__item-preview",onClick:a=>(e=>{O.value=e.url,Z.value=!0})(e)},[n(L,null,{default:r((()=>[n(z)])),_:1})],8,S),d("span",{class:"el-upload-list__item-delete",onClick:e=>((e,a)=>{K.value.splice(a,1),se.value.splice(a,1)})(0,l)},[n(L,null,{default:r((()=>[n(X)])),_:1})],8,W)])])])),default:r((()=>[K.value.length<3?(u(),m(L,{key:0},{default:r((()=>[d("img",{class:"w-100px! h-100px!",src:b(_)(`recharge/${b(H)}_upload.png`),alt:""},null,8,T)])),_:1})):k("",!0)])),_:1},8,["file-list","disabled"]),n(de,{modelValue:Z.value,"onUpdate:modelValue":a[3]||(a[3]=e=>Z.value=e)},{default:r((()=>[d("img",{src:O.value,alt:"Preview Image"},null,8,Y)])),_:1},8,["modelValue"])])]),d("div",{class:h(["btnFrom",{abtnFrom:le.value}]),onClick:ue},"提交",2)])]),n(G,{feedbackList:ae.value},null,8,["feedbackList"])])}}},[["__scopeId","data-v-01262a2e"]]);export{H as default};
