2 lines
8.9 KiB
JavaScript
2 lines
8.9 KiB
JavaScript
|
import{B as e,Q as l,g as a,j as t,h as s,l as o,a as u,b as d,w as f,F as c,i as r,o as i,e as n,t as p,c as _,m,s as b,T as h,n as v,I as g,v as y,C as x,f as w}from"./index-CZsuXyof.js";import{_ as k}from"./uni-icons.CE6FQOeI.js";import{o as C,f as V,r as j}from"./uni-app.es.Cv5-J_i3.js";import{_ as U}from"./uni-popup.M4-7QhOy.js";import{a as I}from"./apex.RGyUGQCM.js";import{v as B}from"./videoMenu.CeB28kIv.js";import{_ as N}from"./_plugin-vue_export-helper.BCo6x5W8.js";/* empty css */import"./uni-popup.vue_vue_type_style_index_0_scoped_f0b957f8_lang.BhWYEB-t.js";import"./statusBar.OmRlYHBn.js";/* empty css *//* empty css */const $=N({__name:"push",setup(N){const{proxy:$}=x(),T=e(),z=l((()=>T.state.userinfo)),R=a({data:[],pageSize:10,pageNum:1,total:0}),S=a({userId:z.value.userId,videoId:[],reason:"",context:"",pic:[]}),F=a({author:"",mobile:"",mail:"",address:""}),L=a([]),M=l((()=>L.map((e=>e.videoId)))),q=a([]),A=l((()=>q.map((e=>R.data.find((l=>l.videoId==e))||{})))),E=l((()=>[...q,...M.value]));function P(){R.pageNum=1,R.total=0,G()}function D(){R.data.length>=R.total||(R.pageNum++,G())}function G(){t.video.myVideoList({query:{isDraft:0,userId:S.userId,pageSize:R.pageSize,pageNum:R.pageNum}}).then((e=>{if(200==e.code)return 1==R.pageNum&&(R.data.length=[]),R.data.push(...e.rows.map((e=>(e.format_videoUrl=s.format_url(e.videoUrl,"video"),e.format_imageUrl=s.format_url(e.imageUrl,"img"),e)))),void(R.total=e.total);s.alert({content:e.msg,showCancel:!1})}))}function H(){E.value.length<1?s.alert({content:"请选择投流视频",showCancel:!1}):z.value.fruit<=10*E.value.length?s.alert({content:"榴莲果不足",showCancel:!1}):h.pushVideo({query:{ids:E.value.join(",")}}).then((e=>{if(200===e.code)return $.$refs.applyRef.close(),s.alert("申请成功,请等待后台审核"),void s.getUserinfo();s.alert({content:e.msg,showCancel:!1})}))}function Q(){E.value.length<1?s.alert({content:"请选择投流视频",showCancel:!1}):z.value.fruit<=10*E.value.length?s.alert({content:"榴莲果不足",showCancel:!1}):h.applyVideo({data:{videoIds:E.value.join(","),author:F.author,mobile:F.mobile,address:F.address,mail:F.mail}}).then((e=>{if(200===e.code)return $.$refs.applyRef.close(),s.alert("申请成功,请等待后台审核"),void s.getUserinfo();s.alert({content:e.msg,showCancel:!1})}))}function J(){uni.navigateTo({url:s.setUrl("/pages/index/dataCenter/pushVideoCollects",{ids:M.value.join(",")})})}return C((()=>{G(),uni.$on("selectPushCollectVideo",(e=>{let l=L.findIndex((l=>l.videoId==e.videoId));l<0?L.push(e):L.splice(l,1)}))})),V((()=>{uni.$off("selectPushCollectVideo")})),(e,l)=>{const a=r,t=j(o("uni-icons"),k),h=w,x=v,C=g,V=j(o("uni-popup"),U),N=y;return i(),u(c,null,[d(a,{class:"app"},{default:f((()=>[d(I,{title:"投流推广"},{right:f((()=>[d(a,{class:"c333 f28",onClick:l[0]||(l[0]=e=>{return l="/pages/index/dataCenter/pushHistory",void uni.navigateTo({url:l});var l})},{default:f((()=>[n("历史推流")])),_:1})])),_:1}),d(a,{class:"first oh mtb40 mlr20 plr20 bfff br10"},{default:f((()=>[d(a,{class:"rows mtb30 c333 f36"},{default:f((()=>[d(a,{class:"col"},{default:f((()=>[d(a,{class:"df aic"},{default:f((()=>[d(a,{class:""},{default:f((()=>[n("我想投流的视频")])),_:1}),d(t,{type:"bottom"})])),_:1}),d(a,{class:"hint mt10 f28"},{default:f((()=>[n("点击选择视频,已选择"+p(A.value.length)+"个",1)])),_:1})])),_:1}),d(a,{class:"line uploadBox"},{default:f((()=>[d(a,{class:"key",onClick:l[1]||(l[1]=l=>e.$refs.select.open())},{default:f((()=>[n("选择视频")])),_:1})])),_:1})])),_:1}),A.value[0]?(i(),_(a,{key:0,class:"listBox mtb30"},{default:f((()=>[d(x,{"scroll-x":"true",class:"scroll"},{default:f((()=>[d(a,{class:"list df"},{default:f((()=>[(i(!0),u(c,null,m(A.value,((e,l)=>(i(),_(a,{class:"item oh pr fs0 mr20 br20",key:l},{default:f((()=>[d(h,{class:"poster br20",src:e.format_imageUrl,mode:"aspectFill"},null,8,["sr
|