import{u as e,l as a,aH as l,S as s}from"./common-utils-8H8K2JPG.js";import{U as i,r as o,G as t,b as n,q as u,I as r,u as c,h as d,aq as m,t as v,n as p,F as f,e as g,f as b,s as h,av as k,bd as q,o as w,x as y,V as C}from"./vendor-jA_NIjzi.js";import{_ as j,bq as x}from"./common-store-e_1WBubm.js";import{H as U}from"./Header-hbN0HDAk.js";import"./vendor-crypto-Vtl7-GZS.js";import"./vendor-mqtt-lYGapirz.js";/* empty css              */import"./SvgIcon-unOD6nfS.js";const G={class:"feedback-box"},V={class:"icon"},_={class:"describe"},F=["onClick"],A={class:"flex items-center gap-2"},L=["src"],T=["src"],z=j({__name:"index",setup(j){const{t:z}=i(),{theme:P}=e(),H=o({fileList:[],feedbackContent:"",faq:"",showFaq:!1,problemType:0,pictureUrls:""}),I=["","",""],R=o(!1),S=[{id:31,name:z("充值问题"),img:a("mine/blackGold/".concat(P.value,"Recharge.svg"))},{id:32,name:z("提款问题"),img:a("mine/blackGold/".concat(P.value,"Withdrwa.svg"))},{id:33,name:z("游戏问题"),img:a("mine/blackGold/".concat(P.value,"Game.svg"))},{id:34,name:z("优惠问题"),img:a("mine/blackGold/".concat(P.value,"gifts.svg"))},{id:35,name:z("登录问题"),img:a("mine/blackGold/".concat(P.value,"-login.svg"))},{id:36,name:z("APP问题"),img:a("mine/blackGold/".concat(P.value,"APP.svg"))},{id:37,name:z("其他问题"),img:a("mine/blackGold/".concat(P.value,"other.svg"))}],D=t((()=>!(""!==H.value.feedbackContent.trim()&&""!==H.value.faq))),O=e=>{h(z("文件大小不能超过10mb"))},W=e=>{if(Array.isArray(e)){for(const a of e)if(!["image/jpeg","image/jpg","image/png"].includes(a.type))return h(z("请上传图片格式")),!1}else if(!["image/jpeg","image/jpg","image/png"].includes(e.type))return h(z("请上传图片格式")),!1;return!0},$=e=>{if(Array.isArray(e))for(const a of e)$(a);else R.value=!0,l(e).then((e=>{var a,l,s;H.value.pictureUrls=null!=(s=null==(l=null==(a=e.body)?void 0:a.data)?void 0:l.imageUrl)?s:"",(!I.value||I.value.length<3)&&(I.value=["","",""]),I.value[0]=I.value[1],I.value[1]=I.value[2],I.value[2]=H.value.pictureUrls,R.value=!1})).catch((()=>R.value=!1))},B=async()=>{var e,a;if(D.value)return;if(R.value)return;const l=await x({problemType:H.value.problemType,feedbackContent:H.value.feedbackContent,pictureUrls:H.value.fileList.length>1?null==(e=I.value)?void 0:e.join(","):null==(a=H.value)?void 0:a.pictureUrls});if(!l.success)return l.message&&h(l.message);h(l.message),H.value={fileList:[],faq:"",problemType:"",feedbackContent:"",pictureUrls:""}};return(e,l)=>{const i=k,o=C,t=q,h=s;return w(),n("div",{class:"feedback",onClick:l[5]||(l[5]=m((e=>H.value.showFaq=!1),["stop"]))},[u(U,{title:c(z)("投诉与建议"),isRightShow:!1},{right:r((()=>[d("p",{class:"navRight",onClick:l[0]||(l[0]=a=>e.$router.push("/feedback-detail"))},v(c(z)("我的反馈")),1)])),_:1},8,["title"]),d("div",G,[u(i,{modelValue:H.value.faq,"onUpdate:modelValue":l[1]||(l[1]=e=>H.value.faq=e),class:"faq",placeholder:c(z)("请选择您的问题"),"right-icon":H.value.showFaq?"arrow-up":"arrow-down",readonly:"",name:"datePicker",onClick:l[2]||(l[2]=m((e=>H.value.showFaq=!H.value.showFaq),["stop"]))},null,8,["modelValue","placeholder","right-icon"]),u(i,{modelValue:H.value.feedbackContent,"onUpdate:modelValue":l[3]||(l[3]=e=>H.value.feedbackContent=e),class:"feedbackContent",colon:!0,required:"",rows:"7",autosize:"",type:"textarea",maxlength:"500",placeholder:c(z)("请详细描述您遇到的问题"),"show-word-limit":""},null,8,["modelValue","placeholder"]),u(t,{modelValue:H.value.fileList,"onUpdate:modelValue":l[4]||(l[4]=e=>H.value.fileList=e),multiple:"","max-count":3,"preview-size":"98px","max-size":1024e4,onOversize:O,"before-read":W,"after-read":$},{default:r((()=>[d("div",V,[u(o,{name:"plus",size:"60"}),d("div",null,v(c(z)("上传截图"))+v(H.value.fileList.length)+"/3",1)])])),_:1},8,["modelValue"]),d("div",_,v(c(z)("上传限制要求")),1),u(h,{disabled:D.value,onClick:B,class:"mt-4"},{default:r((()=>[y(v(c(z)("提交")),1)])),_:1},8,["disabled"])]),H.value.showFaq?(w(),n("div",{key:0,class:p(["popupDiv",{show:H.value.showFaq}])},[d("div",null,[(w(),n(f,null,g(S,(e=>d("div",{class:"item",key:e.id,onClick:a=>(e=>{H.value.faq=e.name,H.value.problemType=e.id,H.value.showFaq=!1})(e)},[d("div",A,[d("img",{src:e.img,alt:""},null,8,L),d("span",null,v(e.name),1)]),+H.value.problemType===e.id?(w(),n("img",{key:0,src:c(a)("mine/blackGold/".concat(c(P),"Dxan.svg")),alt:"Check"},null,8,T)):b("",!0)],8,F))),64))])],2)):b("",!0)])}}},[["__scopeId","data-v-94474758"],["__file","index.vue"]]);export{z as default};
