import React from 'react'
import { Image, View, Text } from '@tarojs/components'
import './index.scss'

import { useEffect } from 'react';
import { useState } from 'react';
import paysuccess from '@/images/paysuccess.png'
import Taro from '@tarojs/taro';
import { useRouter } from '@tarojs/taro';
import { Button } from '@nutui/nutui-react-taro';



function Index() {
    // 跳转
    const navDetailFn = (id) => {
        Taro.navigateTo({
            url: `/pages/order/index`
        })
    }
    // 返回页面
    const backFn = () => {
        Taro.getCurrentPages().length > 0 && Taro.navigateBack()
    }

    const goHome = () => {
        Taro.navigateTo({
            url: '/pages/index/index'
        })
    }

    return (
        <View className='ps-container'>
            <Image src={paysuccess} className='pay-success' />
            <Text className='pay-title'>支付成功</Text>
            <Text className='t14'>您已成功购买商品，请到“我的订单”查看</Text>
            <Button className='go-order pay-btn' onClick={navDetailFn}>我的订单</Button>
            <Button className='go-home pay-btn' onClick={goHome}>返回首页</Button>
        </View>
    )
}

export default Index
