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'] && window['ClapprLoading'] == true) {
setTimeout(() => {
this.componentDidMount()
}, 300)
return;
}
// && window['clappr-playback-rate-plugin']
if (window['Clappr'] ) {
const player = new window.Clappr.Player({
// 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>
)
}

@ -52,7 +52,7 @@ class UserSection extends Component {
{ 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>
<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>
);

@ -29,8 +29,10 @@ class MessagChat extends Component{
}
componentDidMount(){
this.getdata(1);
let target_ids=this.props.match.params.private;
this.getChatList(1,this.state.limits,target_ids);
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({
@ -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>

@ -363,3 +363,7 @@
-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>}
@ -200,7 +200,8 @@ class InfosPackage extends Component{
<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")}
{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>

@ -91,3 +91,7 @@
#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