feat: 流程串通
This commit is contained in:
@@ -4,7 +4,6 @@ export default defineAppConfig({
|
|||||||
'pages/list/index', // 列表页
|
'pages/list/index', // 列表页
|
||||||
'pages/search/index', // 搜索页
|
'pages/search/index', // 搜索页
|
||||||
'pages/searchResult/index', // 搜索结果页面
|
'pages/searchResult/index', // 搜索结果页面
|
||||||
'pages/list/index',
|
|
||||||
'pages/userInfo/myself/index',
|
'pages/userInfo/myself/index',
|
||||||
'pages/login/index/index',
|
'pages/login/index/index',
|
||||||
'pages/login/verification/index',
|
'pages/login/verification/index',
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ const ListCard: React.FC<ListCardProps> = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleViewDetail = () => {
|
const handleViewDetail = () => {
|
||||||
|
console.log('id', id)
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: `/pages/detail/index?id=${id || 1}&from=list&autoShare=0`,
|
url: `/pages/detail/index?id=${id || 1}&from=list&autoShare=0`,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useState, useEffect, useRef, useImperativeHandle, forwardRef } from 'react'
|
import React, { useState, useEffect, useRef, useImperativeHandle, forwardRef } from 'react'
|
||||||
import { View, Text, Button, Swiper, SwiperItem, Image, Map, ScrollView } from '@tarojs/components'
|
import { View, Text, Button, Swiper, SwiperItem, Image, Map, ScrollView } from '@tarojs/components'
|
||||||
import { Cell, Avatar, Progress, Popover } from '@nutui/nutui-react-taro'
|
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服务
|
// 导入API服务
|
||||||
import DetailService from '../../services/detailService'
|
import DetailService from '../../services/detailService'
|
||||||
import {
|
import {
|
||||||
@@ -106,10 +106,15 @@ function Index() {
|
|||||||
const sharePopupRef = useRef<any>(null)
|
const sharePopupRef = useRef<any>(null)
|
||||||
|
|
||||||
// 页面加载时获取数据
|
// 页面加载时获取数据
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
|
// fetchDetail()
|
||||||
|
// calcBgMainColors()
|
||||||
|
// }, [])
|
||||||
|
|
||||||
|
useDidShow(() => {
|
||||||
fetchDetail()
|
fetchDetail()
|
||||||
calcBgMainColors()
|
calcBgMainColors()
|
||||||
}, [])
|
})
|
||||||
|
|
||||||
const fetchDetail = async () => {
|
const fetchDetail = async () => {
|
||||||
const res = await DetailService.getDetail(Number(id))
|
const res = await DetailService.getDetail(Number(id))
|
||||||
|
|||||||
@@ -1,10 +1,29 @@
|
|||||||
import React from 'react'
|
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 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 (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<Text>OrderCheck</Text>
|
<Text>OrderCheck</Text>
|
||||||
|
<Button onClick={handlePay}>支付</Button>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user