"use strict";const e=require("../../common/vendor.js"),t={data:()=>({types:["设备故障","收费问题","使用建议","其他"],selectedType:-1,description:"",images:[],contact:""}),methods:{selectType(e){this.selectedType=e},chooseImage(){e.index.chooseImage({count:3-this.images.length,success:e=>{this.images=[...this.images,...e.tempFilePaths]}})},deleteImage(e){this.images.splice(e,1)},submitFeedback(){if(-1===this.selectedType)return void e.index.showToast({title:"请选择问题类型",icon:"none"});if(!this.description.trim())return void e.index.showToast({title:"请描述您的问题",icon:"none"});if(!this.contact)return void e.index.showToast({title:"请留下联系方式",icon:"none"});const t={type:this.types[this.selectedType],content:this.description,phone:this.contact,images:this.images};e.index.request({url:"/app/feedback/add",method:"POST",data:t,success:t=>{200===t.statusCode?(e.index.showToast({title:"提交成功",icon:"success"}),this.selectedType=-1,this.description="",this.contact="",this.images=[]):e.index.showToast({title:"提交失败",icon:"none"})},fail:()=>{e.index.showToast({title:"提交失败",icon:"none"})}})}}};const s=e._export_sfc(t,[["render",function(t,s,i,o,c,n){return e.e({a:e.f(c.types,((t,s,i)=>({a:e.t(t),b:s,c:c.selectedType===s?1:"",d:e.o((e=>n.selectType(s)),s)}))),b:c.description,c:e.o((e=>c.description=e.detail.value)),d:e.t(c.description.length),e:e.f(c.images,((t,s,i)=>({a:t,b:e.o((e=>n.deleteImage(s)),s),c:s}))),f:c.images.length<3},c.images.length<3?{g:e.o(((...e)=>n.chooseImage&&n.chooseImage(...e)))}:{},{h:c.contact,i:e.o((e=>c.contact=e.detail.value)),j:e.o(((...e)=>n.submitFeedback&&n.submitFeedback(...e)))})}],["__scopeId","data-v-e7b0add7"]]);wx.createPage(s);
