dev_cs_new
杨树林 6 years ago
commit 3029f1cbd2

@ -3,6 +3,8 @@ class Users::PrivateMessageDetailsController < Users::BaseController
after_action :update_message_status, only: [:show] after_action :update_message_status, only: [:show]
helper_method :target_user
def show def show
messages = observed_user.private_messages.without_deleted.where(target: target_user) messages = observed_user.private_messages.without_deleted.where(target: target_user)

@ -15,6 +15,7 @@ class Memo < ApplicationRecord
has_many :descendants, foreign_key: :root_id, class_name: 'Memo' has_many :descendants, foreign_key: :root_id, class_name: 'Memo'
has_many :children, foreign_key: :parent_id, class_name: 'Memo' has_many :children, foreign_key: :parent_id, class_name: 'Memo'
has_many :attachments, as: :container, dependent: :destroy has_many :attachments, as: :container, dependent: :destroy
has_many :tidings, as: :container, dependent: :destroy
scope :field_for_list, lambda{ scope :field_for_list, lambda{
select([:id, :subject, :author_id, :sticky, :updated_at, :language, :reward, :all_replies_count, :viewed_count, :forum_id]) select([:id, :subject, :author_id, :sticky, :updated_at, :language, :reward, :all_replies_count, :viewed_count, :forum_id])

@ -69,7 +69,7 @@ class Users::UpdateAccountService < ApplicationService
end end
def sms_notify_admin name def sms_notify_admin name
Educoder::Sms.send(mobile:'18182021083', send_type:'teacher_register', name: name, user_name:'管理员') Educoder::Sms.send(mobile:'17680641960', send_type:'teacher_register', name: name, user_name:'管理员')
rescue => ex rescue => ex
Util.logger_error(ex) Util.logger_error(ex)
end end

@ -1,9 +1,13 @@
json.count @count json.count @count
json.target do
json.partial! 'users/user_simple', user: target_user
end
json.messages do json.messages do
json.array! @messages.each do |message| json.array! @messages.each do |message|
json.extract! message, :id, :user_id, :receiver_id, :sender_id, :content json.extract! message, :id, :user_id, :receiver_id, :sender_id, :content
json.send_time message.display_send_time json.send_time message.display_send_time
json.send_day message.send_time.strftime('%Y-%m-%d')
json.sender do json.sender do
json.partial! 'users/user_simple', user: message.sender json.partial! 'users/user_simple', user: message.sender
end end

@ -21,7 +21,7 @@ module Educoder
def self.notify_admin(opt) def self.notify_admin(opt)
opt[:name] = '管理员' opt[:name] = '管理员'
opt[:mobile] = ENV['NOTIFY_ADMIN_PHONE'] || EduSetting.get('notify_admin_phone') || '18182021083' opt[:mobile] = ENV['NOTIFY_ADMIN_PHONE'] || EduSetting.get('notify_admin_phone') || '18711085785'
send(opt) send(opt)
end end
@ -39,27 +39,22 @@ module Educoder
params['text'] = "【Edu实训】" + code + "手机验证码有效期为10分钟。如非本人操作请忽略。" params['text'] = "【Edu实训】" + code + "手机验证码有效期为10分钟。如非本人操作请忽略。"
elsif send_type == 'competition_start' elsif send_type == 'competition_start'
params['text'] = "【Edu实训】亲爱的#{user_name},你参与的#{name}将于#{result}开始,请及时参赛" params['text'] = "【Edu实训】亲爱的#{user_name},你参与的#{name}将于#{result}开始,请及时参赛"
Rails.logger.info "#{params['text']}"
elsif send_type == "teacher_register" elsif send_type == "teacher_register"
params['mobile'] = EduSetting.get('teacher_register_phone') || '17680641960'
params['text'] = "【Edu实训】亲爱的#{user_name},有新的老师#{name}注册啦,请尽快处理" params['text'] = "【Edu实训】亲爱的#{user_name},有新的老师#{name}注册啦,请尽快处理"
elsif send_type == 'subject_authorization' || send_type == 'shixun_authorization' elsif send_type == 'subject_authorization' || send_type == 'shixun_authorization'
params['text'] = "【Edu实训】亲爱的#{user_name},您提交的#{name}#{send_type=='subject_authorization'?'':''}发布申请#{result},请登录平台查看详情" params['text'] = "【Edu实训】亲爱的#{user_name},您提交的#{name}#{send_type=='subject_authorization'?'':''}发布申请#{result},请登录平台查看详情"
Rails.logger.info "#{params['text']}"
elsif send_type == 'authentication_pro' || send_type == 'authentication'|| send_type == 'trial_authorization' || send_type == 'project_info' elsif send_type == 'authentication_pro' || send_type == 'authentication'|| send_type == 'trial_authorization' || send_type == 'project_info'
params['text'] = "【Edu实训】亲爱的#{user_name},您提交的#{send_type == 'authentication_pro'?'':(send_type == 'authentication'? '' : (send_type == 'project_info'?'':'' ))}#{result},请登录平台查看详情" params['text'] = "【Edu实训】亲爱的#{user_name},您提交的#{send_type == 'authentication_pro'?'':(send_type == 'authentication'? '' : (send_type == 'project_info'?'':'' ))}#{result},请登录平台查看详情"
Rails.logger.info "#{params['text']}"
elsif send_type == "apply_pro_certification" || send_type == "apply_auth" elsif send_type == "apply_pro_certification" || send_type == "apply_auth"
params['text'] = "【Edu实训】亲爱的#{name},有新的#{send_type == 'apply_pro_certification'?'':''}认证申请,请尽快处理" params['text'] = "【Edu实训】亲爱的#{name},有新的#{send_type == 'apply_pro_certification'?'':''}认证申请,请尽快处理"
Rails.logger.info "#{params['text']}"
elsif send_type == "publish_subject" ||send_type == "publish_shixun"|| send_type == "user_apply_auth" || send_type == "discuss" elsif send_type == "publish_subject" ||send_type == "publish_shixun"|| send_type == "user_apply_auth" || send_type == "discuss"
params['mobile'] = EduSetting.get('subject_shixun_notify_phone') || '18711011226' if send_type == "publish_subject" || send_type == "publish_shixun"
params['text'] = "【Edu实训】亲爱的#{name},有新的#{send_type == 'publish_subject'?'':(send_type == 'publish_shixun' ? '' : (send_type == 'discuss' ? '':''))}申请发布,请尽快处理" params['text'] = "【Edu实训】亲爱的#{name},有新的#{send_type == 'publish_subject'?'':(send_type == 'publish_shixun' ? '' : (send_type == 'discuss' ? '':''))}申请发布,请尽快处理"
Rails.logger.info "#{params['text']}"
elsif send_type == 'join_course_multi_role' elsif send_type == 'join_course_multi_role'
params['text'] = "【Edu实训】亲爱的#{user_name},您的课堂#{name}有助教或者教师申请加入,请尽快审核" params['text'] = "【Edu实训】亲爱的#{user_name},您的课堂#{name}有助教或者教师申请加入,请尽快审核"
Rails.logger.info "#{params['text']}"
elsif send_type == 'applied_project_info' elsif send_type == 'applied_project_info'
params['text'] = "【Edu实训】亲爱的#{user_name},您的项目#{name}有成员申请加入,请尽快审核" params['text'] = "【Edu实训】亲爱的#{user_name},您的项目#{name}有成员申请加入,请尽快审核"
Rails.logger.info "#{params['text']}"
end end
http = Net::HTTP.new(send_tpl_sms_uri.host, send_tpl_sms_uri.port) http = Net::HTTP.new(send_tpl_sms_uri.host, send_tpl_sms_uri.port)

@ -75,14 +75,15 @@ class CommonWorkDetailIndex extends Component{
}) })
} }
goback = () => { goback = () => {
let workId=this.props.match.params.workId; // let workId=this.props.match.params.workId;
//
if ( window.location.pathname.indexOf('appraise') == -1) { // if ( window.location.pathname.indexOf('appraise') == -1) {
let category_id= this.state.category.category_id; // let category_id= this.state.category.category_id;
this.props.toListPage(this.props.match.params, category_id) // this.props.toListPage(this.props.match.params, category_id)
} else { // } else {
this.props.toWorkListPage(this.props.match.params, workId) // this.props.toWorkListPage(this.props.match.params, workId)
} // }
this.props.history.goBack()
} }
// 补交附件 // 补交附件

@ -262,7 +262,8 @@ class CommonWorkPost extends Component{
} }
goback=()=>{ goback=()=>{
this.props.toListPage(this.props.match.params, this.state.category ? this.state.category.category_id : '') // this.props.toListPage(this.props.match.params, this.state.category ? this.state.category.category_id : '')
this.props.history.goBack()
} }
@ -469,7 +470,7 @@ class CommonWorkPost extends Component{
} }
gocannel=()=>{ gocannel=()=>{
window.history.go(-1) this.props.history.goBack()
} }
render(){ render(){

@ -31,14 +31,15 @@ class WorkDetailPageHeader extends Component{
} }
goback = () => { goback = () => {
let workId=this.props.match.params.workId; // let workId=this.props.match.params.workId;
//
if ( window.location.pathname.indexOf('appraise') == -1) { // if ( window.location.pathname.indexOf('appraise') == -1) {
let category_id= this.props.category.category_id; // let category_id= this.props.category.category_id;
this.props.toListPage(this.props.match.params, category_id) // this.props.toListPage(this.props.match.params, category_id)
} else { // } else {
this.props.toWorkListPage(this.props.match.params, this.props.match.params.category_id) // this.props.toWorkListPage(this.props.match.params, this.props.match.params.category_id)
} // }
this.props.history.goBack()
} }
// 补交附件 // 补交附件
Cancelvisible=()=>{ Cancelvisible=()=>{

@ -53,7 +53,7 @@ class Ecercisemount extends Component{
typesylename={"mt28"} typesylename={"mt28"}
/> />
<a href="/student_work?homework=16737" className="color-grey-6 fr font-16 ml20 mt18 mr20">返回</a> <a onClick={()=>this.props.history.goBack()} className="color-grey-6 fr font-16 ml20 mt18 mr20">返回</a>
<a href="/student_work?homework=16737" className="color-grey-6 fr font-16 ml30 mt18 " target={"_blank"}>实训详情</a> <a href="/student_work?homework=16737" className="color-grey-6 fr font-16 ml30 mt18 " target={"_blank"}>实训详情</a>
</div> </div>

@ -248,13 +248,13 @@ class Testpapersettinghomepage extends Component{
// let category_id=this.props.match.params.category_id; // let category_id=this.props.match.params.category_id;
// //
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+datalist.graduation_id; // window.location.href="/courses/"+courseId+"/graduation_tasks/"+datalist.graduation_id;
let courseId=this.props.match.params.coursesId; // let courseId=this.props.match.params.coursesId;
if(courseId===undefined){ // if(courseId===undefined){
this.props.history.push("/courses"); // this.props.history.push("/courses");
}else{ // }else{
this.props.history.push(this.props.current_user.first_category_url); // this.props.history.push(this.props.current_user.first_category_url);
} // }
this.props.history.goBack()
} }
render(){ render(){
let {tab,visible,Commonheadofthetestpaper}=this.state; let {tab,visible,Commonheadofthetestpaper}=this.state;

@ -97,13 +97,13 @@ class GraduationTasksSubmitedit extends Component{
goback=()=>{ goback=()=>{
let courseId=this.props.match.params.coursesId; // let courseId=this.props.match.params.coursesId;
if(courseId===undefined){ // if(courseId===undefined){
this.props.history.push("/courses"); // this.props.history.push("/courses");
}else{ // }else{
this.props.history.push(this.props.current_user.first_category_url); // this.props.history.push(this.props.current_user.first_category_url);
} // }
this.props.history.goBack()
} }
@ -362,7 +362,7 @@ class GraduationTasksSubmitedit extends Component{
} }
gocannel=()=>{ gocannel=()=>{
window.history.go(-1) this.props.history.goBack()
} }
handleSubmit=(e) => { handleSubmit=(e) => {

@ -99,13 +99,13 @@ class GraduationTasksSubmitnew extends Component{
} }
goback=()=>{ goback=()=>{
let courseId=this.props.match.params.coursesId; // let courseId=this.props.match.params.coursesId;
if(courseId===undefined){ // if(courseId===undefined){
this.props.history.push("/courses"); // this.props.history.push("/courses");
}else{ // }else{
this.props.history.push(this.props.current_user.first_category_url); // this.props.history.push(this.props.current_user.first_category_url);
} // }
this.props.history.goBack()
} }
@ -362,7 +362,7 @@ class GraduationTasksSubmitnew extends Component{
} }
} }
gocannel=()=>{ gocannel=()=>{
window.history.go(-1) this.props.history.goBack()
} }
//公用数据 //公用数据

@ -70,13 +70,13 @@ class GraduationTasksappraise extends Component{
// let category_id=this.props.match.params.category_id; // let category_id=this.props.match.params.category_id;
// //
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+datalist.graduation_id; // window.location.href="/courses/"+courseId+"/graduation_tasks/"+datalist.graduation_id;
let courseId=this.props.match.params.coursesId; // let courseId=this.props.match.params.coursesId;
if(courseId===undefined){ // if(courseId===undefined){
this.props.history.push("/courses"); // this.props.history.push("/courses");
}else{ // }else{
this.props.history.push(this.props.current_user.first_category_url); // this.props.history.push(this.props.current_user.first_category_url);
} // }
this.props.history.goBack()
} }
Cancelvisible=()=>{ Cancelvisible=()=>{

@ -82,13 +82,13 @@ class GraduationTasksedit extends Component{
goback=()=>{ goback=()=>{
let courseId = this.props.match.params.coursesId; // let courseId = this.props.match.params.coursesId;
if(courseId===undefined){ // if(courseId===undefined){
this.props.history.push("/courses"); // this.props.history.push("/courses");
}else{ // }else{
this.props.history.push(this.props.current_user.first_category_url); // this.props.history.push(this.props.current_user.first_category_url);
} // }
this.props.history.goBack()
} }

@ -107,12 +107,13 @@ class GraduationTasksnew extends Component {
goback = () => { goback = () => {
let courseId = this.props.match.params.coursesId; // let courseId = this.props.match.params.coursesId;
if(courseId===undefined){ // if(courseId===undefined){
this.props.history.push("/courses"); // this.props.history.push("/courses");
}else{ // }else{
this.props.history.push(this.props.current_user.first_category_url); // this.props.history.push(this.props.current_user.first_category_url);
} // }
this.props.history.goBack()
} }

@ -765,12 +765,13 @@ class GraduationTaskssettingapp extends Component{
} }
goback=()=>{ goback=()=>{
let courseId=this.props.match.params.coursesId; // let courseId=this.props.match.params.coursesId;
if(courseId===undefined){ // if(courseId===undefined){
this.props.history.push("/courses"); // this.props.history.push("/courses");
}else{ // }else{
this.props.history.push(this.props.current_user.first_category_url); // this.props.history.push(this.props.current_user.first_category_url);
} // }
this.props.history.goBack()
} }
isgoback=()=>{ isgoback=()=>{

@ -60,13 +60,13 @@ class GraduationTaskssettinglist extends Component{
goback=()=>{ goback=()=>{
// window.history.back(-1) // window.history.back(-1)
let courseId=this.props.match.params.coursesId; // let courseId=this.props.match.params.coursesId;
if(courseId===undefined){ // if(courseId===undefined){
this.props.history.push("/courses"); // this.props.history.push("/courses");
}else{ // }else{
this.props.history.push(this.props.current_user.first_category_url); // this.props.history.push(this.props.current_user.first_category_url);
} // }
this.props.history.goBack()
} }
seacthdata=(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pages)=>{ seacthdata=(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pages)=>{

@ -55,12 +55,14 @@ class GraduationTasksquestions extends Component{
// let courseId=this.props.match.params.coursesId; // let courseId=this.props.match.params.coursesId;
// let category_id=this.props.match.params.category_id; // let category_id=this.props.match.params.category_id;
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id; // window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id;
let courseId = this.props.match.params.coursesId; // let courseId = this.props.match.params.coursesId;
if(courseId===undefined){ // if(courseId===undefined){
this.props.history.push("/courses"); // this.props.history.push("/courses");
}else{ // }else{
this.props.history.push(this.props.current_user.first_category_url); // this.props.history.push(this.props.current_user.first_category_url);
} // }
this.props.history.goBack()
} }
end=()=>{ end=()=>{

@ -265,7 +265,7 @@ class GraduateTopicPostWorksNew extends Component{
<div style={{ width:'100%',height:'70px'}} > <div style={{ width:'100%',height:'70px'}} >
<p className="ml15 fl color-black mt30 summaryname">提交作品</p> <p className="ml15 fl color-black mt30 summaryname">提交作品</p>
<a href="/student_work?homework=16737" className="color-grey-6 fr font-16 ml30 mt18 mr20">返回</a> <a onClick={()=>this.props.history.goBack()} className="color-grey-6 fr font-16 ml30 mt18 mr20">返回</a>
</div> </div>
<Form {...formItemLayout} onSubmit={this.handleSubmit}> <Form {...formItemLayout} onSubmit={this.handleSubmit}>

@ -257,12 +257,13 @@ class CoursesNew extends Component {
goback = () => { goback = () => {
if(this.props.match.params.coursesId===undefined){ // if(this.props.match.params.coursesId===undefined){
this.props.history.push("/courses"); // this.props.history.push("/courses");
}else{ // }else{
this.props.history.push(this.props.current_user.first_category_url); // this.props.history.push(this.props.current_user.first_category_url);
} // }
// window.history.go(-1) // window.history.go(-1)
this.props.history.goBack()
} }
onCheckAllChange = (e) => { onCheckAllChange = (e) => {

@ -2337,11 +2337,11 @@ class PollNew extends Component {
} }
gotohome=()=>{ gotohome=()=>{
const { current_user} = this.props // const { current_user} = this.props
this.props.history.push(current_user && current_user.first_category_url);
// this.props.history.push(current_user && current_user.first_category_url);
//
this.props.history.goBack()
// let courseId=this.props.match.params.coursesId; // let courseId=this.props.match.params.coursesId;
// if(courseId===undefined){ // if(courseId===undefined){
// this.props.history.push("/courses"); // this.props.history.push("/courses");

@ -48,7 +48,7 @@ class Polldepoly extends Component{
typelist={["已开启补交"]} typelist={["已开启补交"]}
typesylename={"mt28"} typesylename={"mt28"}
/> />
<a href="/student_work?homework=16737" className="color-grey-6 fr font-16 ml30 mt18 mr20">返回</a> <a onClick={()=>this.props.history.goBack()} className="color-grey-6 fr font-16 ml30 mt18 mr20">返回</a>
</div> </div>
{/*<div className={"edu-con-bg01 user_bg_shadow bor-grey-e educontentbox"}>*/} {/*<div className={"edu-con-bg01 user_bg_shadow bor-grey-e educontentbox"}>*/}

@ -71,12 +71,13 @@ class CommitSummary extends Component{
console.log(mdContnet) console.log(mdContnet)
} }
gotohome=()=>{ gotohome=()=>{
let courseId=this.props.match.params.coursesId; // let courseId=this.props.match.params.coursesId;
if(courseId===undefined){ // if(courseId===undefined){
this.props.history.push("/courses"); // this.props.history.push("/courses");
}else{ // }else{
this.props.history.push(this.props.current_user.first_category_url); // this.props.history.push(this.props.current_user.first_category_url);
} // }
this.props.history.goBack()
} }
asdasdsad=()=>{ asdasdsad=()=>{
this.setState({ this.setState({

@ -113,12 +113,13 @@ class ShixunHomeworkPage extends Component {
bindRef = ref => { this.child = ref } bindRef = ref => { this.child = ref }
///////////////教师截止 ///////////////教师截止
gotohome=()=>{ gotohome=()=>{
let courseId=this.props.match.params.coursesId; // let courseId=this.props.match.params.coursesId;
if(courseId===undefined){ // if(courseId===undefined){
this.props.history.push("/courses"); // this.props.history.push("/courses");
}else{ // }else{
this.props.history.push(this.props.current_user.first_category_url); // this.props.history.push(this.props.current_user.first_category_url);
} // }
this.props.history.goBack()
} }
render() { render() {
let {tab, teacherdatapage, jobsettingsdatapage} = this.state; let {tab, teacherdatapage, jobsettingsdatapage} = this.state;

@ -52,13 +52,13 @@ class ShixunWorkDetails extends Component {
} }
goback=(sum)=>{ goback=(sum)=>{
let{data}=this.state // let{data}=this.state
if(sum===1){ // if(sum===1){
window.location.href = "/courses/"+data.course_id+"/students"; // window.location.href = "/courses/"+data.course_id+"/students";
}else{ // }else{
window.history.go(-1) // window.history.go(-1)
} // }
this.props.history.goBack()
} }
render() { render() {
let{data}=this.state; let{data}=this.state;

@ -53,7 +53,7 @@ class StudentHomework extends Component{
typesylename={"mt28"} typesylename={"mt28"}
/> />
<a href="/student_work?homework=16737" className="color-grey-6 fr font-16 ml20 mt18 mr20">返回</a> <a onClick={()=>this.props.history.goBack()} className="color-grey-6 fr font-16 ml20 mt18 mr20">返回</a>
<a href="/student_work?homework=16737" className="color-grey-6 fr font-16 ml30 mt18 " target={"_blank"}>实训详情</a> <a href="/student_work?homework=16737" className="color-grey-6 fr font-16 ml30 mt18 " target={"_blank"}>实训详情</a>
</div> </div>

@ -11,10 +11,10 @@
} }
.user_navlist{ .user_navlist{
margin-left: 40px; /*margin-left: 40px;*/
} }
.next-slick-list{ .next-slick-list{
margin-left: 12px; /*margin-left: 12px;*/
} }
.black_nav_span{ .black_nav_span{
@ -58,7 +58,7 @@
} }
.educontentSlider{ .educontentSlider{
width: 1282px !important; /*width: 1282px !important;*/
} }
.user_navlist_white{ .user_navlist_white{
max-height:350px !important; max-height:350px !important;
@ -73,3 +73,7 @@
font-size: 18px !important; font-size: 18px !important;
line-height: 24px; line-height: 24px;
} }
.next-slick.next-slick-horizontal.next-slick-outer{
padding:0px !important;
}

@ -125,7 +125,16 @@ class ShixunsHome extends Component {
{/*<SiderBar/>*/} {/*<SiderBar/>*/}
<div className="clearfix"> <div className="clearfix">
<div className="clearfix edu-back-white pb40 pt30 mb20" id="index-top" onMouseMove={this.bannaronmousemove} onMouseOut={this.bannaronmouseout}> <style>
{
`
.banners{
overflow: hidden;
}
`
}
</style>
<div className="clearfix edu-back-white pb40 pt30 mb20 banners" id="index-top" onMouseMove={this.bannaronmousemove} onMouseOut={this.bannaronmouseout}>
<div className="educontent pr educontentSlider"> <div className="educontent pr educontentSlider">
{homedatalist===undefined?"": {homedatalist===undefined?"":
<Slider <Slider

@ -112,14 +112,14 @@ class PathDetailIndex extends Component{
this.setState({ this.setState({
Modalstype:false, Modalstype:false,
}) })
window.history.go(-1) this.props.history.goBack()
} }
cardsModalsave=()=>{ cardsModalsave=()=>{
this.setState({ this.setState({
Modalstype:false, Modalstype:false,
}) })
window.history.go(-1) this.props.history.goBack()
} }
// 加载markdown // 加载markdown
updatamakedown=(id)=>{ updatamakedown=(id)=>{

@ -1,7 +1,7 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Link} from "react-router-dom"; import {Link} from "react-router-dom";
import axios from 'axios'; import axios from 'axios';
import { Input ,Icon,Button,Pagination} from 'antd'; import { Input ,Icon,Button,Pagination,Spin} from 'antd';
import moment from 'moment'; import moment from 'moment';
import '../packageconcnet.css'; import '../packageconcnet.css';
import AccountProfile from"../../user/AccountProfile"; import AccountProfile from"../../user/AccountProfile";
@ -50,7 +50,8 @@ class PackageConcent extends Component {
per_page:20, per_page:20,
categories:[], categories:[],
isRender:false, isRender:false,
AccountProfiletype:false AccountProfiletype:false,
isSpin:false
} }
} }
//desc, desc, asc //desc, desc, asc
@ -74,7 +75,9 @@ class PackageConcent extends Component {
} }
setdatas=(category,keyword,sort_by,sort_direction,page)=>{ setdatas=(category,keyword,sort_by,sort_direction,page)=>{
this.setState({
isSpin:true
})
let Url = `/project_packages.json`; let Url = `/project_packages.json`;
axios.get(Url,{params:{ axios.get(Url,{params:{
category_id:category, category_id:category,
@ -87,6 +90,7 @@ class PackageConcent extends Component {
).then((response) => { ).then((response) => {
this.setState({ this.setState({
data:response.data, data:response.data,
isSpin:false,
project_packages:response.data.project_packages project_packages:response.data.project_packages
}) })
}).catch((error) => { }).catch((error) => {
@ -266,7 +270,7 @@ class PackageConcent extends Component {
</p> </p>
</div> </div>
<Spin size="large" spinning={this.state.isSpin}>
{project_packages&&project_packages.map((item,key)=>{ {project_packages&&project_packages.map((item,key)=>{
return( return(
<div className="educontent project-packages-list mb30" key={key}> <div className="educontent project-packages-list mb30" key={key}>
@ -311,16 +315,16 @@ class PackageConcent extends Component {
<div className=" item-group item-other-deadline"> <div className=" item-group item-other-deadline">
<span className=" item-group-icon mr10"><i className="fa fa-clock-o"></i></span> <span className=" item-group-icon mr10"><i className="fa fa-clock-o"></i></span>
<span className=" item-group-text">{item.deadline_at}竞标截止</span> <span className=" item-group-text">{moment(item.deadline_at).format("YYYY-MM-DD HH:mm")}竞标截止</span>
</div> </div>
<div className=" item-group item-other-bidding ml0"> <div className=" item-group item-other-bidding ml0 pagemancenter">
<span className=" item-group-icon mr10"><i className="fa fa-user" ></i></span> <span className=" item-group-icon mr10"><i className="fa fa-user" ></i></span>
<span className=" item-group-text">{item.bidding_users_count}人竞标</span> <span className=" item-group-text">{item.bidding_users_count}人竞标</span>
</div> </div>
<div className=" item-other-blank"></div> {/*<div className=" item-other-blank"></div>*/}
<div className=" item-group item-other-publish-at"> <div className=" item-group item-other-publish-at">
{item.published_at===null?<span className="item-group-text">更新于{moment(item.updated_at).format("YYYY-MM-DD HH:mm")} </span>: {item.published_at===null?<span className="item-group-text">更新于{moment(item.updated_at).format("YYYY-MM-DD HH:mm")} </span>:
<span className=" item-group-text">发布于{moment(item.published_at).format("YYYY-MM-DD HH:mm")} </span>} <span className=" item-group-text">发布于{moment(item.published_at).format("YYYY-MM-DD HH:mm")} </span>}
@ -333,6 +337,7 @@ class PackageConcent extends Component {
</div> </div>
) )
})} })}
</Spin>
{project_packages&&project_packages.length===0?<div className="edu-back-white"> {project_packages&&project_packages.length===0?<div className="edu-back-white">
<div className="edu-tab-con-box clearfix edu-txt-center"> <div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src="https://www.educoder.net/images/educoder/nodata.png" /> <img className="edu-nodata-img mb20" src="https://www.educoder.net/images/educoder/nodata.png" />

@ -230,7 +230,8 @@ class PackageIndexNEITaskDetails extends Component {
} }
goback = () => { goback = () => {
// window.history.go(-1) // window.history.go(-1)
window.location.href="/crowdsourcing"; // window.location.href="/crowdsourcing";
this.props.history.goBack()
} }
render() { render() {

@ -30,7 +30,8 @@ class PackageIndexNewandEditIndex extends Component{
goback = () => { goback = () => {
// window.history.go(-1) // window.history.go(-1)
window.location.href="/crowdsourcing"; // window.location.href="/crowdsourcing";
this.props.history.goBack()
} }
render() { render() {

@ -309,13 +309,11 @@ export function TPMIndexHOC(WrappedComponent) {
<style>{ <style>{
` `
.newContainers{ .newContainers{
width: 100%; min-width: 1200px;
/*min-width: 1440px;*/
max-width: unset; max-width: unset;
overflow: hidden;
} }
// .-task-sidebar{
// right: 270px !important;
// }
` `
}</style> }</style>
<NewHeader {...this.state} {...this.props}></NewHeader> <NewHeader {...this.state} {...this.props}></NewHeader>

@ -193,15 +193,14 @@ class InfosPackage extends Component{
</div> </div>
<div className="item-group item-other-deadline"> <div className="item-group item-other-deadline">
<span className="item-group-icon"><i className="fa fa-clock-o"></i></span> <span className="item-group-icon"><i className="fa fa-clock-o"></i></span>
<span className="item-group-text">{moment(item.deadline_at).endOf('day').fromNow()}竞标截止</span> <span className="item-group-text">{moment(item.deadline_at).format("YYYY-MM-DD HH:mm")}竞标截止</span>
</div> </div>
<div className="item-group item-other-bidding"> <div className="item-group item-other-bidding pagemancenter">
<span className="item-group-icon"><i className="fa fa-user"></i></span> <span className="item-group-icon"><i className="fa fa-user"></i></span>
<span className="item-group-text">{item.bidding_users_count}人竞标</span> <span className="item-group-text">{item.bidding_users_count}人竞标</span>
</div> </div>
<div className="item-group"></div>
<div className="item-group item-other-publish-at"> <div className="item-group item-other-publish-at">
发布于{item.published_at} 发布于{moment(item.published_at).format("YYYY-MM-DD HH:mm")}
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save