import * as React from "react"; import { Radio, Form, Select, Input, Button, Tooltip, Icon, message } from "antd"; import { FormComponentProps } from "antd/lib/form"; import ContentView from "@/layout/ContentView"; import MainLayout from "@/layout"; import FormItemDecorator from "@/components/FormItemDecorator"; import { VIP_INFO, DEVICE_TYPE } from "../constants"; import CustomUpload from "./customUpload"; import API from "@/api"; import ConfirmInfo from "../confirmInfo"; import { CheckRes, APPList } from "@/api/service/RechargeService"; import { getOpenCreateAPPUrl } from "@/shared/common/utils"; import "./index.scss"; // 充值信息 type P = FormComponentProps & {}; type S = { type: string; accountType: number; appList: object[]; isConfirm: Boolean; isLoading: Boolean; chargeInfoData: CheckRes; }; class ChargeInfo extends React.Component { state = { type: "VIP", accountType: 1, appList: [], isConfirm: false, isLoading: false, chargeInfoData: null }; componentDidMount() { API.recharge.APPList().then(res => { // console.log(res); if (res.code === 0) { this.setState({ appList: res.data as APPList[] }); } }); } onTypeChange = e => { this.setState({ type: e.target.value }); }; onAccountTypeChange = e => { this.setState({ accountType: e.target.value }); }; handleUploadSuccess = url => { console.log(url); }; handleSubmit = e => { e.preventDefault(); this.props.form.validateFields((err, values) => { console.log("values=>", values); if (!err) { console.log("Received values of form: ", values); values.mobileList = values.mobileList.split(/,|↵|\\n/); values.xiDianNum = +values.xiDianNum; this.setState({ isLoading: true }); API.recharge .applyRecharge(values) .then(res => { if (res.code === 0) { this.toRecharge(true); this.setState({ chargeInfoData: res.data as CheckRes }); } else { message.error(res.message); } }) .finally(() => { this.setState({ isLoading: false }); }); } }); }; verifyAlbum = async (rule, value, callback) => { // console.log(rule, value); if (value) { const res = await API.recharge.getAlbumInfo(value); if (res.code === 0) { callback(); } else { callback(`${value}专辑,未查询到`); } } else { callback("请填写专辑ID"); } }; toRecharge = (bool: Boolean) => { this.setState({ isConfirm: bool }); }; render() { const { type, accountType, appList, isConfirm, isLoading, chargeInfoData } = this.state; const { form } = this.props; return (
权益充值
充值内容
会员 喜点 专辑
{type === "VIP" && ( )} {type === "XI_DIAN" && ( <> 充值的设备系统

应苹果公司的规定,虚拟商品使用苹果系统充值不能用于安卓、网页等其他平台。所以在充值喜点的时候,请务必正确选择需要充值的账户所在系统。

如果充值的账户用户有使用苹果系统和安卓、网页等其他平台,请先筛选出使用苹果系统的账户,进行充值后,再为其他非苹果系统的用户账户充值。

例:A账户选择了苹果系统充值10喜点。A账户在苹果系统的喜马拉雅app内可以正常使用这10个喜点,在苹果系统以外的系统上的喜马拉雅app内无法使用这10个喜点。

} >
} > )} {type === "ALBUM" && ( )}
充值账户
充值账户 批量添加
{accountType === 1 && ( )} {accountType === 2 && ( )}
选择应用

如果第一次权益充值,请先创建一个名为权益充值的应用。

创建应用时,名称为:公司名称+权益充值。例如:喜马拉雅权益充值;

网址为:权益充值的网址。例如:www.ximalaya.com;

创建成功后,请与商务联系,及时走审核流程。商务反馈审核通过后,刷新该页面,选择项会增加“公司名称+权益充值”的应用。

创建完成后,每次选择该权益充值应用进行权益充值。

} > (如首次权益充值,请先创建一个权益充值应用) 创建应用
{appList && appList.length > 0 && (
{appList.map(({ appName, appKey }) => ( {appName} ))}
)}
); } } export default Form.create

()(ChargeInfo);