diff --git a/src/app.config.ts b/src/app.config.ts index 1cd60c5..eee34b8 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -4,11 +4,10 @@ export default defineAppConfig({ 'pages/list/index', // 列表页 'pages/search/index', // 搜索页 'pages/searchResult/index', // 搜索结果页面 - // 'pages/userInfo/myself/index', + 'pages/userInfo/myself/index', 'pages/login/index/index', 'pages/login/verification/index', 'pages/login/terms/index', - // 'pages/mapDisplay/index', 'pages/detail/index', 'pages/message/index', diff --git a/src/components/ListCard/index.tsx b/src/components/ListCard/index.tsx index df80400..3fb3538 100644 --- a/src/components/ListCard/index.tsx +++ b/src/components/ListCard/index.tsx @@ -22,6 +22,7 @@ const ListCard: React.FC = ({ }; const handleViewDetail = () => { + console.log('id', id) Taro.navigateTo({ url: `/pages/detail/index?id=${id || 1}&from=list&autoShare=0`, }); diff --git a/src/pages/detail/index.tsx b/src/pages/detail/index.tsx index b1e1626..5565e69 100644 --- a/src/pages/detail/index.tsx +++ b/src/pages/detail/index.tsx @@ -1,7 +1,7 @@ import React, { useState, useEffect, useRef, useImperativeHandle, forwardRef } from 'react' import { View, Text, Button, Swiper, SwiperItem, Image, Map, ScrollView } from '@tarojs/components' import { Cell, Avatar, Progress, Popover } from '@nutui/nutui-react-taro' -import Taro, { useRouter, useShareAppMessage, useShareTimeline } from '@tarojs/taro' +import Taro, { useRouter, useShareAppMessage, useShareTimeline, useDidShow } from '@tarojs/taro' // 导入API服务 import DetailService from '../../services/detailService' import { @@ -106,10 +106,15 @@ function Index() { const sharePopupRef = useRef(null) // 页面加载时获取数据 - useEffect(() => { + // useEffect(() => { + // fetchDetail() + // calcBgMainColors() + // }, []) + + useDidShow(() => { fetchDetail() calcBgMainColors() - }, []) + }) const fetchDetail = async () => { const res = await DetailService.getDetail(Number(id)) diff --git a/src/pages/orderCheck/index.tsx b/src/pages/orderCheck/index.tsx index 8165946..7a32e62 100644 --- a/src/pages/orderCheck/index.tsx +++ b/src/pages/orderCheck/index.tsx @@ -1,10 +1,29 @@ import React from 'react' -import { View, Text } from '@tarojs/components' +import { View, Text, Button } from '@tarojs/components' +import Taro from '@tarojs/taro' +import { delay } from '@/utils' const OrderCheck = () => { + const handlePay = async () => { + Taro.showLoading({ + title: '支付中...', + mask: true + }) + await delay(2000) + Taro.hideLoading() + Taro.showToast({ + title: '支付成功', + icon: 'success' + }) + await delay(1000) + Taro.navigateBack({ + delta: 1 + }) + } return ( OrderCheck + ) }