Commit b19e7da0 by guomingpang

feat:微信审核

parent a8783b47
@font-face {
font-family: 'iconfont'; /* Project id 2223403 */
src: url('//at.alicdn.com/t/font_2223403_oe5p510553.woff2?t=1624259078391') format('woff2'),
url('//at.alicdn.com/t/font_2223403_oe5p510553.woff?t=1624259078391') format('woff'),
url('//at.alicdn.com/t/font_2223403_oe5p510553.ttf?t=1624259078391') format('truetype');
src: url('//at.alicdn.com/t/font_2223403_7261tsts1dc.woff2?t=1628475376853') format('woff2'),
url('//at.alicdn.com/t/font_2223403_7261tsts1dc.woff?t=1628475376853') format('woff'),
url('//at.alicdn.com/t/font_2223403_7261tsts1dc.ttf?t=1628475376853') format('truetype');
}
.iconfont {
font-family: 'iconfont' !important;
......
import React from 'react';
import { withRouter } from "react-router-dom";
import { Form, Input, Button, Modal, message} from 'antd';
import { withRouter } from 'react-router-dom';
import { Form, Input, Button, Modal,Switch, message } from 'antd';
import SelectPrepareFileModal from '@/modules/prepare-lesson/modal/SelectPrepareFileModal';
import Upload from '@/core/upload';
import StoreService from "@/domains/store-domain/storeService";
import User from "@/common/js/user";
import StoreService from '@/domains/store-domain/storeService';
import User from '@/common/js/user';
import Bus from '@/core/tbus';
import ImgClipModal from '@/components/ImgClipModal'
import "./CollegeInfoPage.less";
let cutFlag = false;
import ImgClipModal from '@/components/ImgClipModal';
import './CollegeInfoPage.less';
class CollegeInfoPage extends React.Component {
formRef = React.createRef();
constructor(props) {
super(props);
this.state = {
storeName:null,
logo:'',
showSelectFileModal:false,
storeName: null,
logo: '',
showSelectFileModal: false,
cutImageBlob: null,
imageFile: null, // 需要被截取的图片
}
auditSwitch:true,
};
}
componentWillMount() {
if (User.getEnterpriseId()) {
this.getStoreDetail()
this.getStoreDetail();
} else {
window.RCHistory.replace('/store-info')
}
window.RCHistory.replace('/store-info');
}
getStoreDetail = ()=>{
const params= {
storeId:User.getStoreId()
}
getStoreDetail = () => {
const params = {
storeId: User.getStoreId(),
};
StoreService.getStoreDetail(params).then((res) => {
const { result = { } } = res;
const {
storeName,
logo
} = result;
const { result = {} } = res;
const { storeName, logo } = result;
this.formRef.current.setFieldsValue({
storeName:storeName
storeName: storeName,
});
this.setState({
storeName,
logo
})
logo,
});
}
onChangeFiledValue=(filed,value)=>{
});
};
onChangeFiledValue = (filed, value) => {
console.log(filed, value)
this.setState({
[filed]:value
})
}
handleSelectCover = (file)=> {
[filed]: value,
});
};
handleSelectCover = (file) => {
this.setState({
visible: true,
imageFile:file
imageFile: file,
});
}
};
//获取resourceId
getSignature = (blob, fileName) => {
Upload.uploadBlobToOSS(blob, 'cover' + (new Date()).valueOf(),null,'signInfo').then((signInfo) => {
this.setState({
coverClicpPath:signInfo.fileUrl,
coverId:signInfo.resourceId,
visible: false
},()=>this.updateCover())
Upload.uploadBlobToOSS(blob, 'cover' + new Date().valueOf(), null, 'signInfo').then((signInfo) => {
this.setState(
{
coverClicpPath: signInfo.fileUrl,
coverId: signInfo.resourceId,
visible: false,
},
() => this.updateCover()
);
});
};
updateCover = () =>{
const {coverClicpPath,coverId} = this.state
updateCover = () => {
const { coverClicpPath, coverId } = this.state;
this.setState({
showSelectFileModal: false
})
showSelectFileModal: false,
});
this.setState({
logo:coverClicpPath
})
}
logo: coverClicpPath,
});
};
updateInfo=()=>{
updateInfo = () => {
const { storeName, logo } = this.state;
if(!storeName){
if (!storeName) {
message.warning('请输入学院名称');
return;
}
const params= {
const params = {
storeName,
logo,
storeId:User.getStoreId()
}
storeId: User.getStoreId(),
};
StoreService.updateStoreMessage(params).then((res) => {
User.setStoreName(storeName);
Bus.trigger('storeNameChange',storeName);
Bus.trigger('storeNameChange', storeName);
message.success('保存成功');
Bus.trigger("updateCollegeInfo")
Bus.trigger('updateCollegeInfo');
});
}
};
render() {
const {
storeName,
showSelectFileModal,
visible,
hasImgReady,
logo,
cutImageBlob,
imageFile
} = this.state;
const { storeName, showSelectFileModal, visible, logo, imageFile,auditSwitch } = this.state;
return (
<div className="page college-info-page">
<div className="content-header">学院信息</div>
<div className="box">
<div className="college-info-page-form">
<div className='page college-info-page'>
<div className='content-header'>学院信息</div>
<div className='box'>
<div className='college-info-page-form'>
<Form ref={this.formRef}>
<Form.Item
label="学院LOGO"
>
<div className="logo-con">
<div className="logo-img-con">
{ logo ? <img src={logo} className="logo-img"/> : <div className="logo-box"><span className="text">Logo</span></div>}
<div className='title'>基本信息</div>
<Form.Item label='学院LOGO'>
<div className='logo-con'>
<div className='logo-img-con'>
<Choose>
<When condition={logo}>
<img src={logo} className='logo-img' alt=''/>
</When>
<Otherwise>
<div className='logo-box'>
<span className='text'>Logo</span>
</div>
</Otherwise>
</Choose>
</div>
<div className="upload-box">
<span onClick={() => {this.setState({ showSelectFileModal:true })}} className="upload-btn">
<div className='upload-box'>
<span
onClick={() => {
this.setState({ showSelectFileModal: true });
}}
className='upload-btn'>
<span>上传</span>
</span>
<div className="tip">建议尺寸702*180px。最大2M,支持jpg、jpeg和png。</div>
<div className='tip'>建议尺寸702*180px。最大2M,支持jpg、jpeg和png。</div>
</div>
</div>
</Form.Item>
<Form.Item
label="学院名称"
name="storeName"
rules={[{ required: true}]}
>
<Form.Item label='学院名称' name='storeName' rules={[{ required: true }]}>
<Input
value={storeName}
style={{ width: '300px' }}
placeholder="请输入学院名称"
onChange={(e) => this.onChangeFiledValue("storeName", e.target.value)}
placeholder='请输入学院名称'
onChange={(e) => this.onChangeFiledValue('storeName', e.target.value)}
maxLength={30}
/>
</Form.Item>
<div className='title mt40'>高级设置</div>
<Form.Item label='学员审核' name='storeName' rules={[{ required: true }]}>
<div className='switch-box'>
<Switch checked={auditSwitch } onChange={(e) => this.onChangeFiledValue('auditSwitch', e)}/>
<Choose>
<When condition={auditSwitch}>
<div className='switch-desc'>已开启,成为学院学员需要审核</div>
<div className='switch-prew-link'>功能预览</div>
</When>
<Otherwise>
<div className='switch-desc'>已关闭,成为学院学员不需要审核</div>
</Otherwise>
</Choose>
</div>
</Form.Item>
</Form>
</div>
{showSelectFileModal &&
{showSelectFileModal && (
<SelectPrepareFileModal
key="basic"
operateType="select"
key='basic'
operateType='select'
multiple={false}
accept="image/jpeg,image/png,image/jpg"
accept='image/jpeg,image/png,image/jpg'
selectTypeList={['JPG', 'JPEG', 'PNG']}
tooltip='支持文件类型:jpg、jpeg、png'
isOpen={showSelectFileModal}
onClose={() => {
this.setState({
showSelectFileModal:false
})
showSelectFileModal: false,
});
}}
onSelect={this.handleSelectCover}
/>
}
{ visible &&
<ImgClipModal visible={visible} imgUrl={imageFile.ossUrl} aspectRatio='125/32' cropBoxHeight='128' onConfirm={this.getSignature} onClose={()=>{this.setState({ visible: false });}}/>
}
<div><Button type="primary" onClick={this.updateInfo} htmlType="submit" className="submit-btn">更新信息</Button></div>
)}
{visible && (
<ImgClipModal
visible={visible}
imgUrl={imageFile.ossUrl}
aspectRatio='125/32'
cropBoxHeight='128'
onConfirm={this.getSignature}
onClose={() => {
this.setState({ visible: false });
}}
/>
)}
<div>
<Button type='primary' onClick={this.updateInfo} htmlType='submit' className='submit-btn'>
保存设置
</Button>
</div>
</div>
</div>
)
);
}
}
......
......@@ -13,7 +13,14 @@
font-size:14px;
}
.college-info-page-form{
margin-left:29px;
margin-left:20px;
.title{
font-size: 16px;
color: #333;
font-weight: 500;
margin-left: -20px;
margin-bottom: 20px;
}
.logo-con{
.logo-img-con{
width: 258px;
......@@ -58,10 +65,24 @@
}
}
}
.switch-box{
display: flex;
align-items: center;
.switch-desc{
color: #999;
font-size: 14px;
margin: 0 8px;
}
.switch-prew-link{
color: #2966FF;
font-size: 14px;
}
}
}
.submit-btn{
margin-left:142px;
margin-left:132px;
margin-top: 20px;
}
}
\ No newline at end of file
.user-manage-page {
.content-header{
display: flex;
justify-content: space-between;
align-items: center;
.icon-font-weixin{
color: #5DD333;
margin-right:4px ;
}
.content-header-right{
font-size: 14px;
color: #2966FF;
}
}
.box-header {
display: flex;
width: calc(100% - 80px);
......
......@@ -137,7 +137,10 @@ function UserManagePage() {
return (
<div className=" page user-manage-page">
<div className="content-header">学员管理</div>
<div className="content-header">
<div>学员管理</div>
<div ><span className='icon iconfont icon-font-weixin'>&#xe8e0;</span><span className='content-header-right'>学员审核列表</span></div>
</div>
<div className="box">
<div className="box-header">
<div className="header-item">
......
......@@ -155,6 +155,7 @@ class GraphicsEditor extends React.Component {
message.warning(`内容过长,不能超过${maxLimit}字`);
}
Bus.trigger('editorLimit', textLength, editorType);
console.log(onChange,html, this.state.textLength)
onChange(html, this.state.textLength);
});
};
......
import React from 'react';
import { Input, Button, Modal, message, Form } from 'antd';
import { Input, Button, Switch, message, Form } from 'antd';
import Upload from '@/core/upload';
import Service from "@/common/js/service";
import BaseService from "@/domains/basic-domain/baseService";
......@@ -7,9 +7,6 @@ import User from "@/common/js/user";
import Breadcrumbs from "@/components/Breadcrumbs";
import ImgClipModal from '@/components/ImgClipModal'
import './CreateCollege.less';
let cutFlag = false;
export default class CreateCollege extends React.Component {
constructor(props) {
......@@ -20,6 +17,7 @@ export default class CreateCollege extends React.Component {
name: '',
enterpriseId: User.getEnterpriseId(),
imageFile: null, // 需要被截取的图片
auditSwitch:true,
};
this.loginInputRef = React.createRef()
}
......@@ -70,7 +68,7 @@ export default class CreateCollege extends React.Component {
};
updateCover = () =>{
const {coverClicpPath,coverId} = this.state
const {coverClicpPath} = this.state
this.setState({
logo:coverClicpPath
})
......@@ -97,21 +95,19 @@ export default class CreateCollege extends React.Component {
render() {
const {
avatar,
name,
collegeName,
logo,
visible,
hasImgReady,
cutImageBlob,
showError,
imageFile
imageFile,
auditSwitch
} = this.state;
return (
<div className="college-manage-page">
<div className="college-header">
<div className="box">
<img className="box-image" src="https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png" />
<img className="box-image" src="https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png" alt=''/>
</div>
</div>
<div className="breadcrumb-wrap">
......@@ -124,7 +120,7 @@ export default class CreateCollege extends React.Component {
</div>
<div className="create-box">
<div className="image-box">
<img className="image" src={logo}/>
<img className="image" src={logo} alt=''/>
<div className="image-mask">
<span
className="icon iconfont"
......@@ -154,6 +150,20 @@ export default class CreateCollege extends React.Component {
}}
></Input>
</Form.Item>
<Form.Item label='学员审核' name='auditSwitch' rules={[{ required: true }]}>
<div className='switch-box'>
<Switch checked={auditSwitch } onChange={(e) => this.onChangeFiledValue('auditSwitch', e)}/>
<Choose>
<When condition={auditSwitch}>
<div className='switch-desc'>已开启,成为学院学员需要审核</div>
<div className='switch-prew-link'>功能预览</div>
</When>
<Otherwise>
<div className='switch-desc'>已关闭,成为学院学员不需要审核</div>
</Otherwise>
</Choose>
</div>
</Form.Item>
</Form>
<Button
className="button"
......
......@@ -5,7 +5,7 @@
.create-box {
padding-top: 108px;
margin: 0 auto;
width: 350px;
width: 400px;
.image-box {
position: relative;
display: block;
......@@ -45,6 +45,19 @@
}
}
}
.switch-box{
display: flex;
align-items: center;
.switch-desc{
color: #999;
font-size: 14px;
margin: 0 8px;
}
.switch-prew-link{
color: #2966FF;
font-size: 14px;
}
}
.tip {
display: block;
color: #999999;
......
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