|
|
|
@ -8,7 +8,7 @@ import { Block, View, Text, Image, PageMeta, Button } from "@tarojs/components";
|
|
|
|
import { connect } from "react-redux";
|
|
|
|
import { connect } from "react-redux";
|
|
|
|
import { userRefresh } from "../../store/features/userInfo";
|
|
|
|
import { userRefresh } from "../../store/features/userInfo";
|
|
|
|
import { otherSettingRefresh } from "../../store/features/otherSetting";
|
|
|
|
import { otherSettingRefresh } from "../../store/features/otherSetting";
|
|
|
|
import { setIndexFlag } from "../../store/features/global";
|
|
|
|
import { setIndexFlag } from "../../store/features/globalStore";
|
|
|
|
/*** redux end ***/
|
|
|
|
/*** redux end ***/
|
|
|
|
|
|
|
|
|
|
|
|
/** 自定义组件 **/
|
|
|
|
/** 自定义组件 **/
|
|
|
|
@ -32,7 +32,7 @@ import {
|
|
|
|
// css引入
|
|
|
|
// css引入
|
|
|
|
import "taro-ui/rn/style/components/calendar.scss";
|
|
|
|
import "taro-ui/rn/style/components/calendar.scss";
|
|
|
|
import "./index.less";
|
|
|
|
import "./index.less";
|
|
|
|
import { go } from "../../utils/traoAPI";
|
|
|
|
import { go, msg } from "../../utils/traoAPI";
|
|
|
|
|
|
|
|
|
|
|
|
// PropsWithChildren
|
|
|
|
// PropsWithChildren
|
|
|
|
class Index extends Component<any, any> {
|
|
|
|
class Index extends Component<any, any> {
|
|
|
|
@ -41,6 +41,7 @@ class Index extends Component<any, any> {
|
|
|
|
constructor(props) {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
super(props);
|
|
|
|
this.state = {
|
|
|
|
this.state = {
|
|
|
|
|
|
|
|
isShowIndexFlag: this.props.isShowIndexFlag,
|
|
|
|
isShowPrivacyPopup: false,
|
|
|
|
isShowPrivacyPopup: false,
|
|
|
|
isShowSiteSwiper: false,
|
|
|
|
isShowSiteSwiper: false,
|
|
|
|
isNotRegister: false, // 是否未注册
|
|
|
|
isNotRegister: false, // 是否未注册
|
|
|
|
@ -102,7 +103,13 @@ class Index extends Component<any, any> {
|
|
|
|
if (mobile) {
|
|
|
|
if (mobile) {
|
|
|
|
this.GetNoReadMessageNum(); // 查询是否有消息
|
|
|
|
this.GetNoReadMessageNum(); // 查询是否有消息
|
|
|
|
this.RefreshWxUserInfo();
|
|
|
|
this.RefreshWxUserInfo();
|
|
|
|
|
|
|
|
|
|
|
|
this.GetSitePopupList();
|
|
|
|
this.GetSitePopupList();
|
|
|
|
|
|
|
|
// if (!this.state.isShowIndexFlag) {
|
|
|
|
|
|
|
|
// // 仅初次进入首页运行
|
|
|
|
|
|
|
|
// this.GetSitePopupList();
|
|
|
|
|
|
|
|
// this.props.setIndexFlag(true);
|
|
|
|
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -159,13 +166,37 @@ class Index extends Component<any, any> {
|
|
|
|
|
|
|
|
|
|
|
|
// 获取站点管理-弹窗列表 1-首页 2-发现模块 3-活动模块
|
|
|
|
// 获取站点管理-弹窗列表 1-首页 2-发现模块 3-活动模块
|
|
|
|
GetSitePopupList = async () => {
|
|
|
|
GetSitePopupList = async () => {
|
|
|
|
|
|
|
|
this.intData();
|
|
|
|
|
|
|
|
// return;
|
|
|
|
let res = await GetSitePopupList(1);
|
|
|
|
let res = await GetSitePopupList(1);
|
|
|
|
if (res.data.code === 200) {
|
|
|
|
if (res.data.code === 200) {
|
|
|
|
// console.log("GetSitePopupList", res);
|
|
|
|
// console.log("GetSitePopupList", res);
|
|
|
|
this.setState({ sitePopupList: res.data.data, isShowSiteSwiper: true });
|
|
|
|
if (res.data.data) {
|
|
|
|
|
|
|
|
this.setState({ sitePopupList: res.data.data, isShowSiteSwiper: true });
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
msg("暂无数据");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async intData() {
|
|
|
|
|
|
|
|
let MpSplashDetail_type1 =
|
|
|
|
|
|
|
|
Taro.getStorageSync("MpSplashDetail_type1") || undefined;
|
|
|
|
|
|
|
|
if (MpSplashDetail_type1) {
|
|
|
|
|
|
|
|
let detail = JSON.parse(MpSplashDetail_type1);
|
|
|
|
|
|
|
|
let list = detail.filter((item: any) => item.fileSuffix === "images");
|
|
|
|
|
|
|
|
let welcomeList = list.map((item) => {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
image: item.filePath,
|
|
|
|
|
|
|
|
title: item.title,
|
|
|
|
|
|
|
|
desc: item.content,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
console.log("welcomeList", welcomeList);
|
|
|
|
|
|
|
|
this.setState({ sitePopupList: welcomeList, isShowSiteSwiper: true });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
goRegister() {
|
|
|
|
goRegister() {
|
|
|
|
go("/pages/register/register");
|
|
|
|
go("/pages/register/register");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -273,12 +304,10 @@ class Index extends Component<any, any> {
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<PopupSiteSwiper
|
|
|
|
<PopupSiteSwiper
|
|
|
|
isShow={isShowSiteSwiper}
|
|
|
|
isShow={isShowSiteSwiper}
|
|
|
|
data={sitePopupList}
|
|
|
|
siteData={sitePopupList}
|
|
|
|
title="提示"
|
|
|
|
size="middle"
|
|
|
|
content="暂未授权注册,请点击注册"
|
|
|
|
|
|
|
|
confirmButtonText="确定"
|
|
|
|
confirmButtonText="确定"
|
|
|
|
textAlgin="center"
|
|
|
|
textAlgin="center"
|
|
|
|
type="1"
|
|
|
|
|
|
|
|
close={this.closeSiteSwiper}
|
|
|
|
close={this.closeSiteSwiper}
|
|
|
|
confirm={this.closeSiteSwiper}
|
|
|
|
confirm={this.closeSiteSwiper}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
@ -353,6 +382,7 @@ class Index extends Component<any, any> {
|
|
|
|
const mapStateToProps = (state) => ({
|
|
|
|
const mapStateToProps = (state) => ({
|
|
|
|
background: state.navigation.background,
|
|
|
|
background: state.navigation.background,
|
|
|
|
mobile: state.userInfo.mobile,
|
|
|
|
mobile: state.userInfo.mobile,
|
|
|
|
|
|
|
|
isShowIndexFlag: state.globalStore.isShowIndexFlag,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const mapDispatchToProps = (dispatch) => ({
|
|
|
|
const mapDispatchToProps = (dispatch) => ({
|
|
|
|
userRefresh(data) {
|
|
|
|
userRefresh(data) {
|
|
|
|
|