Commit b1347c35 authored by haiyoucuv's avatar haiyoucuv

init

parent 315d6a6f
......@@ -30,7 +30,7 @@ class App extends Component {
const defaultPage = {
myPrize: MyPrize, // TODO 举例子 新宿台奖品页
index: LoadingDemo,
}[skinId] || ResPage;
}[skinId] || RecordPage;
PageCtrl.changePage(defaultPage);
}
......
......@@ -41,8 +41,6 @@ const API = generateAPI({
method: 'post',
showMsg: false,
},
/** 获取地区 */
getParentCode: "/gaw/address/getChildrenByParentCode",
// 挑战-首页
getChallengeIndex: "challenge/index.do",
......@@ -50,12 +48,6 @@ const API = generateAPI({
//挑战-基础首页
getChallengeBaseIndex: "challenge/baseIndex.do",
// 挑战-补签
getChallengeResign: "challenge/resign.do",
// 挑战-任务完成接口
getChallenegeComplete: "challenge/taskComplete.do",
//挑战-获取邀请码
getChallengeInviteCode: "challenge/inviteCode.do",
......@@ -65,9 +57,6 @@ const API = generateAPI({
showMsg: false,
},
// 挑战-选择挑战
getChooseChallenge: "challenge/chooseChallenge.do",
// 扣积分
queryStatus: "credits/queryStatus.do",
creditsCost: {
......@@ -79,10 +68,12 @@ const API = generateAPI({
queryOrder: "/customActivity/kouweiwang/prize/queryOrderNo",
index: "main/index.do",
completeGuide: "main/completeGuide.do",
sign: "main/sign.do",
receiveBubble: "main/receiveBubble.do",
startVideo: "main/startVideo.do",
tradeRecords: "mncp/tradeRecords.do",
redeem: "mncp/redeem.do",
buy: "mncp/buy.do",
mncpIndex: "mncp/index.do",
})
......
......@@ -57,6 +57,8 @@
font-size: 30px;
color: black;
font-weight: bold;
width: 350px;
.lineClamp1();
}
.date {
......
......@@ -2,14 +2,39 @@ import React from 'react';
import { observer } from 'mobx-react';
import styles from './RecordPage.module.less';
import { Button } from "@grace/ui";
import API from "@/api";
import { dateFormatter } from "@/utils/utils.ts";
@observer
class RecordPage extends React.Component<any, any> {
state = {}
state = {
list: [],
}
async componentDidMount() {
this.updateList();
}
pageNum: number = 1;
pageSize: number = 50;
haveMore: boolean = true;
async updateList() {
const { pageNum, pageSize, haveMore } = this;
if (!haveMore) return;
const { success, data } = await API.tradeRecords({ pageNum, pageSize });
if (!success) return;
this.pageNum++;
this.haveMore = data.haveMore;
const list = this.state.list.concat(data.list);
this.setState({ list, })
}
clickBack = () => {
......@@ -17,19 +42,26 @@ class RecordPage extends React.Component<any, any> {
}
render() {
const {} = this.state;
const { list } = this.state;
return <div className={styles.RecordPage}>
<div className={styles.pageTitle}/>
<Button className={styles.backBtn} onClick={this.clickBack}/>
<div className={styles.list}>
{
new Array(100).fill(1).map(() => {
list.map((item) => {
const state = {
0: { txt: "购买待确认", color: "rgba(0,0,0,0.6)" },
1: { txt: "购买成功", color: "#ee4e32" },
2: { txt: "赎回成功", color: "#1b8a4f" },
}[item.tradeStatus];
return <div className={styles.item}>
<div className={styles.title}>纯债日开2号</div>
<div className={styles.date}>2025.06.23 10:32:32</div>
<div className={styles.num}>¥10000.00</div>
<div className={styles.state}>购买待确认</div>
<div className={styles.title}>{item.desc}</div>
<div className={styles.date}>{dateFormatter(item.gmtCreate, "yyyy.MM.dd hh:mm:ss")}</div>
<div className={styles.num}>¥{item.amount / 100}</div>
<div className={styles.state} style={{ color: state.color }}>{state.txt}</div>
</div>
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment