临时提交

master
blak-kong 2 years ago
parent 5c85dc7e5d
commit 5c28cc0624

@ -17,6 +17,7 @@ export default defineAppConfig({
"pages/instrument_manage/index", "pages/instrument_manage/index",
"pages/instrument_detail/index", "pages/instrument_detail/index",
"pages/instrumentClickinUpload/index", "pages/instrumentClickinUpload/index",
"pages/iotCarePlan/iotCarePlan",
'pages/privacyPolicy/privacyPolicy', 'pages/privacyPolicy/privacyPolicy',
'pages/userPolicy/userPolicy', 'pages/userPolicy/userPolicy',
'pages/about/about', 'pages/about/about',

@ -24,6 +24,7 @@ class App extends Component<PropsWithChildren> {
return; return;
} }
// go("/pages/iotCarePlan/iotCarePlan");
// go("/pages/instrument_clickin_upload/index"); // go("/pages/instrument_clickin_upload/index");
// go("/pages/instrument/intro"); // go("/pages/instrument/intro");
// Taro.switchTab({ // Taro.switchTab({

@ -299,8 +299,8 @@ class ConnectionBluetoot extends Component<any, any> {
// let type = this.props.yiqiInfo.model || "FR200"; // let type = this.props.yiqiInfo.model || "FR200";
let type = "WE200"; let type = "WE200";
// this.props.yiqiInfo.model = type; // this.props.yiqiInfo.model = type;
console.log(" this.props.yiqiInfo.model", this.props.yiqiInfo.model); console.log("this.props.yiqiInfo.model", this.props.yiqiInfo.model);
// console.info('搜索到到蓝牙设备 value => ', item.devices[0]?.name) console.info("搜索到到蓝牙设备 value => ", item.devices[0]?.name);
for (let i = 0; i < item.devices.length; i++) { for (let i = 0; i < item.devices.length; i++) {
if ( if (
item.devices[i].connectable && item.devices[i].connectable &&
@ -336,6 +336,10 @@ class ConnectionBluetoot extends Component<any, any> {
} catch (e) {} } catch (e) {}
clearTimeout(connectionTimer); clearTimeout(connectionTimer);
const { yiqiInfo: deviceInfo } = this.props; const { yiqiInfo: deviceInfo } = this.props;
console.log(
"this.props.bluetoothInfo.deviceId",
this.props.bluetoothInfo.deviceId
);
/*********开始主动连接*******/ /*********开始主动连接*******/
createBLEConnection(this.props.bluetoothInfo.deviceId) createBLEConnection(this.props.bluetoothInfo.deviceId)
.then((res) => { .then((res) => {
@ -464,7 +468,7 @@ class ConnectionBluetoot extends Component<any, any> {
connectionStatus, connectionStatus,
islian: true, // 不需要离线记录但暂未完全删除这部分逻辑所以直接设为true islian: true, // 不需要离线记录但暂未完全删除这部分逻辑所以直接设为true
}); });
this.detectVersionUpdate(); // this.detectVersionUpdate(); // 获取升级信息
// todo 连接成功需删除离线记录,暂时未缓存离线记录 // todo 连接成功需删除离线记录,暂时未缓存离线记录
if (this.state.connectionSuccess) return; if (this.state.connectionSuccess) return;
// 暂时不需要查询是否连接子设备, 直接进入查询版本信息 // 暂时不需要查询是否连接子设备, 直接进入查询版本信息
@ -698,7 +702,7 @@ class ConnectionBluetoot extends Component<any, any> {
); );
break; break;
case InstrumentTypeEnum.WL200: case InstrumentTypeEnum.WL200:
console.log("WL200无法配对只能用M01"); // console.log("WL200无法配对只能用M01");
console.log("正在发送WL200", bleCommandSamples.match); console.log("正在发送WL200", bleCommandSamples.match);
// matchArrayBuffer = deviceToolKitInstanceWL200.toBleCommand( // matchArrayBuffer = deviceToolKitInstanceWL200.toBleCommand(
// bleCommandSamples.match as any // bleCommandSamples.match as any

@ -1,9 +1,11 @@
.common-box { .common-box {
width: 670rpx; width: 670rpx;
height: 1150rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.site-popup-content-box { .device-connection-box {
height: 1150rpx;
}
.device-popup-content-box {
margin: 0; margin: 0;
} }
// .van-popup { // .van-popup {
@ -65,7 +67,7 @@
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
column-gap: 30rpx; // column-gap: 30rpx;
// padding-top: 10px; // padding-top: 10px;
margin: 0 auto 10px; margin: 0 auto 10px;
text-align: center; text-align: center;

@ -103,13 +103,13 @@ export default class DeviceConnectPopup extends Component<any, any> {
></View> ></View>
{!error && ( {!error && (
<View className={classnames("common-box upload-tips-common-box")}> <View className={classnames("common-box device-connection-box")}>
<View <View
className={classnames("common-popup-title", "margin-samll")} className={classnames("common-popup-title", "margin-samll")}
> >
{data.bluetoothConnectingTitle} {data.bluetoothConnectingTitle}
</View> </View>
<View className="site-popup-content-box"> <View className="device-popup-content-box">
{this.isImage(data.bluetoothConnecting) ? ( {this.isImage(data.bluetoothConnecting) ? (
<Video className="videos" src={data.bluetoothConnecting} /> <Video className="videos" src={data.bluetoothConnecting} />
) : ( ) : (
@ -121,56 +121,60 @@ export default class DeviceConnectPopup extends Component<any, any> {
)} )}
<View className="block"> <View className="block">
<View className="icon"> {isConnection ? (
{isConnection ? ( <Block>
<Block> <View className="icon">
<Image <Image
className="images" className="images"
src={require("../../../img/selected_success.png")} src={require("../../../img/selected_success.png")}
mode="aspectFill" mode="aspectFill"
/> />
<View className="tip"> </View>
{data.bluetoothConnectingContent} <View className="tip">
</View> {data.bluetoothConnectingContent}
</Block> </View>
) : ( </Block>
<Block> ) : (
<Block>
<View className="icon">
<Image <Image
className="images" className="images"
src={require("../../../img/select_success.png")} src={require("../../../img/select_success.png")}
mode="aspectFill" mode="aspectFill"
/> />
<View className="tip success"> </View>
{data.bluetoothConnectingContent} <View className="tip success">
</View> {data.bluetoothConnectingContent}
</Block> </View>
)} </Block>
</View> )}
</View> </View>
<View className="block2"> <View className="block2">
<View className="icon"> {connectionSuccess ? (
{connectionSuccess ? ( <Block>
<Block> <View className="icon">
<Image <Image
className="images" className="images"
src={require("../../../img/selected_success.png")} src={require("../../../img/selected_success.png")}
mode="aspectFill" mode="aspectFill"
/> />
<View className="tip"></View> </View>
</Block> <View className="tip"></View>
) : ( </Block>
<Block> ) : (
<Block>
<View className="icon">
<Image <Image
className="images" className="images"
src={require("../../../img/select_success.png")} src={require("../../../img/select_success.png")}
mode="aspectFill" mode="aspectFill"
/> />
<View className="tip success"> </View>
<View className="tip success">
</View>
</Block> </View>
)} </Block>
</View> )}
</View> </View>
</View> </View>
<View className="common-popup-btns"> <View className="common-popup-btns">
@ -185,13 +189,13 @@ export default class DeviceConnectPopup extends Component<any, any> {
)} )}
{error && ( {error && (
<View className={classnames("common-box")}> <View className={classnames("common-box", "device-connection-box")}>
<View <View
className={classnames("common-popup-title", "margin-samll")} className={classnames("common-popup-title", "margin-samll")}
> >
{data.bluetoothConnectFailTitle} {data.bluetoothConnectFailTitle}
</View> </View>
<View className="site-popup-content-box"> <View className="device-popup-content-box">
<Video className="videos" src={data.bluetoothConnectFail} /> <Video className="videos" src={data.bluetoothConnectFail} />
<View className="error-block"> <View className="error-block">

@ -573,16 +573,8 @@ class Index extends Component<any, any> {
goNursing = (item) => { goNursing = (item) => {
console.log("goNursing", item); console.log("goNursing", item);
setStorageSync("instrument_detail", JSON.stringify(item)); setStorageSync("instrument_detail", JSON.stringify(item));
// setStorageSync("connectInstrument", JSON.stringify(item));
this.setState({ connectInstrument: item }); this.setState({ connectInstrument: item });
setTimeout(() => this.bindBlockLeft()); setTimeout(() => this.bindBlockLeft());
// isConnectShow
// setTimeout(() => {
// go("/pages/instrumentClickinUpload/index?id=" + item.id);
// }, 10);
// go("/pages/instrument/intro?id=" + item.id);
}; };
/* 扫码进入逻辑 */ /* 扫码进入逻辑 */
@ -599,6 +591,8 @@ class Index extends Component<any, any> {
go("/pages/instrumentClickinUpload/index"); go("/pages/instrumentClickinUpload/index");
}, 10); }, 10);
} else { } else {
go("/pages/iotCarePlan/iotCarePlan"); // 画页面直接跳转
return;
Taro.getSystemInfo({ Taro.getSystemInfo({
success: (res) => { success: (res) => {
console.log("getSystemInfo", res); console.log("getSystemInfo", res);

@ -0,0 +1,99 @@
.mode-list-box {
width: 100%;
height: 160rpx;
margin-bottom: 20rpx;
&:last-child {
margin-bottom: 0;
}
.mode-list {
display: flex;
align-items: center;
.mode-item-title {
display: flex;
align-items: center;
justify-content: center;
width: 110rpx;
min-width: 110rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: bold;
color: #000000;
margin: 0 20rpx;
}
.mode-item {
display: flex;
min-width: 140rpx;
height: 160rpx;
align-items: center;
margin-bottom: 20rpx;
background-color: #fff;
border-radius: 20rpx;
/*padding: 17rpx 18rpx;*/
box-sizing: border-box;
transition: all 0.3s;
flex-shrink: 0;
overflow: hidden;
.mode-info {
min-width: 140rpx;
padding-left: 10rpx;
padding-right: 10rpx;
.mode-info-title {
margin-bottom: 4rpx;
font-size: 26rpx;
text-align: center;
}
.mode-info-time {
margin-bottom: 4rpx;
text-align: center;
color: #666666;
font-size: 24rpx;
}
.mode-info-select {
display: flex;
align-items: center;
justify-content: center;
width: 30rpx;
height: 30rpx;
margin: 10rpx auto 0;
border: 3rpx solid #f1f1f1;
border-radius: 50%;
box-sizing: border-box;
&.is-select {
background-color: #fff;
border: none;
}
}
.mode-info-select-point {
width: 14rpx;
height: 14rpx;
background-color: #000000;
border-radius: 50%;
}
}
}
.mode-item + .mode-item {
margin-left: 20rpx;
}
.mode-item-active {
min-width: 300rpx;
padding-right: 11rpx;
background: linear-gradient(90deg, #efdcc2 0%, #fff2df 100%);
}
.mode-pic {
width: 140rpx;
height: 140rpx;
/*margin-left: 20rpx;*/
background-color: #f1f1f1;
border-radius: 20rpx;
overflow: hidden;
}
.mode-pic image {
width: 100%;
height: 100%;
vertical-align: middle;
}
}
}

@ -0,0 +1,104 @@
import Taro from "@tarojs/taro";
import { Block, View, ScrollView, Image } from "@tarojs/components";
import "./index.less";
interface Props {
// link: string;
// children?: any;
ModeList: any;
}
let scrollIntoView = "0";
function Index({ ModeList }: any) {
let VisorList = ModeList.filter((item) => item.modeType === 1); // 面罩模式
let CabinList = ModeList.filter((item) => item.modeType === 2); // 舱体模式
let YimeishList = ModeList.filter((item) => item.modeType === 3); // 医美术后
return (
<Block>
<ScrollView
className="mode-list-box"
scroll-x="true"
scrollIntoView={scrollIntoView}
>
{VisorList.length > 0 && (
<View className="mode-list">
<View className="mode-item-title"></View>
{VisorList.map((item: any, index: any) => {
return (
<View key={index} className="mode-item mode-item-active">
<View className="mode-info">
<View className="mode-info-title">{item.modeName}</View>
<View className="mode-info-time">{item.modeDesc}</View>
<View className="mode-info-select is-select">
<View className="mode-info-select-point"></View>
</View>
</View>
<View className="mode-pic">
<Image src={item.banner} mode="aspectFill" />
</View>
</View>
);
})}
</View>
)}
</ScrollView>
<ScrollView
className="mode-list-box"
scrollX={true}
scrollIntoView={scrollIntoView}
>
{CabinList.length > 0 && (
<View className="mode-list">
<View className="mode-item-title"></View>
{CabinList.map((item: any, index: any) => {
return (
<View key={index} className="mode-item mode-item-active">
<View className="mode-info">
<View className="mode-info-title">{item.title}</View>
<View className="mode-info-time">{item.time}</View>
<View className="mode-info-select is-select">
<View className="mode-info-select-point"></View>
</View>
</View>
<View className="mode-pic">
<Image src={item.banner} mode="aspectFill" />
</View>
</View>
);
})}
</View>
)}
</ScrollView>
<ScrollView
className="mode-list-box"
scrollX={true}
scrollIntoView={scrollIntoView}
>
{YimeishList.length > 0 && (
<View className="mode-list">
<View className="mode-item-title"></View>
{YimeishList.map((item: any, index: any) => {
return (
<View key={index} className="mode-item mode-item-active">
<View className="mode-info">
<View className="mode-info-title">{item.title}</View>
<View className="mode-info-time">{item.time}</View>
<View className="mode-info-select is-select">
<View className="mode-info-select-point"></View>
</View>
</View>
<View className="mode-pic">
<Image src={item.banner} mode="aspectFill" />
</View>
</View>
);
})}
</View>
)}
</ScrollView>
</Block>
);
}
export default Index;

@ -0,0 +1,52 @@
.iot-main {
padding: 20rpx 30rpx;
background: #f8f8f8;
box-sizing: border-box;
.banner-box {
position: relative;
display: block;
width: 690rpx;
height: 790rpx;
background-color: #fff;
border-radius: 30rpx;
.music-btn {
position: absolute;
top: 17rpx;
right: 17rpx;
width: 54rpx;
height: 54rpx;
background: #f8f8f8;
border-radius: 50%;
z-index: 10;
display: flex;
justify-content: center;
align-items: center;
.music-btn_icon {
width: 54rpx;
height: 54rpx;
}
}
.video-or-image {
display: block;
width: 690rpx;
height: 690rpx;
border-radius: 30rpx;
}
.iot-device {
width: 690rpx;
height: 100rpx;
display: flex;
align-items: center;
.item {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
height: 50rpx;
}
.border-right {
border-right: 1px solid #ddd;
}
}
}
}

@ -2,15 +2,32 @@ import Taro from "@tarojs/taro";
import classnames from "classnames"; import classnames from "classnames";
import { Component, PropsWithChildren, useEffect, useState } from "react"; import { Component, PropsWithChildren, useEffect, useState } from "react";
import { Block, View, Text, Image, Input, Button } from "@tarojs/components"; import {
Block,
View,
Text,
Image,
Video,
Input,
Button,
} from "@tarojs/components";
/*** redux ***/ /*** redux ***/
import { connect } from "react-redux"; import { connect } from "react-redux";
import { userRefresh, tokenRefresh } from "@/store/features/userInfo";
/*** redux end ***/ /*** redux end ***/
// import log from "@/utils/log";
// log.info("123456info", 123456, { sdfasdf: 123 });
/* 公共组件 */
import Navbar from "@/components/navbar/navbar"; import Navbar from "@/components/navbar/navbar";
/* 公共组件 END */
/* 本页组件 */
import ModeListView from "./components/ModeList/index";
/* 本页组件 END */
import { getStorageSync, setStorageSync } from "@/utils/traoAPI";
import { InstrumentInfo } from "@/utils/Interface";
import "./iotCarePlan.less"; import "./iotCarePlan.less";
class IotCarePlan extends Component<any, any> { class IotCarePlan extends Component<any, any> {
@ -18,6 +35,53 @@ class IotCarePlan extends Component<any, any> {
super(props); super(props);
this.state = { this.state = {
name: "iotCarePlan", name: "iotCarePlan",
musicStatus: false, // 声音播放状态
// visorList: [
// {
// title: "visorList",
// time: "2024-02-04",
// banner: "",
// },
// {
// title: "visorList",
// time: "2024-02-04",
// banner: "",
// },
// {
// title: "visorList",
// time: "2024-02-04",
// banner: "",
// },
// {
// title: "visorList",
// time: "2024-02-04",
// banner: "",
// },
// ],
// cabinList: [
// {
// title: "cabinList",
// time: "2024-02-04",
// banner: "",
// },
// {
// title: "cabinList",
// time: "2024-02-04",
// banner: "",
// },
// {
// title: "cabinList",
// time: "2024-02-04",
// banner: "",
// },
// {
// title: "cabinList",
// time: "2024-02-04",
// banner: "",
// },
// ],
ModeList: [],
}; };
} }
@ -26,18 +90,68 @@ class IotCarePlan extends Component<any, any> {
componentWillUnmount() {} componentWillUnmount() {}
componentDidShow() {} componentDidShow() {
this.initData();
}
componentDidHide() {} componentDidHide() {}
async initData() {} async initData() {
let objStr = getStorageSync("instrument_detail");
if (objStr) {
let info = JSON.parse(objStr);
this.GetModeList(info.id);
}
}
GetModeList = async (id) => {
let params = {
instrumentId: id,
};
let res = await InstrumentInfo.modeInfoList(params);
console.log("GetModeList", res);
if (res.data.code === 200) {
this.setState({ ModeList: res.data.data });
}
};
render() { render() {
let { name } = this.state; let { name, musicStatus, ModeList } = this.state;
return ( return (
<Block> <Block>
<Navbar titleSlot="美容仪名字" isBack={true} /> <Navbar titleSlot="美容仪名字" isBack={true} />
<View>{name}</View> <View>
<View className="iot-main">
<View className="banner-box">
<View className="music-btn">
{musicStatus ? (
<Image
className="music-btn_icon"
src={require("../../img/volume_icon.png")}
mode="aspectFill"
/>
) : (
<Image
className="music-btn_icon"
src={require("../../img/mute_icon.png")}
mode="aspectFill"
/>
)}
</View>
<Video className="video-or-image" src="" />
<View className="iot-device">
<View className="item border-right">
<Text>10:00</Text>
</View>
<View className="item">
<Text>WE200</Text>
</View>
</View>
</View>
<ModeListView ModeList={ModeList} />
</View>
</View>
</Block> </Block>
); );
} }

@ -34,9 +34,9 @@ const deviceInfoReducer = createSlice({
} }
}, },
setDeviceId(state, { payload }) { setDeviceId(state, { payload }) {
console.log("setDeviceId state", state);
console.log("setDeviceId payload", payload); console.log("setDeviceId payload", payload);
state.bluetoothInfo.deviceId = payload.deviceId; state.bluetoothInfo.deviceId = payload.deviceId;
console.log("state.bluetoothInfo.deviceId", state.bluetoothInfo.deviceId);
}, },
}, },
}); });

@ -10,7 +10,6 @@ const log = {
}, },
info() { info() {
if (!logger) return; if (!logger) return;
console.log("logger.info", logger.info, arguments);
logger.info.apply(logger, arguments); logger.info.apply(logger, arguments);
}, },
warn() { warn() {

@ -87,9 +87,6 @@ export const Ajax = (params) => {
return false; return false;
} }
if (requestUrlList.length > 0) {
requestUrlList.splice(requestUrlList.indexOf(params.url), 1);
}
reslove(res); reslove(res);
}, },
fail(err) { fail(err) {
@ -102,6 +99,9 @@ export const Ajax = (params) => {
// }); // });
}, },
complete() { complete() {
if (requestUrlList.length > 0) {
requestUrlList.splice(requestUrlList.indexOf(params.url), 1);
}
if (requestUrlList.length === 0) { if (requestUrlList.length === 0) {
Taro.hideLoading(); Taro.hideLoading();
} }

Loading…
Cancel
Save