forked from Gitlink/forgeplus-react
赞助管理页面修改
This commit is contained in:
parent
381ad7135b
commit
c696924523
|
|
@ -33,6 +33,6 @@
|
|||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.sponsor-confirmation-inline{
|
||||
display: inline-block;
|
||||
.sponsor-inline{
|
||||
display: inline;
|
||||
}
|
||||
|
|
@ -10,12 +10,12 @@ import SponsorList from "./sponsor_list";
|
|||
const Search = Input.Search;
|
||||
|
||||
const tempData = [
|
||||
{image_url: "avatars/User/b", username: "万山川", user_id: 1369, login:"alpc104", format_time: "2020-08-01"},
|
||||
{image_url: "avatars/User/b", username: "万山川", user_id: 1369, login:"alpc104", format_time: "2020-08-01"},
|
||||
{image_url: "avatars/User/b", username: "万山川", user_id: 1369, login:"alpc104", format_time: "2020-08-01"},
|
||||
{image_url: "avatars/User/b", username: "万山川", user_id: 1369, login:"alpc104", format_time: "2020-08-01"},
|
||||
{image_url: "avatars/User/b", username: "万山川", user_id: 1369, login:"alpc104", format_time: "2020-08-01"},
|
||||
{image_url: "avatars/User/b", username: "万山川", user_id: 1369, login:"alpc104", format_time: "2020-08-01"},
|
||||
{image_url: "avatars/User/b", username: "万山川", user_id: 1369, login:"alpc104", format_time: "2020-08-01", amount: 100},
|
||||
{image_url: "avatars/User/b", username: "万山川", user_id: 1369, login:"alpc104", format_time: "2020-08-01", amount: 100},
|
||||
{image_url: "avatars/User/b", username: "万山川", user_id: 1369, login:"alpc104", format_time: "2020-08-01", amount: 100},
|
||||
{image_url: "avatars/User/b", username: "万山川", user_id: 1369, login:"alpc104", format_time: "2020-08-01", amount: 100},
|
||||
{image_url: "avatars/User/b", username: "万山川", user_id: 1369, login:"alpc104", format_time: "2020-08-01", amount: 100},
|
||||
{image_url: "avatars/User/b", username: "万山川", user_id: 1369, login:"alpc104", format_time: "2020-08-01", amount: 100},
|
||||
];
|
||||
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ class SponsorManagement extends Component{
|
|||
coinChangeList: undefined,
|
||||
total: undefined,
|
||||
category: undefined,
|
||||
is_public: undefined,
|
||||
is_sponsor: undefined,
|
||||
sponsors: undefined,
|
||||
};
|
||||
}
|
||||
|
|
@ -127,11 +127,20 @@ class SponsorManagement extends Component{
|
|||
return list;
|
||||
}
|
||||
|
||||
|
||||
changeStatus=(check_is_sponsor, e)=>{
|
||||
// const {is_sponsor} = this.state
|
||||
// const new_is_sponsor = is_sponsor === check_is_sponsor ? undefined : check_is_sponsor
|
||||
// this.state.is_sponsor = check_is_sponsor;
|
||||
this.setState({
|
||||
is_sponsor: check_is_sponsor,
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
const { current_user, user } = this.props;
|
||||
const { category , is_public, sponsors } = this.state;
|
||||
const { category , is_sponsor, sponsors } = this.state;
|
||||
const { coinChangeList, isSpin, total, search, limit, page } = this.state;
|
||||
|
||||
return (
|
||||
<Spin spinning={isSpin}>
|
||||
<div className="list-r-operation">
|
||||
|
|
@ -157,7 +166,17 @@ class SponsorManagement extends Component{
|
|||
</div>
|
||||
<div className="infosType">
|
||||
<div>{this.category_button(category)}</div>
|
||||
|
||||
{
|
||||
user && current_user && user.login === current_user.login ?
|
||||
<div className="infoStatus">
|
||||
<span className={is_sponsor === true ? "active" : "" } onClick={(e)=>this.changeStatus(true, e)}>我赞助的</span>
|
||||
{
|
||||
!is_sponsor ? (<Divider type={"vertical"} className="statusDivider" ></Divider>):""
|
||||
}
|
||||
<span className={is_sponsor === false ? "active" : "" } onClick={(e)=>this.changeStatus(false, e)}>赞助我的</span>
|
||||
</div>
|
||||
:""
|
||||
}
|
||||
</div>
|
||||
{sponsors && sponsors.length > 0 ?
|
||||
<SponsorList
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@ import React, { Component } from "react";
|
|||
import { getImageUrl } from "educoder";
|
||||
import FocusButton from "../../UsersList/focus_button";
|
||||
import { Button } from "antd";
|
||||
import "../../UsersList/list.css";
|
||||
import "../../Main/list.css";
|
||||
import "../../sponsor/sponsor.css";
|
||||
class SponsorList extends Component {
|
||||
|
||||
renderList = (users, userClass, current_user) => {
|
||||
|
|
@ -10,12 +11,48 @@ class SponsorList extends Component {
|
|||
if (users && users.length > 0) {
|
||||
return users.map((item, key) => {
|
||||
return (
|
||||
<div className={`pull-left ${userClass}`} key={key}>
|
||||
<div className="pbt25 grid-item mlr10 border-b-line">
|
||||
// <div className={`pull-left ${userClass}`} key={key}>
|
||||
// <div className="pbt25 grid-item mlr10 border-b-line">
|
||||
// <div>
|
||||
// <a
|
||||
// href={`/users/${item.login}`}
|
||||
// className="show-user-link"
|
||||
// >
|
||||
// <img
|
||||
// className="avatar-60"
|
||||
// src={getImageUrl(`images/${item.image_url}`)}
|
||||
// alt=""
|
||||
// />
|
||||
// </a>
|
||||
// </div>
|
||||
// <div className="ml12">
|
||||
// <div>
|
||||
// <a
|
||||
// href={`/users/${item.login}`}
|
||||
// className="font-16 text-primary hide-1 task-hide max-w-200"
|
||||
// >
|
||||
// {item.username}
|
||||
// </a>
|
||||
// </div>
|
||||
// <div className="font-12 text-gray grid-item pb5">
|
||||
// <i className="iconfont icon-shijian user-join-time"></i>
|
||||
// <span className="ml4">赞助时间:{item.format_time}</span>
|
||||
// </div>
|
||||
// {
|
||||
// current_user && current_user.login === item.login ?
|
||||
// <Button type="default">当前用户</Button>
|
||||
// :
|
||||
// // <FocusButton is_watch={item.is_watch} id={item.login} />
|
||||
// <Button>终止赞助关系</Button>
|
||||
// }
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
<div className="p-r-Item" key={key}>
|
||||
<div>
|
||||
<a
|
||||
href={`/users/${item.login}`}
|
||||
className="show-user-link"
|
||||
href={`/users/${item.login}`}
|
||||
className="show-user-link"
|
||||
>
|
||||
<img
|
||||
className="avatar-60"
|
||||
|
|
@ -24,27 +61,17 @@ class SponsorList extends Component {
|
|||
/>
|
||||
</a>
|
||||
</div>
|
||||
<div className="ml12">
|
||||
<div>
|
||||
<a
|
||||
href={`/users/${item.login}`}
|
||||
className="font-16 text-primary hide-1 task-hide max-w-200"
|
||||
>
|
||||
{item.username}
|
||||
</a>
|
||||
</div>
|
||||
<div className="font-12 text-gray grid-item pb5">
|
||||
<i className="iconfont icon-shijian user-join-time"></i>
|
||||
<span className="ml4">加入时间:{item.format_time}</span>
|
||||
</div>
|
||||
{
|
||||
current_user && current_user.login === item.login ?
|
||||
<Button type="default">当前用户</Button>
|
||||
:
|
||||
<FocusButton is_watch={item.is_watch} id={item.login} />
|
||||
}
|
||||
<a href={`/users/${item.login}`}>{item && item.username}</a>
|
||||
<div>
|
||||
<p className="break_word task-hide-2 mt10" style={{ maxHeight: "44px",lineHeight:"22px" }}>金额:{item.amount}硬币</p>
|
||||
<span><label>赞助时间:</label>{item.format_time}</span>
|
||||
</div>
|
||||
<div className="p-r-about">
|
||||
<span className="p-r-detail">
|
||||
{/* {item.amount>0 ? <span><label>金额来源:</label>{item.to_user}</span>: <span><label>金额去向:</label>{item.to_user}</span>} */}
|
||||
</span>
|
||||
</div>
|
||||
<Button>终止赞助关系</Button>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
|
@ -52,7 +79,7 @@ class SponsorList extends Component {
|
|||
}
|
||||
render() {
|
||||
const { users, userClass, current_user } = this.props;
|
||||
console.log(users);
|
||||
// console.log(users);
|
||||
return (
|
||||
this.renderList(users, userClass, current_user)
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue