|
@@ -10,7 +10,9 @@ import APPConfig from "@/config";
|
|
|
import AppContext from "@/context/appContext";
|
|
|
import UserHelper from "@/helper/userHelper";
|
|
|
import ImageUtil from "@/utils/imgUtils";
|
|
|
+import RequestUtil from "@/utils/request";
|
|
|
import RouteUtil from "@/utils/routeUtil";
|
|
|
+import { parseQueryParams, isOuterLink } from "@/utils/toolsUtil";
|
|
|
import { Image, ScrollView, View, Text } from "@tarojs/components";
|
|
|
import Taro, { pxTransform } from "@tarojs/taro";
|
|
|
import { useRequest } from "ahooks";
|
|
@@ -30,12 +32,31 @@ const Home = () => {
|
|
|
|
|
|
const channelResult = useRequest(() => {
|
|
|
return UserApi.homeFetchChannel({
|
|
|
- data: { channelCode: 'txxcx01', refer: '' },
|
|
|
+ data: { channelCode: 'statistic', refer: '' },
|
|
|
}).toData().then(res => {
|
|
|
setBottomRemark(res.bottom_remark)
|
|
|
})
|
|
|
});
|
|
|
|
|
|
+ const postJumpUrlResult = () => {
|
|
|
+ const params = parseQueryParams(indexInfoResult.data.link)
|
|
|
+ return UserApi.getJumpUrlPost({
|
|
|
+ loading: true,
|
|
|
+ data: { appId: APPConfig.APPID, channelCode: params.channelCode, productId: params.productId }
|
|
|
+ }).toData().then(res => {
|
|
|
+ console.log("获取跳转链接结果", res)
|
|
|
+ RouteUtil.toWebViewPage({ url: res?.adJumpLink })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ const loginFlowHandler = () => {
|
|
|
+ if (isOuterLink(indexInfoResult.data.link)) {
|
|
|
+ postJumpUrlResult()
|
|
|
+ } else {
|
|
|
+ RouteUtil.toWebViewPage({ url: indexInfoResult.data.link })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
const imgBackStyle = useMemo(() => {
|
|
|
return {
|
|
@@ -72,7 +93,6 @@ const Home = () => {
|
|
|
const BottomRemark = () => bottomRemark.split(';').map(text => <View style={{ margin: '4px 0' }}>{text}</View>)
|
|
|
|
|
|
const ApplyButton = ({ isLogin }) => {
|
|
|
- console.log("isLogin", isLogin)
|
|
|
return (
|
|
|
<>
|
|
|
{
|
|
@@ -80,20 +100,24 @@ const Home = () => {
|
|
|
UserHelper.afterLogin({
|
|
|
pop: false,
|
|
|
callback: async () => {
|
|
|
- indexInfoResult.data &&
|
|
|
- RouteUtil.toWebViewPage({
|
|
|
- url: indexInfoResult.data.link,
|
|
|
- });
|
|
|
+ indexInfoResult.data && loginFlowHandler()
|
|
|
+ // indexInfoResult.data && postJumpUrlResult()
|
|
|
+ // 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,
|
|
|
- });
|
|
|
+ // indexInfoResult.data &&
|
|
|
+ // RouteUtil.toWebViewPage({
|
|
|
+ // url: indexInfoResult.data.link,
|
|
|
+ // });
|
|
|
+
|
|
|
+ indexInfoResult.data && loginFlowHandler()
|
|
|
+
|
|
|
// if (params.callbackBeforeRoute?.toString() === "1") {
|
|
|
// console.log('进来了', params)
|
|
|
// if (params.page) {
|