index.2db7339f.js 4.6 KB

1
  1. import{t as b,w as E,u as g,d as y,x as I,c as i,C as T,y as _,bi as N,a5 as p,D as C,f as O,L as w,q as B}from"./index.332c7f08.js";import{P as A}from"./plyr.min.22fd58dd.js";/* empty css */const[P,S]=b("steps"),R={active:E(0),direction:g("horizontal"),activeIcon:g("checked"),iconPrefix:String,finishIcon:String,activeColor:String,inactiveIcon:String,inactiveColor:String},x=Symbol(P);var $=y({name:P,props:R,emits:["clickStep"],setup(n,{emit:e,slots:t}){const{linkChildren:o}=I(x);return o({props:n,onClickStep:a=>e("clickStep",a)}),()=>{var a;return i("div",{class:S([n.direction])},[i("div",{class:S("items")},[(a=t.default)==null?void 0:a.call(t)])])}}});const[D,r]=b("step");var F=y({name:D,setup(n,{slots:e}){const{parent:t,index:o}=T(x);if(!t){console.error("[Vant] <Step> must be a child component of <Steps>.");return}const s=t.props,a=()=>{const l=+s.active;return o.value<l?"finish":o.value===l?"process":"waiting"},u=()=>a()==="process",f=_(()=>({background:a()==="finish"?s.activeColor:s.inactiveColor})),k=_(()=>{if(u())return{color:s.activeColor};if(a()==="waiting")return{color:s.inactiveColor}}),v=()=>t.onClickStep(o.value),V=()=>{const{iconPrefix:l,finishIcon:c,activeIcon:z,activeColor:h,inactiveIcon:m}=s;return u()?e["active-icon"]?e["active-icon"]():i(p,{class:r("icon","active"),name:z,color:h,classPrefix:l},null):a()==="finish"&&(c||e["finish-icon"])?e["finish-icon"]?e["finish-icon"]():i(p,{class:r("icon","finish"),name:c,color:h,classPrefix:l},null):e["inactive-icon"]?e["inactive-icon"]():m?i(p,{class:r("icon"),name:m,classPrefix:l},null):i("i",{class:r("circle"),style:f.value},null)};return()=>{var l;const c=a();return i("div",{class:[N,r([s.direction,{[c]:c}])]},[i("div",{class:r("title",{active:u()}),style:k.value,onClick:v},[(l=e.default)==null?void 0:l.call(e)]),i("div",{class:r("circle-container"),onClick:v},[V()]),i("div",{class:r("line"),style:f.value},null)])}}});const W=C(F),X=C($),j="_video_ga7yz_1",q="_loadingVideo_ga7yz_35",L="_playOver_ga7yz_44",K="_tips_ga7yz_52",Y="_btn_ga7yz_56",G="_replay_ga7yz_63",H="_freeTxt_ga7yz_66",J="_freeRate_ga7yz_72";var d={"video-container":"_video-container_ga7yz_1",video:j,loadingVideo:q,playOver:L,tips:K,btn:Y,replay:G,freeTxt:H,freeRate:J},Z=y({name:"o-video",props:{setting:{type:Object,default:()=>{}},controls:Boolean,height:String,src:{type:String,default:""},poster:{type:String,default:""},styleValue:{type:Object,default:()=>({})},preload:{type:String,default:"auto"},currentTime:{type:Boolean,default:!0},playsinline:{type:Boolean,default:!0},onPlay:{type:Function,default:()=>{}}},emits:["exitfullscreen"],data(){return{player:null,loading:!0}},mounted(){this._init()},methods:{_init(){const n=["play-large","play","progress","captions","fullscreen"];this.currentTime&&n.push("current-time");const e={controls:n,...this.setting,invertTime:!1};O().iPhone&&(e.fullscreen={enabled:!0,fallback:"force",iosNative:!0}),this.player=new A(this.$refs.video,e),this.player.elements.container&&(this.player.elements.container.style.height=this.height||"210px"),this.preload==="none"&&(this.loading=!1),this.player.on("loadedmetadata",()=>{this.loading=!1,this.domPlayVisibility(!1)}),this.player.on("play",()=>{this.onPlay&&this.onPlay(this.player)}),this.player.on("enterfullscreen",()=>{console.log("fullscreen");const t=document.createElement("i");t.id="fullscreen-back",t.className="van-icon van-icon-arrow-left video-back",t.addEventListener("click",()=>{this.player.fullscreen.exit()}),console.log(document.getElementsByClassName("plyr")),document.getElementsByClassName("plyr")[0].appendChild(t)}),this.player.on("exitfullscreen",()=>{console.log("exitfullscreen");const t=document.getElementById("fullscreen-back");t&&t.remove(),this.$emit("exitfullscreen")})},domPlayVisibility(n=!0){const e=document.querySelector(".plyr__controls"),t=document.querySelector(".plyr__control--overlaid");n?(e==null||e.setAttribute("style","display:none"),t==null||t.setAttribute("style","display:none")):(e==null||e.removeAttribute("style"),setTimeout(()=>{t==null||t.removeAttribute("style")},200))},onReplay(){this.player.restart(),this.player.play(),this.domPlayVisibility(!1)},onStop(){this.player.stop()}},unmounted(){var n;(n=this.player)==null||n.destroy()},render(){return i("div",{class:d["video-container"]},[i("video",{ref:"video",class:d.video,src:this.src,playsinline:this.playsinline,poster:this.poster,preload:this.preload,style:{...this.styleValue}},null),this.loading&&i("div",{class:d.loadingVideo,style:{height:this.height||"210px"}},[i(w,{size:36,color:"#FF8057",vertical:!0,style:{height:"100%",justifyContent:"center"}},{default:()=>[B("\u52A0\u8F7D\u4E2D...")]})])])}});export{Z as O,X as S,W as a};