dev_cs_new
杨树林 6 years ago
commit e119f8195b

@ -54,7 +54,7 @@ class ProjectPackages::SaveService < ApplicationService
raise Error, '验证码不能为空' if params[:code].blank?
code = VerificationCode.where(phone: params[:contact_phone], code_type: 9, code: params[:code]).last
raise Error, '无效的验证码' if code.blank? || !code.valid_code?
raise Error, '无效的验证码' if code.blank? || !code.effective?
end
def deal_attachments

@ -10,33 +10,50 @@ class Clappr extends Component{
this.state={
}
}
componentWillUnmount() {
this['player'+this.props.id] && this['player'+this.props.id].destroy()
}
componentDidMount() {
const source = this.props.source || "http://your.video/here.mp4"
const { id } = this.props
const { id, type } = this.props
const _id = `#_player${id}`
if (window['Clappr']) {
const player = new window.Clappr.Player({
if (!window['Clappr'] && window['ClapprLoading'] == true) {
setTimeout(() => {
this.componentDidMount()
}, 300)
return;
}
// && window['clappr-playback-rate-plugin']
if (window['Clappr'] ) {
// http://clappr.github.io/classes/Player.html#method_mute
this['player'+id] = new window.Clappr.Player({
source: source, parentId: _id,
plugins: {
'core': [window.Clappr.MediaControl, window.Clappr.Playback]
}
height: type == 'mp3' ? 60 : 360,
hideMediaControl: type == 'mp3' ? false : true,
// plugins: {
// 'core': [window.Clappr.MediaControl, window['clappr-playback-rate-plugin'].default]
// }
});
} else {
window['ClapprLoading'] = true;
$.getScript(
`${_url_origin}/javascripts/media/clappr.min.js`,
(data, textStatus, jqxhr) => {
window.clappr = window.Clappr
$.getScript(
`${_url_origin}/javascripts/media/clappr-playback-rate-plugin.min.js`,
(data, textStatus, jqxhr) => {
const player = new window.Clappr.Player({
// $.getScript(
// `${_url_origin}/javascripts/media/clappr-playback-rate-plugin.min.js`,
// (data, textStatus, jqxhr) => {
this['player'+id] = new window.Clappr.Player({
source: source, parentId: _id,
plugins: {
'core': [window.Clappr.MediaControl, window['clappr-playback-rate-plugin'].default]
}
height: type == 'mp3' ? 60 : 360,
hideMediaControl: type == 'mp3' ? false : true,
// plugins: {
// 'core': [window.Clappr.MediaControl, window['clappr-playback-rate-plugin'].default]
// }
});
})
// })
});
@ -62,7 +79,7 @@ class Clappr extends Component{
render(){
let { source, id, className } = this.props;
let { source, id, className, type } = this.props;
const _id = `_player${id}`
return(
<React.Fragment>
@ -71,7 +88,7 @@ class Clappr extends Component{
margin-right: 16px;
}
`}</style>
<div id={_id} className={className}></div>
<div id={_id} className={className + ' ' + type}></div>
</React.Fragment>
)
}

@ -1,4 +1,6 @@
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { Redirect } from 'react-router';
import PropTypes from 'prop-types';
@ -29,7 +31,11 @@ class EvaluateSuccessEffectDisplay extends Component {
}
}
hidepicture = () => {
window.$('#picture_display').hide();
const dom = document.getElementById('picture_display');
ReactDOM.unmountComponentAtNode(dom)
// window.$('#picture_display').hide();
window.$('.data-tip-right').hide()
}
renderContent = () => {
// qrcode
@ -107,11 +113,11 @@ class EvaluateSuccessEffectDisplay extends Component {
<EffectDisplayContent
typeName="音频"
content1={ orignal_file[0] && orignal_file[0].file_url
? <Clappr source={orignal_file[0].file_url} id="1" className="clappr"></Clappr> : null }
? <Clappr source={orignal_file[0].file_url} id="1" className="clappr" type="mp3"></Clappr> : null }
content2={ user_file[0] && user_file[0].file_url
? <Clappr source={user_file[0].file_url} id="2" className="clappr"></Clappr> : null }
? <Clappr source={user_file[0].file_url} id="2" className="clappr" type="mp3"></Clappr> : null }
content3={ answer_file[0] && answer_file[0].file_url
? <Clappr source={answer_file[0].file_url} id="3" className="clappr"></Clappr> : null }
? <Clappr source={answer_file[0].file_url} id="3" className="clappr" type="mp3"></Clappr> : null }
></EffectDisplayContent>
)
} else if (type == 'mp4') {
@ -119,11 +125,11 @@ class EvaluateSuccessEffectDisplay extends Component {
<EffectDisplayContent
typeName="视频"
content1={ orignal_file[0] && orignal_file[0].file_url
? <Clappr source={orignal_file[0].file_url} id="1" className="clappr"></Clappr> : null }
? <Clappr source={orignal_file[0].file_url} id="1" className="clappr" type="mp4"></Clappr> : null }
content2={ user_file[0] && user_file[0].file_url
? <Clappr source={user_file[0].file_url} id="2" className="clappr"></Clappr> : null }
? <Clappr source={user_file[0].file_url} id="2" className="clappr" type="mp4"></Clappr> : null }
content3={ answer_file[0] && answer_file[0].file_url
? <Clappr source={answer_file[0].file_url} id="3" className="clappr"></Clappr> : null }
? <Clappr source={answer_file[0].file_url} id="3" className="clappr" type="mp4"></Clappr> : null }
></EffectDisplayContent>
)
}

@ -1,62 +1,62 @@
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import axios from 'axios'
class UserSection extends Component {
constructor(props) {
super(props)
this.state = {
}
}
/*点击关注或者取消关注*/
AboutFocus(){
const { author_info } = this.props
/*http://localhost:3000/api/v1/users/155/watch?object_id=156&object_type=user*/
const focusUrl = `/api/v1/users/${author_info.user_id}/${this.props.author_info.watched ? 'unwatch' : 'watch'}?object_id=${author_info.user_id}&object_type=user`
axios.get(focusUrl,{
})
.then((response) => {
const status = response.data.status;
console.log(status);
if(status == 1){
const new_author_info = Object.assign({}, this.props.author_info)
new_author_info.watched = !new_author_info.watched
this.props.initForumState({author_info: new_author_info})
}
}).catch((error) => {
console.log(error)
})
}
render() {
const { match, history, author_info , current_user } = this.props
if (!author_info) {
return <div className="edu-back-white" id="forum_index_list"></div>
}
return (
<div className="edu-back-white padding40-20 edu-txt-center">
<a href={`/users/${author_info.login}`} target="_blank"><img src={`/images/${author_info.image_url}`} width="90" height="90" className="radius mb5"/></a>
<p className="font-20 userPrivateName">{author_info.username}</p>
<p className="color-grey-9 userPrivatePost">{author_info.identity}</p>
{ author_info.user_id !== current_user.user_id &&
<p className="clearfix mt30">
<a href="javascript:void(0)" className="fl font-16 mr10 user_default_btn edu-blueback-btn" onClick={()=>{this.AboutFocus()}}>{ author_info.watched == true ? "取消关注" : "关注" }</a>
<a href={`/users/${current_user.login}/message_detail?user_id=${author_info.user_id}`} className="fr font-16 user_default_btn user_private_btn" target="_blank">私信</a>
</p> }
</div>
);
}
}
export default UserSection;
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import axios from 'axios'
class UserSection extends Component {
constructor(props) {
super(props)
this.state = {
}
}
/*点击关注或者取消关注*/
AboutFocus(){
const { author_info } = this.props
/*http://localhost:3000/api/v1/users/155/watch?object_id=156&object_type=user*/
const focusUrl = `/api/v1/users/${author_info.user_id}/${this.props.author_info.watched ? 'unwatch' : 'watch'}?object_id=${author_info.user_id}&object_type=user`
axios.get(focusUrl,{
})
.then((response) => {
const status = response.data.status;
console.log(status);
if(status == 1){
const new_author_info = Object.assign({}, this.props.author_info)
new_author_info.watched = !new_author_info.watched
this.props.initForumState({author_info: new_author_info})
}
}).catch((error) => {
console.log(error)
})
}
render() {
const { match, history, author_info , current_user } = this.props
if (!author_info) {
return <div className="edu-back-white" id="forum_index_list"></div>
}
return (
<div className="edu-back-white padding40-20 edu-txt-center">
<a href={`/users/${author_info.login}`} target="_blank"><img src={`/images/${author_info.image_url}`} width="90" height="90" className="radius mb5"/></a>
<p className="font-20 userPrivateName">{author_info.username}</p>
<p className="color-grey-9 userPrivatePost">{author_info.identity}</p>
{ author_info.user_id !== current_user.user_id &&
<p className="clearfix mt30">
<a href="javascript:void(0)" className="fl font-16 mr10 user_default_btn edu-blueback-btn" onClick={()=>{this.AboutFocus()}}>{ author_info.watched == true ? "取消关注" : "关注" }</a>
<a href={`/message/${current_user.login}/message_detail?target_ids=${author_info.user_id}`} className="fr font-16 user_default_btn user_private_btn" target="_blank">私信</a>
</p> }
</div>
);
}
}
export default UserSection;

@ -29,11 +29,13 @@ class MessagChat extends Component{
}
componentDidMount(){
this.getdata(1);
let target_ids=this.props.match.params.private;
this.getChatList(1,this.state.limits,target_ids);
// console.log("MessagChat111111");
// console.log(this.props.myysluser);
this.setState({
const query = this.props.location.search;
let target_ids = query.split('?target_ids=');
this.getChatList(1,this.state.limits,target_ids[1]);
// console.log("MessagChat111111");
// console.log(this.props.myysluser);
this.setState({
myyslusers:this.props.myysluser
})
try {
@ -304,7 +306,7 @@ class MessagChat extends Component{
// mess:true,
// })
this.props.history.replace(`/message/${this.props.current_user.user_id}/${user.id}/message_detail`);
this.props.history.replace(`/message/${this.props.current_user.user_id}/message_detail?target_ids=${user.id}`);
// this.getdatatwo(this.state.page);
this.getChatListtwo(this.state.pages,this.state.mypagey,user.id);
@ -315,10 +317,11 @@ class MessagChat extends Component{
isSpin:true,
});
let contents=this.messageRef.current.getValue().trim();
let target_ids=this.props.match.params.private
const query = this.props.location.search;
let target_ids = query.split('?target_ids=');
let url = `/users/${this.props.match.params.userid}/private_messages.json`;
axios.post(url, {
target_id: target_ids,
target_id: target_ids[1],
content: contents
})
.then((response) => {

@ -120,7 +120,7 @@ class Messagerouting extends Component{
routing:i,
});
console.log("22222222222");
this.props.history.replace(`/message/${this.props.current_user.user_id}/${id}/message_detail`);
this.props.history.replace(`/message/${this.props.current_user.user_id}/message_detail?target_ids=${id}`);
}
};
@ -207,7 +207,7 @@ class Messagerouting extends Component{
}
></Route>
{/*/!*私信聊天页面*! letters/*/}
<Route path="/message/:userid/:private/message_detail"
<Route path="/message/:userid/message_detail"
render={
(props) => (<MessagChat {...this.state} {...this.props} {...props} Message2={()=>this.Message2()} Modifyur={(i)=>this.Modifyur(i)} Mtab={(i)=>this.myxiaoxisixintab(i)}></MessagChat>)
}

@ -18,7 +18,7 @@ class DownloadMessage extends Component {
setDownload=()=>{
this.modalCancel();
window.open(`/users/${this.props.user.login}/message_detail?user_id=1`)
window.open(`/message/${this.props.user.login}/message_detail?target_ids=1`)
}
modalCancel = () => {
this.setState({

@ -11,7 +11,7 @@ class DownloadMessageysl extends Component {
setDownload=()=>{
this.props.modalCancel();
window.open(`/users/${this.props.user.login}/message_detail?user_id=1`)
window.open(`/message/${this.props.user.login}/message_detail?target_ids=1`)
}
render() {

@ -294,7 +294,7 @@ class PackageConcent extends Component {
<div className=" item-head-blank"></div>
<div className=" item-head-price">
<div className=" item-head-price mtf12">
{item.min_price===null?"":<span>{item.min_price}</span>}
{item.max_price===null||item.min_price===null?"":<span>~</span>}
{item.max_price===null?"":<span>{item.max_price}</span>}

@ -293,8 +293,8 @@ class PackageIndexNEITaskDetails extends Component {
onMouseOver={this.setover}
onMouseOut={this.setout}
>
{overtype===false?<a className="ContacttheTA fl" target="_blank" href={`/users/${data&&data.creator.login}/message_detail?user_id=${data&&data.creator.id}`}> <img alt="头像" class="mr5" src={require('./newsone.png')} />联系TA</a>:
<a className="ContacttheTAs fl" target="_blank" href={`/users/${data&&data.creator.login}/message_detail?user_id=${data&&data.creator.id}`}> <img alt="头像" className="mr5"
{overtype===false?<a className="ContacttheTA fl" target="_blank" href={`/message/${data&&data.creator.login}/message_detail?target_ids=${data&&data.creator.id}`}> <img alt="头像" class="mr5" src={require('./newsone.png')} />联系TA</a>:
<a className="ContacttheTAs fl" target="_blank" href={`/message/${data&&data.creator.login}/message_detail?target_ids=${data&&data.creator.id}`}> <img alt="头像" className="mr5"
src={require('./newstwo.png')}/>联系TA</a>}
</div>}
</div>
@ -313,7 +313,7 @@ class PackageIndexNEITaskDetails extends Component {
</span>
</div>
<div className=" item-head-price mtf7">
<div className=" item-head-price mt2">
{data&&data.min_price===null?"":<span><span className={"font-24"}>{data&&data.min_price}</span></span>}
{data&&data.max_price===null||data&&data.min_price===null?"":<span>~</span>}
{data&&data.max_price===null?"":<span><span className={"font-24"}>{data&&data.max_price}</span></span>}
@ -407,7 +407,7 @@ class PackageIndexNEITaskDetails extends Component {
{item.status==="bidding_won"?<img src={gouxuan} className="yslgouxuanimg"/>:""}
<a href={`/users/${item.login}`}><img className="div1imgs" src={getImageUrl("images/"+item.image_url)}/></a>
<div className="textall mt10" title={item.name}> <p className="ptext">{item.name}</p></div>
{this.props.current_user&&this.props.current_user.login!=item.login?<a className="ContacttheTAs fl none" target="_blank" href={`/users/${item.login}/message_detail?user_id=${item.id}`}>
{this.props.current_user&&this.props.current_user.login!=item.login?<a className="ContacttheTAs fl none" target="_blank" href={`/message/${item.login}/message_detail?target_ids=${item.id}`}>
<img alt="头像" className="mr5" src={require('./newstwo.png')}/>联系TA
</a>:""}
</div>

@ -362,4 +362,8 @@
*, *::before, *::after {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.mtf12{
margin-top: -12px;
}

@ -357,7 +357,7 @@ class Infos extends Component{
:
<div className="inline">
<a href="javascript:void(0);" onClick={this.followPerson} className="user_default_btn user_watch_btn user_private_btn fl mr20">{followed ? "取消关注":"关注"}</a>
<a href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${login}/message_detail?user_id=${id}`} className="user_default_btn user_private_btn fl">私信</a>
<a href={`${this.props.Headertop && this.props.Headertop.old_url}/message/${login}/message_detail?target_ids=${id}`} className="user_default_btn user_private_btn fl">私信</a>
</div>
}
</div>

@ -176,7 +176,7 @@ class InfosPackage extends Component{
<div className="item-head-tags">
</div>
<div className="item-head-blank"></div>
<div className="item-head-price">
<div className="item-head-price mtf15">
{item.min_price===null?"":<span>{item.min_price}</span>}
{item.max_price===null||item.min_price===null?"":<span>~</span>}
{item.max_price===null?"":<span>{item.max_price}</span>}
@ -199,8 +199,9 @@ class InfosPackage extends Component{
<span className="item-group-icon"><i className="fa fa-user"></i></span>
<span className="item-group-text">{item.bidding_users_count}人竞标</span>
</div>
<div className="item-group item-other-publish-at">
发布于{moment(item.published_at).format("YYYY-MM-DD HH:mm")}
<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>:
<span className=" item-group-text">发布于{moment(item.published_at).format("YYYY-MM-DD HH:mm")} </span>}
</div>
</div>
</div>

@ -1,93 +1,97 @@
.navInfo{
border:none!important;
position: absolute;
width: 100%;
bottom: -8px;
}
.navInfo li {
float: left;
margin: 0px 40px;
padding:0px;
height: 45px;
line-height: 40px;
font-size: 16px;
position: relative;
}
.navInfo li.active::after{
position: absolute;
left: 0px;
height: 2px;
width: 100%;
content: '';
bottom: 0px;
background: #05101A!important;
color: #666!important;
}
.navInfo li,.navInfo li.ant-menu-item-active{
border-bottom: none!important;
color: #666!important;
}
.navInfo li.ant-menu-item-selected{
border-bottom: 2px solid #05101A!important;
color: #05101A!important;
}
.navInfo ul.ant-menu{float: left!important;border:none!important;}
.substancenenew{
width: 236px;
height: 206px;
background: rgba(248,248,248,1);
border: 2px dotted rgba(225,225,225,1);
opacity: 1;
border-radius: 4px;
padding-top: 50px;
position: inherit;
}
.substancepad{
padding: 20px 20px 0px 20px;
border-bottom: 1px solid transparent;
}
.substancefont{
height:24px;
font-size:18px;
font-family:Microsoft YaHei;
font-weight:400;
line-height:21px;
color:rgba(153,153,153,1);
opacity:1;
margin-top: -8px;
}
.topten{
width: 1px;
height: 100px;
border: 2px soild rgba(225,225,225,1);
background: rgba(225,225,225,1);
border: 1px solid rgba(225,225,225,1);
margin: 0 auto;
}
.leftten{
width: 100px;
height: 1px;
background: rgba(225,225,225,1);
border: 1px solid rgba(225,225,225,1);
margin: 0px auto;
position: absolute;
top: 120px;
left: 88px;
}
.squarebox{
position: absolute;
top: 0px;
left: 0px;
}
/*题库的标签--和资源标签样式相似*/
.bankTag{max-height: 82px;overflow-y: auto}
.bankTag #sourceTag li{margin-left: 0px;margin-right: 5px;}
.bank_list_Tag{cursor: default}
/*资源标签*/
#sourceTag li,.bank_list_Tag{font-size: 12px;color: #4E7A9B;background-color: #E5F3FF;padding: 0px 4px;height: 20px;line-height: 20px; margin-left: 5px;display: inline-block;cursor: pointer;margin-bottom: 5px;}
#sourceTag li a{color: #4e7a9b!important;}
#sourceTag li.active{background-color: #4CACFF;color: #fff;}
#sourceTag li.active a{background-color: #4CACFF;color: #fff!important;}
.navInfo{
border:none!important;
position: absolute;
width: 100%;
bottom: -8px;
}
.navInfo li {
float: left;
margin: 0px 40px;
padding:0px;
height: 45px;
line-height: 40px;
font-size: 16px;
position: relative;
}
.navInfo li.active::after{
position: absolute;
left: 0px;
height: 2px;
width: 100%;
content: '';
bottom: 0px;
background: #05101A!important;
color: #666!important;
}
.navInfo li,.navInfo li.ant-menu-item-active{
border-bottom: none!important;
color: #666!important;
}
.navInfo li.ant-menu-item-selected{
border-bottom: 2px solid #05101A!important;
color: #05101A!important;
}
.navInfo ul.ant-menu{float: left!important;border:none!important;}
.substancenenew{
width: 236px;
height: 206px;
background: rgba(248,248,248,1);
border: 2px dotted rgba(225,225,225,1);
opacity: 1;
border-radius: 4px;
padding-top: 50px;
position: inherit;
}
.substancepad{
padding: 20px 20px 0px 20px;
border-bottom: 1px solid transparent;
}
.substancefont{
height:24px;
font-size:18px;
font-family:Microsoft YaHei;
font-weight:400;
line-height:21px;
color:rgba(153,153,153,1);
opacity:1;
margin-top: -8px;
}
.topten{
width: 1px;
height: 100px;
border: 2px soild rgba(225,225,225,1);
background: rgba(225,225,225,1);
border: 1px solid rgba(225,225,225,1);
margin: 0 auto;
}
.leftten{
width: 100px;
height: 1px;
background: rgba(225,225,225,1);
border: 1px solid rgba(225,225,225,1);
margin: 0px auto;
position: absolute;
top: 120px;
left: 88px;
}
.squarebox{
position: absolute;
top: 0px;
left: 0px;
}
/*题库的标签--和资源标签样式相似*/
.bankTag{max-height: 82px;overflow-y: auto}
.bankTag #sourceTag li{margin-left: 0px;margin-right: 5px;}
.bank_list_Tag{cursor: default}
/*资源标签*/
#sourceTag li,.bank_list_Tag{font-size: 12px;color: #4E7A9B;background-color: #E5F3FF;padding: 0px 4px;height: 20px;line-height: 20px; margin-left: 5px;display: inline-block;cursor: pointer;margin-bottom: 5px;}
#sourceTag li a{color: #4e7a9b!important;}
#sourceTag li.active{background-color: #4CACFF;color: #fff;}
#sourceTag li.active a{background-color: #4CACFF;color: #fff!important;}
.mtf15{
margin-top:-15px;
}
Loading…
Cancel
Save