'视频关闭启动,关闭声音'

master
qsj 2 years ago
parent 5c348080c4
commit 9c38818d91

@ -8,7 +8,7 @@
"compileHotReLoad": false, "compileHotReLoad": false,
"postcss": false, "postcss": false,
"preloadBackgroundData": false, "preloadBackgroundData": false,
"minified": false, "minified": true,
"newFeature": true, "newFeature": true,
"autoAudits": false, "autoAudits": false,
"coverView": true, "coverView": true,

@ -26,5 +26,8 @@
} }
] ]
} }
},
"setting": {
"bigPackageSizeSupport": true
} }
} }

@ -8,6 +8,7 @@ import React, {
PropsWithChildren, PropsWithChildren,
useEffect, useEffect,
useState, useState,
useRef,
} from "react"; } from "react";
import Echarts from "./components/Echart/index"; import Echarts from "./components/Echart/index";
@ -144,7 +145,8 @@ class IotCarePlanWL200 extends Component<any, any> {
matrixElectricity: 4, // WE200发箍电量 matrixElectricity: 4, // WE200发箍电量
workMode: "", //当前模式 workMode: "", //当前模式
videoRef: {},
isMuted: false,
gear: { gear: 1 }, gear: { gear: 1 },
currentShowDialog: "", currentShowDialog: "",
step: 1, // 1:选择模式并播放视频, 2:护理中 step: 1, // 1:选择模式并播放视频, 2:护理中
@ -244,7 +246,6 @@ class IotCarePlanWL200 extends Component<any, any> {
componentDidShow() { componentDidShow() {
console.log("页面显示了"); console.log("页面显示了");
if (!this.hadLoadedPage) { if (!this.hadLoadedPage) {
this.hadLoadedPage = true; // 二次进入页面(非首次进入) this.hadLoadedPage = true; // 二次进入页面(非首次进入)
return; return;
@ -2022,6 +2023,23 @@ class IotCarePlanWL200 extends Component<any, any> {
return isFooterBtnDisabled; // 数据更新有延迟,返回用于判断 return isFooterBtnDisabled; // 数据更新有延迟,返回用于判断
}; };
handleClickVideo = () => {
let videoRef = Taro.createVideoContext('myVideo')
// 开始播放
videoRef.play()
// 暂停播放
videoRef.pause()
console.log('暂停播放', videoRef);
};
handleClicksound = () => {
let isMuted = this.state.isMuted
isMuted = !isMuted
this.setState({ isMuted })
}
onPlay = (e) => {
console.log('出发', e);
}
customBack = () => { customBack = () => {
Taro.reLaunch({ url: "/pages/index/index" }); Taro.reLaunch({ url: "/pages/index/index" });
}; };
@ -2039,6 +2057,7 @@ class IotCarePlanWL200 extends Component<any, any> {
isConnectShow, isConnectShow,
isShowStepTips, isShowStepTips,
isShowNurse, isShowNurse,
isStopNurse, isStopNurse,
ModeList, ModeList,
ModeType, ModeType,
@ -2052,6 +2071,7 @@ class IotCarePlanWL200 extends Component<any, any> {
isShowCountdown, isShowCountdown,
countdown, countdown,
Electricity, Electricity,
isMuted,
matrixElectricity, matrixElectricity,
errorTips, errorTips,
isEndCarePlan, isEndCarePlan,
@ -2240,9 +2260,18 @@ class IotCarePlanWL200 extends Component<any, any> {
className='video-or-image' className='video-or-image'
src={ActiveModeItem.modeVideo} src={ActiveModeItem.modeVideo}
loop loop
id="myVideo"
// ref={videoRef}
onPlay={this.onPlay}
muted={isMuted}
/> />
)} )}
<button onClick={this.handleClicksound}>/</button>
{/* <button onClick={this.handleClickVideo}>播放/暂停</button> */}
{isShowNurse && ( {isShowNurse && (
<Block> <Block>
{isStopNurse ? ( {isStopNurse ? (

Loading…
Cancel
Save