This commit is contained in:
黄心宇 2023-06-15 10:28:34 +08:00
parent 8d0f1aa7ab
commit 9dc6ed5d78
10 changed files with 68 additions and 35 deletions

View File

@ -132,6 +132,14 @@ export function getUrl(path, goTest) {
return `${path ? path: ''}`;
}
export function getZoneUrl(path) {
const local = 'https://testgetway.trustie.net'
if (isDev) {
return `${local}${path?path:''}`
}
return `${path ? path: ''}`;
}
export function getUrlmys(path, goTest) {
// https://www.educoder.net
// https://testbdweb.trustie.net

View File

@ -4,7 +4,7 @@
export {
getUploadLogoActionUrl as getUploadLogoActionUrl,numFormat as numFormat,
getImageUrl as getImageUrl,getImageUrlAbsolute as getImageUrlAbsolute,getImage as getImage, getmyUrl as getmyUrl, getRandomNumber as getRandomNumber, getUrl as getUrl, publicSearchs as publicSearchs, getRandomcode as getRandomcode, getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
getImageUrl as getImageUrl,getImageUrlAbsolute as getImageUrlAbsolute,getImage as getImage, getmyUrl as getmyUrl, getRandomNumber as getRandomNumber, getUrl as getUrl, getZoneUrl as getZoneUrl, publicSearchs as publicSearchs, getRandomcode as getRandomcode, getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
, getUploadActionUrl as getUploadActionUrl, getUploadActionUrltwo as getUploadActionUrltwo, getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
, getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl,
turnbar,returnbar,setSeoMeta as setSeoMeta

View File

@ -1,7 +1,7 @@
import React , {forwardRef, useEffect, useState} from 'react';
import { Modal , Form , Input , Button, Icon } from 'antd';
import UploadImage from '../../Team/Component/UploadImage';
import { getImageUrl } from 'educoder';
import { getImageUrl, getZoneUrl } from 'educoder';
const { TextArea } = Input;
@ -12,7 +12,7 @@ function MemberApply(props){
useEffect(()=>{
if (current_user) {
setImageUrl(current_user.image_url);
setImageUrl(getImageUrl(`/${current_user.image_url}`));
}
},[current_user])
@ -24,11 +24,7 @@ function MemberApply(props){
}
})
}
function getImageId(id){
setImageUrl(`/api/attachments/${id}`)
}
const layout = {
labelCol: { span: 5 },
wrapperCol: { span: 18 },
@ -59,7 +55,7 @@ function MemberApply(props){
)}
</Form.Item>
<Form.Item label="会员头像" name="imageUrl" required>
<UploadImage maxSize={ 5 } getImageId={ getImageId } url={ getImageUrl(`/${current_user.image_url}`) }/>
<UploadImage maxSize={ 5 } getImageUrl={ (url) => setImageUrl(url) } url={ getImageUrl(`/${current_user.image_url}`)} action={ getZoneUrl(`/api/cms/common/upload`) } />
</Form.Item>
<Form.Item label="会员简介" name="introduction">
{getFieldDecorator("introduction",{
@ -72,7 +68,7 @@ function MemberApply(props){
{getFieldDecorator("remark",{
rules:[{ required:true,message:"请输入申请原因" }]
})(
<TextArea autoSize={{ minRows: 2, maxRows: 6 }} maxLength={ 130 } placeholder="请输入申请原因" width="220px"/>
<TextArea autoSize={{ minRows: 2, maxRows: 6 }} maxLength={ 300 } placeholder="请输入申请原因" width="220px"/>
)}
</Form.Item>
</Form>

View File

@ -2,10 +2,11 @@ import React , { useState , useEffect } from 'react';
import Crown from '../img/crown.png';
import Nodata from '../../Nodata';
import { Link } from 'react-router-dom';
import { Spin, Button, Alert } from 'antd';
import { Spin, Button, Icon } from 'antd';
import { tempConfig } from '../tempInfo'
import MemberApply from '../Component/memberApply';
import { getVIPLists, getAuditStatus, applyJoin } from '../api';
import nodata from '../img/nodata.png';
import '../indexZone1.scss';
@ -76,7 +77,7 @@ function ZoneVIP(props){
<p className="in_title">{ tempConfig[temp].member }</p>
<p className="vip_sub_title">{ tempConfig[temp].vipDesc }</p>
{ memberStatus === memberStatusEnum.notMember && <Button className="apply_button" onClick={ apply }>申请加入</Button> }
{ memberStatus === memberStatusEnum.applying && <Alert message="您的申请已提交,请耐心等待管理员审核!" className="mt20" style={{ width: '100%' }} type="success"/> }
{ memberStatus === memberStatusEnum.applying && <div className="mt20 tips" ><Icon type="check-circle" theme="filled" />您的申请已提交请耐心等待管理员审核!</div> }
<MemberApply visible={applyVisible} onOk={ onOk } onCancel={() => setApplyVisible(!applyVisible)} current_user={props.current_user}/>
<Spin spinning={isSpin}>
@ -119,7 +120,7 @@ function ZoneVIP(props){
}
</ul>
:
<Nodata _html="暂无数据"/>
<Nodata _html="暂无数据" img={ nodata }/>
}
</div>
)

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@ -904,14 +904,6 @@
display: flex;
flex-direction: column;
align-items: center;
.apply_button {
flex-grow: 0;
margin-top: 20px;
&:hover, &:active, &:focus {
color: var(--primary-color);
border-color: var(--primary-color);
}
}
.vip_sub_title{
color:#1f2329;
font-size:15px;
@ -922,7 +914,7 @@
margin:16px auto 0px;
}
.vip_list{
width: 1200px;
.vip_list_card{
background-color:#fefefe;
border-radius:4px;
@ -1020,6 +1012,44 @@
}
}
}
.zone_VIP_box, .zone1_VIP_box {
.apply_button {
flex-grow: 0;
margin-top: 20px;
width: 111px;
height: 40px;
color: var(--primary-color);
border-color: var(--primary-color);
font-size: 15px;
&:hover, &:active, &:focus {
color: var(--primary-color);
border-color: var(--primary-color);
}
}
.tips {
width: 100%;
font-size: 15px;
display: flex;
justify-content: center;
align-items: center;
background-color: var(--more-light-color);
height: 46px;
border-radius: 4px;
box-shadow: 0px 0px 12px rgba(51, 156, 103, 0.09);
border:1px solid var(--primary-color);
color:#222324;
.anticon {
font-size: 18px;
color: var(--primary-color);
margin-right: 7px;
}
}
.none_panels {
background-color: #FFFFFF;
margin: 25px 25px 25px 0;
border-radius: 12px;
}
}
.zone_parter{
background-color: #fff;
padding:70px 0px 90px;

View File

@ -513,14 +513,6 @@
display: flex;
flex-direction: column;
align-items: center;
.apply_button {
flex-grow: 0;
margin-top: 20px;
&:hover, &:active, &:focus {
color: var(--primary-color);
border-color: var(--primary-color);
}
}
.in_title{
font-size: 38px;
}

View File

@ -1,11 +1,13 @@
html[data-theme="zone"] {
--primary-color: #466aff;
--light-color: rgba(70,106,255,0.85);
--more-light-color: rgba(70, 106, 255, 0.05);
--linear-back-color: linear-gradient(89.9deg,rgba(70, 106, 255, 0) 0%,rgba(70, 106, 255, 0.09) 100%);
--tag-back: rgba(70, 106, 255, 0.12);
}
html[data-theme="zone1"] {
--primary-color: #089f7f;
--more-light-color: rgba(7, 165, 131, 0.05);
--light-color: rgba(7, 165, 131, 0.85);
--linear-back-color: linear-gradient(89.9deg,rgba(7, 165, 131, 0) 0%,rgba(7, 165, 131, 0.09) 100%);
--tag-back: rgba(142, 147, 161, 0.1);

View File

@ -4,11 +4,11 @@ import nodata from './Images/nodata.png';
import './css/index.scss';
class Nodata extends Component{
render(){
const { _html , small } = this.props;
const { _html , small, img } = this.props;
return(
<div className={small ? "none_panels small":"none_panels"}>
<div>
<img src={nodata} alt="" />
<img src={img ? img : nodata} alt="" />
<div className="none_p_title">{_html}</div>
</div>
</div>

View File

@ -1,8 +1,11 @@
import React, { useEffect, useState } from 'react';
import { Upload , Icon , message } from "antd";
import { getUploadActionUrl } from 'educoder';
import cookie from 'react-cookies';
function UploadImage({ getImage , url, getImageId, maxSize = 2 }){
const TokenKey = 'autologin_trustie';
function UploadImage({ getImage , url, getImageId, maxSize = 2, action = getUploadActionUrl(), getImageUrl }){
const [ imageUrl , setImageUrl ] = useState(undefined);
useEffect(()=>{
setImageUrl(url);
@ -32,6 +35,7 @@ function UploadImage({ getImage , url, getImageId, maxSize = 2 }){
function handleChange(info){
if(info && info.file && info.file.status === "done"){
getImageId && getImageId(info.file.response.id);
getImageUrl && getImageUrl(info.file.response.url)
getBase64(info.file.originFileObj, imageUrl =>
setImageUrl(imageUrl)
);
@ -43,11 +47,11 @@ function UploadImage({ getImage , url, getImageId, maxSize = 2 }){
listType="picture-card"
className="avatar-uploader"
showUploadList={false}
action={getUploadActionUrl()}
action={action}
beforeUpload={beforeUpload}
onChange={handleChange}
accept=".png,.jpg,.jpeg"
>
headers={{ Authorization: cookie.load(TokenKey) }}>
{
imageUrl ?
<img src={imageUrl} alt="avatar" style={{ width: '100%' }} />