"use strict";const e=require("../../../../common/vendor.js"),n=require("../../../../components/NationalDictionary.js"),o=require("../../../../components/request.js"),t={data:()=>({genders:0,Gender:[{label:"男",value:1},{label:"女",value:2}],Country:n.optionsArray,countrys:"",nameAnchor:"",Display:!1,Hint:!1,id:null,sendingTime:"",filterable:!0,AnchorProfilePicture:""}),mounted(){e.index.getStorage({key:"userinfo",success:e=>{this.id=e.data.id}})},methods:{gender(e){this.genders=e.value},country(e){this.countrys=e.value},handleOverlayClick(e){e.target===this.$el&&(this.Display=!1,this.Hint=!1)},open(){this.Display?(this.Display=!1,this.Hint=!1,this.nameAnchor="",this.genders=0,this.countrys=""):this.Display=!0},blur(n){this.nameAnchor!==n.target.value&&(this.nameAnchor=n.target.value,e.index.showLoading({title:"正在验证主播",mask:!0}),e.index.request({url:"https://python.yolojt.com/api/"+this.nameAnchor,success:n=>{200===n.data.code?(e.index.hideLoading(),e.index.showToast({title:"查询成功",icon:"none",duration:3e3}),this.AnchorProfilePicture=n.data.data):(e.index.hideLoading(),e.index.showToast({title:"未查询到该主播",icon:"none",duration:3e3}))},fail:function(n){e.index.hideLoading(),e.index.showToast({title:"网络请求失败",icon:"none",duration:3e3})}}))},async Publish(){""!==this.nameAnchor&&0!==this.genders&&""!==this.countrys&&""!==this.AnchorProfilePicture?(e.index.showLoading({title:"添加中...",mask:!0}),await o.request({url:"anchor/add",method:"POST",data:{anchorId:this.nameAnchor,headerIcon:this.AnchorProfilePicture,gender:this.genders,country:this.countrys,createUserId:this.id},userInfo:!0}).then((n=>{200===n.code?(this.Display=!1,this.Hint=!1,this.nameAnchor="",this.genders=0,this.AnchorProfilePicture="",e.index.hideLoading(),e.index.showToast({title:"添加成功",icon:"success",duration:2e3}),this.$emit("Refresh")):(e.index.hideLoading(),e.index.showToast({title:"添加失败"+n.msg,icon:"none",duration:2e3}))}))):this.Hint=!0}}};if(!Array){e.resolveComponent("wht-select")()}Math;const i=e._export_sfc(t,[["render",function(n,o,t,i,r,s){return e.e({a:r.Display},r.Display?e.e({b:e.o$1((e=>s.open())),c:e.o$1(((...e)=>n.NameAnchor&&n.NameAnchor(...e))),d:e.o$1(((...e)=>s.blur&&s.blur(...e))),e:""===r.nameAnchor&&!0===r.Hint},(""===r.nameAnchor&&r.Hint,{}),{f:e.o$1(s.country),g:e.p({backgroundColor:"#ffffff",placeholderColor:"#666666",textColor:"#666666",borderColor:"#ffffff",options:r.Country,filterable:r.filterable,placeholder:"请选择国家"}),h:""===r.countrys&&!0===r.Hint},(""===r.countrys&&r.Hint,{}),{i:e.o$1(s.gender),j:e.p({backgroundColor:"#ffffff",placeholderColor:"#666666",textColor:"#666666",borderColor:"#ffffff",options:r.Gender,placeholder:"性别"}),k:0===r.genders},(r.genders,{}),{l:1===r.genders},(r.genders,{}),{m:2===r.genders},(r.genders,{}),{n:0===r.genders&&!0===r.Hint},(0===r.genders&&r.Hint,{}),{o:e.o$1((e=>s.Publish())),p:e.o$1((()=>{})),q:e.n(r.Display?"create-module":"close-animation "),r:e.o$1((e=>s.open()))}):{})}],["__scopeId","data-v-69f046d6"]]);wx.createComponent(i);
