parent
22c736efc1
commit
efbbe928e9
After Width: | Height: | Size: 1.9 KiB |
@ -0,0 +1,81 @@
|
||||
import React, { useState, Fragment } from 'react';
|
||||
import GotoQQgroup from '../../../modal/GotoQQgroup'
|
||||
import { Input, Icon } from 'antd'
|
||||
import './shixun-keyword-list.scss'
|
||||
|
||||
function AddonAfter({ callback }) {
|
||||
return <a className='btn-search' onClick={callback}>
|
||||
<Icon type='search' />
|
||||
<span>搜索</span>
|
||||
</a>
|
||||
}
|
||||
export default ({ onChangeLabel, btnUrl, OnSearchInput, checkIfLogin, showLoginDialog, checkIfProfileCompleted, showProfileCompleteDialog, current_user }) => {
|
||||
const [data, setData] = useState({
|
||||
type: 'new',
|
||||
showQQ: false,
|
||||
keyword: '',
|
||||
})
|
||||
|
||||
function onChangeTag(e) {
|
||||
const id = e.target.id
|
||||
setData({ ...data, type: id })
|
||||
onChangeLabel(false, id, "desc")
|
||||
}
|
||||
function onSetKeyword(e) {
|
||||
setData({ ...data, keyword: e.target.value })
|
||||
}
|
||||
|
||||
function callback() {
|
||||
if (keyword) {
|
||||
OnSearchInput(keyword, true)
|
||||
}
|
||||
}
|
||||
|
||||
function setShowQQ(v) {
|
||||
setData({ ...data, showQQ: v })
|
||||
}
|
||||
|
||||
function onNewShiXun() {
|
||||
if (!checkIfLogin()) {
|
||||
showLoginDialog()
|
||||
return
|
||||
}
|
||||
if (!checkIfProfileCompleted()) {
|
||||
showProfileCompleteDialog()
|
||||
return
|
||||
}
|
||||
if (current_user && current_user.is_shixun_marker === false) {
|
||||
setShowQQ(true)
|
||||
return
|
||||
}
|
||||
window.location.href = '/shixuns/new'
|
||||
}
|
||||
|
||||
const { type, keyword, showQQ } = data
|
||||
return (
|
||||
<Fragment>
|
||||
<div className="wrapper">
|
||||
<div className="educontent search-keyword-container">
|
||||
<div className="btn-groups">
|
||||
<a id='new' className={type === 'new' ? 'active' : ''} onClick={onChangeTag} title='最新'>最新</a>
|
||||
<a id='hot' className={type === 'hot' ? 'active' : ''} onClick={onChangeTag} title='最热'>最热</a>
|
||||
</div>
|
||||
<div className='search-container'>
|
||||
<Input onChange={onSetKeyword} value={keyword} addonAfter={<AddonAfter callback={callback} />} defaultValue="" placeholder='请输入课程名称进行搜索' />
|
||||
</div>
|
||||
</div>
|
||||
<a className="btn-new" onClick={onNewShiXun}>
|
||||
<img src={btnUrl} width={40} alt="创建实训" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{
|
||||
showQQ ?
|
||||
<GotoQQgroup goshowqqgtounp={showQQ} setgoshowqqgtounp={setShowQQ}></GotoQQgroup>
|
||||
:
|
||||
""
|
||||
}
|
||||
</Fragment>
|
||||
|
||||
)
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
.search-keyword-container {
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20px 0;
|
||||
|
||||
.ant-input-group-addon {
|
||||
background-color: #4CACFF;
|
||||
}
|
||||
|
||||
.ant-input:focus+.ant-input-group-addon {
|
||||
background-color: #4CACFF !important;
|
||||
}
|
||||
|
||||
.search-container {
|
||||
width: 320px;
|
||||
}
|
||||
|
||||
.btn-search {
|
||||
display: block;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
|
||||
span {
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.btn-groups {
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
align-items: center;
|
||||
justify-content: start;
|
||||
|
||||
a {
|
||||
display: block;
|
||||
width: 60px;
|
||||
border-radius: 14px;
|
||||
text-align: center;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
|
||||
&:first-child {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
color: #999;
|
||||
background-color: #eee;
|
||||
|
||||
&.active {
|
||||
color: #fff;
|
||||
background-color: #4CACFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.btn-new {
|
||||
position: absolute;
|
||||
width: 40px;
|
||||
right: 39px;
|
||||
top: 76px;
|
||||
z-index: 10;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
import React from 'react'
|
||||
export default ({
|
||||
activeId, id, callback, text
|
||||
}) => {
|
||||
function onClickHandler() {
|
||||
callback(id)
|
||||
}
|
||||
return (
|
||||
<a className={id === activeId ? "shaiItems shixun_repertoire active" : "shaiItems shixun_repertoire"} onClick={onClickHandler}>{text}</a>
|
||||
)
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
.iconfontShixunSearchBar {
|
||||
z-index: 1000;
|
||||
position: absolute;
|
||||
right: 3px;
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
.pt_b_26 {
|
||||
padding: 26px 0px;
|
||||
}
|
||||
|
||||
.diffSelect {
|
||||
margin-left: 20px !important;
|
||||
}
|
||||
|
||||
.ant-input-search-button {
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.Mousebox {
|
||||
width: 800px !important;
|
||||
}
|
||||
|
||||
.subshaicontent a {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.ant-dropdown {
|
||||
width: 800px;
|
||||
}
|
||||
|
||||
.shixun_repertoire {
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
margin-right: 20px;
|
||||
color: #999;
|
||||
cursor: pointer;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.ant-dropdown-menu-item,
|
||||
.ant-dropdown-menu-submenu-title {
|
||||
padding: 0px 12px;
|
||||
}
|
||||
|
||||
.ant-dropdown-menu-item:hover,
|
||||
.ant-dropdown-menu-submenu-title:hover {
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
.shaiContent li.shaiItem {
|
||||
padding: 0px 15px;
|
||||
line-height: 32px;
|
||||
height: 32px
|
||||
}
|
||||
|
||||
.shaiTitle {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.shaiItems {
|
||||
padding: 0px 15px;
|
||||
line-height: 32px;
|
||||
height: 32px;
|
||||
float: left;
|
||||
border-radius: 4px;
|
||||
color: #4C4C4C;
|
||||
cursor: pointer;
|
||||
margin-right: 15px;
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.shaiItems.active {
|
||||
background-color: #4CACFF !important;
|
||||
color: #fff !important;
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
.ml350 {
|
||||
margin-left: 40%;
|
||||
}
|
||||
|
||||
.ml32 {
|
||||
margin-left: 32%;
|
||||
}
|
||||
|
||||
.square-img {
|
||||
min-height: 210px;
|
||||
}
|
||||
|
||||
.task-hide {
|
||||
margin-bottom: 0em;
|
||||
}
|
||||
|
||||
.backFAFAFA {
|
||||
background: #FAFAFA;
|
||||
}
|
||||
|
||||
.demo {
|
||||
width: 500px;
|
||||
background-color: #0dcecb;
|
||||
text-align: center;
|
||||
padding: 50px;
|
||||
}
|
||||
|
||||
.next-loading {
|
||||
margin-bottom: 5px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.next-rating-overlay .next-icon {
|
||||
color: #FFA800 !important;
|
||||
}
|
||||
|
||||
.custom-pagination {
|
||||
display: inline-block;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.ml425 {
|
||||
margin-left: 42.5%;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.shixun-card {
|
||||
|
||||
.edu-tab-con-box {
|
||||
padding: 100px 0px;
|
||||
}
|
||||
|
||||
.ant-modal-body .edu-tab-con-box {
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
||||
img.edu-nodata-img {
|
||||
margin: 40px auto 20px;
|
||||
}
|
||||
|
||||
.square-list {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.tag-green {
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
bottom: 125px;
|
||||
}
|
||||
|
||||
.tag-org {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 20px;
|
||||
}
|
||||
|
||||
.tag-org-name {
|
||||
width: 66px;
|
||||
height: 28px;
|
||||
background: #FF6802;
|
||||
width: 66px;
|
||||
height: 28px;
|
||||
border-radius: 0px 20px 20px 0px;
|
||||
}
|
||||
|
||||
.tag-org-name-test {
|
||||
width: 45px;
|
||||
height: 23px;
|
||||
font-size: 14px;
|
||||
color: #FFFFFF;
|
||||
line-height: 19px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.intermediatecenter {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue