Commit f2be2cb4 authored by cc's avatar cc

update

parent 9a4b585a
......@@ -56,6 +56,9 @@ importers:
detect-collisions:
specifier: ^9.26.4
version: 9.26.4
dplayer:
specifier: ^1.27.1
version: 1.27.1
duiba-utils:
specifier: ^2.0.2
version: 2.0.2
......@@ -2030,6 +2033,9 @@ packages:
resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==}
engines: {node: '>= 0.4'}
axios@1.2.3:
resolution: {integrity: sha512-pdDkMYJeuXLZ6Xj/Q5J3Phpe+jbGdsSzlQaFVkMQzRUL05+6+tetX8TV3p4HrU4kzuO9bt+io/yGQxuyxA/xcw==, tarball: http://npm.dui88.com:80/axios/-/axios-1.2.3.tgz}
axios@1.9.0:
resolution: {integrity: sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg==}
......@@ -2051,6 +2057,9 @@ packages:
balanced-match@1.0.2:
resolution: {integrity: sha1-6D46fj8wCzTLnYf2FfoMvzV2kO4=}
balloon-css@1.2.0:
resolution: {integrity: sha512-urXwkHgwp6GsXVF+it01485Z2Cj4pnW02ICnM0TemOlkKmCNnDLmyy+ZZiRXBpwldUXO+aRNr7Hdia4CBvXJ5A==, tarball: http://npm.dui88.com:80/balloon-css/-/balloon-css-1.2.0.tgz}
base64-arraybuffer@1.0.2:
resolution: {integrity: sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==}
engines: {node: '>= 0.6.0'}
......@@ -2459,6 +2468,9 @@ packages:
resolution: {integrity: sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==}
engines: {node: '>=12'}
dplayer@1.27.1:
resolution: {integrity: sha512-2laBMXs5V1B9zPwJ7eAIw/OBo+Xjvy03i4GHTk3Cg+IWbrq8rKMFO0fFr6ClAYotYOCcFGOvaJDkOZcgKllsCA==, tarball: http://npm.dui88.com:80/dplayer/-/dplayer-1.27.1.tgz}
duiba-utils@1.0.13:
resolution: {integrity: sha512-VEFzmfiujSZcl40jgRhkuv1lAsvLxhfArENFbI1NXxAz9iihdGOH1SdTektWaH5hrwsWvy/6kB088KzxJ+QvtA==}
......@@ -3884,6 +3896,9 @@ packages:
resolution: {integrity: sha1-foz42PW48jnBvGi+tOt4Vn1XLvg=}
engines: {node: '>=0.4.0'}
promise-polyfill@8.3.0:
resolution: {integrity: sha512-H5oELycFml5yto/atYqmjyigJoAo3+OXwolYiH7OfQuYlAqhxNvTfiNMbV9hsC6Yp83yE5r2KTVmtrG6R9i6Pg==, tarball: http://npm.dui88.com:80/promise-polyfill/-/promise-polyfill-8.3.0.tgz}
protobufjs@7.5.0:
resolution: {integrity: sha512-Z2E/kOY1QjoMlCytmexzYfDm/w5fKAiRwpSzGtdnXW1zC88Z2yXazHHrOtwCzn+7wSxyE8PYM4rvVcMphF9sOA==}
engines: {node: '>=12.0.0'}
......@@ -6496,6 +6511,14 @@ snapshots:
dependencies:
possible-typed-array-names: 1.1.0
axios@1.2.3:
dependencies:
follow-redirects: 1.15.9
form-data: 4.0.2
proxy-from-env: 1.1.0
transitivePeerDependencies:
- debug
axios@1.9.0:
dependencies:
follow-redirects: 1.15.9
......@@ -6530,6 +6553,8 @@ snapshots:
balanced-match@1.0.2: {}
balloon-css@1.2.0: {}
base64-arraybuffer@1.0.2: {}
base64-js@1.5.1: {}
......@@ -6978,6 +7003,14 @@ snapshots:
dotenv@16.4.7: {}
dplayer@1.27.1:
dependencies:
axios: 1.2.3
balloon-css: 1.2.0
promise-polyfill: 8.3.0
transitivePeerDependencies:
- debug
duiba-utils@1.0.13: {}
duiba-utils@2.0.2: {}
......@@ -8354,6 +8387,8 @@ snapshots:
progress@2.0.3: {}
promise-polyfill@8.3.0: {}
protobufjs@7.5.0:
dependencies:
'@protobufjs/aspromise': 1.1.2
......
......@@ -15,7 +15,10 @@ class Homepage extends React.Component {
super(props);
}
componentDidMount(): void {
// ModalCtrl.showModal(Taskpop);
}
showTask = () =>{
ModalCtrl.showModal(Taskpop);
}
showRank = () => {
PageCtrl.changePage(RankPage);
......@@ -34,7 +37,7 @@ class Homepage extends React.Component {
<span className="wenhao"></span>
<span className="title"></span>
<span className="draw"></span>
<span className="task"></span>
<span className="task" onClick={this.showTask}></span>
<div className="matter">
<span className="m_bg"></span>
<span className="answer"></span>
......
@import "../../res.less";
.longImgPop {
position: absolute;
width: 100vw;
height: 100vh;
left: 0px;
top: 0px;
overflow-y: auto;
overflow-x: hidden;
background-color: rgba(0, 0, 0, 0.8);
.mainImg {
position: relative;
width: 100%;
height: auto;
}
.back_home {
width: 60px;
height: 60px;
left: 40px;
top: 65px;
position: fixed;
.sparkBg("PrizePage/back.png");
// .sparkBg("TaskPop/longBackBtn.png");
}
.countdown {
width: 113px;
height: 50px;
text-align: center;
position: fixed;
left: 588px;
top: 65px;
color: #fff;
border: 2px solid rgb(255, 255, 255);
border-left: none;
border-radius: 8px;
background-color: rgba(70, 0, 0, 0.302);
box-shadow: inset 0.707px 0.707px 2px 0px rgba(225, 253, 255, 0.83);
font-size: 31px;
text-align: center;
line-height: 50px;
box-sizing: border-box;
}
.v-wrapper {
width: 100%;
height: 100%;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.vjs-tech {
width: 100%;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
// .dplayer-controller{
// display: none;
// }
#my-player {
width: 100% !important;
// height: 420px;
position: absolute;
top: 50%;
transform: translateY(-50%);
// pointer-events: none;
}
.dplayer-setting-loop {
display: none !important;
}
}
"use strict";
import React from "react";
import { observer } from "mobx-react";
import "./longImgPop.less";
import { _throttle } from "@/utils/utils.ts";
import DPlayer from "dplayer";
import { ModalCtrl } from "@/core/ctrls/ModalCtrl";
import Taskpop from "../taskpop/taskpop";
import { Button } from "@grace/ui";
@observer
class LongImgPop extends React.Component {
constructor(props) {
super(props);
this.state = {
isFinish: false,
countdownTime: 15, // 单位s
};
this.timer = "";
this.isStart = false;
this.stop = false;
this.dp = null;
}
componentDidMount() {
console.log('this.props?.type',this.props?.type)
if (this.props?.type == 2) {
this.dp = new DPlayer({
container: this.videoNode,
video: {
url: this.props?.imgUrl,
},
loop: true,
});
this.dp.on("play", () => {
this.startInterval();
});
this.dp.on("pause", () => {
// this.endCountDown()
});
}
if (this.props?.noCount) {
this.setState({
isFinish: true,
});
} else {
if(this.props?.type == 2) return
this.startInterval();
}
}
componentWillUnmount() {
if (this.timer) clearInterval(this.timer);
}
/** 开始倒计时 */
startInterval = () => {
if (this.timer) clearInterval(this.timer);
this.timer = setInterval(async () => {
if (this.state.countdownTime === 0) {
this.setState({
isFinish: true,
});
clearInterval(this.timer);
this.timer = "";
// 完成任务
const { taskSucCb } = this.props || {};
taskSucCb && taskSucCb();
return;
}
this.setState({
countdownTime: Math.max(0, this.state.countdownTime - 1),
});
}, 1000);
};
/** 关闭当前页面 */
closeHandle = () => {
ModalCtrl.closeModal()
if (!this.props.noCount) {
ModalCtrl.showModal(Taskpop)
}
};
render() {
const { imgUrl, type } = this.props || {};
const { isFinish, countdownTime } = this.state;
return (
<div className="longImgPop">
{type == 1 && <img src={imgUrl} alt="" className="mainImg" />}
{type == 2 && (
<div className="v-wrapper">
<div ref={(node) => (this.videoNode = node)} id="my-player" className="video-js"></div>
</div>
)}
<Button className="back_home" onClick={this.closeHandle}></Button>
{!isFinish && <span className="countdown">{`${countdownTime}s`}</span>}
</div>
);
}
}
export default LongImgPop;
......@@ -23,10 +23,10 @@
.sparkBg("TaskPop/icon.png");
}
.close {
width: 62px;
height: 62px;
left: 668px;
top: -70px;
width: 64px;
height: 64px;
left: 648px;
top: -10px;
position: absolute;
.sparkBg("TaskPop/close.png");
}
......
......@@ -9,6 +9,8 @@ import { isWeChat } from "../utils/share";
import { appJump, getUrlParam, windowJumpUrl } from "../utils/utils";
import { CHANNEL_PARAMS, TASK_CODE } from "../utils/constants";
import { Toast } from "@grace/ui";
import { ModalCtrl } from "@/core/ctrls/ModalCtrl";
import LongImgPop from "@/panels/longImgPop/longImgPop";
const taskStore = makeAutoObservable({
/** 当前任务 */
......@@ -50,17 +52,15 @@ const taskStore = makeAutoObservable({
break;
//增员介绍 海报or视频
case code?.indexOf("browse_zeng_yuan") > -1:
// if(code == "browser_zeng_yuan_1"){
// modalStore.closePop("Taskpop");
// modalStore.pushPop("LongImgPop", {
// imgUrl: jumpUrl,
// taskSucCb: async () => {
// await this.complete(item);
// },
// noCount: false,
// type: code == "browse_zeng_yuan_1" ? 1 : 2, //1海报 2视频
// });
// }
ModalCtrl.closeModal();
ModalCtrl.showModal(LongImgPop,{
imgUrl: jumpUrl,
taskSucCb: async () => {
await this.complete(item);
},
noCount: false,
type: code == "browse_zeng_yuan_1" ? 1 : 2, //1海报 2视频
})
break;
// 七秒浏览 or 税优关爱百万任务
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment