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

2 lines
6.6 KiB
JavaScript
Raw Normal View History

2025-07-18 13:06:06 +08:00
"use strict";const e=require("./common/vendor.js"),n=require("./components/NationalDictionary.js"),t=require("./components/request.js"),i=require("./components/formatDate.js"),s={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,AnchorList:[],selectedId:null,selectedIddata:null,AnchorProfilePicture:"",senderId:""}),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.id,this.nameAnchor=e.anchorId,this.countrys=e.country,this.genders="1"===e.sex?1:2,this.AnchorProfilePicture=e.anchorIcon.split("/").pop(),this.senderId=e.senderId}},methods:{close(){this.$refs.popup.close()},invite(){this.selectedId?(this.nameAnchor=this.selectedIddata.anchorId,this.AnchorProfilePicture=this.selectedIddata.headerIcon,this.genders=this.selectedIddata.gender,this.countrys=this.selectedIddata.country,this.close()):e.index.showToast({title:"请选择主播",icon:"none",duration:2e3})},Select(e,n){this.selectedId!==e?(this.selectedId=e,this.selectedIddata=n):(this.selectedId=null,this.selectedIddata=null)},getAnchorList(){t.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},country(e){this.countrys=e.value},open(){this.Display?(this.Display=!1,this.Hint=!1):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(){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 s=Math.floor(Date.now()/1e3);if(this.sendingTime<s)return void e.index.showToast({title:"日期不能早于当前时间",icon:"none",duration:2e3});e.index.showLoading({title:"修改中...",mask:!0});200===(await t.request({url:"pk/updatePkInfoById",method:"POST",data:{id:this.id,anchorId:this.nameAnchor,pkTime:this.sendingTime,sex:this.genders,country:this.countrys,coin:this.numberCoins,remark:this.remarks,senderId:this.senderId,anchorIcon:this.AnchorProfilePicture,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(),this.$emit("Refresh"),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-numb