2 lines
22 KiB
JavaScript
2 lines
22 KiB
JavaScript
|
import{r as e,g as t,Q as l,y as s,l as a,o,c as i,w as n,b as c,K as d,s as r,u,h as f,e as m,t as p,p as h,a as _,F as A,m as g,ab as v,Y as k,i as y,f as x,k as b,v as C,n as w,ai as I,an as S,A as B,j as L,D as N,_ as F,C as U}from"./index-CZsuXyof.js";import{r as V,o as R,g as T}from"./uni-app.es.Cv5-J_i3.js";import{_ as P}from"./uni-icons.CE6FQOeI.js";import{_ as E}from"./pause.BChT5pq5.js";import{_ as j,a as z,b as D,c as Q}from"./indexShare.CMAhXKtL.js";import{_ as $}from"./indexLike1.BFuTKZF9.js";import{_ as M}from"./privateLike.BFvAkl-P.js";import{_ as K}from"./openPage.BSRlUAts.js";import{s as O}from"./statusBar.OmRlYHBn.js";import{_ as q}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{_ as H}from"./uni-popup.M4-7QhOy.js";import{c as G,a as X}from"./collectList.Bw4PX0UH.js";/* empty css *//* empty css */import"./uni-popup.vue_vue_type_style_index_0_scoped_f0b957f8_lang.BhWYEB-t.js";import"./uni-swipe-action.BQfv4oYi.js";const J=q({__name:"indexVideo",props:{item:{type:Object},index:{type:Number},current:{type:Number},tabIndex:{type:Number},mode:{type:String,default:"list"},isMine:{type:[String,Number],default:0}},emits:["showTime","showComment","showCollect","showShareFirend","onPlay","onPause","like","detailMenu","onEnd","longtap","update:item"],setup(I,{expose:S,emit:B}){const L=I,N=B,F=e(null),U=e(!0),R=e(!1),T=t({duration:0,currentTime:0});let q=e(0);const H=l((()=>uni.$store.state.alarmTime));function G(){U.value?J():X()}function X(){let e=v(),t=e[e.length-1];L.index==L.current&&["pages/index/index","pages/index/videoDetail"].includes(t.route)&&F.value.play()}function J(){F.value.pause()}function Y(){U.value=!0,N("onPlay")}function Z(){U.value=!1,N("onPause")}function W(){N("showComment",L.item)}function ee(){N("showTime")}function te(){f.isLogin().then((e=>{N("showCollect",L.item)})).catch((()=>{uni.navigateTo({url:"/pages/login/loginPhone"})}))}function le(){}function se(){f.isLogin().then((e=>{N("showShareFirend",L.item)})).catch((()=>{uni.navigateTo({url:"/pages/login/loginPhone"})}))}function ae(e,t){console.log("index",e),f.isLogin().then((l=>{N("like",{index:e,isLike:t})})).catch((()=>{uni.navigateTo({url:"/pages/login/loginPhone"})}))}function oe(e){N("detailMenu")}function ie(e){Object.assign(T,e.detail),0!=T.duration&&(q.value=T.currentTime/T.duration*750),N("update:item",{...L.item,videoTime:T,videoCurrentTime:q.value})}function ne(){q.value=750,F.value.stop(),setTimeout((()=>{L.index==L.current?X():J()}),750),N("onEnd")}function ce(e){L.index==L.current?X():J()}function de(e){N("longtap")}return s((()=>{F.value=uni.createVideoContext(`video${L.tabIndex}${L.index}`)})),S({play:X,pause:J,videoTime:T,item:L.item,playState:U,videoCtx:()=>F.value}),(e,t)=>{const l=k,s=y,v=x,S=b,B=C,L=w,F=V(a("uni-icons"),P);return o(),i(s,{class:"f1 pr",ref:"videoBoxRef"},{default:n((()=>[c(s,{class:"videoBox pfull",onLongpress:de,onTouchmove:t[0]||(t[0]=d((()=>{}),["stop"]))},{default:n((()=>[c(O),c(l,{class:"video f1",id:"video"+I.tabIndex+I.index,src:I.item.format_videoUrl,"show-fullscreen-btn":!1,"enable-progress-gesture":!1,controls:"false",onClick:G,onPlay:Y,onPause:Z,"show-center-play-btn":!1,onTimeupdate:ie,onEnded:ne,onWaiting:ce,"play-strategy":2},null,8,["id","src"])])),_:1}),U.value?r("",!0):(o(),i(s,{key:0,class:"pausePanel pfull fmid"},{default:n((()=>[c(v,{class:"pauseImg",src:E,mode:"aspectFit"})])),_:1})),c(s,{class:"panelRight pa t0 b0 r0"},{default:n((()=>[c(O),c(s,{class:"head"}),c(s,{class:"f1 jcr pl5 pt40 pr20"},{default:n((()=>[c(s,{class:"operate f1"},{default:n((()=>[c(s,{class:"item"},{default:n((()=>[c(s,{class:"col"},{default:n((()=>[c(v,{class:"wh60",src:"/assets/statistics-CLmAzmRv.jpg",mode:"aspectFit"})])),_:1})])),_:1}),c(S,{url:u(f).setUrl("/pages/index/videoHome",{userId:I.item.userId}),class:"item pr mb10"},{default:n((()=>[c(s,{class:"col"},{default:n((()=>[c(v,{class:"wh80 cir",src:I.item.format_header,mode:"aspectFill"},null,8,["src"]),I.item.
|