|
|
|
|
@ -2,7 +2,14 @@ import classnames from "classnames";
|
|
|
|
|
import dayjs from "dayjs";
|
|
|
|
|
import Taro from "@tarojs/taro";
|
|
|
|
|
import { Component, PropsWithChildren } from "react";
|
|
|
|
|
import { Block, View, Text, Image, PageMeta, Button } from "@tarojs/components";
|
|
|
|
|
import {
|
|
|
|
|
Block,
|
|
|
|
|
View,
|
|
|
|
|
Text,
|
|
|
|
|
Image,
|
|
|
|
|
Swiper,
|
|
|
|
|
SwiperItem,
|
|
|
|
|
} from "@tarojs/components";
|
|
|
|
|
|
|
|
|
|
/*** redux ***/
|
|
|
|
|
import { connect } from "react-redux";
|
|
|
|
|
@ -20,13 +27,13 @@ import type CustomTabBar from "../../custom-tab-bar";
|
|
|
|
|
import Navbar from "../../components/navbar/navbar";
|
|
|
|
|
/** 自定义组件 **/
|
|
|
|
|
|
|
|
|
|
import { Toast } from "@antmjs/vantui";
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
RefreshWxUserInfo,
|
|
|
|
|
GetNoReadMessageNum,
|
|
|
|
|
GetOtherSetting,
|
|
|
|
|
GetSitePopupList,
|
|
|
|
|
GetSiteCarousel,
|
|
|
|
|
GetSiteAddTag,
|
|
|
|
|
} from "../../utils/Interface";
|
|
|
|
|
|
|
|
|
|
// css引入
|
|
|
|
|
@ -67,6 +74,9 @@ class Index extends Component<any, any> {
|
|
|
|
|
info: {}, // 护理推荐点击参与活动的信息
|
|
|
|
|
weekinfo: undefined,
|
|
|
|
|
currentDate: dayjs().format("YYYY-MM-DD"),
|
|
|
|
|
// 横幅轮播
|
|
|
|
|
bannerList: [],
|
|
|
|
|
bannerCurrent: 0,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -105,6 +115,7 @@ class Index extends Component<any, any> {
|
|
|
|
|
this.RefreshWxUserInfo();
|
|
|
|
|
|
|
|
|
|
this.GetSitePopupList();
|
|
|
|
|
this.GetSiteCarousel();
|
|
|
|
|
// if (!this.state.isShowIndexFlag) {
|
|
|
|
|
// // 仅初次进入首页运行
|
|
|
|
|
// this.GetSitePopupList();
|
|
|
|
|
@ -174,7 +185,26 @@ class Index extends Component<any, any> {
|
|
|
|
|
if (res.data.data) {
|
|
|
|
|
this.setState({ sitePopupList: res.data.data, isShowSiteSwiper: true });
|
|
|
|
|
} else {
|
|
|
|
|
msg("暂无数据");
|
|
|
|
|
// msg("暂无数据");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 获取站点管理-广告轮播列表
|
|
|
|
|
GetSiteCarousel = async () => {
|
|
|
|
|
let res = await GetSiteCarousel();
|
|
|
|
|
if (res.data.code === 200) {
|
|
|
|
|
if (res.data.data) {
|
|
|
|
|
this.setState({ bannerList: res.data.data });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
GetSiteAddTag = async (id) => {
|
|
|
|
|
let res = await GetSiteAddTag(id);
|
|
|
|
|
console.log("tag", res.data);
|
|
|
|
|
if (res.data.code === 200) {
|
|
|
|
|
if (res.data.data) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
@ -267,6 +297,13 @@ class Index extends Component<any, any> {
|
|
|
|
|
this.setState({ isShowSiteSwiper: false });
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
bannerSwiperchange() {}
|
|
|
|
|
|
|
|
|
|
gobanner(item) {
|
|
|
|
|
console.log("item", item);
|
|
|
|
|
this.GetSiteAddTag(item.id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let {
|
|
|
|
|
currentDate,
|
|
|
|
|
@ -276,7 +313,12 @@ class Index extends Component<any, any> {
|
|
|
|
|
isNotRegister,
|
|
|
|
|
isShowSiteSwiper,
|
|
|
|
|
isDev,
|
|
|
|
|
|
|
|
|
|
bannerList,
|
|
|
|
|
bannerCurrent,
|
|
|
|
|
} = this.state;
|
|
|
|
|
|
|
|
|
|
console.log("bannerList", bannerList);
|
|
|
|
|
return (
|
|
|
|
|
<Block>
|
|
|
|
|
<PopupAlert
|
|
|
|
|
@ -373,7 +415,72 @@ class Index extends Component<any, any> {
|
|
|
|
|
<View className="tips">您暂时还没有绑定任何设备</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
<Toast id="toast"></Toast>
|
|
|
|
|
|
|
|
|
|
{/* <View className="infobox7">
|
|
|
|
|
<View className="nurse_recommend_box flex aitems sb">
|
|
|
|
|
<View className="title">护理推荐</View>
|
|
|
|
|
<View className="txt_box flex jcenter aitems" data-url="/pages/care_plan/list/list" onClick={this.goCarePlanList}>
|
|
|
|
|
<View className="txt">更多</View>
|
|
|
|
|
<Image className="right_icon" src="/img/index-right.png" mode="aspectFill"></Image>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
<ScrollView className="scroll_View" enable-flex scroll-x>
|
|
|
|
|
<View className="recommend_list flex">
|
|
|
|
|
<Block wx:for="{{carePlanList}}" wx:key="index">
|
|
|
|
|
<View className="recommend_item" data-url="/pages/care_plan/detail/detail?id={{item.id}}" onClick={this.gourl}>
|
|
|
|
|
<Image className="banner_img" src={imgUrl+item.indexBanner} mode="aspectFill"></Image>
|
|
|
|
|
<View className="bottom flex sb fc">
|
|
|
|
|
<View className="title ellipsis2">{{item.title}}</View>
|
|
|
|
|
<View className="join_in {{carePlan.activity.id==item.id&&carePlan.join.status==1?'disabled':''}}">
|
|
|
|
|
<Block wx:if="{{carePlan.activity.id===item.id&&carePlan.join.status==1}}">参与中</Block>
|
|
|
|
|
<Block wx:else>参与</Block>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</Block>
|
|
|
|
|
</View>
|
|
|
|
|
</ScrollView>
|
|
|
|
|
</View> */}
|
|
|
|
|
|
|
|
|
|
{/* {bannerList.length && (
|
|
|
|
|
<View className="infobox3">
|
|
|
|
|
<Swiper
|
|
|
|
|
autoplay={true}
|
|
|
|
|
onAnimationFinish={this.bannerSwiperchange.bind(this)}
|
|
|
|
|
current={bannerCurrent}
|
|
|
|
|
>
|
|
|
|
|
{bannerList.map((item, index) => {
|
|
|
|
|
return (
|
|
|
|
|
<SwiperItem
|
|
|
|
|
key={"banner_" + index}
|
|
|
|
|
onClick={this.gobanner.bind(this)}
|
|
|
|
|
data-item={item}
|
|
|
|
|
>
|
|
|
|
|
<Image src={item.fileUrl} />
|
|
|
|
|
</SwiperItem>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</Swiper>
|
|
|
|
|
</View>
|
|
|
|
|
)} */}
|
|
|
|
|
<View className="infobox3">
|
|
|
|
|
<Swiper
|
|
|
|
|
autoplay={true}
|
|
|
|
|
onAnimationFinish={this.bannerSwiperchange.bind(this)}
|
|
|
|
|
current={bannerCurrent}
|
|
|
|
|
>
|
|
|
|
|
{bannerList.map((item, index) => {
|
|
|
|
|
return (
|
|
|
|
|
<SwiperItem
|
|
|
|
|
key={"banner_" + index}
|
|
|
|
|
onClick={this.gobanner.bind(this, item)}
|
|
|
|
|
>
|
|
|
|
|
<Image src={item.fileUrl} />
|
|
|
|
|
</SwiperItem>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</Swiper>
|
|
|
|
|
</View>
|
|
|
|
|
</Block>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|