|
@@ -10,16 +10,24 @@ import APPConfig from "@/config";
|
|
import AppContext from "@/context/appContext";
|
|
import AppContext from "@/context/appContext";
|
|
import UserHelper from "@/helper/userHelper";
|
|
import UserHelper from "@/helper/userHelper";
|
|
import ImageUtil from "@/utils/imgUtils";
|
|
import ImageUtil from "@/utils/imgUtils";
|
|
-import RequestUtil from "@/utils/request";
|
|
|
|
import RouteUtil from "@/utils/routeUtil";
|
|
import RouteUtil from "@/utils/routeUtil";
|
|
-import { Image, ScrollView, View, Text, Input } from "@tarojs/components";
|
|
|
|
|
|
+import {
|
|
|
|
+ Image,
|
|
|
|
+ ScrollView,
|
|
|
|
+ View,
|
|
|
|
+ Text,
|
|
|
|
+ OfficialAccount,
|
|
|
|
+} from "@tarojs/components";
|
|
import { parseQueryParams, isOuterLink } from "@/utils/toolsUtil";
|
|
import { parseQueryParams, isOuterLink } from "@/utils/toolsUtil";
|
|
-import Taro, { pxTransform } from "@tarojs/taro";
|
|
|
|
|
|
+import { pxTransform } from "@tarojs/taro";
|
|
import { useRequest } from "ahooks";
|
|
import { useRequest } from "ahooks";
|
|
-import React, { useContext, useMemo, useState, useEffect, useRef } from "react";
|
|
|
|
|
|
+import React, { useContext, useMemo, useState, useRef } from "react";
|
|
import LoginBox from "../user/components/LoginBox";
|
|
import LoginBox from "../user/components/LoginBox";
|
|
|
|
+import BottomBarContext from "@/context/bottomBarContext";
|
|
|
|
|
|
const Home = () => {
|
|
const Home = () => {
|
|
|
|
+ const bottomBarContext = useContext(BottomBarContext);
|
|
|
|
+
|
|
const childRef: any = useRef();
|
|
const childRef: any = useRef();
|
|
const handleOpen = () => {
|
|
const handleOpen = () => {
|
|
childRef.current.handleOpen();
|
|
childRef.current.handleOpen();
|
|
@@ -28,13 +36,13 @@ const Home = () => {
|
|
const { screenWidth, statusBarHeight } = appContext.systemInfo!;
|
|
const { screenWidth, statusBarHeight } = appContext.systemInfo!;
|
|
const [bottomRemark, setBottomRemark] = useState("");
|
|
const [bottomRemark, setBottomRemark] = useState("");
|
|
const isUserLogin = UserHelper.isLogin();
|
|
const isUserLogin = UserHelper.isLogin();
|
|
- const indexInfoResult = useRequest(() => {
|
|
|
|
|
|
+ const indexInfoResult: any = useRequest(() => {
|
|
return UserApi.getIndexInfoUsingPost({
|
|
return UserApi.getIndexInfoUsingPost({
|
|
params: { appId: APPConfig.APPID },
|
|
params: { appId: APPConfig.APPID },
|
|
}).toData();
|
|
}).toData();
|
|
});
|
|
});
|
|
|
|
|
|
- const channelResult = useRequest(() => {
|
|
|
|
|
|
+ const channelResult: any = useRequest(() => {
|
|
return UserApi.homeFetchChannel({
|
|
return UserApi.homeFetchChannel({
|
|
data: { channelCode: "hrqbxcx", refer: "" },
|
|
data: { channelCode: "hrqbxcx", refer: "" },
|
|
})
|
|
})
|
|
@@ -45,7 +53,7 @@ const Home = () => {
|
|
});
|
|
});
|
|
|
|
|
|
const postJumpUrlResult = () => {
|
|
const postJumpUrlResult = () => {
|
|
- const params = parseQueryParams(indexInfoResult.data.link);
|
|
|
|
|
|
+ const params: any = parseQueryParams(indexInfoResult.data.link);
|
|
return UserApi.getJumpUrlPost({
|
|
return UserApi.getJumpUrlPost({
|
|
loading: true,
|
|
loading: true,
|
|
data: {
|
|
data: {
|
|
@@ -55,7 +63,7 @@ const Home = () => {
|
|
},
|
|
},
|
|
})
|
|
})
|
|
.toData()
|
|
.toData()
|
|
- .then((res) => {
|
|
|
|
|
|
+ .then((res: any) => {
|
|
console.log("获取跳转链接结果", res);
|
|
console.log("获取跳转链接结果", res);
|
|
RouteUtil.toWebViewPage({ url: res?.adJumpLink });
|
|
RouteUtil.toWebViewPage({ url: res?.adJumpLink });
|
|
});
|
|
});
|
|
@@ -76,6 +84,7 @@ const Home = () => {
|
|
position: "relative",
|
|
position: "relative",
|
|
} as React.CSSProperties;
|
|
} as React.CSSProperties;
|
|
}, []);
|
|
}, []);
|
|
|
|
+ // @ts-ignore
|
|
const item = (index: number, title: string, desc: string) => {
|
|
const item = (index: number, title: string, desc: string) => {
|
|
return (
|
|
return (
|
|
<View style={imgBackStyle}>
|
|
<View style={imgBackStyle}>
|
|
@@ -269,6 +278,13 @@ const Home = () => {
|
|
</View>
|
|
</View>
|
|
</Flex>
|
|
</Flex>
|
|
</ScrollView>
|
|
</ScrollView>
|
|
|
|
+
|
|
|
|
+ <View className="index-official-account">
|
|
|
|
+ <View className="index-official-box ">
|
|
|
|
+ {bottomBarContext?.index === 0 && <OfficialAccount />}
|
|
|
|
+ </View>
|
|
|
|
+ </View>
|
|
|
|
+
|
|
<LoginBox ref={childRef}></LoginBox>
|
|
<LoginBox ref={childRef}></LoginBox>
|
|
</Layout>
|
|
</Layout>
|
|
);
|
|
);
|