import Taro from '@tarojs/taro'
import { View } from '@tarojs/components'
import React from 'react'
import './index.less'
import { useDidShow, useUnload } from '@tarojs/taro'

let count = 0
const Webview: React.FC = () => {
  useDidShow(() => {
    Taro.navigateToMiniProgram({
      appId: 'wxdd07a068bf2e6ef4',
      path: 'pages/middlepage/middlepage?paramKey=fdc2ab9b532143aea717520b5f9b8f10'
    })
    count++
    console.log(count)

    if (count > 1) {
      Taro.navigateBack()
    }
  })

  useUnload(() => {
    count = 0
  })
  return (
    <View>
      全屏小程序
    </View>
  )
}

export default Webview
