feat: 流程串通

This commit is contained in:
2025-09-01 14:50:14 +08:00
parent a2502df05b
commit 66c85d6586
4 changed files with 29 additions and 5 deletions

View File

@@ -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<any>(null)
// 页面加载时获取数据
useEffect(() => {
// useEffect(() => {
// fetchDetail()
// calcBgMainColors()
// }, [])
useDidShow(() => {
fetchDetail()
calcBgMainColors()
}, [])
})
const fetchDetail = async () => {
const res = await DetailService.getDetail(Number(id))

View File

@@ -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 (
<View>
<Text>OrderCheck</Text>
<Button onClick={handlePay}></Button>
</View>
)
}