Merge branch 'lzwdev' of https://gitee.com/yunqiang_technology/flowsomwechat into rwkdev
commit
50da63ce9f
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,109 @@
|
|||||||
|
.footer {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
background: #fff;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
padding-bottom: 30rpx;
|
||||||
|
// padding-bottom: env(safe-area-inset-bottom);
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer .btn {
|
||||||
|
width: 690rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
background: #000;
|
||||||
|
border-radius: 45rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 90rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-family: PingFang SC;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer .text {
|
||||||
|
background: transparent;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-family: PingFang SC;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main {
|
||||||
|
height: 100vh;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 34rpx;
|
||||||
|
padding-bottom: calc(env(safe-area-inset-bottom) + 180rpx);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cover {
|
||||||
|
display: block; // 消除默认间距
|
||||||
|
width: 660rpx;
|
||||||
|
height: 922rpx;
|
||||||
|
border-radius: 50rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
display: block; // 消除默认间距
|
||||||
|
width: 660rpx;
|
||||||
|
// height: 474rpx;
|
||||||
|
height: 488rpx;
|
||||||
|
background: linear-gradient(rgba(204, 204, 204, 0.4), #fff);
|
||||||
|
border-radius: 50rpx;
|
||||||
|
margin-top: 7rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 48rpx;
|
||||||
|
font-family: PingFang SC;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #000;
|
||||||
|
text-align: center;
|
||||||
|
padding-bottom: 30rpx;
|
||||||
|
padding-top: 84rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
// .indicator {
|
||||||
|
// position: absolute;
|
||||||
|
// left: 50%;
|
||||||
|
// top: 960rpx;
|
||||||
|
// transform: translate(-50%, -50%);
|
||||||
|
// width: 120rpx;
|
||||||
|
// height: 1rpx;
|
||||||
|
// background: #ccc;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// .dot {
|
||||||
|
// height: 100%;
|
||||||
|
// background: #000;
|
||||||
|
// transition-property: all;
|
||||||
|
// transition-duration: 0.8s;
|
||||||
|
// }
|
||||||
|
.indicator {
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 960rpx;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
display: inline-flex;
|
||||||
|
width: 360rpx;
|
||||||
|
height: 1px;
|
||||||
|
background: transparent;
|
||||||
|
.dot {
|
||||||
|
display: inline-flex;
|
||||||
|
flex: 1;
|
||||||
|
height: 100%;
|
||||||
|
background: #f2f2f2;
|
||||||
|
transition-duration: 0.5s;
|
||||||
|
margin-right: 4rpx;
|
||||||
|
transition: all 0.6s ease-in-out 0.1s;
|
||||||
|
}
|
||||||
|
.bg-show {
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,177 @@
|
|||||||
|
import Taro from "@tarojs/taro";
|
||||||
|
import classnames from "classnames";
|
||||||
|
|
||||||
|
import { Component, PropsWithChildren, useEffect, useState } from "react";
|
||||||
|
import {
|
||||||
|
Block,
|
||||||
|
View,
|
||||||
|
Image,
|
||||||
|
Video,
|
||||||
|
Swiper,
|
||||||
|
SwiperItem,
|
||||||
|
} from "@tarojs/components";
|
||||||
|
|
||||||
|
/* 自定义组件 */
|
||||||
|
import Navbar from "../../components/navbar/navbar";
|
||||||
|
// import PopupAlert from "../../components/popup/popup-alert";
|
||||||
|
/* 组件 */
|
||||||
|
|
||||||
|
/*** redux ***/
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { setInstrument } from "../../store/features/instrument";
|
||||||
|
/*** redux end ***/
|
||||||
|
|
||||||
|
import { InstrumentInfo } from "../../utils/Interface";
|
||||||
|
import { setStorageSync, getStorageSync, go } from "../../utils/traoAPI";
|
||||||
|
|
||||||
|
import "./intro.less";
|
||||||
|
|
||||||
|
class Intro extends Component<any, any> {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
name: "template模板页",
|
||||||
|
current: 0,
|
||||||
|
instrument: {},
|
||||||
|
introList: [],
|
||||||
|
isNursing: false,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async onLoad() {}
|
||||||
|
componentDidMount() {}
|
||||||
|
componentWillMount() {
|
||||||
|
// let params = Taro.Current?.router?.params;
|
||||||
|
// if (params) {
|
||||||
|
// this.getInstrumentInfo(params.id);
|
||||||
|
// }
|
||||||
|
|
||||||
|
let strObj = getStorageSync("instrument_item");
|
||||||
|
if (strObj) {
|
||||||
|
let instrument = JSON.parse(strObj);
|
||||||
|
this.getInstrumentInfo(instrument.id);
|
||||||
|
this.setState({ instrument });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
componentWillUnmount() {}
|
||||||
|
|
||||||
|
componentDidShow() {}
|
||||||
|
|
||||||
|
componentDidHide() {}
|
||||||
|
|
||||||
|
async initData() {}
|
||||||
|
|
||||||
|
onChange(event) {
|
||||||
|
console.info("onchange", event);
|
||||||
|
// const current = event.detail.current;
|
||||||
|
// this.setState({ current });
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取设备信息
|
||||||
|
async getInstrumentInfo(id) {
|
||||||
|
let res = await InstrumentInfo.instructionInfo({
|
||||||
|
instrumentId: id,
|
||||||
|
});
|
||||||
|
if (res.data.code === 200) {
|
||||||
|
this.setState({ introList: res.data.data });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
toNursing() {
|
||||||
|
// if (this.state.info.iot === 2) {
|
||||||
|
// this.setState({ isNursing: true }, () => {
|
||||||
|
// this.toHomePage();
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// go("/pages/clock_in2/clock_in2?iid=" + this.state.info.id);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
toHomePage() {
|
||||||
|
// const { isNursing, info } = this.state;
|
||||||
|
// if (isNursing) {
|
||||||
|
// setStorageSync("introduceId", info.id);
|
||||||
|
// }
|
||||||
|
const url = "/pages/index/index";
|
||||||
|
Taro.switchTab({
|
||||||
|
url,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
let { current, introList, instrument } = this.state;
|
||||||
|
return (
|
||||||
|
<Block>
|
||||||
|
<Navbar titleSlot="仪器绑定" isBack={true} />
|
||||||
|
<View style="position: relative">
|
||||||
|
<Swiper
|
||||||
|
className="main"
|
||||||
|
current={current}
|
||||||
|
onChange={this.onChange}
|
||||||
|
duration={800}
|
||||||
|
indicatorDots={false}
|
||||||
|
indicatorColor="#999"
|
||||||
|
indicatorActiveColor="#333"
|
||||||
|
previousMargin="32rpx"
|
||||||
|
nextMargin="32rpx"
|
||||||
|
>
|
||||||
|
{introList.map((item: any, index: number) => {
|
||||||
|
return (
|
||||||
|
<SwiperItem key={index}>
|
||||||
|
{item.fileType === "video" ? (
|
||||||
|
<Video className="cover" src={item.file} />
|
||||||
|
) : (
|
||||||
|
<Image
|
||||||
|
className="cover"
|
||||||
|
src={item.file}
|
||||||
|
mode="aspectFill"
|
||||||
|
></Image>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<View className="content">
|
||||||
|
<View className="title">{instrument.name}</View>
|
||||||
|
<View className="text">{item.message}</View>
|
||||||
|
</View>
|
||||||
|
</SwiperItem>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Swiper>
|
||||||
|
|
||||||
|
{introList.length && (
|
||||||
|
<View className="indicator">
|
||||||
|
{introList.map((_item, index) => {
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
key={"indicator_" + index}
|
||||||
|
className={classnames("dot", {
|
||||||
|
"bg-show": current === index,
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View className="footer flex aitems jcenter">
|
||||||
|
<View className="btn" onClick={this.toNursing}>
|
||||||
|
马上护理
|
||||||
|
</View>
|
||||||
|
<View className="btn text" onClick={this.toHomePage}>
|
||||||
|
暂不护理
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</Block>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapStateToProps = (state) => ({
|
||||||
|
instrument: state.instrument,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
setInstrument(data) {
|
||||||
|
dispatch(setInstrument(data));
|
||||||
|
},
|
||||||
|
});
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(Intro);
|
||||||
@ -0,0 +1,397 @@
|
|||||||
|
page {
|
||||||
|
background: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.titlemain {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 99;
|
||||||
|
width: 100%;
|
||||||
|
top: 0;
|
||||||
|
/* box-shadow: 0px 1.5px 6px rgba(0, 0, 0, 0.16) */
|
||||||
|
}
|
||||||
|
|
||||||
|
.titlemain .logoicon {
|
||||||
|
width: 223rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.titlemain .title {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infobox1 {
|
||||||
|
/* background: #fff; */
|
||||||
|
margin: 20rpx 0rpx;
|
||||||
|
box-shadow: -2rpx 0 12rpx 0.5rpx rgba(129, 129, 129, 0.05);
|
||||||
|
#myVideo {
|
||||||
|
display: block;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.infobox1 .img {
|
||||||
|
position: relative;
|
||||||
|
width: calc(345rpx * 2);
|
||||||
|
height: calc(345rpx * 2);
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
/* padding: 10rpx; */
|
||||||
|
/* box-shadow: -2rpx 0 12rpx .5rpx rgba(129, 129, 129, 0.05); */
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-cover {
|
||||||
|
position: absolute;
|
||||||
|
top: 300rpx;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 160rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-cover-icon {
|
||||||
|
width: 90rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-cover-time {
|
||||||
|
margin-top: 26rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infobox2 {
|
||||||
|
background: #fff;
|
||||||
|
overflow: hidden;
|
||||||
|
margin: 20rpx 0 0;
|
||||||
|
box-shadow: -2rpx 0 12rpx 0.5rpx rgba(129, 129, 129, 0.05);
|
||||||
|
}
|
||||||
|
.infobox2 .info4 {
|
||||||
|
/* margin: 0 30rpx; */
|
||||||
|
padding: 41rpx 32rpx 0 32rpx;
|
||||||
|
}
|
||||||
|
.infobox2 .info4 .imgbox {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.infobox2 .info4 .upload_header .upload_title {
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #030000;
|
||||||
|
}
|
||||||
|
.infobox2 .info4 .upload_header .icon {
|
||||||
|
width: 36rpx;
|
||||||
|
height: 36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infobox2 .info4 .imgbox .img {
|
||||||
|
width: 180rpx;
|
||||||
|
height: 180rpx;
|
||||||
|
/* background: #DCB585; */
|
||||||
|
border-radius: 20rpx;
|
||||||
|
margin: 43rpx 32rpx 0 0;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infobox2 .info4 .imgbox .img .close {
|
||||||
|
position: absolute;
|
||||||
|
background: rgba(27, 7, 7, 0.5);
|
||||||
|
width: 46rpx;
|
||||||
|
height: 42rpx;
|
||||||
|
border-radius: 0 20rpx 0 20rpx;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infobox2 .info4 .imgbox .img .close image {
|
||||||
|
width: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infobox2 .info4 .imgbox .img2 {
|
||||||
|
margin: 43rpx 32rpx 0 0;
|
||||||
|
width: 180rpx;
|
||||||
|
height: 180rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
border: 2rpx solid #dddddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infobox2 .info4 .imgbox .img2 image {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infobox2 .info4 .content {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 3rpx;
|
||||||
|
padding: 28rpx;
|
||||||
|
width: calc(100% - 28rpx - 28rpx);
|
||||||
|
height: 186rpx;
|
||||||
|
margin: 37rpx 0 20rpx;
|
||||||
|
/*box-shadow: -2rpx 0 12rpx .5rpx rgba(129, 129, 129, 0.1);*/
|
||||||
|
border: 2rpx solid #dddddd;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.infobox2 .info4 .content .textarea {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
color: #000;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
.infobox2 .info4 .content .contenttip {
|
||||||
|
color: #e1e1e1;
|
||||||
|
font-size: 20rpx;
|
||||||
|
position: absolute;
|
||||||
|
right: 24rpx;
|
||||||
|
bottom: 18rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infobox2 .info4 .content textarea {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #000;
|
||||||
|
border-radius: 3rpx;
|
||||||
|
}
|
||||||
|
.placeholder {
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
.confirm_btn {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 999;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 153rpx;
|
||||||
|
background: #ffffff;
|
||||||
|
box-shadow: 0rpx -3rpx 7rpx 1rpx rgba(173, 191, 207, 0.21);
|
||||||
|
padding: 0 30rpx 21rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.confirm_btn .btn {
|
||||||
|
width: 100%;
|
||||||
|
height: 90rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
text-align: center;
|
||||||
|
background: #000000;
|
||||||
|
border-radius: 45rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infobox3 {
|
||||||
|
display: block;
|
||||||
|
margin: 20rpx 31rpx;
|
||||||
|
height: 162rpx;
|
||||||
|
font-family: PingFang SC;
|
||||||
|
.info1 {
|
||||||
|
display: inline-block;
|
||||||
|
white-space: nowrap;
|
||||||
|
background: #fff;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: -2rpx 0 12rpx 0.5rpx rgba(129, 129, 129, 0.05);
|
||||||
|
margin-right: 23rpx;
|
||||||
|
}
|
||||||
|
.info2 {
|
||||||
|
width: calc(100% - 130rpx - 20rpx);
|
||||||
|
background: #fff;
|
||||||
|
height: 162rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
box-shadow: -2rpx 0 12rpx 0.5rpx rgba(129, 129, 129, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.info1,
|
||||||
|
.info2 {
|
||||||
|
.block1 {
|
||||||
|
// width: 300rpx;
|
||||||
|
// height: 160rpx;
|
||||||
|
flex-direction: column;
|
||||||
|
display: inline-block;
|
||||||
|
height: 100%;
|
||||||
|
text-align: center;
|
||||||
|
.block1_1 {
|
||||||
|
height: 100%;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.info1_img {
|
||||||
|
width: 140rpx;
|
||||||
|
height: 140rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tip1 {
|
||||||
|
margin-top: 33rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
.tip2 {
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #666666;
|
||||||
|
margin-top: 15rpx;
|
||||||
|
}
|
||||||
|
.quan1 {
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 3rpx solid #f1f1f1;
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin-top: 21rpx;
|
||||||
|
&.is-select {
|
||||||
|
display: flex;
|
||||||
|
background-color: #fff;
|
||||||
|
border-color: #fff;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.quan2 {
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #000000;
|
||||||
|
width: 14rpx;
|
||||||
|
height: 14rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.info2 .block1 {
|
||||||
|
padding: 0 16rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.popbox {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
background: #fff;
|
||||||
|
position: relative;
|
||||||
|
padding-top: 52rpx;
|
||||||
|
padding-bottom: 40rpx;
|
||||||
|
}
|
||||||
|
.popbox > .closeicon1 {
|
||||||
|
position: absolute;
|
||||||
|
right: 20rpx;
|
||||||
|
top: 20rpx;
|
||||||
|
width: 24rpx;
|
||||||
|
height: 24rpx;
|
||||||
|
}
|
||||||
|
.popbox > .closeicon2 {
|
||||||
|
width: 130rpx;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
.popbox > .tip {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 30rpx;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 27rpx;
|
||||||
|
color: #030000;
|
||||||
|
}
|
||||||
|
.popbox > .tip2 {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 30rpx;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popbox2 {
|
||||||
|
}
|
||||||
|
.popbox2 > .title {
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
color: #212121;
|
||||||
|
}
|
||||||
|
.popbox2 > .tipimg {
|
||||||
|
margin: 20rpx 28rpx 0;
|
||||||
|
}
|
||||||
|
.popbox2 > .tipvideo {
|
||||||
|
margin: 20rpx 28rpx 0;
|
||||||
|
width: calc(100% - 28rpx - 28rpx);
|
||||||
|
height: 630rpx;
|
||||||
|
}
|
||||||
|
.popbox2 > .tiptext {
|
||||||
|
text-align: center;
|
||||||
|
color: #666666;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
.popbox2 > .popbox2btn > .nextbtn {
|
||||||
|
background: #000;
|
||||||
|
width: 270rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
/*padding: 0 74rpx;*/
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 30rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
/*margin: 50rpx auto 30rpx;*/
|
||||||
|
border-radius: 45rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.popbox2 > .popbox2btn > .prebtn {
|
||||||
|
width: 270rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
/*padding: 0 74rpx;*/
|
||||||
|
text-align: center;
|
||||||
|
color: #000;
|
||||||
|
font-size: 30rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
/*margin: 40rpx auto 30rpx;*/
|
||||||
|
border-radius: 45rpx;
|
||||||
|
border: 1px solid #000;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.popbox2btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 73rpx 54rpx 44rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.finish-tips {
|
||||||
|
margin-bottom: 80rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #030000;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.finish-icon {
|
||||||
|
width: 120rpx;
|
||||||
|
height: 120rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.finish-btn {
|
||||||
|
background: #000;
|
||||||
|
width: 270rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 30rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
margin: 40rpx auto 0;
|
||||||
|
border-radius: 45rpx;
|
||||||
|
}
|
||||||
@ -0,0 +1,333 @@
|
|||||||
|
import Taro from "@tarojs/taro";
|
||||||
|
import classnames from "classnames";
|
||||||
|
|
||||||
|
import { Component, PropsWithChildren, useEffect, useState } from "react";
|
||||||
|
import {
|
||||||
|
Block,
|
||||||
|
View,
|
||||||
|
Video,
|
||||||
|
Text,
|
||||||
|
Image,
|
||||||
|
Input,
|
||||||
|
Button,
|
||||||
|
ScrollView,
|
||||||
|
Textarea,
|
||||||
|
Canvas,
|
||||||
|
} from "@tarojs/components";
|
||||||
|
|
||||||
|
import Navbar from "@/components/navbar/navbar";
|
||||||
|
|
||||||
|
import { InstrumentInfo } from "@/utils/Interface";
|
||||||
|
|
||||||
|
import "./index.less";
|
||||||
|
import { contraction, getImgInfo } from "@/utils/compressImage";
|
||||||
|
import PopupAlert from "@/components/popup/popup-alert";
|
||||||
|
|
||||||
|
export default class InstrumentClickInUpload extends Component<any, any> {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
name: "仪器打卡上传",
|
||||||
|
year: new Date().getFullYear(),
|
||||||
|
month: String(new Date().getMonth() + 1).padStart(2, "0"),
|
||||||
|
day: String(new Date().getDate()).padStart(2, "0"),
|
||||||
|
zkmoshiindex: 0,
|
||||||
|
moshiindex: null,
|
||||||
|
buzhouindex: null,
|
||||||
|
autoplay: false,
|
||||||
|
scrollleft: 0,
|
||||||
|
sysinfo: Taro.getSystemInfoSync(),
|
||||||
|
showVideoPlayBtn: true,
|
||||||
|
duration: 0,
|
||||||
|
|
||||||
|
punchInInfo: {
|
||||||
|
imageList: [],
|
||||||
|
content: "",
|
||||||
|
instrumentId: "84",
|
||||||
|
},
|
||||||
|
// 现在选中的数据
|
||||||
|
currentInfo: {
|
||||||
|
modeVideo: "",
|
||||||
|
},
|
||||||
|
modeInfo: [],
|
||||||
|
isModeLock: false,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async onLoad() {
|
||||||
|
this.initData();
|
||||||
|
}
|
||||||
|
componentDidMount() {}
|
||||||
|
|
||||||
|
componentWillUnmount() {}
|
||||||
|
|
||||||
|
componentDidShow() {}
|
||||||
|
|
||||||
|
componentDidHide() {}
|
||||||
|
|
||||||
|
async initData() {
|
||||||
|
this.firstNurseInfo();
|
||||||
|
this.modeInfoList();
|
||||||
|
}
|
||||||
|
|
||||||
|
firstNurseInfo = async () => {
|
||||||
|
let res = await InstrumentInfo.firstNurseInfo({
|
||||||
|
instrumentId: "84",
|
||||||
|
});
|
||||||
|
console.log("firstNurseInfo", res);
|
||||||
|
};
|
||||||
|
|
||||||
|
modeInfoList = async () => {
|
||||||
|
let res = await InstrumentInfo.modeInfoList({
|
||||||
|
instrumentId: "84",
|
||||||
|
});
|
||||||
|
console.log("modeInfo", res);
|
||||||
|
if (res.data.code === 200) {
|
||||||
|
if (res.data.data.length) {
|
||||||
|
this.setState({
|
||||||
|
currentInfo: res.data.data[0],
|
||||||
|
modeInfo: res.data.data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
bindMoshi = async (index) => {
|
||||||
|
let { currentInfo, modeInfo, punchInInfo } = this.state;
|
||||||
|
currentInfo = modeInfo[index];
|
||||||
|
this.setState({ zkmoshiindex: index, currentInfo });
|
||||||
|
};
|
||||||
|
|
||||||
|
// 选择图片上传
|
||||||
|
handleChooseImage = async () => {
|
||||||
|
let { punchInInfo } = this.state;
|
||||||
|
Taro.chooseMedia({
|
||||||
|
count: 1,
|
||||||
|
mediaType: ["image"],
|
||||||
|
sourceType: ["album", "camera"],
|
||||||
|
sizeType: ["compressed"],
|
||||||
|
camera: "back",
|
||||||
|
success: async (res) => {
|
||||||
|
const tempFilePath = res.tempFiles[0].tempFilePath;
|
||||||
|
let img = await getImgInfo(tempFilePath);
|
||||||
|
let compressImage = await contraction(img, "compressImage");
|
||||||
|
// 压缩后文件地址
|
||||||
|
let compressTempFilePath = compressImage.tempFilePath;
|
||||||
|
punchInInfo.imageList.push(compressTempFilePath);
|
||||||
|
this.setState({ punchInInfo });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
handleDeleteImage = async (index) => {
|
||||||
|
let { punchInInfo } = this.state;
|
||||||
|
punchInInfo.imageList.splice(index, 1);
|
||||||
|
this.setState({ punchInInfo });
|
||||||
|
};
|
||||||
|
|
||||||
|
onModeLockOpen = async () => {
|
||||||
|
this.setState({ isModeLock: true });
|
||||||
|
};
|
||||||
|
onModeLockClose = async () => {
|
||||||
|
this.setState({ isModeLock: false });
|
||||||
|
};
|
||||||
|
|
||||||
|
onTipShow = async () => {};
|
||||||
|
|
||||||
|
handleSubmit = async () => {};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
let {
|
||||||
|
name,
|
||||||
|
duration,
|
||||||
|
showVideoPlayBtn,
|
||||||
|
scrollleft,
|
||||||
|
zkmoshiindex,
|
||||||
|
punchInInfo,
|
||||||
|
tipshow,
|
||||||
|
currentInfo,
|
||||||
|
modeInfo,
|
||||||
|
isModeLock,
|
||||||
|
} = this.state;
|
||||||
|
return (
|
||||||
|
<Block>
|
||||||
|
<Navbar titleSlot="打卡上传" isBack={true} />
|
||||||
|
<Canvas
|
||||||
|
style="height: 0"
|
||||||
|
id="compressImage"
|
||||||
|
canvasId="compressImage"
|
||||||
|
type="2d"
|
||||||
|
></Canvas>
|
||||||
|
<PopupAlert
|
||||||
|
isShow={isModeLock}
|
||||||
|
title="提示"
|
||||||
|
content="该模式即将上线,敬请期待"
|
||||||
|
confirmButtonText="知道了"
|
||||||
|
textAlgin="center"
|
||||||
|
isClose={false}
|
||||||
|
close={this.onModeLockClose}
|
||||||
|
confirm={this.onModeLockClose}
|
||||||
|
></PopupAlert>
|
||||||
|
<View className="infobox1 flex aitems jcenter">
|
||||||
|
<View className="img">
|
||||||
|
<Video
|
||||||
|
src={currentInfo.modeVideo}
|
||||||
|
id="myVideo"
|
||||||
|
enableProgressGesture={false}
|
||||||
|
controls={true}
|
||||||
|
autoplay={false}
|
||||||
|
loop={false}
|
||||||
|
showMuteBtn={true}
|
||||||
|
onTimeUpdate={this.Videobindtimeupdate}
|
||||||
|
onEnded={this.videoEnded}
|
||||||
|
onPause={this.videoPause}
|
||||||
|
onPlay={this.videoPlay}
|
||||||
|
showCenterPlayBtn={false}
|
||||||
|
onLoadedMetaData={this.videoLoadedMetaData}
|
||||||
|
style="width: 100%; height: 100%;border-radius: 30rpx;"
|
||||||
|
/>
|
||||||
|
{showVideoPlayBtn && (
|
||||||
|
<View className="video-cover">
|
||||||
|
<Image
|
||||||
|
className="video-cover-icon"
|
||||||
|
src={require("../../img/fr200/play.png")}
|
||||||
|
onClick={this.onPlayTap}
|
||||||
|
></Image>
|
||||||
|
{duration && (
|
||||||
|
<View className="Video-cover-time">{duration}</View>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View className="infobox3">
|
||||||
|
<ScrollView
|
||||||
|
style="white-space: nowrap; height: 100%;"
|
||||||
|
scroll-x={true}
|
||||||
|
scroll-left={scrollleft}
|
||||||
|
>
|
||||||
|
{modeInfo.map((item, index) => {
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
className="info1"
|
||||||
|
onClick={this.bindMoshi.bind(this, index)}
|
||||||
|
key={index}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
className="flex aitems"
|
||||||
|
style="height: 100%; {{zkmoshiindex == index ? 'background: linear-gradient(90deg, #EFDCC2, #FFF2DF)': ''}}"
|
||||||
|
>
|
||||||
|
<View className="block1">
|
||||||
|
<View
|
||||||
|
className="block1_1 flex aitems "
|
||||||
|
style="min-width: 80rpx"
|
||||||
|
>
|
||||||
|
<View className="tip1">{item.modeName}</View>
|
||||||
|
<View className="tip2">{item.modeDesc}</View>
|
||||||
|
|
||||||
|
{!item.lock && zkmoshiindex !== index && (
|
||||||
|
<View className="quan1"></View>
|
||||||
|
)}
|
||||||
|
{!item.lock && zkmoshiindex == index && (
|
||||||
|
<View className="quan1 is-select flex aitems jcenter">
|
||||||
|
<View className="quan2"></View>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{item.lock && (
|
||||||
|
<View className="icon">
|
||||||
|
<Image
|
||||||
|
src="/img/fr200/suo.png"
|
||||||
|
mode="aspectFill"
|
||||||
|
></Image>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
{item.modeBanner && (
|
||||||
|
<View className="info1_img">
|
||||||
|
<Image src={item.modeBanner} mode="aspectFill" />
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</ScrollView>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View className="infobox2">
|
||||||
|
<View className="infobox2_info">
|
||||||
|
<View className="info4">
|
||||||
|
<View className="upload_header flex aitems sb">
|
||||||
|
<View className="upload_title">打卡上传</View>
|
||||||
|
<View className="icon" onClick={this.onTipShow}>
|
||||||
|
<Image
|
||||||
|
src={require("../../img/clock_in_upload/info.png")}
|
||||||
|
mode="aspectFill"
|
||||||
|
></Image>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View className="imgbox flex aitems">
|
||||||
|
{punchInInfo.imageList.length > 0 &&
|
||||||
|
punchInInfo.imageList.map((item, index) => {
|
||||||
|
return (
|
||||||
|
<View className="img" key={"clickin_" + index}>
|
||||||
|
<Image src={item}></Image>
|
||||||
|
<View
|
||||||
|
className="close flex aitems jcenter"
|
||||||
|
data-index="{{index}}"
|
||||||
|
onClick={this.handleDeleteImage}
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
src={require("../../img/fr200/close_white.png")}
|
||||||
|
mode="widthFix"
|
||||||
|
></Image>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
|
||||||
|
{punchInInfo.imageList.length < 3 && (
|
||||||
|
<View
|
||||||
|
className="img2 flex aitems jcenter"
|
||||||
|
onClick={this.handleChooseImage}
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
src={require("../../img/fr200/add-Image.png")}
|
||||||
|
mode="aspectFill"
|
||||||
|
></Image>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
<View className="content">
|
||||||
|
{!tipshow && (
|
||||||
|
<Textarea
|
||||||
|
placeholder-className="placeholder"
|
||||||
|
maxlength={120}
|
||||||
|
onInput={this.handleTextareaInput}
|
||||||
|
value={punchInInfo.content}
|
||||||
|
placeholder="请记录一下今天打卡的心得吧~"
|
||||||
|
></Textarea>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{tipshow && (
|
||||||
|
<View className="Textarea">
|
||||||
|
{punchInInfo.content
|
||||||
|
? punchInInfo.content
|
||||||
|
: "请记录一下今天打卡的心得吧~"}
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View className="confirm_btn flex aitems" onClick={this.handleSubmit}>
|
||||||
|
<View className="btn">提交打卡</View>
|
||||||
|
</View>
|
||||||
|
</Block>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,156 @@
|
|||||||
|
page {
|
||||||
|
background: #f8f8f8;
|
||||||
|
padding-bottom: calc(env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
|
.list {
|
||||||
|
margin: 26rpx 30rpx 0rpx;
|
||||||
|
border-radius: 50rpx;
|
||||||
|
padding-bottom: 0rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
height: calc(166rpx * 2);
|
||||||
|
}
|
||||||
|
.list > .instrument_img {
|
||||||
|
position: relative;
|
||||||
|
height: 100%;
|
||||||
|
/* top: -250rpx; */
|
||||||
|
}
|
||||||
|
.list > .instrument_img .bind_status {
|
||||||
|
position: absolute;
|
||||||
|
top: 40rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
left: 40rpx;
|
||||||
|
padding: 6rpx 40rpx;
|
||||||
|
background: linear-gradient(90deg, #fff0da, #ffe4c0);
|
||||||
|
border-radius: 30rpx;
|
||||||
|
}
|
||||||
|
.list > .instrument_img .titile {
|
||||||
|
position: absolute;
|
||||||
|
top: 110rpx;
|
||||||
|
left: 40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
z-index: 99;
|
||||||
|
}
|
||||||
|
.list > .instrument_img .iot_versions {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 40rpx;
|
||||||
|
left: 40rpx;
|
||||||
|
/* font-weight: bold; */
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #666666;
|
||||||
|
z-index: 99;
|
||||||
|
}
|
||||||
|
.list > .name {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
color: #000;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 30rpx;
|
||||||
|
}
|
||||||
|
.list > .bindbtn {
|
||||||
|
background: #cab18c;
|
||||||
|
position: absolute;
|
||||||
|
right: 6rpx;
|
||||||
|
top: 6rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
border-radius: 56rpx;
|
||||||
|
width: 134rpx;
|
||||||
|
height: 48rpx;
|
||||||
|
line-height: 48rpx;
|
||||||
|
text-align: center;
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.list > .bindbtn2 {
|
||||||
|
background: rgba(255, 255, 255, 0.6);
|
||||||
|
position: absolute;
|
||||||
|
right: 6rpx;
|
||||||
|
top: 6rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
border-radius: 56rpx;
|
||||||
|
width: 134rpx;
|
||||||
|
height: 48rpx;
|
||||||
|
line-height: 48rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infobox1 {
|
||||||
|
.box {
|
||||||
|
.tip {
|
||||||
|
color: #d3bc8c;
|
||||||
|
font-size: 24rpx;
|
||||||
|
padding: 30rpx 30rpx 20rpx;
|
||||||
|
}
|
||||||
|
.tip2 {
|
||||||
|
padding: 30rpx 36rpx 30rpx 30rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #030000;
|
||||||
|
font-weight: 500;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
image {
|
||||||
|
width: 44rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.inputbox {
|
||||||
|
width: 690rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
background: #f2f2f2;
|
||||||
|
border: 1px solid #dddddd;
|
||||||
|
border-radius: 3rpx;
|
||||||
|
padding: 24rpx 28rpx;
|
||||||
|
margin: 0 30rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
position: relative;
|
||||||
|
border: 1px solid #dddddd;
|
||||||
|
font-weight: 500;
|
||||||
|
box-sizing: border-box;
|
||||||
|
input {
|
||||||
|
width: 100%;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
.share_icon {
|
||||||
|
width: 42rpx;
|
||||||
|
}
|
||||||
|
.bottom_icon {
|
||||||
|
width: 20rpx;
|
||||||
|
}
|
||||||
|
.value {
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
.picker {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 99;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
.picker view {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 99;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.serial_img {
|
||||||
|
width: 160rpx;
|
||||||
|
height: 160rpx;
|
||||||
|
margin: 0rpx 30rpx 20rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
|
.infobox1 text {
|
||||||
|
color: #d71229;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: "设备管理",
|
||||||
|
});
|
||||||
@ -0,0 +1,180 @@
|
|||||||
|
page {
|
||||||
|
background: #f8f8f8;
|
||||||
|
padding-bottom: calc(env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
|
.instrument_box {
|
||||||
|
.title {
|
||||||
|
margin: 35rpx 37rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #030000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bind_list,
|
||||||
|
.un_bind_list {
|
||||||
|
width: 100%;
|
||||||
|
white-space: nowrap;
|
||||||
|
// margin-left: 37rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.un_bind_list {
|
||||||
|
margin-left: 37rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bind_list {
|
||||||
|
height: 650rpx;
|
||||||
|
.wrapper {
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
width: 661rpx;
|
||||||
|
margin-right: 16rpx;
|
||||||
|
.bind_status {
|
||||||
|
position: absolute;
|
||||||
|
top: 40rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
left: 40rpx;
|
||||||
|
padding: 6rpx 40rpx;
|
||||||
|
background: linear-gradient(90deg, #fff0da, #ffe4c0);
|
||||||
|
border-radius: 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.cover {
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
width: 661rpx;
|
||||||
|
height: 350rpx;
|
||||||
|
border-radius: 50rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #fff;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.image {
|
||||||
|
width: 100%;
|
||||||
|
height: 350rpx;
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
color: #000000;
|
||||||
|
width: 100%;
|
||||||
|
line-height: 1;
|
||||||
|
margin: 30rpx 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.intro {
|
||||||
|
position: absolute;
|
||||||
|
left: 40rpx;
|
||||||
|
bottom: 38rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
.tips {
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #666666;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.right {
|
||||||
|
width: 26rpx;
|
||||||
|
margin-left: 5rpx;
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bind_cont {
|
||||||
|
.title {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
.bindinfo {
|
||||||
|
/* display: block; */
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 240rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
text-align: center;
|
||||||
|
/* background: transparent; */
|
||||||
|
border-radius: 60rpx;
|
||||||
|
border: 1px solid #000000;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #000000;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.un_bind_list {
|
||||||
|
.wrapper {
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
width: 335rpx;
|
||||||
|
margin-right: 16rpx;
|
||||||
|
}
|
||||||
|
.cover {
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
width: 335rpx;
|
||||||
|
height: 330rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #fff;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.image {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 177rpx;
|
||||||
|
}
|
||||||
|
.name {
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
color: #000000;
|
||||||
|
width: 100%;
|
||||||
|
line-height: 1;
|
||||||
|
margin: 30rpx 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.buy {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
.tips {
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #666666;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.right {
|
||||||
|
width: 26rpx;
|
||||||
|
margin-left: 5rpx;
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.bind_cont {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 30rpx 0;
|
||||||
|
.tobind {
|
||||||
|
width: 160rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
text-align: center;
|
||||||
|
background: #000000;
|
||||||
|
border-radius: 50rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.scroll {
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
@ -0,0 +1,274 @@
|
|||||||
|
import Taro from "@tarojs/taro";
|
||||||
|
import classnames from "classnames";
|
||||||
|
|
||||||
|
import { Component, PropsWithChildren, useEffect, useState } from "react";
|
||||||
|
import {
|
||||||
|
Block,
|
||||||
|
View,
|
||||||
|
Text,
|
||||||
|
Image,
|
||||||
|
Input,
|
||||||
|
Button,
|
||||||
|
ScrollView,
|
||||||
|
Swiper,
|
||||||
|
SwiperItem,
|
||||||
|
} from "@tarojs/components";
|
||||||
|
|
||||||
|
import "./index.less";
|
||||||
|
import Navbar from "../../components/navbar/navbar";
|
||||||
|
|
||||||
|
import { InstrumentInfo } from "../../utils/Interface";
|
||||||
|
import { go, msg, setStorageSync } from "../../utils/traoAPI";
|
||||||
|
|
||||||
|
export default class InstrumentManage extends Component<any, any> {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
name: "InstrumentManage",
|
||||||
|
userinfo: {},
|
||||||
|
imgUrl: "",
|
||||||
|
imgUrl2: "",
|
||||||
|
list: [],
|
||||||
|
bindList: [],
|
||||||
|
unBindList: [],
|
||||||
|
page: 1,
|
||||||
|
isback: false,
|
||||||
|
//全局参数
|
||||||
|
appdata: {},
|
||||||
|
tipshow: false,
|
||||||
|
FR200LIST: [],
|
||||||
|
devinfo: {},
|
||||||
|
current: 0,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async onLoad() {
|
||||||
|
this.initData();
|
||||||
|
}
|
||||||
|
componentDidMount() {}
|
||||||
|
|
||||||
|
componentWillUnmount() {}
|
||||||
|
|
||||||
|
componentDidShow() {}
|
||||||
|
|
||||||
|
componentDidHide() {}
|
||||||
|
|
||||||
|
async initData() {
|
||||||
|
this.bindingInstrumentList();
|
||||||
|
this.unbindingInstrumentInfoList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取已绑定仪器列表
|
||||||
|
bindingInstrumentList = async () => {
|
||||||
|
Taro.showLoading({
|
||||||
|
title: "请求中...",
|
||||||
|
mask: true,
|
||||||
|
});
|
||||||
|
let { data: res } = await InstrumentInfo.bindingInstrumentList();
|
||||||
|
Taro.hideLoading();
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.setState({ bindList: res.data });
|
||||||
|
} else {
|
||||||
|
// 仪器列表失败todo
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 获取未绑定仪器列表
|
||||||
|
unbindingInstrumentInfoList = async () => {
|
||||||
|
Taro.showLoading({
|
||||||
|
title: "请求中...",
|
||||||
|
mask: true,
|
||||||
|
});
|
||||||
|
let { data: res } = await InstrumentInfo.unbindingInstrumentInfoList();
|
||||||
|
Taro.hideLoading();
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.setState({ unBindList: res.data });
|
||||||
|
} else {
|
||||||
|
// 仪器列表失败todo
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
goIntro(item) {
|
||||||
|
let bindid = item.id;
|
||||||
|
go("/pages/introduce/introduce?id=" + bindid);
|
||||||
|
}
|
||||||
|
goBind(item) {
|
||||||
|
let bindid = item.id;
|
||||||
|
go("/pages/instrument/instrument?id=" + bindid);
|
||||||
|
}
|
||||||
|
|
||||||
|
goBindInfo(item) {
|
||||||
|
// let bindid = item.id;
|
||||||
|
setStorageSync("instrument_detail", JSON.stringify(item));
|
||||||
|
go("/pages/instrument_detail/index");
|
||||||
|
}
|
||||||
|
|
||||||
|
async lesgobuy(item) {
|
||||||
|
console.log(item);
|
||||||
|
// if (item.programs_json) {
|
||||||
|
// item.programs_json = JSON.parse(item.programs_json);
|
||||||
|
// // console.log(item.programs_json)
|
||||||
|
// Taro.navigateToMiniProgram({
|
||||||
|
// appId: item.programs_json.buylink,
|
||||||
|
// path: item.programs_json.buypath,
|
||||||
|
// envVersion: "release",
|
||||||
|
// success(res) {
|
||||||
|
// // 打开成功
|
||||||
|
// },
|
||||||
|
// fail() {},
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// msg("暂无购买链接");
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
let { bindList, unBindList, current } = this.state;
|
||||||
|
return (
|
||||||
|
<Block>
|
||||||
|
<Navbar titleSlot="设备管理" background="#fff" isBack={true} />
|
||||||
|
<View className="instrument_box">
|
||||||
|
{bindList.length && (
|
||||||
|
<Block>
|
||||||
|
<View className="title">我的设备</View>
|
||||||
|
<View className="scroll">
|
||||||
|
<Swiper
|
||||||
|
className="bind_list"
|
||||||
|
current={current}
|
||||||
|
duration={800}
|
||||||
|
indicatorDots={false}
|
||||||
|
indicatorColor="#999"
|
||||||
|
indicatorActiveColor="#333"
|
||||||
|
previousMargin="32rpx"
|
||||||
|
nextMargin="32rpx"
|
||||||
|
>
|
||||||
|
{bindList.map((item: any, index: number) => {
|
||||||
|
return (
|
||||||
|
<SwiperItem key={index}>
|
||||||
|
<View className="wrapper" key={"bind_" + index}>
|
||||||
|
<View className="cover" onClick={this.goIntro}>
|
||||||
|
<Image
|
||||||
|
className="Image"
|
||||||
|
src={item.banner}
|
||||||
|
mode="aspectFill"
|
||||||
|
></Image>
|
||||||
|
<View className="bind_status">已绑定</View>
|
||||||
|
<View className="intro">
|
||||||
|
<View className="tips" onClick={this.goIntro}>
|
||||||
|
仪器介绍
|
||||||
|
</View>
|
||||||
|
<View className="right">
|
||||||
|
<Image
|
||||||
|
src={require("../../img/index/right.png")}
|
||||||
|
mode="widthFix"
|
||||||
|
style="height: 20rpx;"
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View className="bind_cont">
|
||||||
|
<View className="title">{item.name}</View>
|
||||||
|
<View
|
||||||
|
className="bindinfo"
|
||||||
|
onClick={this.goBindInfo.bind(this, item)}
|
||||||
|
>
|
||||||
|
查看绑定信息
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</SwiperItem>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Swiper>
|
||||||
|
{/* <ScrollView scroll-x="true" className="bind_list">
|
||||||
|
{bindList.map((item, index) => {
|
||||||
|
if (item.status === 0) {
|
||||||
|
return (
|
||||||
|
<View className="wrapper" key={"bind_" + index}>
|
||||||
|
<View className="cover" onClick={this.goIntro}>
|
||||||
|
<Image
|
||||||
|
className="Image"
|
||||||
|
src={item.banner}
|
||||||
|
mode="aspectFill"
|
||||||
|
></Image>
|
||||||
|
<View className="bind_status">已绑定</View>
|
||||||
|
<View className="intro">
|
||||||
|
<View className="tips" onClick={this.goIntro}>
|
||||||
|
仪器介绍
|
||||||
|
</View>
|
||||||
|
<View className="right">
|
||||||
|
<Image
|
||||||
|
src={require("../../img/index/right.png")}
|
||||||
|
mode="widthFix"
|
||||||
|
style="height: 20rpx;"
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View className="bind_cont">
|
||||||
|
<View className="title">{item.name}</View>
|
||||||
|
<View
|
||||||
|
className="bindinfo"
|
||||||
|
onClick={this.goBindInfo.bind(this, item)}
|
||||||
|
>
|
||||||
|
查看绑定信息
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
})}
|
||||||
|
</ScrollView> */}
|
||||||
|
</View>
|
||||||
|
</Block>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<View className="title">未绑定的仪器</View>
|
||||||
|
<View className="scroll">
|
||||||
|
<ScrollView scroll-x="true" className="un_bind_list">
|
||||||
|
{unBindList.map((item, index) => {
|
||||||
|
if (item.status === 0) {
|
||||||
|
return (
|
||||||
|
<View className="wrapper" key={index}>
|
||||||
|
<View
|
||||||
|
className="cover"
|
||||||
|
onClick={this.lesgobuy.bind(this, item)}
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
className="image"
|
||||||
|
src={item.banner}
|
||||||
|
mode="aspectFill"
|
||||||
|
></Image>
|
||||||
|
<View className="name">{item.name}</View>
|
||||||
|
<View
|
||||||
|
className="buy"
|
||||||
|
onClick={this.lesgobuy.bind(this, item)}
|
||||||
|
>
|
||||||
|
<View className="tips">立即购买</View>
|
||||||
|
<View className="right">
|
||||||
|
<Image
|
||||||
|
src={require("../../img/index/right.png")}
|
||||||
|
mode="widthFix"
|
||||||
|
style="height: 20rpx;"
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View className="bind_cont">
|
||||||
|
<View
|
||||||
|
className="tobind"
|
||||||
|
onClick={this.goBind.bind(this, item)}
|
||||||
|
>
|
||||||
|
前往绑定
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
})}
|
||||||
|
</ScrollView>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</Block>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue