重新计算价格显示
This commit is contained in:
@@ -17,8 +17,8 @@ export default function HelpMenu() {
|
||||
icon={h01}
|
||||
title="提取 IP"
|
||||
items={[
|
||||
{lead: '短效 IP 提取', href: '/collect?type=short'},
|
||||
{lead: '长效 IP 提取', href: '/collect?type=long'},
|
||||
{lead: '短效/长效 IP 提取', href: '/collect?type=short'},
|
||||
// {lead: '长效 IP 提取', href: '/collect?type=long'},
|
||||
]}
|
||||
/>
|
||||
<Column
|
||||
|
||||
@@ -16,7 +16,7 @@ export default function CollectPage(props: CollectPageProps) {
|
||||
// </Wrap>
|
||||
// </main>
|
||||
<HomePage path={[
|
||||
{label: '短效IP 提取', href: '/collect'},
|
||||
{label: '短效/长效IP 提取', href: '/collect'},
|
||||
]}>
|
||||
<Wrap>
|
||||
<Extract/>
|
||||
|
||||
@@ -2,7 +2,7 @@ import {ReactNode} from 'react'
|
||||
import Header from './header'
|
||||
import Footer from './footer'
|
||||
import Script from 'next/script'
|
||||
|
||||
import {MessageCircleMoreIcon} from 'lucide-react'
|
||||
export type HomeLayoutProps = {
|
||||
children: ReactNode
|
||||
}
|
||||
@@ -19,7 +19,21 @@ export default function HomeLayout(props: HomeLayoutProps) {
|
||||
{/* 页脚 */}
|
||||
<Footer/>
|
||||
|
||||
<Script id="qd2852138148beb7882a4a6a3e5ff5b569436003e7dc" src="https://wp.qiye.qq.com/qidian/2852138148/beb7882a4a6a3e5ff5b569436003e7dc" async defer></Script>
|
||||
{/* <Script id="qd2852138148beb7882a4a6a3e5ff5b569436003e7dc" src="https://wp.qiye.qq.com/qidian/2852138148/beb7882a4a6a3e5ff5b569436003e7dc" async defer></Script> */}
|
||||
<a
|
||||
href="https://wpa1.qq.com/K0s0cvwf?_type=wpa&qidian=true"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="fixed bottom-6 right-6 z-50 w-14 h-14 rounded-full bg-blue-600 hover:bg-blue-700 shadow-lg hover:shadow-xl transition-all duration-300 hover:scale-110 flex items-center justify-center group"
|
||||
aria-label="在线客服"
|
||||
>
|
||||
<span className="text-white font-bold text-lg">客</span>
|
||||
<span className="text-white font-bold text-lg">服</span>
|
||||
|
||||
<span className="absolute -top-2 -right-2 flex items-center justify-center w-6 h-6 bg-red-500 rounded-full text-white shadow-md">
|
||||
<MessageCircleMoreIcon size={14}/>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ export default function ResourceList({resourceType}: ResourceListProps) {
|
||||
const live = resourceKey === 'long'
|
||||
? (row.original as Resource<2>).long.live
|
||||
: (row.original as Resource<1>).short.live
|
||||
return <span>{isLong ? `${live}小时` : `${live / 60}分钟`}</span>
|
||||
return <span>{isLong ? `${live}小时` : `${live}分钟`}</span>
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -337,6 +337,7 @@ function SelectResource() {
|
||||
setStatus('load')
|
||||
try {
|
||||
const resp = await allResource()
|
||||
console.log(resp, '/api/resource/all')
|
||||
|
||||
if (!resp.success) {
|
||||
throw new Error('获取套餐失败,请稍后再试')
|
||||
@@ -651,9 +652,9 @@ function name(resource: Resource) {
|
||||
// 短效套餐
|
||||
switch (resource.short.type) {
|
||||
case 1:
|
||||
return `短效包时 ${resource.short.live / 60} 分钟`
|
||||
return `短效包时 ${resource.short.live} 分钟`
|
||||
case 2:
|
||||
return `短效包量 ${resource.short.live / 60} 分钟`
|
||||
return `短效包量 ${resource.short.live} 分钟`
|
||||
}
|
||||
break
|
||||
|
||||
|
||||
@@ -32,12 +32,19 @@ export default function Right() {
|
||||
const resp = await getPrice({
|
||||
type: 2,
|
||||
long: {
|
||||
live: Number(live),
|
||||
live: Number(live) * 60,
|
||||
mode: Number(mode),
|
||||
quota: mode === '1' ? Number(dailyLimit) : Number(quota),
|
||||
expire: mode === '1' ? Number(expire) : undefined,
|
||||
},
|
||||
})
|
||||
console.log({
|
||||
live: Number(live) * 60,
|
||||
mode: Number(mode),
|
||||
quota: mode === '1' ? Number(dailyLimit) : Number(quota),
|
||||
expire: mode === '1' ? Number(expire) : undefined,
|
||||
})
|
||||
|
||||
if (!resp.success) {
|
||||
throw new Error('获取价格失败')
|
||||
}
|
||||
@@ -49,6 +56,7 @@ export default function Right() {
|
||||
})
|
||||
}
|
||||
catch (error) {
|
||||
console.error('获取价格失败:', error)
|
||||
setPriceData({
|
||||
price: '0.00',
|
||||
discounted_price: '0.00',
|
||||
@@ -165,9 +173,9 @@ function BalanceOrLogin(props: {
|
||||
type: 2,
|
||||
long: {
|
||||
mode: Number(props.mode),
|
||||
live: Number(props.live),
|
||||
expire: Number(props.expire),
|
||||
quota: props.mode === '1' ? props.dailyLimit : props.quota,
|
||||
live: Number(props.live) * 60,
|
||||
expire: props.mode === '1' ? Number(props.expire) : undefined,
|
||||
quota: props.mode === '1' ? Number(props.dailyLimit) : Number(props.quota),
|
||||
},
|
||||
}}/>
|
||||
</>
|
||||
|
||||
@@ -47,6 +47,7 @@ export default function Pay(props: PayProps) {
|
||||
payment_method: method,
|
||||
payment_platform: TradePlatform.Desktop,
|
||||
}
|
||||
console.log(req, 'req')
|
||||
|
||||
const resp = await prepareResource(req)
|
||||
|
||||
|
||||
@@ -68,11 +68,11 @@ export default function Center() {
|
||||
onValueChange={field.onChange}
|
||||
className="grid grid-cols-[repeat(auto-fill,minmax(120px,1fr))] gap-4">
|
||||
|
||||
<FormOption id={`${id}-3`} value="180" label="3 分钟" description="¥0.005/IP" compare={field.value}/>
|
||||
<FormOption id={`${id}-5`} value="300" label="5 分钟" description="¥0.01/IP" compare={field.value}/>
|
||||
<FormOption id={`${id}-10`} value="600" label="10 分钟" description="¥0.02/IP" compare={field.value}/>
|
||||
<FormOption id={`${id}-20`} value="1200" label="20 分钟" description="¥0.03/IP" compare={field.value}/>
|
||||
<FormOption id={`${id}-30`} value="1800" label="30 分钟" description="¥0.06/IP" compare={field.value}/>
|
||||
<FormOption id={`${id}-3`} value="3" label="3 分钟" description="¥0.005/IP" compare={field.value}/>
|
||||
<FormOption id={`${id}-5`} value="5" label="5 分钟" description="¥0.01/IP" compare={field.value}/>
|
||||
<FormOption id={`${id}-10`} value="10" label="10 分钟" description="¥0.02/IP" compare={field.value}/>
|
||||
<FormOption id={`${id}-20`} value="15" label="15 分钟" description="¥0.03/IP" compare={field.value}/>
|
||||
<FormOption id={`${id}-30`} value="30" label="30 分钟" description="¥0.06/IP" compare={field.value}/>
|
||||
</RadioGroup>
|
||||
)}
|
||||
</FormField>
|
||||
|
||||
@@ -9,7 +9,7 @@ import {zodResolver} from '@hookform/resolvers/zod'
|
||||
// 定义表单验证架构
|
||||
const schema = z.object({
|
||||
type: z.enum(['1', '2']).default('2'),
|
||||
live: z.enum(['180', '300', '600', '1200', '1800']),
|
||||
live: z.enum(['3', '5', '10', '15', '30']),
|
||||
quota: z.number().min(10000, '购买数量不能少于10000个'),
|
||||
expire: z.enum(['7', '15', '30', '90', '180', '365']),
|
||||
daily_limit: z.number().min(2000, '每日限额不能少于2000个'),
|
||||
@@ -24,7 +24,7 @@ export default function ShortForm() {
|
||||
resolver: zodResolver(schema),
|
||||
defaultValues: {
|
||||
type: '2', // 默认为包量套餐
|
||||
live: '180', // 分钟
|
||||
live: '3', // 分钟
|
||||
quota: 10_000, // >= 10000
|
||||
expire: '30', // 天
|
||||
daily_limit: 2_000, // >= 2000
|
||||
|
||||
@@ -38,6 +38,13 @@ export default function Right() {
|
||||
expire: mode === '1' ? Number(expire) : undefined,
|
||||
},
|
||||
})
|
||||
console.log({
|
||||
live: Number(live),
|
||||
mode: Number(mode),
|
||||
quota: mode === '1' ? Number(dailyLimit) : Number(quota),
|
||||
expire: mode === '1' ? Number(expire) : undefined,
|
||||
})
|
||||
|
||||
if (!priceResponse.success) {
|
||||
throw new Error('获取价格失败')
|
||||
}
|
||||
@@ -78,7 +85,7 @@ export default function Right() {
|
||||
<li className="flex justify-between items-center">
|
||||
<span className="text-sm text-gray-500">IP 时效</span>
|
||||
<span className="text-sm">
|
||||
{Number(live) / 60}
|
||||
{live}
|
||||
{' '}
|
||||
分钟
|
||||
</span>
|
||||
@@ -168,8 +175,8 @@ function BalanceOrLogin(props: {
|
||||
short: {
|
||||
mode: Number(props.mode),
|
||||
live: Number(props.live),
|
||||
expire: Number(props.expire),
|
||||
quota: props.mode === '1' ? props.dailyLimit : props.quota,
|
||||
expire: props.mode === '1' ? Number(props.expire) : undefined,
|
||||
quota: props.mode === '1' ? Number(props.dailyLimit) : Number(props.quota),
|
||||
},
|
||||
}}/>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user