nomadro/apps/miniprogram/tt/src/pages/destinations/index.tsx
eric 1d3e513ae2 Ship Douyin tt/ miniprogram: offline reader, clipboard privacy, README.
Add apps/miniprogram/tt as a standalone Douyin app with official usePrivacyCheck + tt.showModal/setClipboardData flow, single-chapter offline reader, and document console privacy setup for clipboard.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 15:17:52 +08:00

35 lines
1.3 KiB
TypeScript

import { View, Text, ScrollView } from '@tarojs/components'
import { useLoad } from '@tarojs/taro'
import { useState } from 'react'
import { BrandNav, SiteFooter } from '../../components/Chrome'
import { DestinationsSection } from '../../components/DestinationsSection'
import { fetchDestinations, type Destination } from '../../services/api'
import './index.scss'
export default function DestinationsPage() {
const [list, setList] = useState<Destination[]>([])
const [err, setErr] = useState('')
const [loading, setLoading] = useState(true)
useLoad(() => {
fetchDestinations()
.then((d) => { setList(d); setLoading(false) })
.catch((e) => { setErr(e.message || '加载失败'); setLoading(false) })
})
return (
<ScrollView scrollY className='page-shell' showScrollbar={false}>
<BrandNav chip='探索' />
<View className='container' style={{ paddingTop: '8px' }}>
<Text className='section-tag'>🧭 EXPLORE</Text>
<Text className='section-h2'>探索</Text>
<Text className='section-p'>发现下一座适合你的城市</Text>
{loading ? <Text className='dest-empty'>加载中…</Text> : null}
{err ? <Text className='dest-empty'>{err}</Text> : null}
</View>
{!loading && !err ? <DestinationsSection list={list} /> : null}
<SiteFooter />
</ScrollView>
)
}