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

2 lines
6.2 KiB
JavaScript
Raw Normal View History

2025-06-16 22:09:12 +08:00
"use strict";const e=require("./common/vendor.js"),s=require("./components/NationalDictionary.js"),n=require("./components/request.js"),t=require("./components/formatDate.js"),i={data:()=>({genders:"",Gender:[{label:"男",value:1},{label:"女",value:2}],Country:s.optionsArray,countrys:"",nameAnchor:"",numberCoins:"",session:"",remarks:"",Display:!1,Hint:!1,datetimesingle:"",id:"",sendingTime:"",filterable:!0,AnchorList:[],selectedId:null,selectedIddata:null}),props:{message:{type:Object}},watch:{message(e,s){this.numberCoins=e.coin,this.session=e.pkNumber,this.remarks=e.remark,this.datetimesingle=t.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:{close(){this.$refs.popup.close()},invite(){this.selectedId?(this.nameAnchor=this.selectedIddata.anchorId,this.AnchorProfilePicture=this.selectedIddata.headerIcon,this.close()):e.index.showToast({title:"请选择主播",icon:"none",duration:2e3})},Select(e,s){this.selectedId!==e?(this.selectedId=e,this.selectedIddata=s):(this.selectedId=null,this.selectedIddata=null)},getAnchorList(){n.request({url:"anchor/list",method:"POST",data:{id:this.id},userInfo:!0}).then((e=>{this.triggered=!1,200==e.code?this.AnchorList=e.data:console.log(e.msg)}))},chooseMyStreamer(){this.$refs.popup.open("center"),this.getAnchorList()},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 s=this.datetimesingle.replace(" ","T"),t=Date.parse(s);if(isNaN(t))throw new Error(`Invalid date format: ${this.datetimesingle}`);this.sendingTime=Math.floor(t/1e3);const i=Math.floor(Date.now()/1e3);if(this.sendingTime<i)return void e.index.showToast({title:"日期不能早于当前时间",icon:"none",duration:2e3});e.index.showLoading({title:"发布中...",mask:!0});200===(await n.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")+e.resolveComponent("uni-popup"))()}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")+(()=>"./uni_modules/uni-popup/components/uni-popup/uni-popup.js"))();const o=e._export_sfc(i,[["render",function(s,n,t,i,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:e.o$1(((...e)=>s.blur&&s.blur(...e))),e:o.nameAnchor,f:""===o.nameAnchor