|
@@ -12,7 +12,7 @@ import UserHelper from "@/helper/userHelper";
|
|
|
import ImageUtil from "@/utils/imgUtils";
|
|
|
import RouteUtil from "@/utils/routeUtil";
|
|
|
import { Image, ScrollView, View, Text } from "@tarojs/components";
|
|
|
-import { pxTransform } from "@tarojs/taro";
|
|
|
+import Taro, { pxTransform } from "@tarojs/taro";
|
|
|
import { useRequest } from "ahooks";
|
|
|
import React, { useContext, useMemo, useState } from "react";
|
|
|
|
|
@@ -20,6 +20,7 @@ const Home = () => {
|
|
|
const appContext = useContext(AppContext);
|
|
|
const { screenWidth, statusBarHeight } = appContext.systemInfo!;
|
|
|
const [bottomRemark, setBottomRemark] = useState('')
|
|
|
+ const isUserLogin = UserHelper.isLogin()
|
|
|
|
|
|
const indexInfoResult = useRequest(() => {
|
|
|
return UserApi.getIndexInfoUsingPost({
|
|
@@ -67,6 +68,61 @@ const Home = () => {
|
|
|
</View>
|
|
|
);
|
|
|
};
|
|
|
+
|
|
|
+
|
|
|
+ const ApplyButton = ({ isLogin }) => {
|
|
|
+ console.log("isLogin", isLogin)
|
|
|
+ return (
|
|
|
+ <>
|
|
|
+ {
|
|
|
+ isLogin ? (<Button className='index-back-btn' onClick={() => {
|
|
|
+ UserHelper.afterLogin({
|
|
|
+ pop: false,
|
|
|
+ callback: async () => {
|
|
|
+ indexInfoResult.data &&
|
|
|
+ RouteUtil.toWebViewPage({
|
|
|
+ url: indexInfoResult.data.link,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ >立即申请额度</Button>) : (<Button openType='getPhoneNumber'
|
|
|
+ onGetPhoneNumber={async (e) => {
|
|
|
+ if (e.detail.code && await UserHelper.userWxLogin(e.detail.code) === true) {
|
|
|
+ indexInfoResult.data &&
|
|
|
+ RouteUtil.toWebViewPage({
|
|
|
+ url: indexInfoResult.data.link,
|
|
|
+ });
|
|
|
+ // if (params.callbackBeforeRoute?.toString() === "1") {
|
|
|
+ // console.log('进来了', params)
|
|
|
+ // if (params.page) {
|
|
|
+ // RouteUtil.replace(params.page, { params: params.params });
|
|
|
+ // }
|
|
|
+ // else {
|
|
|
+ // +pop && RouteUtil.pop();
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // console.log('进来了----71', params)
|
|
|
+ if (UserHelper.callback) {
|
|
|
+ await UserHelper.callback();
|
|
|
+ }
|
|
|
+ // if (params.callbackBeforeRoute?.toString() !== "1") {
|
|
|
+ // if (params.page) {
|
|
|
+ // RouteUtil.replace(params.page, { params: params.params });
|
|
|
+ // }
|
|
|
+ // else {
|
|
|
+
|
|
|
+ // +pop && RouteUtil.pop();
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ }} fill
|
|
|
+ className='index-back-btn'
|
|
|
+ >立即申请额度</Button>)
|
|
|
+ }
|
|
|
+ </>
|
|
|
+ )
|
|
|
+ }
|
|
|
return (
|
|
|
<Layout safe className='index' bottomBarIndex={0}>
|
|
|
<ScrollView className='index-container'>
|
|
@@ -111,7 +167,8 @@ const Home = () => {
|
|
|
<View className='index-back-btn-tip'>
|
|
|
现在申请,最快1分钟激活额度
|
|
|
</View>
|
|
|
- <Button
|
|
|
+ <ApplyButton isLogin={isUserLogin}></ApplyButton>
|
|
|
+ {/* <Button
|
|
|
onClick={() => {
|
|
|
UserHelper.afterLogin({
|
|
|
pop: false,
|
|
@@ -125,8 +182,8 @@ const Home = () => {
|
|
|
}}
|
|
|
className='index-back-btn'
|
|
|
>
|
|
|
- {indexInfoResult.data?.name || "立即激活"}
|
|
|
- </Button>
|
|
|
+ 立即申请额度
|
|
|
+ </Button> */}
|
|
|
</View>
|
|
|
</Flex>
|
|
|
</View>
|
|
@@ -190,7 +247,6 @@ const Home = () => {
|
|
|
>
|
|
|
<View>
|
|
|
{ bottomRemark }
|
|
|
- {/* { channelResult.data?.bottomRemark || "哈哈哈哈" } */}
|
|
|
{/* 郑重声明:平台只提供贷款咨询和推荐服务,放款由银行或金融机构进行,贷款额度、放款时间以资金分审批结果为准,所有贷款申请在未成功贷款前绝不收取任何费用,为了保证您的资金安全,请不要相信任何要求您支付费用的信息、邮件、电话等不实信息。 */}
|
|
|
</View>
|
|
|
<View>如遇问题请向{ channelResult.data?.customerServiceInfo || '400-003-9350'}举报投诉,平台将及时为您解决!</View>
|