Files
tk-mini-program/unpackage/dist/build/mp-weixin/recompose.js
pengxiaolong 8ec7365e7c 优化页面
2025-06-16 22:09:12 +08:00

2 lines
6.2 KiB
JavaScript

"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&&!0===o.Hint},(""===o.nameAnchor&&o.Hint,{}),{g:e.o$1(((...e)=>r.chooseMyStreamer&&r.chooseMyStreamer(...e))),h:e.o$1(r.country),i:e.p({backgroundColor:"#ffffff",placeholderColor:"#666666",textColor:"#666666",borderColor:"#ffffff",options:o.Country,filterable:o.filterable,placeholder:"请选择国家",value:o.countrys}),j:""===o.countrys||null===o.countrys&&!0===o.Hint},(""===o.countrys||null===o.countrys&&o.Hint,{}),{k:e.o$1(r.gender),l:e.p({backgroundColor:"#ffffff",placeholderColor:"#666666",textColor:"#666666",borderColor:"#ffffff",options:o.Gender,placeholder:"性别",value:"1"===t.message.sex?1:2}),m:0===o.genders||"0"===t.message.sex},(0===o.genders||t.message.sex,{}),{n:1===o.genders||"1"===t.message.sex},(1===o.genders||t.message.sex,{}),{o:2===o.genders||"2"===t.message.sex},(2===o.genders||t.message.sex,{}),{p:0===o.genders||null===o.genders&&!0===o.Hint},(0===o.genders||null===o.genders&&o.Hint,{}),{q:e.o$1((e=>o.numberCoins=e)),r:e.p({max:9999999999,background:"#03ABA8",modelValue:o.numberCoins}),s:""===o.numberCoins||null===o.numberCoins&&!0===o.Hint},(""===o.numberCoins||null===o.numberCoins&&o.Hint,{}),{t:e.o$1((e=>o.datetimesingle=e)),v:e.p({type:"datetime","hide-second":"true",modelValue:o.datetimesingle}),w:""===o.datetimesingle||null===o.datetimesingle&&!0===o.Hint},(""===o.datetimesingle||null===o.datetimesingle&&o.Hint,{}),{x:e.o$1((e=>o.session=e)),y:e.p({background:"#03ABA8",modelValue:o.session}),z:""===o.session||null===o.session&&!0===o.Hint},(""===o.session||null===o.session&&o.Hint,{}),{A:e.o$1((e=>o.remarks=e)),B:e.p({type:"textarea",placeholder:"备注",modelValue:o.remarks}),C:e.o$1((e=>r.Publish())),D:e.o$1((()=>{})),E:e.n(o.Display?"create-module":"close-animation "),F:e.o$1((e=>r.open()))}):{},{G:0!==o.AnchorList.length},0!==o.AnchorList.length?{H:e.f(o.AnchorList,((s,n,t)=>({a:s.headerIcon,b:e.t(s.anchorId),c:e.t(s.country),d:e.o$1((e=>r.Select(s.id,s)),n),e:o.selectedId===s.id?"#f6f6f6":"#ffffff",f:n})))}:{},{I:0===o.AnchorList.length},(o.AnchorList.length,{}),{J:e.o$1((e=>r.invite())),K:e.o$1((e=>r.close())),L:e.sr("popup","f7cb2642-6"),M:e.p({type:"center","border-radius":"10px 10px 0 0"})})}],["__scopeId","data-v-f7cb2642"]]);exports.MiniProgramPage=o;