Commit e2c7aa96 by yanglang123

页面修改

parent 1d552aef
...@@ -23,7 +23,7 @@ app.get("*", function(req, res) { ...@@ -23,7 +23,7 @@ app.get("*", function(req, res) {
res.sendFile(path.join(rootPath, "dist/index.html")); res.sendFile(path.join(rootPath, "dist/index.html"));
}); });
app.listen(3003, function(err) { app.listen(8003, function(err) {
if (err) { if (err) {
return console.error(err); return console.error(err);
} }
......
...@@ -62,31 +62,6 @@ function getUserInfo(){ ...@@ -62,31 +62,6 @@ function getUserInfo(){
}); });
} }
function getConfig(){
$.ajax({
type: "get",
url: "https://wechat.kmelearning.com/web-student/public/wechat/get/signature",
async: true,
dataType:"json",
data: {
"url":location.href.split('#')[0],
"appid": corpId,
"agentId": agentId
},
success: function(data) {
produceSign1(data.data);
},
error:function(data){
console.log("TokenError:"+JSON.stringify(data));
}
});
}
function getQueryString(name) { function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg); var r = window.location.search.substr(1).match(reg);
......
...@@ -63,30 +63,6 @@ function getUserInfo(){ ...@@ -63,30 +63,6 @@ function getUserInfo(){
} }
function getConfig(){
$.ajax({
type: "get",
url: "https://wechat.kmelearning.com/web-student/public/wechat/get/signature",
async: true,
dataType:"json",
data: {
"url":location.href.split('#')[0],
"appid": corpId,
"agentId": agentId
},
success: function(data) {
produceSign1(data.data);
},
error:function(data){
console.log("TokenError:"+JSON.stringify(data));
}
});
}
function getQueryString(name) { function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg); var r = window.location.search.substr(1).match(reg);
......
...@@ -30,6 +30,8 @@ import $ from "jquery"; ...@@ -30,6 +30,8 @@ import $ from "jquery";
import zan from "../../../image/zan.png"; import zan from "../../../image/zan.png";
import alreadyzan from "../../../image/alreadyzan.png"; import alreadyzan from "../../../image/alreadyzan.png";
import myIcon from "../../../image/my.png"; import myIcon from "../../../image/my.png";
import ellipse from "./Ellipse-icon.png";
import ellipseJf from "./Ellipse-jf.png";
import ReactPlayer from "react-player"; import ReactPlayer from "react-player";
const TabPane = Tabs.TabPane; const TabPane = Tabs.TabPane;
...@@ -68,8 +70,10 @@ class TrainingSteps extends Component { ...@@ -68,8 +70,10 @@ class TrainingSteps extends Component {
showContentOccupy: false, showContentOccupy: false,
isNative: false, isNative: false,
enablePosition: 0, enablePosition: 0,
baomingModal: false,
refreshTrainComment: "", refreshTrainComment: "",
activityStateCode: "", //0待开始;1待报名;2待签到;3正在报名;4正在签到;5进行中;6已结束;7未报名;8未签到 activityStateCode: "", //0待开始;1待报名;2待签到;3立即报名;4立即签到;5进行中;6已结束;7未报名;8未签到
activityStateName: "",
signTimeId: "", //签到 signTimeId: "", //签到
signType: "", //签到 signType: "", //签到
}; };
...@@ -99,9 +103,11 @@ class TrainingSteps extends Component { ...@@ -99,9 +103,11 @@ class TrainingSteps extends Component {
this.props.trainStepsData(finished, params, () => { this.props.trainStepsData(finished, params, () => {
let { introductionVo } = _this.props.TrainingStepsReducer; let { introductionVo } = _this.props.TrainingStepsReducer;
let { activityStateCode,signTimeId,signType } = introductionVo; let { activityStateCode, activityStateName, signTimeId, signType } =
introductionVo;
_this.setState({ _this.setState({
activityStateCode: activityStateCode, activityStateCode: activityStateCode,
activityStateName: activityStateName,
signTimeId: signTimeId, signTimeId: signTimeId,
signType: signType, signType: signType,
}); });
...@@ -241,7 +247,7 @@ class TrainingSteps extends Component { ...@@ -241,7 +247,7 @@ class TrainingSteps extends Component {
} }
}; };
renderContent = () => { renderContent = (code) => {
let { let {
introductionVo = {}, introductionVo = {},
hasEnrolled, hasEnrolled,
...@@ -268,23 +274,25 @@ class TrainingSteps extends Component { ...@@ -268,23 +274,25 @@ class TrainingSteps extends Component {
return ( return (
<div style={{ backgroundColor: "#F4F4F4" }}> <div style={{ backgroundColor: "#F4F4F4" }}>
{this.renderIntroduction(introductionVo)} {this.renderIntroduction(introductionVo)}
{this.renderComment(reviewListData, loadMore)}
{code != "4" ? this.renderComment(reviewListData, loadMore) : ""}
</div> </div>
); );
}; };
render() { render() {
let { introductionVo = {} } = this.props.TrainingStepsReducer; let { introductionVo = {} } = this.props.TrainingStepsReducer;
let { activityStateCode, signTimeId, signType } = this.state; let { activityStateCode, activityStateName, signTimeId, signType } =
this.state;
let signUpTitle = let signUpTitle =
activityStateCode == "1" activityStateCode == "1"
? "待报名" ? "待报名"
: activityStateCode == "2" : activityStateCode == "2"
? "待签到" ? "待签到"
: activityStateCode == "3" : activityStateCode == "3"
? "正在报名" ? "立即报名"
: activityStateCode == "4" : activityStateCode == "4"
? "正在签到" ? "立即签到"
: "进行中"; : "进行中";
let signUpColor = "#999999"; let signUpColor = "#999999";
let signedColor = "#d23a29"; let signedColor = "#d23a29";
...@@ -309,15 +317,15 @@ class TrainingSteps extends Component { ...@@ -309,15 +317,15 @@ class TrainingSteps extends Component {
{activityStateCode == 1 ? ( {activityStateCode == 1 ? (
<div className="overed">待报名</div> <div className="overed">待报名</div>
) : activityStateCode == 2 ? ( ) : activityStateCode == 2 ? (
<div className="overed">待签到</div> <div className="enrolled">已报名</div>
) : activityStateCode == 3 ? ( ) : activityStateCode == 3 ? (
<div className="enroll">正在报名</div> <div className="enroll">报名</div>
) : activityStateCode == 4 ? ( ) : activityStateCode == 4 ? (
<div className="enrolled">已报名</div> <div className="enrolled">已报名</div>
) : activityStateCode == 5 ? ( ) : activityStateCode == 5 ? (
<div className="enrolled">进行中</div> <div className="enrolled">进行中</div>
) : activityStateCode == 6 ? ( ) : activityStateCode == 6 ? (
<div className="overed">结束</div> <div className="overed">活动结束</div>
) : activityStateCode == 7 ? ( ) : activityStateCode == 7 ? (
<div className="overed">未报名</div> <div className="overed">未报名</div>
) : activityStateCode == 8 ? ( ) : activityStateCode == 8 ? (
...@@ -328,9 +336,11 @@ class TrainingSteps extends Component { ...@@ -328,9 +336,11 @@ class TrainingSteps extends Component {
</div> </div>
</div> </div>
<div style={{ width: "100%", marginTop: 0 }}> <div style={{ width: "100%", marginTop: 0 }}>
<StickyContainer>{this.renderContent()}</StickyContainer> <StickyContainer>
{this.renderContent(activityStateCode)}
</StickyContainer>
</div> </div>
{ {activityStateCode != "5" && activityStateCode != "6" ? (
<Fragment> <Fragment>
<div style={{ width: "100%", height: 88 }}></div> <div style={{ width: "100%", height: 88 }}></div>
<div <div
...@@ -348,8 +358,30 @@ class TrainingSteps extends Component { ...@@ -348,8 +358,30 @@ class TrainingSteps extends Component {
> >
{signUpTitle} {signUpTitle}
</div> </div>
<Modal
title="报名成功"
visible={this.state.baomingModal}
transparent
maskClosable={false}
className={"signup-modal"}
onClose={this.baomingHidden}
footer={[
{
text: "确定",
onPress: () => {
this.baomingHidden();
},
},
]}
>
<div className="modal-body">
报名成功后,待活动开始,您要在活动现场扫码签到哦
</div>
</Modal>
</Fragment> </Fragment>
} ) : (
""
)}
</div> </div>
); );
} }
...@@ -399,10 +431,15 @@ class TrainingSteps extends Component { ...@@ -399,10 +431,15 @@ class TrainingSteps extends Component {
intl.get("To") || "至" intl.get("To") || "至"
} ${introEndTime && introEndTime}`} } ${introEndTime && introEndTime}`}
</p> </p>
{introductionVo.organizer ? (
<p> <p>
<span>组织方</span> <span>组织方</span> :
{introductionVo && introductionVo.organizer} {introductionVo && introductionVo.organizer}
</p> </p>
) : (
""
)}
<p> <p>
<span>活动地点</span> <span>活动地点</span>
{introductionVo && introductionVo.activityAddress} {introductionVo && introductionVo.activityAddress}
...@@ -439,11 +476,13 @@ class TrainingSteps extends Component { ...@@ -439,11 +476,13 @@ class TrainingSteps extends Component {
活动介绍 活动介绍
</p> </p>
{introductionVo.videoUrl ? (
<div <div
style={{ style={{
width: "100%", width: "100%",
height: "350px", height: "350px",
paddingLeft: "40px", paddingLeft: "40px",
paddingRight: "40px",
}} }}
> >
<ReactPlayer <ReactPlayer
...@@ -454,6 +493,27 @@ class TrainingSteps extends Component { ...@@ -454,6 +493,27 @@ class TrainingSteps extends Component {
height="100%" height="100%"
/> />
</div> </div>
) : (
introductionVo.detailsImage.map((item) => {
return (
<div
style={{
width: "100%",
height: "280px",
paddingLeft: "40px",
paddingRight: "40px",
}}
>
<img
style={{ width: "100%", height: "280px" }}
src={item.img}
alt=""
/>
</div>
);
})
)}
<div className="train-info"> <div className="train-info">
<div> <div>
<List className="train-info-contain"> <List className="train-info-contain">
...@@ -467,6 +527,7 @@ class TrainingSteps extends Component { ...@@ -467,6 +527,7 @@ class TrainingSteps extends Component {
</div> </div>
</div> </div>
</div> </div>
{introductionVo.researchName ? (
<div style={{ marginBottom: "20px" }}> <div style={{ marginBottom: "20px" }}>
<p <p
style={{ style={{
...@@ -486,9 +547,14 @@ class TrainingSteps extends Component { ...@@ -486,9 +547,14 @@ class TrainingSteps extends Component {
}} }}
onClick={() => this.toSurvey(introductionVo.researchId)} onClick={() => this.toSurvey(introductionVo.researchId)}
> >
<img className="tp-icon" src={ellipse} alt="" />
{introductionVo.researchName} {introductionVo.researchName}
</div> </div>
</div> </div>
) : (
<div></div>
)}
{introductionVo.point > 0 ? ( {introductionVo.point > 0 ? (
<div> <div>
<p <p
...@@ -506,6 +572,7 @@ class TrainingSteps extends Component { ...@@ -506,6 +572,7 @@ class TrainingSteps extends Component {
paddingLeft: "40px", paddingLeft: "40px",
}} }}
> >
<img className="tp-icon1" src={ellipseJf} alt="" />
参与活动获得{introductionVo.point}积分 参与活动获得{introductionVo.point}积分
</div> </div>
</div> </div>
...@@ -695,6 +762,11 @@ class TrainingSteps extends Component { ...@@ -695,6 +762,11 @@ class TrainingSteps extends Component {
commitContent: "", commitContent: "",
}); });
}; };
baomingHidden = () => {
this.setState({
baomingModal: false,
});
};
handleCancel = () => { handleCancel = () => {
this.setState({ this.setState({
visible: false, visible: false,
...@@ -702,16 +774,19 @@ class TrainingSteps extends Component { ...@@ -702,16 +774,19 @@ class TrainingSteps extends Component {
}; };
//确认报名 //确认报名
handleOk = (code, signTimeId, signType) => { handleOk = (code, signTimeId, signType) => {
console.log(code, signTimeId, signType, "111111111111111111");
let { id, finished } = this.props.location.query; let { id, finished } = this.props.location.query;
if (code == "4") { if (code == "4") {
let _this = this;
let params = { let params = {
trainingProjectId: id, trainingProjectId: id,
signTimeId: signTimeId, signTimeId: signTimeId,
signType: signType, signType: signType,
}; };
let params1 = {
id: id,
};
this.props.sign(params, () => { this.props.sign(params, () => {
_this.props.trainStepsData(finished, params, () => { _this.props.trainStepsData(finished, params1, () => {
let { introductionVo } = _this.props.TrainingStepsReducer; let { introductionVo } = _this.props.TrainingStepsReducer;
let { activityStateCode } = introductionVo; let { activityStateCode } = introductionVo;
_this.setState({ _this.setState({
...@@ -730,6 +805,7 @@ class TrainingSteps extends Component { ...@@ -730,6 +805,7 @@ class TrainingSteps extends Component {
let { activityStateCode } = introductionVo; let { activityStateCode } = introductionVo;
_this.setState({ _this.setState({
activityStateCode: activityStateCode, activityStateCode: activityStateCode,
baomingModal: true,
}); });
}); });
}); });
......
...@@ -178,10 +178,8 @@ export const lessonEnrollEvent = (params, callBack) => { ...@@ -178,10 +178,8 @@ export const lessonEnrollEvent = (params, callBack) => {
NetWork.post(API.courseSignUp, params, (response) => { NetWork.post(API.courseSignUp, params, (response) => {
try { try {
if (Number.parseInt(response.code) === 1000) { if (Number.parseInt(response.code) === 1000) {
Toast.info(intl.get("PublishKey70") || "报名成功");
callBack && callBack(); callBack && callBack();
} else { } else {
Toast.info(intl.get("PublishKey70") || "报名成功");
} }
} catch (e) { } catch (e) {
console.log(e); console.log(e);
...@@ -192,12 +190,17 @@ export const lessonEnrollEvent = (params, callBack) => { ...@@ -192,12 +190,17 @@ export const lessonEnrollEvent = (params, callBack) => {
//签到 //签到
export function sign(params, callBack) { export function sign(params, callBack) {
return (dispatch) => { return (dispatch) => {
return excute.post(API.signIn, params, (res) => { NetWork.post(API.signIn, params, (response) => {
callBack(res); try {
dispatch({ if (Number.parseInt(response.code) === 1000) {
type: SIGN_ACTION, Toast.info("签到成功");
data: res, callBack && callBack();
}); } else {
Toast.info("签到成功");
}
} catch (e) {
console.log(e);
}
}); });
}; };
} }
...@@ -296,4 +299,3 @@ export const trainCertificateGet = (data, callback) => { ...@@ -296,4 +299,3 @@ export const trainCertificateGet = (data, callback) => {
}); });
}; };
}; };
...@@ -10,6 +10,16 @@ ...@@ -10,6 +10,16 @@
width: 40px; width: 40px;
height: 40px; height: 40px;
} }
.train-info-view .tp-icon {
width: 24px !important;
height: 24px;
margin-right: 15px;
}
.train-info-view .tp-icon1 {
width: 20px !important;
height: 20px;
margin-right: 15px;
}
.BraftEditor-content { .BraftEditor-content {
font-size: 0.25rem; font-size: 0.25rem;
} }
...@@ -436,21 +446,21 @@ ...@@ -436,21 +446,21 @@
background-color: #53af5c; background-color: #53af5c;
color: #fff; color: #fff;
text-align: center; text-align: center;
padding: 5px 8px; padding: 8px 10px;
} }
.train-info .enrolled { .train-info .enrolled {
width: 120px; width: 120px;
background-color: #ffba19; background-color: #ffba19;
color: #fff; color: #fff;
text-align: center; text-align: center;
padding: 5px 8px; padding: 8px 10px;
} }
.train-info .overed { .train-info .overed {
width: 100px; width: 120px;
background-color: #e5e6e8; background-color: #e5e6e8;
color: #a1a1a1; color: #a1a1a1;
text-align: center; text-align: center;
padding: 5px 8px; padding: 8px 10px;
} }
.train-info p { .train-info p {
color: #fff; color: #fff;
...@@ -698,6 +708,26 @@ ...@@ -698,6 +708,26 @@
color: white; color: white;
text-align: center; text-align: center;
} }
.signup-modal .am-modal-content {
background: linear-gradient(180deg, #ffe2e2 0%, #fff 25%);
}
.signup-modal .am-modal-title {
color: #16181a;
font-weight: 600;
}
.signup-modal .modal-body {
text-align: left;
margin: 28px 0;
}
.signup-modal .am-modal-button {
width: 45% !important;
height: 80px !important;
line-height: 80px !important;
margin: 0 auto;
color: #fff !important;
margin-bottom: 25px;
background: linear-gradient(270deg, #eb6c53, #d23a29);
}
.train-pay-button-container { .train-pay-button-container {
width: 100%; width: 100%;
height: 128px; height: 128px;
......
...@@ -7,7 +7,18 @@ ...@@ -7,7 +7,18 @@
height: 40px; height: 40px;
//margin-right: 16px; //margin-right: 16px;
} }
.train-info-view {
.tp-icon {
width: 24px !important;
height: 24px;
margin-right: 15px;
}
.tp-icon1 {
width: 20px !important;
height: 20px;
margin-right: 15px;
}
}
.color-4a() { .color-4a() {
color: #4a4a4a; color: #4a4a4a;
} }
...@@ -591,21 +602,21 @@ ...@@ -591,21 +602,21 @@
background-color: #53af5c; background-color: #53af5c;
color: #fff; color: #fff;
text-align: center; text-align: center;
padding: 5px 8px; padding: 8px 10px;
} }
.enrolled { .enrolled {
width: 120px; width: 120px;
background-color: #ffba19; background-color: #ffba19;
color: #fff; color: #fff;
text-align: center; text-align: center;
padding: 5px 8px; padding: 8px 10px;
} }
.overed { .overed {
width: 100px; width: 120px;
background-color: #e5e6e8; background-color: #e5e6e8;
color: #a1a1a1; color: #a1a1a1;
text-align: center; text-align: center;
padding: 5px 8px; padding: 8px 10px;
} }
p { p {
color: #fff; color: #fff;
...@@ -885,7 +896,28 @@ ...@@ -885,7 +896,28 @@
color: white; color: white;
text-align: center; text-align: center;
} }
.signup-modal {
.am-modal-content{
background: linear-gradient(180deg,#ffe2e2 0%,#fff 25%);
}
.am-modal-title {
color: #16181a;
font-weight: 600;
}
.modal-body {
text-align: left;
margin: 28px 0;
}
.am-modal-button{
width: 45% !important;
height: 80px !important;
line-height: 80px !important;
margin: 0 auto;
color: #fff !important;
margin-bottom: 25px;
background:linear-gradient(270deg,#eb6c53, #d23a29);
}
}
.train-pay-button-container { .train-pay-button-container {
width: 100%; width: 100%;
height: 128px; height: 128px;
......
//轮播图 //轮播图
import React, { Component } from 'react'; import React, { Component } from "react";
import { Carousel } from 'antd-mobile'; import { Carousel } from "antd-mobile";
import fnNavigate from '../../util/navDirector'; import fnNavigate from "../../util/navDirector";
import "./less/carousel.less"; import "./less/carousel.less";
export default class carousel extends Component { export default class carousel extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state ={ this.state = {
imageIndex:0 imageIndex: 0,
} };
} }
autoSlideListen = (index)=>{ autoSlideListen = (index) => {
this.setState({ this.setState({
imageIndex:index imageIndex: index,
}) });
} };
imageClick(item) { imageClick(item) {
console.log(item); console.log(item);
fnNavigate(item, 'banner'); fnNavigate(item, "banner");
} }
render() { render() {
let { data, carouselparam, frameOverflow } = this.props; let { data, carouselparam } = this.props;
const {imageIndex} = this.state; if (data.length == 1) {
let carouselItemWidth = document.body.clientWidth - 60;
if (data.length == 1 ) {
return ( return (
<div style={{width:"100%",padding:"0 30px"}}> <div style={{ width: "100%", padding: "0 30px" }}>
<a key={data[0].id} <a
style={{ display: 'inline-block', width: '100%',padding:0 }} key={data[0].id}
style={{ display: "inline-block", width: "100%", padding: 0 }}
onClick={() => this.imageClick(data[0])} onClick={() => this.imageClick(data[0])}
className={this.props.isIndex ? "carousel-container" : ''} className={this.props.isIndex ? "carousel-container" : ""}
> >
<img <img
style={{ style={{
...@@ -48,7 +44,7 @@ export default class carousel extends Component { ...@@ -48,7 +44,7 @@ export default class carousel extends Component {
alt="icon" alt="icon"
onLoad={() => { onLoad={() => {
// fire window resize event to change height // fire window resize event to change height
window.dispatchEvent(new Event('resize')); window.dispatchEvent(new Event("resize"));
this.setState({ this.setState({
initialHeight: null, initialHeight: null,
}); });
...@@ -56,33 +52,36 @@ export default class carousel extends Component { ...@@ -56,33 +52,36 @@ export default class carousel extends Component {
/> />
</a> </a>
</div> </div>
); );
} else { } else {
return ( return (
<div className={this.props.isIndex ? "carousel-index-container" : ''} style={{ width: "100%" }}> <div
className={this.props.isIndex ? "carousel-index-container" : ""}
style={{ width: "100%" }}
>
<Carousel <Carousel
className="my-index-carousel" className="my-index-carousel"
autoplay={true} autoplay={true}
infinite={true} infinite={true}
dots={true} dots={false}
swipeSpeed={35} swipeSpeed={35}
afterChange={this.autoSlideListen } afterChange={this.autoSlideListen}
> >
{data.map((item, index) => ( {data.map((item, index) => (
<a key={index} <a
key={index}
style={{ style={{
display: 'block', display: "block",
height: carouselparam.height, height: carouselparam.height + 80,
borderRadius: carouselparam.radius, borderRadius: carouselparam.radius,
overflow: "hidden", overflow: "hidden",
position:"relative" position: "relative",
}} }}
onClick={() => this.imageClick(item)} onClick={() => this.imageClick(item)}
> >
<img <img
style={{ style={{
height: carouselparam.height, height: carouselparam.height + 80,
borderRadius: carouselparam.radius, borderRadius: carouselparam.radius,
width: "100%", width: "100%",
}} }}
...@@ -90,19 +89,32 @@ export default class carousel extends Component { ...@@ -90,19 +89,32 @@ export default class carousel extends Component {
alt="icon" alt="icon"
onLoad={() => { onLoad={() => {
// fire window resize event to change height // fire window resize event to change height
window.dispatchEvent(new Event('resize')); window.dispatchEvent(new Event("resize"));
this.setState({ this.setState({
initialHeight: null, initialHeight: null,
}); });
}} }}
/> />
<div
style={{
width: "100%",
textAlign: "center",
color: "#fff",
fontSize: "26px",
position: "absolute",
bottom: "20px",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
overflow: "hidden",
}}
>
{item.imgTitle}
</div>
</a> </a>
))} ))}
</Carousel> </Carousel>
</div> </div>
); );
} }
} }
} }
...@@ -5,7 +5,6 @@ import { ...@@ -5,7 +5,6 @@ import {
getHomeShowConfig, getHomeShowConfig,
getHomeTemplateConfig, getHomeTemplateConfig,
getModubleById, getModubleById,
getVisitCount,
getReportHome, getReportHome,
getTaskModuleState, getTaskModuleState,
getCalendarList, getCalendarList,
...@@ -199,7 +198,7 @@ function mapDispatchToProps(dispatch) { ...@@ -199,7 +198,7 @@ function mapDispatchToProps(dispatch) {
// getHomeTemplateConfig: (data, callback) => dispatch(getHomeTemplateConfig(data, callback)), // getHomeTemplateConfig: (data, callback) => dispatch(getHomeTemplateConfig(data, callback)),
// getModubleById: (data, callback) => dispatch(getModubleById(data, callback)), // getModubleById: (data, callback) => dispatch(getModubleById(data, callback)),
// getVisitCount: (callback) => dispatch(getVisitCount(callback)),
// getReportHome: (data, callback) => dispatch(getReportHome(data, callback)), // getReportHome: (data, callback) => dispatch(getReportHome(data, callback)),
getTaskModuleState: (callback) => dispatch(getTaskModuleState(callback)), getTaskModuleState: (callback) => dispatch(getTaskModuleState(callback)),
getCalendarList: (data, callback) => getCalendarList: (data, callback) =>
......
...@@ -3,11 +3,11 @@ import { Rate, Icon } from "antd"; ...@@ -3,11 +3,11 @@ import { Rate, Icon } from "antd";
import { SearchBar, WhiteSpace, Toast } from "antd-mobile"; import { SearchBar, WhiteSpace, Toast } from "antd-mobile";
import { hashHistory } from "react-router"; import { hashHistory } from "react-router";
import { connect } from "react-redux"; import { connect } from "react-redux";
import moment from "moment";
import { import {
getHomeShowConfig, getHomeShowConfig,
getHomeTemplateConfig, getHomeTemplateConfig,
getModubleById, getModubleById,
getVisitCount,
getReportHome, getReportHome,
getCalendarList, getCalendarList,
getAssToken, getAssToken,
...@@ -19,7 +19,6 @@ import Mycarousel from "../common/carousel"; ...@@ -19,7 +19,6 @@ import Mycarousel from "../common/carousel";
//我是有底线的 //我是有底线的
import Footline from "../../common/footer/footer"; import Footline from "../../common/footer/footer";
import NoticeBlock from "../../common/noticeblock/index"; import NoticeBlock from "../../common/noticeblock/index";
import VisitCount from "./visitCount";
//平台报告浮窗 //平台报告浮窗
import func from "../../util/commonFunc"; import func from "../../util/commonFunc";
...@@ -57,7 +56,7 @@ function mapDispatchToProps(dispatch) { ...@@ -57,7 +56,7 @@ function mapDispatchToProps(dispatch) {
getModubleById: (data, callback) => getModubleById: (data, callback) =>
dispatch(getModubleById(data, callback)), dispatch(getModubleById(data, callback)),
getVisitCount: (callback) => dispatch(getVisitCount(callback)),
getReportHome: (data, callback) => dispatch(getReportHome(data, callback)), getReportHome: (data, callback) => dispatch(getReportHome(data, callback)),
getCalendarList: (data, callback) => getCalendarList: (data, callback) =>
dispatch(getCalendarList(data, callback)), dispatch(getCalendarList(data, callback)),
...@@ -349,7 +348,7 @@ class Menulearn extends React.Component { ...@@ -349,7 +348,7 @@ class Menulearn extends React.Component {
{/* 轮播图 */} {/* 轮播图 */}
<div className="carouseldiv"> <div className="carouseldiv">
<div style={{ height: bannerHeight, position: "relative" }}> <div style={{ height: bannerHeight + 80, position: "relative" }}>
{carouselData && carouselData.length > 0 ? ( {carouselData && carouselData.length > 0 ? (
<Mycarousel <Mycarousel
carouselparam={carouselparam} carouselparam={carouselparam}
...@@ -364,7 +363,6 @@ class Menulearn extends React.Component { ...@@ -364,7 +363,6 @@ class Menulearn extends React.Component {
/> />
)} )}
</div> </div>
<VisitCount getVisitCount={this.props.getVisitCount} />
</div> </div>
{/* 选项卡 */} {/* 选项卡 */}
...@@ -386,7 +384,7 @@ class Menulearn extends React.Component { ...@@ -386,7 +384,7 @@ class Menulearn extends React.Component {
display: "inline-block", display: "inline-block",
width: "9px", width: "9px",
height: "34px", height: "34px",
background: 'linear-gradient(180deg,#fe742b, #fc5b2b 100%)', background: "linear-gradient(180deg,#fe742b, #fc5b2b 100%)",
marginLeft: "4%", marginLeft: "4%",
marginRight: "1%", marginRight: "1%",
}} }}
...@@ -418,8 +416,6 @@ class Menulearn extends React.Component { ...@@ -418,8 +416,6 @@ class Menulearn extends React.Component {
<IndexModuleContainer /> <IndexModuleContainer />
{/* 底部 */} {/* 底部 */}
{this.state.showFooter && false ? ( {this.state.showFooter && false ? (
<Footline <Footline
...@@ -458,6 +454,7 @@ const NewsItemList = ({ list, onClick }) => { ...@@ -458,6 +454,7 @@ const NewsItemList = ({ list, onClick }) => {
image: item.logoPath || newsDefaultImage, image: item.logoPath || newsDefaultImage,
number: item.number, number: item.number,
releaseTime: item.releaseTime, releaseTime: item.releaseTime,
author: item.author,
}; };
if (index < list.length - 1) { if (index < list.length - 1) {
return ( return (
...@@ -503,20 +500,11 @@ const IndexNewsItem = ({ data, onClick }) => { ...@@ -503,20 +500,11 @@ const IndexNewsItem = ({ data, onClick }) => {
> >
<div className="index-module-news-item-info-name">{data.name}</div> <div className="index-module-news-item-info-name">{data.name}</div>
<div className="index-module-news-item-info-text"> <div className="index-module-news-item-info-text">
<img <span style={{marginRight:'20px'}}>{data.author}</span>
src={newsClockIcon} {moment(data.releaseTime).format("YYYY-MM-DD")}
alt=""
className="index-module-news-item-info-icon"
/>
{func.dateFormat(data.releaseTime, false, true)}
<Icon
type="eye"
style={{ fontSize: 24, marginRight: 10, marginLeft: 60 }}
/>
{data.number}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
); );
}; };
\ No newline at end of file
import React, {Component} from "react";
import "./style.less";
import intl from "react-intl-universal";
class VisitCount extends Component {
constructor(props) {
super(props);
this.state = {
visitCount: 0
};
this.visitCountTimer = null;
this.refreshVisitCountByTime = this.refreshVisitCountByTime.bind(this);
}
componentDidMount() {
const {getVisitCount} = this.props;
let _this = this;
getVisitCount((visitCount) => {
_this.setState({
visitCount
});
});
}
refreshVisitCountByTime() {
const {getVisitCount} = this.props;
let _this = this;
this.visitCountTimer = setInterval(() => {
getVisitCount((visitCount) => {
_this.setState({
visitCount
});
if (visitCount <= 0) {
clearInterval(_this.visitCountTimer);
}
});
}, 3 * 60 * 1000);
}
render() {
if (this.state.visitCount > 0) {
return <div className="visit-people-count">
{intl.get("Visits")}{this.state.visitCount}
</div>;
} else {
return <div style={{display: "none"}}></div>;
}
}
}
export default VisitCount;
\ No newline at end of file
.visit-people-count{
position: absolute;
height: 42px;
line-height: 42px;
font-size: 24px;
color: #fff;
left: 30px;
top: 44px;
background-color: rgba(0,0,0,0.5);
padding: 0 12px;
border-radius: 5px;
}
\ No newline at end of file
...@@ -30,7 +30,6 @@ class MenuTrain extends Component { ...@@ -30,7 +30,6 @@ class MenuTrain extends Component {
inHeight: document.documentElement.clientHeight, inHeight: document.documentElement.clientHeight,
isLoading: false, isLoading: false,
trainDataList: [], trainDataList: [],
trainDataList: [],
carouselParam: { carouselParam: {
height: carouselHeight, height: carouselHeight,
radius: "0.1rem", radius: "0.1rem",
......
...@@ -55,7 +55,9 @@ function itemList(item) { ...@@ -55,7 +55,9 @@ function itemList(item) {
id: item.id, id: item.id,
finished: item.finished, finished: item.finished,
activitieNum: item.activitieNum, activitieNum: item.activitieNum,
activityName: item.activityName,
activityStateCode:item.activityStateCode, activityStateCode:item.activityStateCode,
activityStateName:item.activityStateName,
period: item.period, period: item.period,
trainingDurationShow: item.trainingDurationShow, trainingDurationShow: item.trainingDurationShow,
enablePay: item.enablePay enablePay: item.enablePay
......
...@@ -63,26 +63,12 @@ const TrainItem = ({ data, onClick }) => { ...@@ -63,26 +63,12 @@ const TrainItem = ({ data, onClick }) => {
<div className="train-index-list-item-container" onClick={onClick}> <div className="train-index-list-item-container" onClick={onClick}>
<img src={data.image} alt="" className="train-index-list-item-image" /> <img src={data.image} alt="" className="train-index-list-item-image" />
<div style={{ display: "flex", alignItems: "end" }}> <div style={{ display: "flex", alignItems: "end" }}>
<div className="train-index-list-item-info"> <div className="train-index-list-item-info" style={{display:'flex',flexDirection:'column',justifyContent:'space-between'}}>
<div className="train-index-list-item-info-name">{data.text}</div> <div className="train-index-list-item-info-name">{data.text}</div>
<div className="train-index-list-item-info-text">
<IconfontD
code={"iconnumberofactivities"}
style={{ fontSize: 28, marginRight: 6 }}
/>
{data.activitieNum}
{intl.get("AtLeastFinish2")}
{parseInt(data.enablePay) == 1 ? (
<TrigleTagComponent text={intl.get("payTheBill") || "付费"} />
) : (
""
)}
</div>
<div <div
className="train-index-list-item-info-text" className="train-index-list-item-info-text"
style={{ marginTop: 16 }}
> >
{data.trainTimeStr} <span style={{marginRight:'10px'}}>{data.activityName}</span> {data.trainTimeStr}
</div> </div>
</div> </div>
<div <div
...@@ -94,23 +80,7 @@ const TrainItem = ({ data, onClick }) => { ...@@ -94,23 +80,7 @@ const TrainItem = ({ data, onClick }) => {
: "train-enroll-status" : "train-enroll-status"
} }
> >
{data.activityStateCode == 1 <span>{data.activityStateName}</span>
? " 待报名"
: data.activityStateCode == 2
? "待签到"
: data.activityStateCode == 3
? "正在报名"
: data.activityStateCode == 4
? "已报名"
: data.activityStateCode == 5
? "进行中"
: data.activityStateCode == 6
? "结束"
: data.activityStateCode == 7
? "未报名"
: data.activityStateCode == 8
? "未签到"
: ""}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
text-align: center; text-align: center;
} }
.train-index-list-container .train-index-list-item-container .train-enroll-status { .train-index-list-container .train-index-list-item-container .train-enroll-status {
width: 150px; width: 160px;
border-radius: 50px; border-radius: 50px;
padding: 5px 15px; padding: 5px 15px;
font-size: 30px; font-size: 30px;
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
color: #d23a29; color: #d23a29;
} }
.train-index-list-container .train-index-list-item-container .train-sign-status { .train-index-list-container .train-index-list-item-container .train-sign-status {
width: 150px; width: 160px;
border-radius: 50px; border-radius: 50px;
padding: 5px 15px; padding: 5px 15px;
font-size: 30px; font-size: 30px;
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
color: #fff; color: #fff;
} }
.train-index-list-container .train-index-list-item-container .train-end-status { .train-index-list-container .train-index-list-item-container .train-end-status {
width: 150px; width: 160px;
border-radius: 50px; border-radius: 50px;
padding: 5px 15px; padding: 5px 15px;
font-size: 30px; font-size: 30px;
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
text-align: center; text-align: center;
} }
.train-enroll-status { .train-enroll-status {
width: 150px; width: 160px;
border-radius: 50px; border-radius: 50px;
padding: 5px 15px; padding: 5px 15px;
font-size: 30px; font-size: 30px;
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
color: #d23a29; color: #d23a29;
} }
.train-sign-status { .train-sign-status {
width: 150px; width: 160px;
border-radius: 50px; border-radius: 50px;
padding: 5px 15px; padding: 5px 15px;
font-size: 30px; font-size: 30px;
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
color: #fff; color: #fff;
} }
.train-end-status { .train-end-status {
width: 150px; width: 160px;
border-radius: 50px; border-radius: 50px;
padding: 5px 15px; padding: 5px 15px;
font-size: 30px; font-size: 30px;
......
...@@ -75,16 +75,6 @@ export function getModuleByIdRefresh(param,callback) { ...@@ -75,16 +75,6 @@ export function getModuleByIdRefresh(param,callback) {
}); });
}; };
} }
export function getVisitCount(callback) {
let url = api.homeUrl+"/api/portal/pc/look/num?terminalType=3"+"&t="+new Date().getTime();
return dispatch => {
return excute.get(url,(json)=>{
if(callback){
callback(json.data||0);
}
});
};
}
// GET /api/portal/getReport 获取首页配置的平台报告 // GET /api/portal/getReport 获取首页配置的平台报告
export const getReportHome=(data,callback)=>{ export const getReportHome=(data,callback)=>{
return dispatch=>{ return dispatch=>{
......
...@@ -81,10 +81,6 @@ var commonFetch = { ...@@ -81,10 +81,6 @@ var commonFetch = {
callback(data); callback(data);
} }
} else { } else {
if (url.indexOf("public/wechat/get/signature") != -1 || url.indexOf("api/portal/bottomMenu/list") != -1) {
return;
}
if (url.indexOf("system/api/loginApp") != -1) { if (url.indexOf("system/api/loginApp") != -1) {
Toast.info(intl.get(data.subMsg) ? Toast.info(intl.get(data.subMsg) ?
intl.get(data.subMsg) : intl.get(data.subMsg) :
...@@ -173,9 +169,6 @@ var commonFetch = { ...@@ -173,9 +169,6 @@ var commonFetch = {
callback(data); callback(data);
} }
} else { } else {
if (url.indexOf("public/wechat/get/signature") != -1) {
return;
}
if (url.indexOf("system/api/loginApp") != -1) { if (url.indexOf("system/api/loginApp") != -1) {
Toast.info(intl.get(data.subMsg) ? Toast.info(intl.get(data.subMsg) ?
intl.get(data.subMsg) : intl.get(data.subMsg) :
...@@ -338,9 +331,6 @@ var commonFetch = { ...@@ -338,9 +331,6 @@ var commonFetch = {
callback(data); callback(data);
} }
} else { } else {
if (url.indexOf("public/wechat/get/signature") != -1) {
return;
}
if (data.subMsg) { if (data.subMsg) {
Toast.info(intl.get(data.subMsg) ? Toast.info(intl.get(data.subMsg) ?
intl.get(data.subMsg) : intl.get(data.subMsg) :
...@@ -464,9 +454,6 @@ var commonFetch = { ...@@ -464,9 +454,6 @@ var commonFetch = {
callback(data); callback(data);
} }
} else { } else {
if (url.indexOf("public/wechat/get/signature") != -1) {
return;
}
if (data.subMsg) { if (data.subMsg) {
Toast.info(intl.get(data.subMsg) ? Toast.info(intl.get(data.subMsg) ?
intl.get(data.subMsg) : intl.get(data.subMsg) :
...@@ -542,9 +529,6 @@ var commonFetch = { ...@@ -542,9 +529,6 @@ var commonFetch = {
callback(data); callback(data);
} }
} else { } else {
if (url.indexOf("public/wechat/get/signature") != -1) {
return;
}
if (data.subMsg) { if (data.subMsg) {
Toast.info(intl.get(data.subMsg) ? Toast.info(intl.get(data.subMsg) ?
intl.get(data.subMsg) : intl.get(data.subMsg) :
......
...@@ -19,24 +19,11 @@ if ( ...@@ -19,24 +19,11 @@ if (
host.indexOf("1") != -1 || host.indexOf("1") != -1 ||
host.indexOf("172.") != -1 host.indexOf("172.") != -1
) { ) {
//本地浏览器使用localhost时 //开发环境
baseUrl = "http://192.168.1.106:8090";
//生产环境
// baseUrl = "http://10.23.1.180:8090";
// baseUrl = 'http://dev.wechat.kmelearning.com';
baseUrl = "http://10.23.1.180:8090";
// baseUrl = 'https://uat.wechat.kmelearning.com';
// baseUrl = 'https://sasswx.kmelearning.com';
// baseUrl = 'http://dev.wechat.kmelearning.com';
// baseUrl = 'http://192.168.1.22:31043';
// baseUrl = 'http://localhost:8003';
// baseUrl = 'http://192.168.1.22:31061';
// baseUrl = 'http://localhost:8003';
// baseUrl = 'https://wechat.kmelearning.com';
} else if ( } else if (
host.indexOf("192.168.1.131") != -1 || host.indexOf("192.168.1.131") != -1 ||
host.indexOf("192.168.2.23") != -1 host.indexOf("192.168.2.23") != -1
...@@ -218,8 +205,8 @@ const url = { ...@@ -218,8 +205,8 @@ const url = {
myShareUrl: `${baseUrl}${WEBSTUDENT}api/marketing/course/share/list`, myShareUrl: `${baseUrl}${WEBSTUDENT}api/marketing/course/share/list`,
//我分享的课程被浏览数 //我分享的课程被浏览数
myShareLeSeeUrl: `${baseUrl}${WEBSTUDENT}api/marketing/course/share/browse/records`, myShareLeSeeUrl: `${baseUrl}${WEBSTUDENT}api/marketing/course/share/browse/records`,
//微信签名
signatureUrl: `${baseUrl}${WEBSTUDENT}public/wechat/get/signature`,
accessToken: `${baseUrl}${WEBSTUDENT}public/wechat/get/token`, accessToken: `${baseUrl}${WEBSTUDENT}public/wechat/get/token`,
//签到 //签到
signIn: `${baseUrl}${WEBSTUDENT}api/sign/scan`, signIn: `${baseUrl}${WEBSTUDENT}api/sign/scan`,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment