import { Card, Col, Row } from "antd"; import jb from '../../../../../public/jb.png'; import vip from '../../../../../public/vip.png'; import top from '../../../../../public/top-r1.png'; import { createStyles } from "antd-style"; import { useModel } from "@umijs/max"; export function Template(params: { data: any }) { let { data } = params let { getEnum } = useModel("global") let { firstRecharge, rechargeConfigList } = data const useStyles = createStyles((props) => { let { token } = props let navTheme = localStorage.getItem("navTheme")//全局 2亮色 3黑色 return { cardBox: { position: 'relative' }, bgVip: { backgroundImage: "linear-gradient(180deg, #fff1dc 60%, #fffdfa 100%)", color: navTheme == "3" ? "#000" : "unset" }, bg: { backgroundImage: 'linear-gradient(180deg, #ffeced 60%, #fffafa 100%)', color: navTheme == "3" ? "#000" : "unset" }, topRight: { lineHeight: '20px', background: "#ff2441", position: 'absolute', top: 0, right: 0, fontSize: 12, borderRadius: "0px 8px 0 8px", }, topRightVip: { background: "#ffd89d !important", }, // topRightSpan1: { display: 'inline-block', background: `url(${top}) no-repeat`, minWidth: 40, height: 20, padding: "0 10px 0 6px", backgroundSize: "100% 100%", color: "#fff" }, topRightSpan2: { color: "#fff", display: 'inline-block', padding: "0 5px" }, del: { fontSize: 14, textDecoration: 'line-through', marginLeft: 7, color: token.colorTextTertiary, fontWeight: "500" } } }); let { styles } = useStyles() return { rechargeConfigList?.map((item: any, index: any) => { let { color,//背景色 description,//整数购买文案 extra,//右上角描述值 gearType,//充值类型 gift,//赠送 obtain,//获得书币/vip每天价格 price,//价格 subscript,//右上角文案 首充|超值等 vipDays,//vip天数 } = item switch (gearType) { case 1://充值 return {/* 右上角 */}
{ <> {subscript && {subscript}} 多送{extra}元 }
{price} {obtain}书币 送{gift}书券
{color && }
case 2://vip let vipEnum = getEnum("VIP_DAYS","arr") let vipStr = vipEnum?.find((i: { value: any; }) => i.value === vipDays)?.label || "" return {/* 右上角 */}
{ <> {subscript && {subscript}} {vipStr} }
{price} ¥{obtain}元/天
{color && }
case 3://整本 return {/* 右上角 */}
{ subscript ? <> {item.description} : <> {subscript} {item.description} }
{price} {/* {isVip && item.gift && ¥{item.gift}} */} {/* {isVip ? {isOne ? "仅" : "¥"}{item.extra}元/天 : {item.gift}书币 送{item.extra}书券} */}
{/* {isOne && } */}
default: break; } }) }
}