绑定流程临时提交
parent
30a84112b7
commit
92c3ed2fd1
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,78 @@
|
||||
.footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
background: #fff;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
padding-bottom: 20rpx;
|
||||
/*padding-bottom: env(safe-area-inset-bottom);*/
|
||||
}
|
||||
|
||||
.footer .btn {
|
||||
width: 690rpx;
|
||||
height: 90rpx;
|
||||
background: #000;
|
||||
border-radius: 45rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 90rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.footer .text {
|
||||
background: transparent;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.main {
|
||||
height: 100vh;
|
||||
text-align: center;
|
||||
margin: 48rpx 45rpx 0;
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 180rpx);
|
||||
}
|
||||
|
||||
.cover {
|
||||
width: 660rpx;
|
||||
height: 922rpx;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 660rpx;
|
||||
height: 474rpx;
|
||||
background: linear-gradient(rgba(204, 204, 204, 0.4), #fff);
|
||||
border-radius: 50rpx;
|
||||
margin-top: 7rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 48rpx;
|
||||
font-weight: 500;
|
||||
color: #000;
|
||||
text-align: center;
|
||||
padding-bottom: 48rpx;
|
||||
padding-top: 96rpx;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
@ -0,0 +1,153 @@
|
||||
import Taro from "@tarojs/taro";
|
||||
import classnames from "classnames";
|
||||
|
||||
import { Component, PropsWithChildren, useEffect, useState } from "react";
|
||||
import {
|
||||
Block,
|
||||
View,
|
||||
Text,
|
||||
Image,
|
||||
Video,
|
||||
Input,
|
||||
Button,
|
||||
Swiper,
|
||||
SwiperItem,
|
||||
} from "@tarojs/components";
|
||||
|
||||
import { InstrumentInfo } from "../../utils/Interface";
|
||||
import { setStorageSync, getStorageSync, go } from "../../utils/traoAPI";
|
||||
import util from "../../utils/utilhtml";
|
||||
|
||||
import "./intro.less";
|
||||
|
||||
export default class Intro extends Component<any, any> {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
name: "template模板页",
|
||||
current: 0,
|
||||
info: {},
|
||||
introList: [],
|
||||
isNursing: false,
|
||||
};
|
||||
}
|
||||
|
||||
async onLoad() {}
|
||||
componentDidMount() {}
|
||||
componentWillMount() {
|
||||
console.log("Taro.Current", Taro.Current);
|
||||
let params = Taro.Current?.router?.params;
|
||||
if (params) {
|
||||
this.getInstrumentInfo(params.id);
|
||||
}
|
||||
}
|
||||
componentWillUnmount() {}
|
||||
|
||||
componentDidShow() {}
|
||||
|
||||
componentDidHide() {}
|
||||
|
||||
async initData() {}
|
||||
|
||||
onChange(event) {
|
||||
console.info("onchange", event);
|
||||
const current = event.detail.current;
|
||||
this.setState({ current });
|
||||
}
|
||||
|
||||
// 获取设备信息
|
||||
async getInstrumentInfo(id) {
|
||||
// const { data: res } = await InstrumentInfo({ id });
|
||||
let { data: res } = await InstrumentInfo.instructionInfo({
|
||||
instrumentId: id,
|
||||
});
|
||||
console.log("instrumentId", res);
|
||||
// if (res.code === 200) {
|
||||
// const { intro_json } = res.data.info;
|
||||
// if (intro_json) {
|
||||
// try {
|
||||
// res.data.info.intro_json = JSON.parse(intro_json);
|
||||
// } catch (e) {
|
||||
// console.log(e);
|
||||
// }
|
||||
// }
|
||||
// this.setState({
|
||||
// info: res.data?.info,
|
||||
// introList: res.data?.info?.intro_json,
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
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) {
|
||||
// isNursing ? '/pages/index/index?instrument_id=' + info.id
|
||||
setStorageSync("introduceId", info.id);
|
||||
}
|
||||
const url = "/pages/index/index";
|
||||
Taro.switchTab({
|
||||
url,
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
let { name, current, introList, info } = this.state;
|
||||
return (
|
||||
<Block>
|
||||
<View style="position: relative">
|
||||
<Swiper className="main" current={current} onChange={this.onChange}>
|
||||
{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">{info.titile}</View>
|
||||
<View className="text">{item.title}</View>
|
||||
</View>
|
||||
</SwiperItem>
|
||||
);
|
||||
})}
|
||||
</Swiper>
|
||||
<View className="indicator">
|
||||
<View
|
||||
className="dot"
|
||||
style={{
|
||||
transform:
|
||||
"translateX(" + (current * 120) / introList.length + "rpx)",
|
||||
width: "calc(100% / " + introList.length + ")",
|
||||
}}
|
||||
></View>
|
||||
</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>
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue