dev_cs
杨树林 6 years ago
parent 628e248a2d
commit 6067f74b86

@ -44,8 +44,8 @@ export function initAxiosInterceptors(props) {
// proxy = "https://testeduplus2.educoder.net"
proxy="http://47.96.87.25:48080"
// wy
proxy="https://pre-newweb.educoder.net"
// proxy="https://pre-newweb.educoder.net"
proxy="https://test-newweb.educoder.net";
// wy
// proxy="http://192.168.2.63:3001"

@ -1,10 +1,10 @@
const isDev = window.location.port == 3007;
export const TEST_HOST = "https://pre-newweb.educoder.net"
export const TEST_HOST = "https://test-newweb.educoder.net"
export function getImageUrl(path) {
// https://www.educoder.net
// https://testbdweb.trustie.net
// const local = 'http://localhost:3000'
const local = 'https://pre-newweb.educoder.net'
const local = 'https://test-newweb.educoder.net'
if (isDev) {
return `${local}/${path}`
}
@ -12,7 +12,7 @@ export function getImageUrl(path) {
}
export function setImagesUrl(path){
const local = 'https://pre-newweb.educoder.net'
const local = 'https://test-newweb.educoder.net'
let firstStr=path.substr(0,1);
// console.log(firstStr);
if(firstStr=="/"){
@ -31,7 +31,7 @@ export function getUrl(path, goTest) {
// testbdweb.educoder.net testbdweb.trustie.net
// const local = goTest ? 'https://testeduplus2.educoder.net' : 'http://localhost:3000'
// const local = 'https://testeduplus2.educoder.net'
const local = 'https://pre-newweb.educoder.net'
const local = 'https://test-newweb.educoder.net'
if (isDev) {
return `${local}${path?path:''}`
}

@ -93,9 +93,9 @@ class Elearning extends Component{
if(prevProps.yslElearning===this.props.yslElearning) {
if(prevProps.yslElearning===true && this.props.yslElearning===true){
console.log("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
console.log(prevProps.yslElearning);
console.log(this.props.yslElearning);
// console.log("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
// console.log(prevProps.yslElearning);
// console.log(this.props.yslElearning);
this.getdata();
this.props.comyslElearning(false);
}

@ -160,7 +160,54 @@ class YslDetailCards extends Component{
console.log(error);
})
}
};
//章节下移
chapterdown=(id)=>{
let url=`/course_stages/${id}/down_position.json`;
axios.post(url).then((response) => {
if(response){
if(response.data){
if(response.data.status===0){
this.props.showNotification(`下移成功`);
}else{
this.props.showNotification(`下移失败`);
}
}else{
this.props.showNotification(`下移失败`);
}
}else {
this.props.showNotification(`下移失败`);
}
}).catch((error) => {
console.log(error)
});
};
//章节上移
chapterup=(id)=>{
let url=`/course_stages/${id}/up_position.json`;
axios.post(url).then((response) => {
if(response){
if(response.data){
if(response.data.status===0){
this.props.showNotification(`上移成功`);
}else{
this.props.showNotification(`上移失败`);
}
}else{
this.props.showNotification(`上移失败`);
}
}else{
this.props.showNotification(`上移失败`);
}
}).catch((error) => {
console.log(error)
});
};
//取消的
updatapathCardsedit=()=>{
this.setState({
@ -183,16 +230,18 @@ class YslDetailCards extends Component{
//编辑用
pathCardsedit=(key,pathid)=>{
let url=`/stages/`+pathid+`/edit.json`;
let url=`/course_stages/${pathid}/edit.json`;
axios.get(url).then((result)=>{
if(result.status===200){
this.setState({
idsum:key,
pathCardsedittype:true,
pathlistedit:result.data,
editbuttomtype:true,
editbuttomtypeadd:true
})
if(result){
if(result.status===200){
this.setState({
idsum:key,
pathCardsedittype:true,
pathlistedit:result.data,
editbuttomtype:true,
editbuttomtypeadd:true
})
}
}
}).catch((error)=>{
console.log(error);
@ -232,23 +281,33 @@ class YslDetailCards extends Component{
let {delecttype,editdelectid}=this.state;
let id=editdelectid;
if(delecttype===true){
let url ='/stages/'+id+'.json'
let url =`/course_stages/${id}.json`
axios.delete(url).then((response) => {
if(response.data.status===1){
// window.location.href = "/paths/" + response.data.subject_id
this.setState({
idsum:undefined,
pathCardsedittype:false,
Modalstype:false,
Modalstopval:'',
Modalsbottomval:'',
delecttype:false,
editdelectid:undefined
})
// this.getPathCardsList();
this.updatapathCardsedit()
if(response){
if(response.data){
if(response.data.status===0){
this.setState({
idsum:undefined,
pathCardsedittype:false,
Modalstype:false,
Modalstopval:'',
Modalsbottomval:'',
delecttype:false,
editdelectid:undefined
})
this.updatapathCardsedit()
this.props.showNotification(`删除成功`);
}else {
this.props.showNotification(`删除失败`);
}
}else{
this.props.showNotification(`删除失败`);
}
}else {
this.props.showNotification(`删除失败`);
}
}).catch((error) => {
console.log(error)
})
@ -265,7 +324,7 @@ class YslDetailCards extends Component{
// console.log(editbuttomtype);
// console.log("this.props.isAdmin");
// console.log(this.props.isAdmin());
console.log(this.state.delecttype);
// console.log(this.state.delecttype);
return(
<div>
{
@ -354,7 +413,7 @@ class YslDetailCards extends Component{
}
</a>
{
stages.length=== key+1?"":<a className="fr ring-op-green mr20" onClick={()=>this.operations(item.down_path)}>
stages.length=== key+1?"":<a className="fr ring-op-green mr20" onClick={()=>this.chapterdown(item.stage_id)}>
<Tooltip placement="bottom" title="向下移动">
<img src={getImageUrl("images/educoder/icon/movedown.svg")} className="fl mt2 ml4"/>
</Tooltip>
@ -363,7 +422,7 @@ class YslDetailCards extends Component{
{key===0?"":
<a className="fr ring-op-green mr20" onClick={()=>this.operations(item.up_path)}>
<a className="fr ring-op-green mr20" onClick={()=>this.chapterup(item.stage_id)}>
<Tooltip placement="bottom" title="向上移动">
<img src={getImageUrl("images/educoder/icon/moveup.svg")} className="fl mt2 ml4"/>
</Tooltip>
@ -438,6 +497,7 @@ class YslDetailCards extends Component{
updatapathCardsedits={this.updatapathCardsedit}
pathlisteditlist={pathlistedit}
stageid={item.stage_id}
ysldetailcards={"ysldetailcards"}
pathid={pathid}
></DetailCardsEditAndEdit>
</div>
@ -446,7 +506,7 @@ class YslDetailCards extends Component{
}
</div>
}
{ editbuttomtypeadd===true?'':
{ editbuttomtypeadd===true?'':this.props.isAdmin()===true?
<DetailCardsEditAndAdd
{...this.props}
sum={stages && stages.length+1}
@ -454,7 +514,9 @@ class YslDetailCards extends Component{
detailInfoList={this.props.detailInfoList}
getPathCardsLists={this.updatapathCardsedit}
editeditbuttomtypes={this.editeditbuttomtypecanle}
ysldetailcards={"ysldetailcards"}
></DetailCardsEditAndAdd>
:""
}
</div>

@ -94,21 +94,27 @@ class DetailCardsEditAndAdd extends Component{
axios.post(url,{
shixun_id:patheditarry
}).then((response) => {
let newshixun_lists=response.data.shixun_lists;
if(response){
if(response.data){
let newshixun_lists=response.data.shixun_lists;
for(var z=0; z<newshixun_lists.length; z++){
newshixuns_listedit.push(newshixun_lists[z]);
}
for(var i=0; i<newshixun_lists.length; i++){
list.push(newshixun_lists[i].shixun_id);
}
this.setState({
shixuns_listedit:newshixuns_listedit,
shixuns_listeditlist:list,
patheditarry:[],
selectShixun:false,
page:1,
})
}
for(var z=0; z<newshixun_lists.length; z++){
newshixuns_listedit.push(newshixun_lists[z]);
}
for(var i=0; i<newshixun_lists.length; i++){
list.push(newshixun_lists[i].shixun_id);
}
this.setState({
shixuns_listedit:newshixuns_listedit,
shixuns_listeditlist:list,
patheditarry:[],
selectShixun:false,
page:1,
})
}).catch((error) => {
console.log(error)
});
@ -276,7 +282,12 @@ class DetailCardsEditAndAdd extends Component{
let pathId=this.props.pathid;
let url='/stages.json?subject_id='+pathId
let url;
if(this.props.ysldetailcards===undefined){
url='/stages.json?subject_id='+pathId;
}else{
url=`/courses/${pathId}/course_stages.json`;
}
axios.post(url, {
name:stage_names,
description:newstage_descriptions,

@ -236,10 +236,12 @@ class DetailCardsEditAndEdit extends Component{
}else{
newstage_descriptions=""
}
let url='/stages/'+stageid+'.json'
let url;
if(this.props.ysldetailcards===undefined){
url='/stages/'+stageid+'.json';
}else{
url=`/course_stages/${stageid}.json`;
}
axios.put(url, {
name:stage_name,
description:newstage_descriptions,

@ -11,7 +11,7 @@ if(window.wx) {
title: ' title', // 分享标题
desc: 'hello world', // 分享描述
link: 'https://www.educoder.net', // 分享链接该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: 'https://pre-newweb.educoder.net/images/educoder/headNavLogo.png', // 分享图标
imgUrl: 'https://test-newweb.educoder.net/images/educoder/headNavLogo.png', // 分享图标
success: function () {
// 设置成功
}

Loading…
Cancel
Save