Files
tk-mini-program/unpackage/dist/build/mp-weixin/recompose.js

2 lines
5.0 KiB
JavaScript
Raw Normal View History

2025-06-11 22:16:44 +08:00
"use strict";const e=require("./common/vendor.js"),n=require("./components/NationalDictionary.js"),s=require("./components/request.js"),i=require("./components/formatDate.js"),t={data:()=>({genders:"",Gender:[{label:"男",value:1},{label:"女",value:2}],Country:n.optionsArray,countrys:"",nameAnchor:"",numberCoins:"",session:"",remarks:"",Display:!1,Hint:!1,datetimesingle:"",id:"",sendingTime:"",filterable:!0}),props:{message:{type:Object}},watch:{message(e,n){this.numberCoins=e.coin,this.session=e.pkNumber,this.remarks=e.remark,this.datetimesingle=i.formatDate(e.pkTime),this.id=e.senderId,this.nameAnchor=e.anchorId,this.countrys=e.country,this.genders="1"===e.sex?1:2}},mounted(){e.index.getStorage({key:"userinfo",success:e=>{this.id=e.data.id}})},methods:{gender(e){this.genders=e.value,console.log(e)},country(e){this.countrys=e.value,console.log(e)},open(){this.Display?(this.Display=!1,this.Hint=!1,this.nameAnchor="",this.genders=0,this.numberCoins="",this.remarks="",this.datetimesingle="",this.countrys="",this.session=""):this.Display=!0},NameAnchor:function(e){this.nameAnchor=e.target.value},async Publish(){if(""==this.nameAnchor&&null==this.nameAnchor||0==this.genders&&null==this.genders||""==this.numberCoins&&null==this.numberCoins||""==this.datetimesingle&&null==this.datetimesingle||""==this.countrys&&null==his.countrys||""==this.datetimesingle&&null==this.datetimesingle||""==this.session&&null==this.session)return void(this.Hint=!0);if(this.remarks.includes(this.nameAnchor))return void e.index.showToast({title:"备注中不能包含主播昵称",icon:"none",duration:2e3});const n=this.datetimesingle.replace(" ","T"),i=Date.parse(n);if(isNaN(i))throw new Error(`Invalid date format: ${this.datetimesingle}`);this.sendingTime=Math.floor(i/1e3);const t=Math.floor(Date.now()/1e3);if(this.sendingTime<t)return void e.index.showToast({title:"日期不能早于当前时间",icon:"none",duration:2e3});e.index.showLoading({title:"发布中...",mask:!0});200===(await s.request({url:"pk/addPkData",method:"POST",data:{anchorId:this.nameAnchor,pkTime:this.sendingTime,sex:this.genders,country:this.countrys,coin:this.numberCoins,remark:this.remarks,status:0,senderId:this.id,anchorIcon:"",pkNumber:this.session},userInfo:!0})).code?(this.Display=!1,this.Hint=!1,this.nameAnchor="",this.genders=0,this.numberCoins="",this.remarks="",this.datetimesingle="",this.session="",e.index.hideLoading(),e.index.showToast({title:"发布成功",icon:"success",duration:2e3})):(e.index.hideLoading(),e.index.showToast({title:"发布失败",icon:"none",duration:2e3}))}}};if(!Array){(e.resolveComponent("wht-select")+e.resolveComponent("uni-number-box")+e.resolveComponent("uni-datetime-picker")+e.resolveComponent("uni-easyinput"))()}Math||((()=>"./uni_modules/wht-select/components/wht-select/wht-select.js")+(()=>"./uni_modules/uni-number-box/components/uni-number-box/uni-number-box.js")+(()=>"./uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.js")+(()=>"./uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js"))();const o=e._export_sfc(t,[["render",function(n,s,i,t,o,r){return e.e({a:o.Display},o.Display?e.e({b:e.o$1((e=>r.open())),c:e.o$1(((...e)=>r.NameAnchor&&r.NameAnchor(...e))),d:o.nameAnchor,e:""===o.nameAnchor||null===o.nameAnchor&&!0===o.Hint},(""===o.nameAnchor||null===o.nameAnchor&&o.Hint,{}),{f:e.o$1(r.country),g:e.p({backgroundColor:"#ffffff",placeholderColor:"#666666",textColor:"#666666",borderColor:"#ffffff",options:o.Country,filterable:o.filterable,placeholder:"请选择国家",value:o.countrys}),h:""===o.countrys||null===o.countrys&&!0===o.Hint},(""===o.countrys||null===o.countrys&&o.Hint,{}),{i:e.o$1(r.gender),j:e.p({backgroundColor:"#ffffff",placeholderColor:"#666666",textColor:"#666666",borderColor:"#ffffff",options:o.Gender,placeholder:"性别",value:"1"===i.message.sex?1:2}),k:0===o.genders||"0"===i.message.sex},(0===o.genders||i.message.sex,{}),{l:1===o.genders||"1"===i.message.sex},(1===o.genders||i.message.sex,{}),{m:2===o.genders||"2"===i.message.sex},(2===o.genders||i.message.sex,{})