2 lines
29 KiB
JavaScript
2 lines
29 KiB
JavaScript
|
import{r as e,a6 as t,o as l,a as s,c as a,w as o,b as n,e as i,y as c,z as d,N as u,_ as r,F as f,x as m,i as p,g as h,s as A,ah as v,B as g,aI as _,p as k,u as b,h as y,n as x,k as C,$ as I,aj as w,f as S,l as N,b1 as T,q as B,b4 as R,b3 as L,S as U,an as F,H as V,aD as D,aC as M,E as z,a8 as P,A as Q}from"./index-CH9-aFWw.js";import{r as j,o as E,d as X,g as q}from"./uni-app.es.DPi2kvld.js";import{_ as O}from"./uni-icons.DST64Pwo.js";import{_ as K}from"./pause.BChT5pq5.js";import{_ as Z,a as G,b as H,c as J,d as Y}from"./indexShare.BHhcFR3i.js";import{_ as W}from"./openPage.BSRlUAts.js";import{s as $}from"./statusBar.N83grA_6.js";import{_ as ee}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{_ as te}from"./uni-popup.ICCw_VFK.js";import{c as le,a as se}from"./collectList.BwuiCbuk.js";/* empty css *//* empty css */import"./uni-swipe-action.9Z8FtlTp.js";const ae=ee({__name:"videoProgress",props:{time:{type:Object,default:{duration:0,currentTime:0}},viewWidth:{type:Number}},emits:["change","end"],setup(h,{emit:A}){const v=h,g=A,_=e(!1),k=e(0),b=e(0),y=t((()=>{let e=I(v.time.currentTime);return _.value&&(e=k.value),e})),x=t((()=>{let e=0;if(_.value)e=b.value;else{const t=I(v.time.duration);0!=t&&(e=I(v.time.currentTime)/t*v.viewWidth),e=I(e)}return e})),C=t((()=>I(v.time.duration).toFixed(2)));function I(e){let t=Number.parseFloat(e).toFixed(2);return Number.parseFloat(t)}function w(){_.value=!0}function S(e){const t=I(e.changedTouches[0].screenX);let l=I(I(t/v.viewWidth)*Number(C.value));k.value=l,b.value=t}function N(e){_.value=!1,g("change",{time:k.value})}return(e,t)=>{const h=m,A=p;return l(),s(f,null,[_.value?(l(),a(A,{key:0,class:"timeBox fdr jcc"},{default:o((()=>[n(A,{class:"time fdr jcc"},{default:o((()=>[n(h,{class:"text f1"},{default:o((()=>[i(c(y.value),1)])),_:1}),n(h,{class:"text"},{default:o((()=>[i("/")])),_:1}),n(h,{class:"text f1"},{default:o((()=>[i(c(C.value),1)])),_:1})])),_:1})])),_:1})):d("",!0),n(A,{class:"durationBox",ref:"durationBoxRef",onTouchstart:r(w,["stop"]),onTouchmove:r(S,["stop"]),onTouchcancel:N,onTouchend:r(N,["stop"])},{default:o((()=>[n(A,{class:"duration"},{default:o((()=>[n(A,{class:"line",style:u({width:x.value+"px"})},null,8,["style"])])),_:1})])),_:1},512)],64)}}},[["__scopeId","data-v-4e844c95"]]),oe=ee({__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},viewWidth:{type:Number}},emits:["showTime","showComment","showCollect","showFastCollect","showShareFirend","onPlay","onPause","like","detailMenu","onEnd","longtap"],setup(s,{expose:u,emit:f}){const T=s,B=f,R=e(null),L=e(!0);e(!1);const U=e({duration:0,currentTime:0}),F=h([]),V=e(null),D=e(!1),M=e(!1),z=t((()=>uni.$store.state.alarmTime));function P(){if(D.value)F.length=0,E();else{D.value=!0;let e=(new Date).getTime();F.push(e)}clearTimeout(V.value)}function Q(){if(!D.value)return;D.value=!1,(new Date).getTime()-F[F.length-1]>350||(V.value=setTimeout((()=>{const e=T.item.isLike;let t=F.length;switch(F.length=0,t){case 1:E();break;case 2:console.log("公开赞"),B("like",{index:T.index,isLike:0==e?0:1});break;case 3:console.log("隐私赞"),B("like",{index:T.index,isLike:0==e?3:1})}}),200))}function E(){L.value?q():X()}function X(){let e=_(),t=e[e.length-1];T.index==T.current&&["pages/index/index","pages/index/videoDetail"].includes(t.route)&&R.value.play()}function q(){R.value.pause()}function W(){L.value=!0,B("onPlay")}function ee(){L.value=!1,B("onPause")}function te(){B("showComment",T.item)}function le(){B("showTime")}function se(e){M.value=!0,y.isLogin().then((t=>{setTimeout((()=>{if(M.value)setTimeout((()=>{y.isLogin().then((e=>{B("showCollect",T.item)})).catch((()=>{x({url:"/pages/login/loginPhone"})}))}),350);else{if(!T.item.isCollect)return void function(e){const t=e.changedTouches[0];let l=ne(T.viewWidth)-ne(t.screenX)+ne(t.pageX),s=ne(t.screenY)-ne(t.p
|