Commit e2c7aa96 by yanglang123

页面修改

parent 1d552aef
......@@ -23,7 +23,7 @@ app.get("*", function(req, res) {
res.sendFile(path.join(rootPath, "dist/index.html"));
});
app.listen(3003, function(err) {
app.listen(8003, function(err) {
if (err) {
return console.error(err);
}
......
......@@ -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) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
......
......@@ -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) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
......
......@@ -178,10 +178,8 @@ export const lessonEnrollEvent = (params, callBack) => {
NetWork.post(API.courseSignUp, params, (response) => {
try {
if (Number.parseInt(response.code) === 1000) {
Toast.info(intl.get("PublishKey70") || "报名成功");
callBack && callBack();
} else {
Toast.info(intl.get("PublishKey70") || "报名成功");
}
} catch (e) {
console.log(e);
......@@ -192,12 +190,17 @@ export const lessonEnrollEvent = (params, callBack) => {
//签到
export function sign(params, callBack) {
return (dispatch) => {
return excute.post(API.signIn, params, (res) => {
callBack(res);
dispatch({
type: SIGN_ACTION,
data: res,
});
NetWork.post(API.signIn, params, (response) => {
try {
if (Number.parseInt(response.code) === 1000) {
Toast.info("签到成功");
callBack && callBack();
} else {
Toast.info("签到成功");
}
} catch (e) {
console.log(e);
}
});
};
}
......@@ -296,4 +299,3 @@ export const trainCertificateGet = (data, callback) => {
});
};
};
......@@ -10,6 +10,16 @@
width: 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 {
font-size: 0.25rem;
}
......@@ -436,21 +446,21 @@
background-color: #53af5c;
color: #fff;
text-align: center;
padding: 5px 8px;
padding: 8px 10px;
}
.train-info .enrolled {
width: 120px;
background-color: #ffba19;
color: #fff;
text-align: center;
padding: 5px 8px;
padding: 8px 10px;
}
.train-info .overed {
width: 100px;
width: 120px;
background-color: #e5e6e8;
color: #a1a1a1;
text-align: center;
padding: 5px 8px;
padding: 8px 10px;
}
.train-info p {
color: #fff;
......@@ -698,6 +708,26 @@
color: white;
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 {
width: 100%;
height: 128px;
......
......@@ -7,7 +7,18 @@
height: 40px;
//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: #4a4a4a;
}
......@@ -591,21 +602,21 @@
background-color: #53af5c;
color: #fff;
text-align: center;
padding: 5px 8px;
padding: 8px 10px;
}
.enrolled {
width: 120px;
background-color: #ffba19;
color: #fff;
text-align: center;
padding: 5px 8px;
padding: 8px 10px;
}
.overed {
width: 100px;
width: 120px;
background-color: #e5e6e8;
color: #a1a1a1;
text-align: center;
padding: 5px 8px;
padding: 8px 10px;
}
p {
color: #fff;
......@@ -885,7 +896,28 @@
color: white;
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 {
width: 100%;
height: 128px;
......
//轮播图
import React, { Component } from 'react';
import { Carousel } from 'antd-mobile';
import fnNavigate from '../../util/navDirector';
import React, { Component } from "react";
import { Carousel } from "antd-mobile";
import fnNavigate from "../../util/navDirector";
import "./less/carousel.less";
export default class carousel extends Component {
constructor(props) {
super(props);
this.state ={
imageIndex:0
}
}
autoSlideListen = (index)=>{
this.setState({
imageIndex:index
})
}
imageClick(item) {
console.log(item);
fnNavigate(item, 'banner');
constructor(props) {
super(props);
this.state = {
imageIndex: 0,
};
}
autoSlideListen = (index) => {
this.setState({
imageIndex: index,
});
};
}
render() {
let { data, carouselparam, frameOverflow } = this.props;
const {imageIndex} = this.state;
let carouselItemWidth = document.body.clientWidth - 60;
if (data.length == 1 ) {
return (
<div style={{width:"100%",padding:"0 30px"}}>
<a key={data[0].id}
style={{ display: 'inline-block', width: '100%',padding:0 }}
onClick={() => this.imageClick(data[0])}
className={this.props.isIndex ? "carousel-container" : ''}
>
<img
style={{
height: carouselparam.height,
borderRadius: carouselparam.radius,
width: "100%",
}}
src={data[0].imageSrc}
alt="icon"
onLoad={() => {
// fire window resize event to change height
window.dispatchEvent(new Event('resize'));
this.setState({
initialHeight: null,
});
}}
/>
</a>
</div>
imageClick(item) {
console.log(item);
fnNavigate(item, "banner");
}
);
} else {
return (
<div className={this.props.isIndex ? "carousel-index-container" : ''} style={{ width: "100%" }}>
<Carousel
className="my-index-carousel"
autoplay={true}
infinite={true}
dots={true}
swipeSpeed={35}
afterChange={this.autoSlideListen }
>
{data.map((item, index) => (
<a key={index}
style={{
display: 'block',
height: carouselparam.height,
borderRadius: carouselparam.radius,
overflow: "hidden",
position:"relative"
}}
onClick={() => this.imageClick(item)}
>
<img
style={{
height: carouselparam.height,
borderRadius: carouselparam.radius,
width: "100%",
}}
src={item.imageSrc}
alt="icon"
onLoad={() => {
// fire window resize event to change height
window.dispatchEvent(new Event('resize'));
this.setState({
initialHeight: null,
});
}}
/>
</a>
))}
</Carousel>
render() {
let { data, carouselparam } = this.props;
if (data.length == 1) {
return (
<div style={{ width: "100%", padding: "0 30px" }}>
<a
key={data[0].id}
style={{ display: "inline-block", width: "100%", padding: 0 }}
onClick={() => this.imageClick(data[0])}
className={this.props.isIndex ? "carousel-container" : ""}
>
<img
style={{
height: carouselparam.height,
borderRadius: carouselparam.radius,
width: "100%",
}}
src={data[0].imageSrc}
alt="icon"
onLoad={() => {
// fire window resize event to change height
window.dispatchEvent(new Event("resize"));
this.setState({
initialHeight: null,
});
}}
/>
</a>
</div>
);
} else {
return (
<div
className={this.props.isIndex ? "carousel-index-container" : ""}
style={{ width: "100%" }}
>
<Carousel
className="my-index-carousel"
autoplay={true}
infinite={true}
dots={false}
swipeSpeed={35}
afterChange={this.autoSlideListen}
>
{data.map((item, index) => (
<a
key={index}
style={{
display: "block",
height: carouselparam.height + 80,
borderRadius: carouselparam.radius,
overflow: "hidden",
position: "relative",
}}
onClick={() => this.imageClick(item)}
>
<img
style={{
height: carouselparam.height + 80,
borderRadius: carouselparam.radius,
width: "100%",
}}
src={item.imageSrc}
alt="icon"
onLoad={() => {
// fire window resize event to change height
window.dispatchEvent(new Event("resize"));
this.setState({
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>
))}
</Carousel>
</div>
);
}
}
}
......@@ -5,7 +5,6 @@ import {
getHomeShowConfig,
getHomeTemplateConfig,
getModubleById,
getVisitCount,
getReportHome,
getTaskModuleState,
getCalendarList,
......@@ -199,7 +198,7 @@ function mapDispatchToProps(dispatch) {
// getHomeTemplateConfig: (data, callback) => dispatch(getHomeTemplateConfig(data, callback)),
// getModubleById: (data, callback) => dispatch(getModubleById(data, callback)),
// getVisitCount: (callback) => dispatch(getVisitCount(callback)),
// getReportHome: (data, callback) => dispatch(getReportHome(data, callback)),
getTaskModuleState: (callback) => dispatch(getTaskModuleState(callback)),
getCalendarList: (data, callback) =>
......
......@@ -3,11 +3,11 @@ import { Rate, Icon } from "antd";
import { SearchBar, WhiteSpace, Toast } from "antd-mobile";
import { hashHistory } from "react-router";
import { connect } from "react-redux";
import moment from "moment";
import {
getHomeShowConfig,
getHomeTemplateConfig,
getModubleById,
getVisitCount,
getReportHome,
getCalendarList,
getAssToken,
......@@ -19,7 +19,6 @@ import Mycarousel from "../common/carousel";
//我是有底线的
import Footline from "../../common/footer/footer";
import NoticeBlock from "../../common/noticeblock/index";
import VisitCount from "./visitCount";
//平台报告浮窗
import func from "../../util/commonFunc";
......@@ -57,7 +56,7 @@ function mapDispatchToProps(dispatch) {
getModubleById: (data, callback) =>
dispatch(getModubleById(data, callback)),
getVisitCount: (callback) => dispatch(getVisitCount(callback)),
getReportHome: (data, callback) => dispatch(getReportHome(data, callback)),
getCalendarList: (data, callback) =>
dispatch(getCalendarList(data, callback)),
......@@ -349,7 +348,7 @@ class Menulearn extends React.Component {
{/* 轮播图 */}
<div className="carouseldiv">
<div style={{ height: bannerHeight, position: "relative" }}>
<div style={{ height: bannerHeight + 80, position: "relative" }}>
{carouselData && carouselData.length > 0 ? (
<Mycarousel
carouselparam={carouselparam}
......@@ -364,7 +363,6 @@ class Menulearn extends React.Component {
/>
)}
</div>
<VisitCount getVisitCount={this.props.getVisitCount} />
</div>
{/* 选项卡 */}
......@@ -386,7 +384,7 @@ class Menulearn extends React.Component {
display: "inline-block",
width: "9px",
height: "34px",
background: 'linear-gradient(180deg,#fe742b, #fc5b2b 100%)',
background: "linear-gradient(180deg,#fe742b, #fc5b2b 100%)",
marginLeft: "4%",
marginRight: "1%",
}}
......@@ -418,8 +416,6 @@ class Menulearn extends React.Component {
<IndexModuleContainer />
{/* 底部 */}
{this.state.showFooter && false ? (
<Footline
......@@ -458,6 +454,7 @@ const NewsItemList = ({ list, onClick }) => {
image: item.logoPath || newsDefaultImage,
number: item.number,
releaseTime: item.releaseTime,
author: item.author,
};
if (index < list.length - 1) {
return (
......@@ -483,40 +480,31 @@ const NewsItemList = ({ list, onClick }) => {
);
};
const IndexNewsItem = ({ data, onClick }) => {
let imageWidth = Math.floor(document.body.clientWidth * (220 / 750));
let imageHeight = Math.floor(imageWidth * (132 / 220));
imageWidth = imageWidth < 220 ? 220 : imageWidth;
imageHeight = imageHeight < 132 ? 132 : imageHeight;
return (
<div className="index-module-news-item-container" onClick={onClick}>
<div className="index-module-news-item-content-container">
<img
src={data.image}
alt="图片加载失败"
className="index-module-news-item-image"
style={{ width: imageWidth, height: imageHeight }}
/>
<div
className="index-module-news-info-container"
style={{ height: imageHeight }}
>
<div className="index-module-news-item-info-name">{data.name}</div>
<div className="index-module-news-item-info-text">
<img
src={newsClockIcon}
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>
let imageWidth = Math.floor(document.body.clientWidth * (220 / 750));
let imageHeight = Math.floor(imageWidth * (132 / 220));
imageWidth = imageWidth < 220 ? 220 : imageWidth;
imageHeight = imageHeight < 132 ? 132 : imageHeight;
return (
<div className="index-module-news-item-container" onClick={onClick}>
<div className="index-module-news-item-content-container">
<img
src={data.image}
alt="图片加载失败"
className="index-module-news-item-image"
style={{ width: imageWidth, height: imageHeight }}
/>
<div
className="index-module-news-info-container"
style={{ height: imageHeight }}
>
<div className="index-module-news-item-info-name">{data.name}</div>
<div className="index-module-news-item-info-text">
<span style={{marginRight:'20px'}}>{data.author}</span>
{moment(data.releaseTime).format("YYYY-MM-DD")}
</div>
</div>
</div>
);
};
\ No newline at end of file
</div>
);
};
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 {
inHeight: document.documentElement.clientHeight,
isLoading: false,
trainDataList: [],
trainDataList: [],
carouselParam: {
height: carouselHeight,
radius: "0.1rem",
......
......@@ -55,7 +55,9 @@ function itemList(item) {
id: item.id,
finished: item.finished,
activitieNum: item.activitieNum,
activityName: item.activityName,
activityStateCode:item.activityStateCode,
activityStateName:item.activityStateName,
period: item.period,
trainingDurationShow: item.trainingDurationShow,
enablePay: item.enablePay
......
......@@ -63,26 +63,12 @@ const TrainItem = ({ data, onClick }) => {
<div className="train-index-list-item-container" onClick={onClick}>
<img src={data.image} alt="" className="train-index-list-item-image" />
<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-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
className="train-index-list-item-info-text"
style={{ marginTop: 16 }}
>
{data.trainTimeStr}
<span style={{marginRight:'10px'}}>{data.activityName}</span> {data.trainTimeStr}
</div>
</div>
<div
......@@ -94,23 +80,7 @@ const TrainItem = ({ data, onClick }) => {
: "train-enroll-status"
}
>
{data.activityStateCode == 1
? " 待报名"
: data.activityStateCode == 2
? "待签到"
: data.activityStateCode == 3
? "正在报名"
: data.activityStateCode == 4
? "已报名"
: data.activityStateCode == 5
? "进行中"
: data.activityStateCode == 6
? "结束"
: data.activityStateCode == 7
? "未报名"
: data.activityStateCode == 8
? "未签到"
: ""}
<span>{data.activityStateName}</span>
</div>
</div>
</div>
......
......@@ -56,7 +56,7 @@
text-align: center;
}
.train-index-list-container .train-index-list-item-container .train-enroll-status {
width: 150px;
width: 160px;
border-radius: 50px;
padding: 5px 15px;
font-size: 30px;
......@@ -65,7 +65,7 @@
color: #d23a29;
}
.train-index-list-container .train-index-list-item-container .train-sign-status {
width: 150px;
width: 160px;
border-radius: 50px;
padding: 5px 15px;
font-size: 30px;
......@@ -74,7 +74,7 @@
color: #fff;
}
.train-index-list-container .train-index-list-item-container .train-end-status {
width: 150px;
width: 160px;
border-radius: 50px;
padding: 5px 15px;
font-size: 30px;
......
......@@ -46,7 +46,7 @@
text-align: center;
}
.train-enroll-status {
width: 150px;
width: 160px;
border-radius: 50px;
padding: 5px 15px;
font-size: 30px;
......@@ -55,7 +55,7 @@
color: #d23a29;
}
.train-sign-status {
width: 150px;
width: 160px;
border-radius: 50px;
padding: 5px 15px;
font-size: 30px;
......@@ -64,7 +64,7 @@
color: #fff;
}
.train-end-status {
width: 150px;
width: 160px;
border-radius: 50px;
padding: 5px 15px;
font-size: 30px;
......
......@@ -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 获取首页配置的平台报告
export const getReportHome=(data,callback)=>{
return dispatch=>{
......
......@@ -81,10 +81,6 @@ var commonFetch = {
callback(data);
}
} else {
if (url.indexOf("public/wechat/get/signature") != -1 || url.indexOf("api/portal/bottomMenu/list") != -1) {
return;
}
if (url.indexOf("system/api/loginApp") != -1) {
Toast.info(intl.get(data.subMsg) ?
intl.get(data.subMsg) :
......@@ -173,9 +169,6 @@ var commonFetch = {
callback(data);
}
} else {
if (url.indexOf("public/wechat/get/signature") != -1) {
return;
}
if (url.indexOf("system/api/loginApp") != -1) {
Toast.info(intl.get(data.subMsg) ?
intl.get(data.subMsg) :
......@@ -338,9 +331,6 @@ var commonFetch = {
callback(data);
}
} else {
if (url.indexOf("public/wechat/get/signature") != -1) {
return;
}
if (data.subMsg) {
Toast.info(intl.get(data.subMsg) ?
intl.get(data.subMsg) :
......@@ -464,9 +454,6 @@ var commonFetch = {
callback(data);
}
} else {
if (url.indexOf("public/wechat/get/signature") != -1) {
return;
}
if (data.subMsg) {
Toast.info(intl.get(data.subMsg) ?
intl.get(data.subMsg) :
......@@ -542,9 +529,6 @@ var commonFetch = {
callback(data);
}
} else {
if (url.indexOf("public/wechat/get/signature") != -1) {
return;
}
if (data.subMsg) {
Toast.info(intl.get(data.subMsg) ?
intl.get(data.subMsg) :
......
......@@ -19,24 +19,11 @@ if (
host.indexOf("1") != -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 (
host.indexOf("192.168.1.131") != -1 ||
host.indexOf("192.168.2.23") != -1
......@@ -218,8 +205,8 @@ const url = {
myShareUrl: `${baseUrl}${WEBSTUDENT}api/marketing/course/share/list`,
//我分享的课程被浏览数
myShareLeSeeUrl: `${baseUrl}${WEBSTUDENT}api/marketing/course/share/browse/records`,
//微信签名
signatureUrl: `${baseUrl}${WEBSTUDENT}public/wechat/get/signature`,
accessToken: `${baseUrl}${WEBSTUDENT}public/wechat/get/token`,
//签到
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