|
|
|
|
@ -16,6 +16,7 @@ import { Popup } from "@antmjs/vantui";
|
|
|
|
|
|
|
|
|
|
import "./popup.less";
|
|
|
|
|
import "./popup-site-swiper.less";
|
|
|
|
|
import "./fade.css";
|
|
|
|
|
|
|
|
|
|
import { go } from "../../utils/traoAPI";
|
|
|
|
|
|
|
|
|
|
@ -34,6 +35,9 @@ export default class PopupSiteSwiper extends Component<any, any> {
|
|
|
|
|
super(props);
|
|
|
|
|
this.state = {
|
|
|
|
|
name: "确认组件",
|
|
|
|
|
current: 0,
|
|
|
|
|
toRight: false,
|
|
|
|
|
isClick: false,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -46,7 +50,13 @@ export default class PopupSiteSwiper extends Component<any, any> {
|
|
|
|
|
|
|
|
|
|
componentDidHide() {}
|
|
|
|
|
|
|
|
|
|
async initData() {}
|
|
|
|
|
initData = () => {
|
|
|
|
|
console.log("this.props.siteData", this.props.siteData);
|
|
|
|
|
if (this.props.siteData) {
|
|
|
|
|
let arr = JSON.parse(JSON.stringify(this.props.siteData));
|
|
|
|
|
this.setState({ siteList: arr });
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onClose = () => {
|
|
|
|
|
this.props.close();
|
|
|
|
|
@ -72,16 +82,45 @@ export default class PopupSiteSwiper extends Component<any, any> {
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onChange(event) {
|
|
|
|
|
const current = event.detail.current;
|
|
|
|
|
const { current: curCurrent } = this.state;
|
|
|
|
|
const { siteData } = this.props;
|
|
|
|
|
if (curCurrent + 2 === siteData.length && current + 1 === siteData.length) {
|
|
|
|
|
this.setState({ toRight: true });
|
|
|
|
|
}
|
|
|
|
|
this.setState({ current });
|
|
|
|
|
}
|
|
|
|
|
onClickSwiperItem() {
|
|
|
|
|
const { current } = this.state;
|
|
|
|
|
const { siteData } = this.props;
|
|
|
|
|
if (current < siteData.length - 1) {
|
|
|
|
|
this.setState({
|
|
|
|
|
current: current + 1,
|
|
|
|
|
isClick: true,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
// this.toHomePage();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
onFinish(event) {
|
|
|
|
|
const { current } = event.detail;
|
|
|
|
|
const { toRight, isClick } = this.state;
|
|
|
|
|
const { siteData } = this.props;
|
|
|
|
|
if (current === siteData.length - 1) {
|
|
|
|
|
if (toRight || isClick) {
|
|
|
|
|
this.setState({ toRight: false, isClick: false });
|
|
|
|
|
} else {
|
|
|
|
|
// this.toHomePage();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let {
|
|
|
|
|
title,
|
|
|
|
|
content,
|
|
|
|
|
confirmButtonText,
|
|
|
|
|
textAlgin,
|
|
|
|
|
isShow,
|
|
|
|
|
isLarge,
|
|
|
|
|
// type,
|
|
|
|
|
} = this.props;
|
|
|
|
|
let { confirmButtonText, isShow, siteData } = this.props;
|
|
|
|
|
let { current } = this.state;
|
|
|
|
|
|
|
|
|
|
console.log("siteData", siteData);
|
|
|
|
|
return (
|
|
|
|
|
<Block>
|
|
|
|
|
<PageMeta pageStyle={isShow ? "overflow: hidden;" : ""} />
|
|
|
|
|
@ -96,70 +135,51 @@ export default class PopupSiteSwiper extends Component<any, any> {
|
|
|
|
|
className="at-icon at-icon-close common-close"
|
|
|
|
|
onClick={this.onClose}
|
|
|
|
|
></View>
|
|
|
|
|
<View
|
|
|
|
|
className={classnames("common-box", {
|
|
|
|
|
large: isLarge,
|
|
|
|
|
})}
|
|
|
|
|
>
|
|
|
|
|
{/* <View className="common-popup-title">{title}</View>
|
|
|
|
|
<View className="common-popup-content-box">
|
|
|
|
|
<View
|
|
|
|
|
className={classnames("common-popup-content", {
|
|
|
|
|
"text-left": textAlgin === "left",
|
|
|
|
|
"text-right": textAlgin === "right",
|
|
|
|
|
"text-center": textAlgin === "center",
|
|
|
|
|
})}
|
|
|
|
|
<View className={classnames("common-box")}>
|
|
|
|
|
<View className="site-popup-content-box">
|
|
|
|
|
<Swiper
|
|
|
|
|
className="absolutely"
|
|
|
|
|
style="width: 600rpx;height: 800rpx"
|
|
|
|
|
current={current}
|
|
|
|
|
onChange={this.onChange.bind(this)}
|
|
|
|
|
onAnimationFinish={this.onFinish.bind(this)}
|
|
|
|
|
duration={800}
|
|
|
|
|
indicatorDots={true}
|
|
|
|
|
indicatorColor="#999"
|
|
|
|
|
indicatorActiveColor="#333"
|
|
|
|
|
>
|
|
|
|
|
{content}
|
|
|
|
|
</View>
|
|
|
|
|
</View> */}
|
|
|
|
|
{/* <Swiper
|
|
|
|
|
className="absolutely"
|
|
|
|
|
current={current}
|
|
|
|
|
onChange={this.onChange.bind(this)}
|
|
|
|
|
onAnimationFinish={this.onFinish.bind(this)}
|
|
|
|
|
duration={800}
|
|
|
|
|
indicatorDots={true}
|
|
|
|
|
indicatorColor="#999"
|
|
|
|
|
indicatorActiveColor="#333"
|
|
|
|
|
>
|
|
|
|
|
{welcomeList.map((item, index) => {
|
|
|
|
|
return (
|
|
|
|
|
<SwiperItem
|
|
|
|
|
className="absolutely"
|
|
|
|
|
onClick={this.onClickSwiperItem.bind(this)}
|
|
|
|
|
key={"swiper_" + index}
|
|
|
|
|
>
|
|
|
|
|
<View
|
|
|
|
|
className="body FadeInFrame fadein"
|
|
|
|
|
style={{
|
|
|
|
|
top: menu.top + "px",
|
|
|
|
|
height: "calc(" + (100 % -menu.height) + "px)",
|
|
|
|
|
display: current === index ? "block" : "none",
|
|
|
|
|
}}
|
|
|
|
|
{siteData.map((item, index) => {
|
|
|
|
|
return (
|
|
|
|
|
<SwiperItem
|
|
|
|
|
className="absolutely"
|
|
|
|
|
onClick={this.onClickSwiperItem.bind(this)}
|
|
|
|
|
key={"swiper_" + index}
|
|
|
|
|
>
|
|
|
|
|
<View>
|
|
|
|
|
<View
|
|
|
|
|
// className="body FadeInFrame fadein"
|
|
|
|
|
style={{
|
|
|
|
|
width: "100%",
|
|
|
|
|
height: "100%",
|
|
|
|
|
// display: current === index ? "block" : "none",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Image
|
|
|
|
|
className="cover"
|
|
|
|
|
src={item.image}
|
|
|
|
|
mode="aspectFill"
|
|
|
|
|
mode="aspectFit"
|
|
|
|
|
></Image>
|
|
|
|
|
</View>
|
|
|
|
|
<View className="bottom-card">
|
|
|
|
|
<View className="text slide-left">{item.title}</View>
|
|
|
|
|
<View className="txt slide-left">{item.desc}</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</SwiperItem>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</Swiper> */}
|
|
|
|
|
</SwiperItem>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</Swiper>
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
|
|
<View className="common-popup-btns">
|
|
|
|
|
{/* <View className="common-popup-btns">
|
|
|
|
|
<Button className="common-popup-btn" onClick={this.onConfirm}>
|
|
|
|
|
{confirmButtonText}
|
|
|
|
|
</Button>
|
|
|
|
|
</View>
|
|
|
|
|
</View> */}
|
|
|
|
|
</View>
|
|
|
|
|
</Popup>
|
|
|
|
|
</Block>
|
|
|
|
|
|