From 9c38818d91f2c94b99c31911772edafe40889006 Mon Sep 17 00:00:00 2001 From: qsj <731458905@qq.com> Date: Sat, 16 Mar 2024 17:35:03 +0800 Subject: [PATCH] =?UTF-8?q?'=E8=A7=86=E9=A2=91=E5=85=B3=E9=97=AD=E5=90=AF?= =?UTF-8?q?=E5=8A=A8,=E5=85=B3=E9=97=AD=E5=A3=B0=E9=9F=B3'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.config.json | 2 +- project.private.config.json | 3 ++ src/moduleIOT/pages/iotCarePlan/WL200.tsx | 35 +++++++++++++++++++++-- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/project.config.json b/project.config.json index 5b91d3e..8c8e96f 100644 --- a/project.config.json +++ b/project.config.json @@ -8,7 +8,7 @@ "compileHotReLoad": false, "postcss": false, "preloadBackgroundData": false, - "minified": false, + "minified": true, "newFeature": true, "autoAudits": false, "coverView": true, diff --git a/project.private.config.json b/project.private.config.json index 0d68e04..8793a36 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -26,5 +26,8 @@ } ] } + }, + "setting": { + "bigPackageSizeSupport": true } } \ No newline at end of file diff --git a/src/moduleIOT/pages/iotCarePlan/WL200.tsx b/src/moduleIOT/pages/iotCarePlan/WL200.tsx index d3d7aa7..0a74b90 100644 --- a/src/moduleIOT/pages/iotCarePlan/WL200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/WL200.tsx @@ -8,12 +8,13 @@ import React, { PropsWithChildren, useEffect, useState, + useRef, } from "react"; import Echarts from "./components/Echart/index"; import { Block, - View, + View, Text, Image, Video, @@ -144,7 +145,8 @@ class IotCarePlanWL200 extends Component { matrixElectricity: 4, // WE200发箍电量 workMode: "", //当前模式 - + videoRef: {}, + isMuted: false, gear: { gear: 1 }, currentShowDialog: "", step: 1, // 1:选择模式并播放视频, 2:护理中 @@ -244,7 +246,6 @@ class IotCarePlanWL200 extends Component { componentDidShow() { console.log("页面显示了"); - if (!this.hadLoadedPage) { this.hadLoadedPage = true; // 二次进入页面(非首次进入) return; @@ -2022,6 +2023,23 @@ class IotCarePlanWL200 extends Component { 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 = () => { Taro.reLaunch({ url: "/pages/index/index" }); }; @@ -2039,6 +2057,7 @@ class IotCarePlanWL200 extends Component { isConnectShow, isShowStepTips, isShowNurse, + isStopNurse, ModeList, ModeType, @@ -2052,6 +2071,7 @@ class IotCarePlanWL200 extends Component { isShowCountdown, countdown, Electricity, + isMuted, matrixElectricity, errorTips, isEndCarePlan, @@ -2240,9 +2260,18 @@ class IotCarePlanWL200 extends Component { className='video-or-image' src={ActiveModeItem.modeVideo} loop + + id="myVideo" + + // ref={videoRef} + onPlay={this.onPlay} + muted={isMuted} /> )} + + + {/* */} {isShowNurse && ( {isStopNurse ? (