configShareForPaths

dev_cs
hjm 6 years ago
parent 8722cbf36d
commit d782e2acde

@ -37,7 +37,7 @@ import {MuiThemeProvider, createMuiTheme} from 'material-ui/styles';
import history from './history'; import history from './history';
import {SnackbarHOC} from 'educoder' import {SnackbarHOC, configShareForIndex} from 'educoder'
import {initAxiosInterceptors} from './AppConfig' import {initAxiosInterceptors} from './AppConfig'
@ -326,22 +326,7 @@ class App extends Component {
}); });
wx.ready(function () { wx.ready(function () {
console.log('wx is ready') console.log('wx is ready')
var shareData = { configShareForIndex()
title: 'EduCoder - 首页',
desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台提供企业级工程实训以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动将传统的知识传授和时兴的工程实战一体化。',
link: currentUrl,
imgUrl: window.__testImageUrl
|| (currentUrl.endsWith('/') ? currentUrl : currentUrl + '/') + 'react/build/images/share_logo_icon.jpg'
};
wx.onMenuShareAppMessage(shareData);//分享给好友
wx.onMenuShareTimeline(shareData);//分享到朋友圈
wx.onMenuShareQQ(shareData);//分享给手机QQ
wx.onMenuShareWeibo(shareData);//分享腾讯微博
wx.onMenuShareQZone(shareData);//分享到QQ空间
}); });
wx.error(function (res) { wx.error(function (res) {
console.log('wx is error') console.log('wx is error')

@ -20,7 +20,7 @@ export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, ap
downloadFile, sortDirections } from './TextUtil' downloadFile, sortDirections } from './TextUtil'
export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil' export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil'
export { configShareForIndex, configShareForPaths, configShareForShixuns, configShareForCourses, configShareForSinglePath, configShareForSingleShixun } from './util/ShareUtil' export { configShareForIndex, configShareForPaths, configShareForShixuns, configShareForCourses, configShareForCustom } from './util/ShareUtil'
export { isDev as isDev, isMobile } from './Env' export { isDev as isDev, isMobile } from './Env'

@ -1,12 +1,17 @@
const host = window.location.host const host = window.location.host
const wx = window.wx const wx = window.wx
function share(shareData) { function share(shareData) {
wx.onMenuShareAppMessage(shareData);//分享给好友 try {
wx.onMenuShareTimeline(shareData);//分享到朋友圈 wx.onMenuShareAppMessage(shareData);//分享给好友
wx.onMenuShareQQ(shareData);//分享给手机QQ wx.onMenuShareTimeline(shareData);//分享到朋友圈
wx.onMenuShareWeibo(shareData);//分享腾讯微博 wx.onMenuShareQQ(shareData);//分享给手机QQ
wx.onMenuShareQZone(shareData);//分享到QQ空间 wx.onMenuShareWeibo(shareData);//分享腾讯微博
wx.onMenuShareQZone(shareData);//分享到QQ空间
} catch(e) {
console.log(e)
}
} }
/** /**
实践课程 平台提供涵盖基础入门案例实践和创新应用的完整实训项目体系通过由浅入深的实训路径帮助学生快速提升实战能力 实践课程 平台提供涵盖基础入门案例实践和创新应用的完整实训项目体系通过由浅入深的实训路径帮助学生快速提升实战能力
实训项目 覆盖不同专业的IT实验和实训每周更新无需配置本机实验环境随时随地开启企业级真实实训 实训项目 覆盖不同专业的IT实验和实训每周更新无需配置本机实验环境随时随地开启企业级真实实训
@ -15,6 +20,7 @@ function share(shareData) {
*/ */
export function configShareForIndex () { export function configShareForIndex () {
if (!wx) return;
var shareData = { var shareData = {
title: 'EduCoder - 首页', title: 'EduCoder - 首页',
desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台提供企业级工程实训以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动将传统的知识传授和时兴的工程实战一体化。', desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台提供企业级工程实训以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动将传统的知识传授和时兴的工程实战一体化。',
@ -25,6 +31,7 @@ export function configShareForIndex () {
share(shareData) share(shareData)
} }
export function configShareForPaths () { export function configShareForPaths () {
if (!wx) return;
var shareData = { var shareData = {
title: 'EduCoder - 实践课程', title: 'EduCoder - 实践课程',
desc: '平台提供涵盖基础入门、案例实践和创新应用的完整实训项目体系,通过由浅入深的实训路径,帮助学生快速提升实战能力。', desc: '平台提供涵盖基础入门、案例实践和创新应用的完整实训项目体系,通过由浅入深的实训路径,帮助学生快速提升实战能力。',
@ -35,6 +42,7 @@ export function configShareForPaths () {
share(shareData) share(shareData)
} }
export function configShareForShixuns () { export function configShareForShixuns () {
if (!wx) return;
var shareData = { var shareData = {
title: 'EduCoder - 实训项目', title: 'EduCoder - 实训项目',
desc: '覆盖不同专业的IT实验和实训每周更新无需配置本机实验环境随时随地开启企业级真实实训。', desc: '覆盖不同专业的IT实验和实训每周更新无需配置本机实验环境随时随地开启企业级真实实训。',
@ -45,6 +53,7 @@ export function configShareForShixuns () {
share(shareData) share(shareData)
} }
export function configShareForCourses () { export function configShareForCourses () {
if (!wx) return;
var shareData = { var shareData = {
title: 'EduCoder - 翻转课堂', title: 'EduCoder - 翻转课堂',
desc: '自动评测实训任务,支持技能统计,提供教学活动分析报告,减轻教师和助教的辅导压力,免去作业发布和批改的困扰,实时了解学生学习情况,全面提升教师施教效率和水平。', desc: '自动评测实训任务,支持技能统计,提供教学活动分析报告,减轻教师和助教的辅导压力,免去作业发布和批改的困扰,实时了解学生学习情况,全面提升教师施教效率和水平。',
@ -56,7 +65,8 @@ export function configShareForCourses () {
} }
// detail // detail
export function configShareForSinglePath (title, desc, path, imgUrl) { export function configShareForCustom (title, desc, path, imgUrl) {
if (!wx) return;
var shareData = { var shareData = {
title: title, title: title,
desc: desc, desc: desc,
@ -66,14 +76,3 @@ export function configShareForSinglePath (title, desc, path, imgUrl) {
}; };
share(shareData) share(shareData)
} }
export function configShareForSingleShixun (title, desc, path, imgUrl) {
var shareData = {
title: title,
desc: desc,
link: `${host}/${path}`,
imgUrl: imgUrl || window.__testImageUrl
|| host + '/react/build/images/share_logo_icon.jpg'
};
share(shareData)
}

@ -12,7 +12,7 @@ import SiderBar from '../tpm/SiderBar';
import UpgradeModals from '../modals/UpgradeModals'; import UpgradeModals from '../modals/UpgradeModals';
import { SnackbarHOC , getImageUrl} from 'educoder'; import { SnackbarHOC , getImageUrl, configShareForIndex} from 'educoder';
import Slider from '@icedesign/base/lib/slider'; import Slider from '@icedesign/base/lib/slider';
@ -37,6 +37,7 @@ class ShixunsHome extends Component {
} }
} }
componentDidMount(){ componentDidMount(){
configShareForIndex()
const upsystem=`/users/system_update.json`; const upsystem=`/users/system_update.json`;
axios.get(upsystem).then((response)=>{ axios.get(upsystem).then((response)=>{
let updata=response.data; let updata=response.data;

@ -1,12 +1,16 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import PathSearch from './ShixunPathSearch.js'; import PathSearch from './ShixunPathSearch.js';
import { configShareForPaths } from 'educoder'
class ShixunPath extends Component{ class ShixunPath extends Component{
constructor(props) { constructor(props) {
super(props) super(props)
} }
componentDidMount() {
configShareForPaths()
}
render(){ render(){
return( return(
<div> <div>

Loading…
Cancel
Save