feat: 广告

This commit is contained in:
chashaobao
2025-07-07 01:15:50 +08:00
parent de7f0e14fe
commit e8cf28b6e9
18 changed files with 507 additions and 53 deletions

View File

@ -2,7 +2,7 @@ import Taro from '@tarojs/taro';
import { Button } from '@taroify/core';
import classNames from 'classnames';
import { useCallback, useEffect, useState } from 'react';
import { Fragment, useCallback, useEffect, useState } from 'react';
import Badge from '@/components/badge';
import { PREFIX } from '@/components/product-dialog/const';
@ -16,6 +16,7 @@ import { postSubscribe, subscribeMessage } from '@/utils/subscribe';
import Toast from '@/utils/toast';
interface IProps {
justBuy?: boolean;
onConfirm: () => void;
}
@ -29,22 +30,22 @@ interface Item {
}
const LIST: Item[] = [
{ id: ProductSpecId.WeeklyVIP, title: '会员', content: '每日2次', price: '免费', amt: 0 },
{ id: ProductSpecId.WeeklyVIP, title: '会员', content: '1天内免广告', price: '60播豆', amt: 6, badge: '限时体验' },
{
id: ProductSpecId.WeeklyVIP,
title: '周会员',
content: '每日5次',
price: '60播豆',
amt: 6,
badge: '限时体验',
content: '7天内免广告',
price: '180播豆',
amt: 18,
badge: '4.2折',
},
{
id: ProductSpecId.NewMonthlyVIP,
title: '月会员',
content: '每日5次',
price: '180播豆',
amt: 18,
badge: ' 超值',
content: '30天内免广告',
price: '300播豆',
amt: 30,
badge: '1.6折',
},
];
@ -75,6 +76,7 @@ export default function JobBuy(props: IProps) {
type: OrderType.VIP,
amt: getOrderPrice(selectItem.amt),
productCode: ProductType.VIP,
// todo: 日会员的 productSpectId 是什么?
productSpecId: selectItem.id,
});
log('handleBuy payInfo', payOrderNo, createPayInfo);
@ -107,14 +109,26 @@ export default function JobBuy(props: IProps) {
return (
<div className={`${PREFIX}__job-buy`}>
<div className={`${PREFIX}__job-buy__header`}>
<div></div>
<div className="highlight"></div>
{props.justBuy ? (
<div></div>
) : (
<Fragment>
<div></div>
<div className="highlight"></div>
</Fragment>
)}
</div>
<div className={`${PREFIX}__job-buy__describe`}>
<div></div>
<div className="highlight"></div>
<div> </div>
<div className="highlight"></div>
{props.justBuy ? (
<div>10</div>
) : (
<Fragment>
<div></div>
<div className="highlight"></div>
<div> </div>
<div className="highlight"></div>
</Fragment>
)}
</div>
<div className={`${PREFIX}__job-buy__container`}>
{LIST.map(item => (