修复购买套餐每日限购字段参数 & 底部服务保障链接
This commit is contained in:
@@ -18,8 +18,22 @@ export default function Footer(props: FooterProps) {
|
|||||||
<p className="text-sm text-gray-400">微信/电话:177 9666 8888</p>
|
<p className="text-sm text-gray-400">微信/电话:177 9666 8888</p>
|
||||||
<p className="text-sm text-gray-400">QQ: 70177252</p>
|
<p className="text-sm text-gray-400">QQ: 70177252</p>
|
||||||
<h3 className="hidden sm:block">服务保障</h3>
|
<h3 className="hidden sm:block">服务保障</h3>
|
||||||
<p className="text-sm text-gray-400 hidden sm:block">售前服务</p>
|
<a
|
||||||
<p className="text-sm text-gray-400 hidden sm:block">技术支持</p>
|
href="https://weixin.qq.com/r/mp/AxYMFAzErFHTrUh390MR"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-sm text-gray-400 hidden sm:block cursor-pointer hover:text-white transition-colors"
|
||||||
|
>
|
||||||
|
售前服务
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
href="https://weixin.qq.com/r/mp/AxYMFAzErFHTrUh390MR"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-sm text-gray-400 hidden sm:block cursor-pointer hover:text-white transition-colors"
|
||||||
|
>
|
||||||
|
技术支持
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<SiteNavList
|
<SiteNavList
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export default function Center() {
|
|||||||
const type = useWatch({name: 'type'})
|
const type = useWatch({name: 'type'})
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (type === '1') {
|
if (type === '1') {
|
||||||
form.setValue('quota', 100)
|
form.setValue('daily_limit', 100)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
form.setValue('quota', 500)
|
form.setValue('quota', 500)
|
||||||
@@ -144,7 +144,7 @@ export default function Center() {
|
|||||||
{/* 包时:每日提取上限 */}
|
{/* 包时:每日提取上限 */}
|
||||||
<FormField
|
<FormField
|
||||||
className="space-y-4"
|
className="space-y-4"
|
||||||
name="quota"
|
name="daily_limit"
|
||||||
label="每日提取上限">
|
label="每日提取上限">
|
||||||
{({id, field}) => {
|
{({id, field}) => {
|
||||||
const value = Number(field.value) || 100
|
const value = Number(field.value) || 100
|
||||||
@@ -159,7 +159,7 @@ export default function Center() {
|
|||||||
className={`h-10 w-10 border border-gray-200 rounded-sm flex items-center justify-center text-lg ${
|
className={`h-10 w-10 border border-gray-200 rounded-sm flex items-center justify-center text-lg ${
|
||||||
value === minValue ? 'opacity-50 cursor-not-allowed' : ''
|
value === minValue ? 'opacity-50 cursor-not-allowed' : ''
|
||||||
}`}
|
}`}
|
||||||
onClick={() => form.setValue('quota', Math.max(minValue, value - step))}
|
onClick={() => form.setValue('daily_limit', Math.max(minValue, value - step))}
|
||||||
disabled={value === minValue}>
|
disabled={value === minValue}>
|
||||||
<Minus/>
|
<Minus/>
|
||||||
</Button>
|
</Button>
|
||||||
@@ -172,7 +172,7 @@ export default function Center() {
|
|||||||
theme="outline"
|
theme="outline"
|
||||||
type="button"
|
type="button"
|
||||||
className="h-10 w-10 border border-gray-200 rounded-sm flex items-center justify-center text-lg"
|
className="h-10 w-10 border border-gray-200 rounded-sm flex items-center justify-center text-lg"
|
||||||
onClick={() => form.setValue('quota', value + step)}>
|
onClick={() => form.setValue('daily_limit', value + step)}>
|
||||||
<Plus/>
|
<Plus/>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ export default function Right() {
|
|||||||
const live = useWatch({control, name: 'live'})
|
const live = useWatch({control, name: 'live'})
|
||||||
const quota = useWatch({control, name: 'quota'})
|
const quota = useWatch({control, name: 'quota'})
|
||||||
const expire = useWatch({control, name: 'expire'})
|
const expire = useWatch({control, name: 'expire'})
|
||||||
|
const dailyLimit = useWatch({control, name: 'daily_limit'})
|
||||||
const [price, setPrice] = useState<string>('0.00')
|
const [price, setPrice] = useState<string>('0.00')
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -35,12 +36,10 @@ export default function Right() {
|
|||||||
long: {
|
long: {
|
||||||
live: Number(live),
|
live: Number(live),
|
||||||
mode: Number(mode),
|
mode: Number(mode),
|
||||||
quota: quota,
|
quota: Number(mode) === 1 ? dailyLimit : quota,
|
||||||
expire: Number(mode) === 1 ? Number(expire) : undefined,
|
expire: Number(mode) === 1 ? Number(expire) : undefined,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
console.log(params, 'params')
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const priceValue = await getPrice(params)
|
const priceValue = await getPrice(params)
|
||||||
if (priceValue.success && priceValue.data?.price) {
|
if (priceValue.success && priceValue.data?.price) {
|
||||||
@@ -56,7 +55,7 @@ export default function Right() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
price()
|
price()
|
||||||
}, [expire, live, quota, mode])
|
}, [dailyLimit, expire, live, quota, mode])
|
||||||
return (
|
return (
|
||||||
<Card className={merge(
|
<Card className={merge(
|
||||||
`flex-none basis-90 p-6 flex flex-col gap-6 relative`,
|
`flex-none basis-90 p-6 flex flex-col gap-6 relative`,
|
||||||
@@ -97,7 +96,7 @@ export default function Right() {
|
|||||||
<li className="flex justify-between items-center">
|
<li className="flex justify-between items-center">
|
||||||
<span className="text-sm text-gray-500">每日限额</span>
|
<span className="text-sm text-gray-500">每日限额</span>
|
||||||
<span className="text-sm">
|
<span className="text-sm">
|
||||||
{quota}
|
{dailyLimit}
|
||||||
个
|
个
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
@@ -113,7 +112,7 @@ export default function Right() {
|
|||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<Suspense>
|
<Suspense>
|
||||||
<BalanceOrLogin {...{method, price, mode, live, quota, expire}}/>
|
<BalanceOrLogin {...{method, price, mode, live, quota, expire, dailyLimit}}/>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</Card>
|
</Card>
|
||||||
)
|
)
|
||||||
@@ -126,6 +125,7 @@ function BalanceOrLogin(props: {
|
|||||||
live: string
|
live: string
|
||||||
quota: number
|
quota: number
|
||||||
expire: string
|
expire: string
|
||||||
|
dailyLimit: number
|
||||||
}) {
|
}) {
|
||||||
const profile = use(useProfileStore(store => store.profile))
|
const profile = use(useProfileStore(store => store.profile))
|
||||||
return profile ? (
|
return profile ? (
|
||||||
@@ -186,7 +186,7 @@ function BalanceOrLogin(props: {
|
|||||||
mode: Number(props.mode),
|
mode: Number(props.mode),
|
||||||
live: Number(props.live),
|
live: Number(props.live),
|
||||||
expire: Number(props.expire),
|
expire: Number(props.expire),
|
||||||
quota: props.quota,
|
quota: props.mode === '1' ? props.dailyLimit : props.quota,
|
||||||
},
|
},
|
||||||
}}/>
|
}}/>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export default function Center() {
|
|||||||
const type = useWatch({name: 'type'})
|
const type = useWatch({name: 'type'})
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (type === '1') {
|
if (type === '1') {
|
||||||
form.setValue('quota', 2000)
|
form.setValue('daily_limit', 2000)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
form.setValue('quota', 10000)
|
form.setValue('quota', 10000)
|
||||||
@@ -138,7 +138,7 @@ export default function Center() {
|
|||||||
{/* 包时:每日提取上限 */}
|
{/* 包时:每日提取上限 */}
|
||||||
<FormField
|
<FormField
|
||||||
className="space-y-4"
|
className="space-y-4"
|
||||||
name="quota"
|
name="daily_limit"
|
||||||
label="每日提取上限">
|
label="每日提取上限">
|
||||||
{({id, field}) => (
|
{({id, field}) => (
|
||||||
<div className="flex gap-2 items-center">
|
<div className="flex gap-2 items-center">
|
||||||
@@ -146,7 +146,7 @@ export default function Center() {
|
|||||||
theme="outline"
|
theme="outline"
|
||||||
type="button"
|
type="button"
|
||||||
className="h-10 w-10 border border-gray-200 rounded-sm flex items-center justify-center text-lg"
|
className="h-10 w-10 border border-gray-200 rounded-sm flex items-center justify-center text-lg"
|
||||||
onClick={() => form.setValue('quota', Math.max(2_000, Number(field.value) - 1_000))}
|
onClick={() => form.setValue('daily_limit', Math.max(2_000, Number(field.value) - 1_000))}
|
||||||
disabled={Number(field.value) === 2_000}>
|
disabled={Number(field.value) === 2_000}>
|
||||||
<Minus/>
|
<Minus/>
|
||||||
</Button>
|
</Button>
|
||||||
@@ -162,7 +162,7 @@ export default function Center() {
|
|||||||
theme="outline"
|
theme="outline"
|
||||||
type="button"
|
type="button"
|
||||||
className="h-10 w-10 border border-gray-200 rounded-sm flex items-center justify-center text-lg"
|
className="h-10 w-10 border border-gray-200 rounded-sm flex items-center justify-center text-lg"
|
||||||
onClick={() => form.setValue('quota', Number(field.value) + 1_000)}>
|
onClick={() => form.setValue('daily_limit', Number(field.value) + 1_000)}>
|
||||||
<Plus/>
|
<Plus/>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export default function Right() {
|
|||||||
const mode = useWatch({control, name: 'type'})
|
const mode = useWatch({control, name: 'type'})
|
||||||
const expire = useWatch({control, name: 'expire'})
|
const expire = useWatch({control, name: 'expire'})
|
||||||
const quota = useWatch({control, name: 'quota'})
|
const quota = useWatch({control, name: 'quota'})
|
||||||
|
const dailyLimit = useWatch({control, name: 'daily_limit'})
|
||||||
const [price, setPrice] = useState<string>('0.00')
|
const [price, setPrice] = useState<string>('0.00')
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const price = async () => {
|
const price = async () => {
|
||||||
@@ -32,12 +33,10 @@ export default function Right() {
|
|||||||
short: {
|
short: {
|
||||||
live: Number(live),
|
live: Number(live),
|
||||||
mode: Number(mode),
|
mode: Number(mode),
|
||||||
quota: quota,
|
quota: Number(mode) === 1 ? dailyLimit : quota,
|
||||||
expire: Number(mode) === 1 ? Number(expire) : undefined,
|
expire: Number(mode) === 1 ? Number(expire) : undefined,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
console.log(params, 'params')
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const priceResponse = await getPrice(params)
|
const priceResponse = await getPrice(params)
|
||||||
if (priceResponse.success && priceResponse.data?.price) {
|
if (priceResponse.success && priceResponse.data?.price) {
|
||||||
@@ -53,7 +52,7 @@ export default function Right() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
price()
|
price()
|
||||||
}, [expire, live, quota, mode])
|
}, [expire, live, quota, mode, dailyLimit])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className={merge(
|
<Card className={merge(
|
||||||
@@ -95,7 +94,7 @@ export default function Right() {
|
|||||||
<li className="flex justify-between items-center">
|
<li className="flex justify-between items-center">
|
||||||
<span className="text-sm text-gray-500">每日限额</span>
|
<span className="text-sm text-gray-500">每日限额</span>
|
||||||
<span className="text-sm">
|
<span className="text-sm">
|
||||||
{quota}
|
{dailyLimit}
|
||||||
个
|
个
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
@@ -111,7 +110,7 @@ export default function Right() {
|
|||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<Suspense>
|
<Suspense>
|
||||||
<BalanceOrLogin {...{method, price, mode, live, quota, expire}}/>
|
<BalanceOrLogin {...{method, price, mode, live, quota, expire, dailyLimit}}/>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</Card>
|
</Card>
|
||||||
)
|
)
|
||||||
@@ -124,6 +123,7 @@ function BalanceOrLogin(props: {
|
|||||||
live: string
|
live: string
|
||||||
quota: number
|
quota: number
|
||||||
expire: string
|
expire: string
|
||||||
|
dailyLimit: number
|
||||||
}) {
|
}) {
|
||||||
const profile = use(useProfileStore(store => store.profile))
|
const profile = use(useProfileStore(store => store.profile))
|
||||||
return profile ? (
|
return profile ? (
|
||||||
@@ -184,7 +184,7 @@ function BalanceOrLogin(props: {
|
|||||||
mode: Number(props.mode),
|
mode: Number(props.mode),
|
||||||
live: Number(props.live),
|
live: Number(props.live),
|
||||||
expire: Number(props.expire),
|
expire: Number(props.expire),
|
||||||
quota: props.quota,
|
quota: props.mode === '1' ? props.dailyLimit : props.quota,
|
||||||
},
|
},
|
||||||
}}/>
|
}}/>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user