Commit 2b03989c by yanglang123

首页活动

parent 7139b9a3
......@@ -34,6 +34,7 @@
"react-html5video": "^2.5.1",
"react-infinite-scroller": "^1.2.4",
"react-photo-view": "^0.5.2",
"react-player": "^2.16.0",
"react-redux": "^4.4.6",
"react-router": "^3.2.6",
"react-router-redux": "^4.0.7",
......@@ -94,7 +95,6 @@
"svg-sprite-loader": "^0.3.1",
"terser-webpack-plugin": "^2.2.1",
"thread-loader": "^2.1.3",
"url-loader": "^0.5.9",
"video-react": "^0.11.2",
"webpack": "^4.44.2",
"webpack-bundle-analyzer": "^2.8.1",
......@@ -6591,6 +6591,14 @@
"integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
"dev": true
},
"node_modules/deepmerge": {
"version": "4.3.1",
"resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-4.3.1.tgz",
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/default-gateway": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/default-gateway/-/default-gateway-4.2.0.tgz",
......@@ -12233,8 +12241,7 @@
"node_modules/load-script": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/load-script/-/load-script-1.0.0.tgz",
"integrity": "sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA==",
"dev": true
"integrity": "sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA=="
},
"node_modules/loader-runner": {
"version": "2.4.0",
......@@ -12580,6 +12587,11 @@
"node": ">=4"
}
},
"node_modules/memoize-one": {
"version": "5.2.1",
"resolved": "https://registry.npmmirror.com/memoize-one/-/memoize-one-5.2.1.tgz",
"integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q=="
},
"node_modules/memory-fs": {
"version": "0.4.1",
"resolved": "https://registry.npmmirror.com/memory-fs/-/memory-fs-0.4.1.tgz",
......@@ -18260,8 +18272,7 @@
"dependencies": {
"babel-runtime": "6.x",
"classnames": "2.x",
"rc-gesture": "~0.0.22",
"react-native-swipeout": "^2.2.2"
"rc-gesture": "~0.0.22"
}
},
"node_modules/rc-switch": {
......@@ -18502,6 +18513,11 @@
"react": "^16.14.0"
}
},
"node_modules/react-fast-compare": {
"version": "3.2.2",
"resolved": "https://registry.npmmirror.com/react-fast-compare/-/react-fast-compare-3.2.2.tgz",
"integrity": "sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ=="
},
"node_modules/react-fontawesome": {
"version": "1.7.1",
"resolved": "https://registry.npmmirror.com/react-fontawesome/-/react-fontawesome-1.7.1.tgz",
......@@ -18654,17 +18670,6 @@
"react": "*"
}
},
"node_modules/react-native-swipeout": {
"version": "2.3.6",
"resolved": "https://registry.npmmirror.com/react-native-swipeout/-/react-native-swipeout-2.3.6.tgz",
"integrity": "sha512-t9suUCspzck4vp2pWggWe0frS/QOtX6yYCawHnEes75A7dZCEE74bxX2A1bQzGH9cUMjq6xsdfC94RbiDKIkJg==",
"deprecated": "Package no longer supported. Use at your own risk or consider using https://github.com/software-mansion/react-native-gesture-handler",
"dependencies": {
"create-react-class": "^15.6.0",
"prop-types": "^15.5.10",
"react-tween-state": "^0.1.5"
}
},
"node_modules/react-pdf": {
"version": "5.7.2",
"resolved": "https://registry.npmmirror.com/react-pdf/-/react-pdf-5.7.2.tgz",
......@@ -18746,6 +18751,21 @@
"react-dom": ">=16.8.0"
}
},
"node_modules/react-player": {
"version": "2.16.0",
"resolved": "https://registry.npmmirror.com/react-player/-/react-player-2.16.0.tgz",
"integrity": "sha512-mAIPHfioD7yxO0GNYVFD1303QFtI3lyyQZLY229UEAp/a10cSW+hPcakg0Keq8uWJxT2OiT/4Gt+Lc9bD6bJmQ==",
"dependencies": {
"deepmerge": "^4.0.0",
"load-script": "^1.0.0",
"memoize-one": "^5.1.1",
"prop-types": "^15.7.2",
"react-fast-compare": "^3.0.1"
},
"peerDependencies": {
"react": ">=16.6.0"
}
},
"node_modules/react-redux": {
"version": "4.4.10",
"resolved": "https://registry.npmmirror.com/react-redux/-/react-redux-4.4.10.tgz",
......@@ -18901,15 +18921,6 @@
"csstype": "^3.0.2"
}
},
"node_modules/react-tween-state": {
"version": "0.1.5",
"resolved": "https://registry.npmmirror.com/react-tween-state/-/react-tween-state-0.1.5.tgz",
"integrity": "sha512-sJQpjsdn0wjlDIUpfpb7jQGnOG8hAEW2e8k0KPA+xmf5KFa6Xat2JldbmxBhaqP0S/uIXhVE5ymKyH/b9X8nYA==",
"dependencies": {
"raf": "^3.1.0",
"tween-functions": "^1.0.1"
}
},
"node_modules/read-pkg": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/read-pkg/-/read-pkg-1.1.0.tgz",
......@@ -22050,11 +22061,6 @@
"node": "*"
}
},
"node_modules/tween-functions": {
"version": "1.2.0",
"resolved": "https://registry.npmmirror.com/tween-functions/-/tween-functions-1.2.0.tgz",
"integrity": "sha512-PZBtLYcCLtEcjL14Fzb1gSxPBeL7nWvGhO5ZFPGqziCcr8uvHp0NDmdjBchp6KHL+tExcg0m3NISmKxhU394dA=="
},
"node_modules/tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npmmirror.com/tweetnacl/-/tweetnacl-0.14.5.tgz",
......@@ -22444,54 +22450,6 @@
"node": ">= 0.4"
}
},
"node_modules/url-loader": {
"version": "0.5.9",
"resolved": "https://registry.npmmirror.com/url-loader/-/url-loader-0.5.9.tgz",
"integrity": "sha512-B7QYFyvv+fOBqBVeefsxv6koWWtjmHaMFT6KZWti4KRw8YUD/hOU+3AECvXuzyVawIBx3z7zQRejXCDSO5kk1Q==",
"dev": true,
"dependencies": {
"loader-utils": "^1.0.2",
"mime": "1.3.x"
},
"peerDependencies": {
"file-loader": "*"
}
},
"node_modules/url-loader/node_modules/json5": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz",
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
"dev": true,
"dependencies": {
"minimist": "^1.2.0"
},
"bin": {
"json5": "lib/cli.js"
}
},
"node_modules/url-loader/node_modules/loader-utils": {
"version": "1.4.2",
"resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz",
"integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==",
"dev": true,
"dependencies": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
},
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/url-loader/node_modules/mime": {
"version": "1.3.6",
"resolved": "https://registry.npmmirror.com/mime/-/mime-1.3.6.tgz",
"integrity": "sha512-a/kG+3WTtU8GJG1ngpkkHOHcH6zNjGrI47OQyoFsFBN0QpYYJ4u2yEORsGK5cZMI+cfu9HbSCCfGfRzG0fWE9A==",
"dev": true,
"bin": {
"mime": "cli.js"
}
},
"node_modules/url-parse": {
"version": "1.5.10",
"resolved": "https://registry.npmmirror.com/url-parse/-/url-parse-1.5.10.tgz",
......@@ -29465,6 +29423,11 @@
"integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
"dev": true
},
"deepmerge": {
"version": "4.3.1",
"resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-4.3.1.tgz",
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="
},
"default-gateway": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/default-gateway/-/default-gateway-4.2.0.tgz",
......@@ -33967,8 +33930,7 @@
"load-script": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/load-script/-/load-script-1.0.0.tgz",
"integrity": "sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA==",
"dev": true
"integrity": "sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA=="
},
"loader-runner": {
"version": "2.4.0",
......@@ -34265,6 +34227,11 @@
"mimic-fn": "^1.0.0"
}
},
"memoize-one": {
"version": "5.2.1",
"resolved": "https://registry.npmmirror.com/memoize-one/-/memoize-one-5.2.1.tgz",
"integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q=="
},
"memory-fs": {
"version": "0.4.1",
"resolved": "https://registry.npmmirror.com/memory-fs/-/memory-fs-0.4.1.tgz",
......@@ -38725,8 +38692,7 @@
"requires": {
"babel-runtime": "6.x",
"classnames": "2.x",
"rc-gesture": "~0.0.22",
"react-native-swipeout": "^2.2.2"
"rc-gesture": "~0.0.22"
}
},
"rc-switch": {
......@@ -38943,6 +38909,11 @@
"scheduler": "^0.19.1"
}
},
"react-fast-compare": {
"version": "3.2.2",
"resolved": "https://registry.npmmirror.com/react-fast-compare/-/react-fast-compare-3.2.2.tgz",
"integrity": "sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ=="
},
"react-fontawesome": {
"version": "1.7.1",
"resolved": "https://registry.npmmirror.com/react-fontawesome/-/react-fontawesome-1.7.1.tgz",
......@@ -39059,16 +39030,6 @@
"prop-types": "^15.5.0"
}
},
"react-native-swipeout": {
"version": "2.3.6",
"resolved": "https://registry.npmmirror.com/react-native-swipeout/-/react-native-swipeout-2.3.6.tgz",
"integrity": "sha512-t9suUCspzck4vp2pWggWe0frS/QOtX6yYCawHnEes75A7dZCEE74bxX2A1bQzGH9cUMjq6xsdfC94RbiDKIkJg==",
"requires": {
"create-react-class": "^15.6.0",
"prop-types": "^15.5.10",
"react-tween-state": "^0.1.5"
}
},
"react-pdf": {
"version": "5.7.2",
"resolved": "https://registry.npmmirror.com/react-pdf/-/react-pdf-5.7.2.tgz",
......@@ -39119,6 +39080,18 @@
"lodash.uniqueid": "^4.0.1"
}
},
"react-player": {
"version": "2.16.0",
"resolved": "https://registry.npmmirror.com/react-player/-/react-player-2.16.0.tgz",
"integrity": "sha512-mAIPHfioD7yxO0GNYVFD1303QFtI3lyyQZLY229UEAp/a10cSW+hPcakg0Keq8uWJxT2OiT/4Gt+Lc9bD6bJmQ==",
"requires": {
"deepmerge": "^4.0.0",
"load-script": "^1.0.0",
"memoize-one": "^5.1.1",
"prop-types": "^15.7.2",
"react-fast-compare": "^3.0.1"
}
},
"react-redux": {
"version": "4.4.10",
"resolved": "https://registry.npmmirror.com/react-redux/-/react-redux-4.4.10.tgz",
......@@ -39259,15 +39232,6 @@
}
}
},
"react-tween-state": {
"version": "0.1.5",
"resolved": "https://registry.npmmirror.com/react-tween-state/-/react-tween-state-0.1.5.tgz",
"integrity": "sha512-sJQpjsdn0wjlDIUpfpb7jQGnOG8hAEW2e8k0KPA+xmf5KFa6Xat2JldbmxBhaqP0S/uIXhVE5ymKyH/b9X8nYA==",
"requires": {
"raf": "^3.1.0",
"tween-functions": "^1.0.1"
}
},
"read-pkg": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/read-pkg/-/read-pkg-1.1.0.tgz",
......@@ -41880,11 +41844,6 @@
"safe-buffer": "^5.0.1"
}
},
"tween-functions": {
"version": "1.2.0",
"resolved": "https://registry.npmmirror.com/tween-functions/-/tween-functions-1.2.0.tgz",
"integrity": "sha512-PZBtLYcCLtEcjL14Fzb1gSxPBeL7nWvGhO5ZFPGqziCcr8uvHp0NDmdjBchp6KHL+tExcg0m3NISmKxhU394dA=="
},
"tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npmmirror.com/tweetnacl/-/tweetnacl-0.14.5.tgz",
......@@ -42175,44 +42134,6 @@
}
}
},
"url-loader": {
"version": "0.5.9",
"resolved": "https://registry.npmmirror.com/url-loader/-/url-loader-0.5.9.tgz",
"integrity": "sha512-B7QYFyvv+fOBqBVeefsxv6koWWtjmHaMFT6KZWti4KRw8YUD/hOU+3AECvXuzyVawIBx3z7zQRejXCDSO5kk1Q==",
"dev": true,
"requires": {
"loader-utils": "^1.0.2",
"mime": "1.3.x"
},
"dependencies": {
"json5": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz",
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
}
},
"loader-utils": {
"version": "1.4.2",
"resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz",
"integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
}
},
"mime": {
"version": "1.3.6",
"resolved": "https://registry.npmmirror.com/mime/-/mime-1.3.6.tgz",
"integrity": "sha512-a/kG+3WTtU8GJG1ngpkkHOHcH6zNjGrI47OQyoFsFBN0QpYYJ4u2yEORsGK5cZMI+cfu9HbSCCfGfRzG0fWE9A==",
"dev": true
}
}
},
"url-parse": {
"version": "1.5.10",
"resolved": "https://registry.npmmirror.com/url-parse/-/url-parse-1.5.10.tgz",
......@@ -25,6 +25,7 @@
"react-html5video": "^2.5.1",
"react-infinite-scroller": "^1.2.4",
"react-photo-view": "^0.5.2",
"react-player": "^2.16.0",
"react-redux": "^4.4.6",
"react-router": "^3.2.6",
"react-router-redux": "^4.0.7",
......@@ -85,7 +86,6 @@
"svg-sprite-loader": "^0.3.1",
"terser-webpack-plugin": "^2.2.1",
"thread-loader": "^2.1.3",
"url-loader": "^0.5.9",
"video-react": "^0.11.2",
"webpack": "^4.44.2",
"webpack-bundle-analyzer": "^2.8.1",
......
......@@ -446,7 +446,6 @@ class App extends React.Component {
let companyCode = location.hash.split("/")[1];
let siteCode = location.hash.split("/")[2];
console.log(this.state.selectedTab, companyCode, siteCode, location, '当前选定tab');
let { showTab, tabInfo } = this.state;
// if (this.props.showInfo.portalBlockList) {
// this.props.showInfo.portalBlockList.map((rowData) => {
......
import React, { Component, Fragment } from "react";
import { ListView, Modal, TextareaItem, Toast } from "antd-mobile";
import { Icon, List } from "antd";
import {
Accordion,
ListView,
Modal,
Tabs,
TextareaItem,
Toast,
} from "antd-mobile";
import API from "../../../util/urlconfig";
import { Sticky, StickyContainer } from "react-sticky";
import MediaDisplay from "../../../common/mediaDisplay/index";
import blackPage from "../../../common/mediaDisplay/black-bg.png";
import "../../menumarketing/MarketingDetail.less";
import trainComment from "./comment-icon.jpg";
import trainCommentReplay from "../../../image/train-comment.png";
import intl, { init } from "react-intl-universal";
import { hashHistory } from "react-router";
import "./index.less";
import moment from "moment";
import { connect } from "react-redux";
import * as TrainingStepsAction from "./TrainingStepsAction";
import func from "../../../util/commonFunc";
import SecListView from "../../common/listview/secListView";
import trainComment from "./comment-icon.jpg";
import $ from "jquery";
import zan from "../../../image/zan.png";
import alreadyzan from "../../../image/alreadyzan.png";
import myIcon from "../../../image/my.png";
import ReactPlayer from "react-player";
const TabPane = Tabs.TabPane;
class TrainingSteps extends Component {
constructor(props) {
......@@ -25,11 +43,19 @@ class TrainingSteps extends Component {
this.state = {
displayProgress: false,
courseInfo:
"IC1金融法规与银行从业人员职业操守认证考试试题20170901项目名称项目名称项目名称项...", //课程信息
successTimer: "2018-02-28 至 2018-03-28", //报名成功时间
successTxt: "开始时间:", //开始时间
learningCountTxt: "总学习时长", //学习时长
hour: "10", //总共小时
minute: "30", //总共分钟
loading: false,
visible: false,
confirmLoading: false,
commitContent: "",
currentType: 1,
//showEnroll :0评论 >=1:报名 (具体处理到下周接口出来)
showEnroll: 1,
showComment: false,
comment: "",
......@@ -38,49 +64,50 @@ class TrainingSteps extends Component {
commentType: 1,
replyCommentTypeId: 0,
showProgress: true,
trainLogoHeight: 400,
defaultTabKey: "1",
commentHasMore: true,
showContentOccupy: false,
isNative: false,
enablePosition: 0,
refreshTrainComment: "",
activityStateCode: "", //0待开始;1待报名;2待签到;3正在报名;4正在签到;5进行中;6已结束;7未报名;8未签到
signTimeId: "", //签到
signType: "", //签到
};
this.contentDomHeightSetForSticky =
this.contentDomHeightSetForSticky.bind(this);
}
componentWillMount() {}
componentWillMount() {
const { tabkey } = this.props.location.query;
this.setState({
defaultTabKey: tabkey ? tabkey + "" : "1",
});
}
componentDidMount() {
let _this = this;
this.logoHeightListen();
if (parseInt(terminalMp) == 0 || parseInt(terminalMp) == 1) {
console.log("原生", terminalMp);
_this.setState({ isNative: true });
}
this.props.initailData();
let { id, finished, tabkey, bizType } = this.props.location.query;
let { id, finished } = this.props.location.query;
let params = {
id: id,
};
if (bizType != "2") {
this.props.trainStepsData(finished, params, () => {
let { introductionVo } = _this.props.TrainingStepsReducer;
let {
needEnroll,
needAudit,
hasEnrolled,
audited,
enablePosition,
enableSign,
} = introductionVo;
_this.setState({
showProgress: this.showProgressJudge(
needEnroll,
hasEnrolled,
needAudit,
audited
),
enablePosition,
enableSign,
});
_this.contentDomHeightSetForSticky();
this.props.trainStepsData(finished, params, () => {
let { introductionVo } = _this.props.TrainingStepsReducer;
let { activityStateCode,signTimeId,signType } = introductionVo;
_this.setState({
activityStateCode: activityStateCode,
signTimeId: signTimeId,
signType: signType,
});
}
_this.contentDomHeightSetForSticky();
});
this.setState({
isLoading: true,
});
......@@ -99,13 +126,8 @@ class TrainingSteps extends Component {
});
}
);
func.changeDocumentTitle(intl.get("TrainingProgram2") || "项目");
}
logoHeightListen() {
this.setState({
trainLogoHeight: document.body.clientWidth * (225 / 375),
});
}
contentDomHeightSetForSticky() {
let domHeight = document.getElementById(
"train-contain-list-sticky-div"
......@@ -120,27 +142,6 @@ class TrainingSteps extends Component {
});
}
}
showProgressJudge(needEnroll, hasEnrolled, needAudit, audited) {
if (needEnroll) {
if (hasEnrolled) {
if (needAudit) {
if (audited) {
return true;
} else {
return false;
}
} else {
return true;
}
} else {
return false;
}
} else {
return true;
}
}
onLoadMore = () => {
let { id } = this.props.location.query;
let _this = this;
......@@ -175,6 +176,16 @@ class TrainingSteps extends Component {
);
};
showInputView = () => {
console.log("出现");
this.setState({ showEnroll: 0 });
};
hiddenInputView = () => {
if (this.state.commitContent == "") {
this.setState({ showEnroll: 1 });
}
};
//提交评论
trainCommitVerb = () => {
if (!this.state.commitContent) {
......@@ -230,9 +241,18 @@ class TrainingSteps extends Component {
this.setState({ showEnroll: 1, showComment: false });
}
};
render() {
let { reviewListData, isMore } = this.props.TrainingStepsReducer;
renderContent = () => {
let {
introductionVo = {},
hasEnrolled,
contentVo,
reviewListData,
isMore,
reviewListTotle,
progressVo,
} = this.props.TrainingStepsReducer;
let { activityStateCode } = this.state;
let loadMore = isMore ? (
<button className="load-more" onClick={() => this.onLoadMore()}>
{intl.get("PublishKey74") || "点击加载更多"}
......@@ -245,18 +265,264 @@ class TrainingSteps extends Component {
this.state.dataSource = this.state.dataSource.cloneWithRows(
this.props.TrainingStepsReducer.reviewListData
);
return (
<div style={{ backgroundColor: "#F4F4F4" }}>
{this.renderIntroduction(introductionVo)}
{this.renderComment(reviewListData, loadMore)}
</div>
);
};
render() {
let { introductionVo = {} } = this.props.TrainingStepsReducer;
let { activityStateCode, signTimeId, signType } = this.state;
let signUpTitle =
activityStateCode == "1"
? "待报名"
: activityStateCode == "2"
? "待签到"
: activityStateCode == "3"
? "正在报名"
: activityStateCode == "4"
? "正在签到"
: "进行中";
let signUpColor = "#999999";
let signedColor = "#d23a29";
this.state.dataSource = this.state.dataSource.cloneWithRows(
this.props.TrainingStepsReducer.reviewListData
);
return (
<div
className="train-contain"
style={{ backgroundColor: "#f4f4f4", width: "100%", height: "100%" }}
>
<div className="train-logo">
<img
id="train-logo-image"
src={introductionVo && introductionVo.logoImg}
alt=""
/>
{/*头部信息*/}
<div className="train-info">
<p>{introductionVo && introductionVo.name}</p>
{activityStateCode == 1 ? (
<div className="overed">待报名</div>
) : activityStateCode == 2 ? (
<div className="overed">待签到</div>
) : activityStateCode == 3 ? (
<div className="enroll">正在报名</div>
) : activityStateCode == 4 ? (
<div className="enrolled">已报名</div>
) : activityStateCode == 5 ? (
<div className="enrolled">进行中</div>
) : activityStateCode == 6 ? (
<div className="overed">结束</div>
) : activityStateCode == 7 ? (
<div className="overed">未报名</div>
) : activityStateCode == 8 ? (
<div className="overed">未签到</div>
) : (
""
)}
</div>
</div>
<div style={{ width: "100%", marginTop: 0 }}>
<Fragment>{this.renderComment(reviewListData, loadMore)}</Fragment>
<StickyContainer>{this.renderContent()}</StickyContainer>
</div>
{
<Fragment>
<div style={{ width: "100%", height: 88 }}></div>
<div
style={{
background:
activityStateCode == "3" || activityStateCode == "4"
? signedColor
: signUpColor,
}}
type="primary"
className="signup-button"
onClick={() => {
this.handleOk(activityStateCode, signTimeId, signType);
}}
>
{signUpTitle}
</div>
</Fragment>
}
</div>
);
}
//简介
renderIntroduction = (introductionVo) => {
console.log(introductionVo, "~~~~~~~~~~~!!!!!!!!!!!!!");
let introStartTime = moment(
introductionVo && introductionVo.enroll.startTime
).format("YYYY-MM-DD HH:mm");
let introEndTime = moment(
introductionVo && introductionVo.enroll.endTime
).format("YYYY-MM-DD HH:mm");
$("#train-marketId video").each((index, item) => {
$(item)
.attr("controls", true)
.attr("preload", true)
.css("width", "100%")
.attr("poster", blackPage);
});
$("#train-marketId audio").each((index, item) => {
$(item).attr("controls", true).css("width", "100%").attr("preload", true);
});
$("#train-marketId img").each((index, item) => {
$(item).css("width", "100%");
});
return (
<div id="train-marketId" style={{ height: "100%", zIndex: 999 }}>
<div
className="train-header"
style={{
// 简介内容为空不需要设置样式 任务919
paddingBottom:
introductionVo && !introductionVo.description.trim()
? 0
: "0.5rem",
}}
>
{/*项目须知*/}
<div className="train-info-view">
<div className="train-up-info">
{introductionVo && (
<div>
<p>
<span>{intl.get("ApplyTime") || "报名时间"}</span>
{`${introStartTime && introStartTime} ${
intl.get("To") || "至"
} ${introEndTime && introEndTime}`}
</p>
<p>
<span>组织方</span>
{introductionVo && introductionVo.organizer}
</p>
<p>
<span>活动地点</span>
{introductionVo && introductionVo.activityAddress}
</p>
<p>
<span>{intl.get("PublishKey78") || "项目名额"}</span>
{`${
introductionVo && introductionVo.enroll.limit
? (introductionVo &&
introductionVo.enroll.limit + intl.get("People")) ||
"人"
: intl.get("PublishKey79") || "无限制"
} `}
</p>
</div>
)}
</div>
</div>
{/*项目介绍*/}
{String(introductionVo && introductionVo.description) === "" ||
(introductionVo && introductionVo.description === null) ||
!introductionVo ? null : introductionVo && // 简介内容为空不追加product-info-view 任务919
!introductionVo.description.trim() ? null : (
<div>
<div className="product-info-view">
<div className="train-info-view">
<div style={{ marginBottom: "20px" }}>
<p
style={{
fontWeight: "bold",
paddingLeft: "40px",
}}
>
活动介绍
</p>
<div
style={{
width: "100%",
height: "350px",
paddingLeft: "40px",
}}
>
<ReactPlayer
url={introductionVo.videoUrl} // 替换为你的视频文件URL
controls // 显示播放控件
playing={true} // 自动播放视频
width="100%"
height="100%"
/>
</div>
<div className="train-info">
<div>
<List className="train-info-contain">
<List.Item>
<MediaDisplay
width={document.body.clientWidth - 80}
content={introductionVo.description}
/>
</List.Item>
</List>
</div>
</div>
</div>
<div style={{ marginBottom: "20px" }}>
<p
style={{
fontWeight: "bold",
paddingLeft: "40px",
paddingBottom: "20px",
}}
>
投票链接
</p>
<div
style={{
fontSize: "26px",
paddingLeft: "40px",
color: "#659EFE",
textDecoration: "underline",
}}
onClick={() => this.toSurvey(introductionVo.researchId)}
>
{introductionVo.researchName}
</div>
</div>
{introductionVo.point > 0 ? (
<div>
<p
style={{
fontWeight: "bold",
paddingLeft: "40px",
paddingBottom: "20px",
}}
>
活动奖励
</p>
<div
style={{
fontSize: "26px",
paddingLeft: "40px",
}}
>
参与活动获得{introductionVo.point}积分
</div>
</div>
) : (
""
)}
</div>
</div>
<div className="segement" />
</div>
)}
</div>
</div>
);
};
//评论
renderComment = (reviewListData, loadMore) => {
let { reviewPageNo, reviewListTotle } = this.props.TrainingStepsReducer;
......@@ -370,7 +636,7 @@ class TrainingSteps extends Component {
pageNo: reviewPageNo,
pageSize: 10,
}}
footText={intl.get("PublishKey47") || "没有更多了"}
// footText={intl.get("PublishKey47") || "没有更多了"}
/>
<Modal
title={intl.get("Comment") || "评论"}
......@@ -431,6 +697,46 @@ class TrainingSteps extends Component {
commitContent: "",
});
};
handleCancel = () => {
this.setState({
visible: false,
});
};
//确认报名
handleOk = (code, signTimeId, signType) => {
console.log(code, signTimeId, signType, "111111111111111111");
let { id, finished } = this.props.location.query;
if (code == "4") {
let params = {
trainingProjectId: id,
signTimeId: signTimeId,
signType: signType,
};
this.props.sign(params, () => {
_this.props.trainStepsData(finished, params, () => {
let { introductionVo } = _this.props.TrainingStepsReducer;
let { activityStateCode } = introductionVo;
_this.setState({
activityStateCode: activityStateCode,
});
});
});
} else {
let params = {
id: id,
};
let _this = this;
this.props.lessonEnrollEvent(params, () => {
_this.props.trainStepsData(finished, params, () => {
let { introductionVo } = _this.props.TrainingStepsReducer;
let { activityStateCode } = introductionVo;
_this.setState({
activityStateCode: activityStateCode,
});
});
});
}
};
reviewDetail = (item) => {
console.log(item);
// let time = moment(item.createTime).format("YYYY-MM-DD HH:hh:SS");
......@@ -457,7 +763,6 @@ class TrainingSteps extends Component {
let { id } = this.props.location.query;
let param = { id: id };
let _this = this;
if (String(item.status) === "0") {
// item.thumbsUps++;
// this.props.TrainingStepsReducer.reviewListData[index].thumbsUps++;
......@@ -474,8 +779,6 @@ class TrainingSteps extends Component {
);
});
} else {
// this.props.TrainingStepsReducer.reviewListData[index].thumbsUps--;
// item.thumbsUps--;
this.props.laudDeleEnrollEvent(params, () => {
Toast.info(intl.get("Unlike") || "取消点赞");
this.props.reviewListData(
......@@ -490,6 +793,13 @@ class TrainingSteps extends Component {
});
}
};
// 跳转到投稿
toSurvey = (id) => {
hashHistory.push({
pathname: func.routerBefore() + "/SurveyDetails",
query: { id: id },
});
};
}
export default connect((state) => {
......
import React, { Component, Fragment } from "react";
import { ListView, Modal, TextareaItem, Toast } from "antd-mobile";
import "../../menumarketing/MarketingDetail.less";
import trainCommentReplay from "../../../image/train-comment.png";
import intl, { init } from "react-intl-universal";
import { hashHistory } from "react-router";
import "./index.less";
import moment from "moment";
import { connect } from "react-redux";
import * as TrainingStepsAction from "./TrainingStepsAction";
import func from "../../../util/commonFunc";
import SecListView from "../../common/listview/secListView";
import trainComment from "./comment-icon.jpg";
import zan from "../../../image/zan.png";
import alreadyzan from "../../../image/alreadyzan.png";
import myIcon from "../../../image/my.png";
class TrainingSteps extends Component {
constructor(props) {
super(props);
const ds = new ListView.DataSource({
rowHasChanged: (r1, r2) => r1 !== r2,
});
this.state = {
displayProgress: false,
visible: false,
confirmLoading: false,
commitContent: "",
showEnroll: 1,
showComment: false,
comment: "",
dataSource: ds,
isLoading: false,
commentType: 1,
replyCommentTypeId: 0,
showProgress: true,
trainLogoHeight: 400,
commentHasMore: true,
showContentOccupy: false,
enablePosition: 0,
refreshTrainComment: "",
};
}
componentWillMount() {}
componentDidMount() {
let _this = this;
this.logoHeightListen();
this.props.initailData();
let { id, finished, tabkey, bizType } = this.props.location.query;
let params = {
id: id,
};
if (bizType != "2") {
this.props.trainStepsData(finished, params, () => {
let { introductionVo } = _this.props.TrainingStepsReducer;
let {
needEnroll,
needAudit,
hasEnrolled,
audited,
enablePosition,
enableSign,
} = introductionVo;
_this.setState({
showProgress: this.showProgressJudge(
needEnroll,
hasEnrolled,
needAudit,
audited
),
enablePosition,
enableSign,
});
_this.contentDomHeightSetForSticky();
});
}
this.setState({
isLoading: true,
});
this.props.reviewListData(
{ ...params, pageNo: 1, pageSize: 10 },
false,
() => {
const { reviewListTotle, reviewPageNo, reviewListData } =
_this.props.TrainingStepsReducer;
this.setState({
isLoading: false,
commentHasMore:
(reviewPageNo - 2) * 10 + reviewListData.length < reviewListTotle
? true
: false,
});
}
);
}
logoHeightListen() {
this.setState({
trainLogoHeight: document.body.clientWidth * (225 / 375),
});
}
contentDomHeightSetForSticky() {
let domHeight = document.getElementById(
"train-contain-list-sticky-div"
).offsetHeight;
let bodyHeight = document.body.clientHeight;
if (
bodyHeight - (domHeight + 88) < 50 &&
bodyHeight - (domHeight + 88) > 0
) {
this.setState({
showContentOccupy: true,
});
}
}
showProgressJudge(needEnroll, hasEnrolled, needAudit, audited) {
if (needEnroll) {
if (hasEnrolled) {
if (needAudit) {
if (audited) {
return true;
} else {
return false;
}
} else {
return true;
}
} else {
return false;
}
} else {
return true;
}
}
onLoadMore = () => {
let { id } = this.props.location.query;
let _this = this;
let { reviewPageNo } = this.props.TrainingStepsReducer;
let params = {
id: id,
};
if (this.state.isLoading) {
return;
}
if (!this.state.commentHasMore) {
return;
}
this.setState({
isLoading: true,
});
this.props.reviewListData(
{ ...params, pageNo: reviewPageNo, pageSize: 10 },
true,
() => {
const { reviewListTotle, reviewPageNo, reviewListData } =
_this.props.TrainingStepsReducer;
this.setState({
isLoading: false,
commentHasMore:
(reviewPageNo - 2) * 10 + reviewListData.length < reviewListTotle
? true
: false,
});
}
);
};
//提交评论
trainCommitVerb = () => {
if (!this.state.commitContent) {
Toast.info(intl.get("PublishKey73") || "评论不能为空");
return;
}
let _this = this;
if (this.state.commentType == 1) {
let { id } = this.props.location.query;
let param = { trainingProjectId: id, content: this.state.commitContent };
this.props.commitVerb(param, () => {
this.setState({ commitContent: "" });
let params = {
id: id,
};
this.props.reviewListData(
{ ...params, pageNo: 1, pageSize: 10 },
false,
() => {
_this.setState({
refreshTrainComment: new Date().getTime(),
});
}
);
});
this.setState({ showEnroll: 1, showComment: false });
} else if (this.state.commentType == 2) {
let { id } = this.props.location.query;
let param = {
trainingProjectId: id,
tpCommentId: this.state.replyCommentTypeId,
content: this.state.commitContent,
};
this.props.reviewReplyCommit(param, () => {
this.setState({ commitContent: "" });
let params = {
id: id,
};
this.props.reviewListData(
{ ...params, pageNo: 1, pageSize: 10 },
false,
() => {
this.setState({
isLoading: false,
});
}
);
Toast.info(intl.get("CommentSuccess") || "评论成功");
});
this.setState({ showEnroll: 1, showComment: false });
}
};
render() {
let { reviewListData, isMore } = this.props.TrainingStepsReducer;
let loadMore = isMore ? (
<button className="load-more" onClick={() => this.onLoadMore()}>
{intl.get("PublishKey74") || "点击加载更多"}
</button>
) : (
<button className="load-more">
{intl.get("PublishKey30") || "没有更多数据"}
</button>
);
this.state.dataSource = this.state.dataSource.cloneWithRows(
this.props.TrainingStepsReducer.reviewListData
);
return (
<div
className="train-contain"
style={{ backgroundColor: "#f4f4f4", width: "100%", height: "100%" }}
>
<div style={{ width: "100%", marginTop: 0 }}>
<Fragment>{this.renderComment(reviewListData, loadMore)}</Fragment>
</div>
</div>
);
}
//评论
renderComment = (reviewListData, loadMore) => {
let { reviewPageNo, reviewListTotle } = this.props.TrainingStepsReducer;
let row = (item, section, row) => {
let imgsrc = item.userAvatar == "" ? myIcon : item.userAvatar;
const imageStyle = {
backgroundImage: `url(${imgsrc})`,
backgroundPosition: "center",
backgroundRepeat: "no-repeat",
backgroundSize: "contain",
};
return (
<div className="list-item-div">
<div className="list-item-img-box">
<div className="list-item-img" style={imageStyle} />
</div>
<div className="list-item-content">
<h2 className="item-title-style">{item.commentator}</h2>
<p
className="item-text-style"
dangerouslySetInnerHTML={{
__html: item.content.replace(/\r?\n/g, "</br>"),
}}
/>
<div className="item-footer-box">
<p className="item-time-style">
{item.createTime.length > 16
? item.createTime.substring(0, 16)
: item.createTime}{" "}
</p>
<span
className="item-zhan-style"
style={{ marginLeft: "2rem" }}
onClick={() => this.reviewDetail(item)}
>
<span>{item.replys == "0" ? "0" : item.replys}</span>
<img
src={trainCommentReplay}
style={{ marginTop: 10 }}
className="cell-left-icon"
alt=""
/>
</span>
<span
className="item-zhan-style"
onClick={() => this.laudClick(item, row)}
>
<span>{item.thumbsUps}</span>
<img
src={String(item.status) === "1" ? alreadyzan : zan}
alt=""
/>
</span>
</div>
{item.tpCommentReplies.length > 0 ? (
<div className="train-comment-replay">
<div>{item.tpCommentReplies[0].createByName}:</div>
<div
dangerouslySetInnerHTML={{
__html: item.tpCommentReplies[0].content.replace(
/\r?\n/g,
"</br>"
),
}}
/>
{item.tpCommentReplies.length > 1 ? (
<div onClick={() => this.reviewDetail(item)}>
{`${intl.get("PublishKey83") || "查看全部"}${item.replys}${
intl.get("PublishKey84") || "条回复"
}>`}
</div>
) : (
""
)}
</div>
) : (
""
)}
</div>
</div>
);
};
return (
<div
className="train-comment"
style={{ paddingBottom: "1rem", backgroundColor: "#F4F4F4" }}
>
<div className="train-comment-contain">
<img src={trainComment} className="cell-left-icon" alt="" />
<div className="comment-slider" onClick={() => this.commentShow(1)}>
{" "}
{intl.get("PublishKey85") || "说点什么吧~"}
</div>
</div>
<p style={{ padding: "0.3rem 0.2rem", fontSize: "0.3rem" }}>
{intl.get("all_comment") || "全部评论"}
</p>
{/* */}
<SecListView
key={this.state.refreshTrainComment}
dataSource={this.state.dataSource}
renderRow={row.bind(this)}
onEndReached={this.onLoadMore}
listStyle={50}
isLoading={this.state.isLoading}
page={{
pageTotal: reviewListTotle,
pageNo: reviewPageNo,
pageSize: 10,
}}
footText={intl.get("PublishKey47") || "没有更多了"}
/>
<Modal
title={intl.get("Comment") || "评论"}
visible={this.state.showComment}
transparent
maskClosable={false}
className={"train-comment-input"}
onClose={this.commentHidden}
footer={[
{
text: intl.get("Cancel") || "取消",
onPress: () => {
this.commentHidden();
},
},
{
text: intl.get("Yes") || "确定",
onPress: () => {
this.trainCommitVerb(1, 0);
},
},
]}
>
<div className="comment-body">
<TextareaItem
maxLength={800}
placeholder={intl.get("WriteComment") || "写评论"}
rows={4}
value={this.state.commitContent}
style={{ backgroundColor: "clear" }}
onChange={(txt) => {
let value = txt;
if (value.length > 800) {
value = value.slice(0, 800);
}
this.setState({ commitContent: value });
}}
ref={(el) => (this.autoFocusInst = el)}
/>
</div>
</Modal>
</div>
);
};
reachEnd = () => {};
commentShow = (type, id) => {
//type=1为项目评论,2为项目评论回复
this.setState({
showComment: true,
commentType: type,
replyCommentTypeId: id,
});
};
commentHidden = () => {
this.setState({
showComment: false,
commitContent: "",
});
};
reviewDetail = (item) => {
console.log(item);
// let time = moment(item.createTime).format("YYYY-MM-DD HH:hh:SS");
let time = moment(item.createTime).format("YYYY-MM-DD HH:mm");
hashHistory.push({
pathname: func.routerBefore() + "/train/trainingReview",
query: {
targeId: this.props.location.query.id,
commentId: item.id,
headsrc: item.userAvatar,
time: time,
title: item.commentator,
content: item.content,
lauNumber: item.thumbsUps,
status: item.status,
},
});
};
//点赞
laudClick = (item, index) => {
let params = {
tpCommentId: item.id,
};
let { id } = this.props.location.query;
let param = { id: id };
let _this = this;
if (String(item.status) === "0") {
// item.thumbsUps++;
// this.props.TrainingStepsReducer.reviewListData[index].thumbsUps++;
this.props.laudSaveEnrollEvent(params, () => {
Toast.info(intl.get("LikeSuccess") || "点赞成功");
this.props.reviewListData(
{ ...param, pageNo: 1, pageSize: 10 },
false,
() => {
_this.setState({
refreshTrainComment: new Date().getTime(),
});
}
);
});
} else {
// this.props.TrainingStepsReducer.reviewListData[index].thumbsUps--;
// item.thumbsUps--;
this.props.laudDeleEnrollEvent(params, () => {
Toast.info(intl.get("Unlike") || "取消点赞");
this.props.reviewListData(
{ ...param, pageNo: 1, pageSize: 10 },
false,
() => {
_this.setState({
refreshTrainComment: new Date().getTime(),
});
}
);
});
}
};
}
export default connect((state) => {
let { TrainingStepsReducer } = state;
return {
TrainingStepsReducer,
};
}, TrainingStepsAction)(TrainingSteps);
import * as actions from './TrainReduxTypes';
import NetWork from '../../../util/fetchUtil';
import API from '../../../util/urlconfig';
import {Toast} from 'antd-mobile';
import func from '../../../util/commonFunc'
import * as actions from "./TrainReduxTypes";
import excute from "../../../util/fetchUtil";
import NetWork from "../../../util/fetchUtil";
import API from "../../../util/urlconfig";
import { Toast } from "antd-mobile";
import func from "../../../util/commonFunc";
import intl, { init } from "react-intl-universal";
import { INITIAL_TRAIN_REDUCER } from '../../menutrain/TrainReduxTypes';
export const trainStepsData=(finished,params,callback)=>{
return dispatch=>{
let url = finished?API.trainStepsFinish:API.trainSteps;
NetWork.post(url, params,
response=>{
export const trainStepsData = (finished, params, callback) => {
return (dispatch) => {
let url = finished ? API.trainStepsFinish : API.trainSteps;
NetWork.post(url, params, (response) => {
// 数据反转
if (
response.data.progressVo &&
response.data.progressVo.courseRecentVos
) {
response.data.progressVo.courseRecentVos.reverse();
}
// 数据反转
if( response.data.progressVo && response.data.progressVo.courseRecentVos ) {
response.data.progressVo.courseRecentVos.reverse()
}
dispatch({
type:actions.TRAIN_STEPS_DATA_EVENT,
introductionVo:response.data.introductionVo,
contentVo:pacePer(response.data.contentVo),
progressVo:response.data.progressVo,
hasEnrolled:response.data.hasEnrolled
})
if(callback){
callback();
}
}
)
}
dispatch({
type: actions.TRAIN_STEPS_DATA_EVENT,
introductionVo: response.data.introductionVo,
contentVo: pacePer(response.data.contentVo),
progressVo: response.data.progressVo,
hasEnrolled: response.data.hasEnrolled,
});
if (callback) {
callback();
}
});
};
};
/**
......@@ -41,248 +41,273 @@ export const trainStepsData=(finished,params,callback)=>{
* @param termialType 1、pc端;2、微信端
* @constructor
*/
export const CheckDownloadingStatus = (needEnroll, hasEnroll, projectStartTime, projectEndTime) => {
return dispatch => {
let paramsData = {
needEnroll: needEnroll,
hasEnroll: hasEnroll,
projectStartTime: projectStartTime,
projectEndTime: projectEndTime,
termialType: 2
};
NetWork.getNetwork(API.trainDataLibraryDataStatus, paramsData,
response => {
console.log("response1", response.data);
// dispatch({
// type: actions.CHECK_DOWNLOADING_STATUS,
// });
}
);
}
}
let pacePer=(obj)=> {
//添加百分比ratio
obj.plans.map(item => {
let ratio = 0;
item.activities.map(childItem => {
if (String(childItem.type) === "0") {
if (childItem.finished) {
ratio += 1;
} else {
ratio += 0.5;
}
} else {
if (childItem.finished) {
ratio += 1;
} else {
ratio += 0;
}
}
});
item['ratio'] = Number.parseFloat(ratio / item.activities.length).toFixed(2);
});
return obj;
export const CheckDownloadingStatus = (
needEnroll,
hasEnroll,
projectStartTime,
projectEndTime
) => {
return (dispatch) => {
let paramsData = {
needEnroll: needEnroll,
hasEnroll: hasEnroll,
projectStartTime: projectStartTime,
projectEndTime: projectEndTime,
termialType: 2,
};
NetWork.getNetwork(
API.trainDataLibraryDataStatus,
paramsData,
(response) => {
console.log("response1", response.data);
// dispatch({
// type: actions.CHECK_DOWNLOADING_STATUS,
// });
}
);
};
};
export const reviewListData=(params, isUpData,callBack)=>{
return dispatch=>{
let urlParams=API.reviewListLink;
if (params) {
let paramsArray = [];
//拼接参数
Object.keys(params).forEach(key => paramsArray.push(key + '=' + params[key]))
if (urlParams.indexOf('?')==-1) {
urlParams += '?' + paramsArray.join('&')
} else {
urlParams += '&' + paramsArray.join('&')
}
let pacePer = (obj) => {
//添加百分比ratio
obj.plans.map((item) => {
let ratio = 0;
item.activities.map((childItem) => {
if (String(childItem.type) === "0") {
if (childItem.finished) {
ratio += 1;
} else {
ratio += 0.5;
}
} else {
if (childItem.finished) {
ratio += 1;
} else {
ratio += 0;
}
NetWork.get(urlParams,
response=>{
console.log('评论');
console.log(response);
}
});
item["ratio"] = Number.parseFloat(ratio / item.activities.length).toFixed(
2
);
});
return obj;
};
export const reviewListData = (params, isUpData, callBack) => {
return (dispatch) => {
let urlParams = API.reviewListLink;
if (params) {
let paramsArray = [];
//拼接参数
Object.keys(params).forEach((key) =>
paramsArray.push(key + "=" + params[key])
);
if (urlParams.indexOf("?") == -1) {
urlParams += "?" + paramsArray.join("&");
} else {
urlParams += "&" + paramsArray.join("&");
}
}
NetWork.get(urlParams, (response) => {
console.log("评论");
console.log(response);
try{
if(String(response.code)==="1000"){
let reviewPageNo=Number.parseInt(response.data.current)+1;
dispatch({
type:actions.REVIEW_LIST_DATA_EVENT,
reviewListData:response.data.records,
reviewPageNo:reviewPageNo,
isUpData:isUpData,
total:response.data.total,
})
if(callBack){
callBack();
}
}
}catch(e){
console.log(e);
}
try {
if (String(response.code) === "1000") {
let reviewPageNo = Number.parseInt(response.data.current) + 1;
})
};
dispatch({
type: actions.REVIEW_LIST_DATA_EVENT,
reviewListData: response.data.records,
reviewPageNo: reviewPageNo,
isUpData: isUpData,
total: response.data.total,
});
if (callBack) {
callBack();
}
}
} catch (e) {
console.log(e);
}
});
};
};
//评论
export const commitVerb=(params,callBack)=>{
return dispatch=>{
NetWork.post(API.reviewCommit, params, response=>{
try {
if(Number.parseFloat(response.code)===1000){
dispatch({
type:actions.REVIEW_COMMIT_SUCCESS,
status:1,
});
Toast.info(intl.get("CommentSuccess")||"评论成功");
callBack();
}
}catch (e) {
}
});
}
export const commitVerb = (params, callBack) => {
return (dispatch) => {
NetWork.post(API.reviewCommit, params, (response) => {
try {
if (Number.parseFloat(response.code) === 1000) {
dispatch({
type: actions.REVIEW_COMMIT_SUCCESS,
status: 1,
});
Toast.info(intl.get("CommentSuccess") || "评论成功");
callBack();
}
} catch (e) {}
});
};
};
//点赞保存功能
export const laudSaveEnrollEvent=(params,callBack)=>{
return dispatch=>{
NetWork.post(API.trainReviewGood, params, response=>{
try {
if(Number.parseFloat(response.code)===1000){
dispatch({
type:actions.LAUD_SAVE_SUCCESS_EVENT,
status:1,
itemId:params.tpCommentId
});
if(callBack){
callBack();
}
}
}catch (e) {
console.log(e);
}
});
}
export const laudSaveEnrollEvent = (params, callBack) => {
return (dispatch) => {
NetWork.post(API.trainReviewGood, params, (response) => {
try {
if (Number.parseFloat(response.code) === 1000) {
dispatch({
type: actions.LAUD_SAVE_SUCCESS_EVENT,
status: 1,
itemId: params.tpCommentId,
});
if (callBack) {
callBack();
}
}
} catch (e) {
console.log(e);
}
});
};
};
//报名
export const lessonEnrollEvent=(params,callBack)=>{
return dispatch=>{
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)
}
});
}
export const lessonEnrollEvent = (params, callBack) => {
return (dispatch) => {
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);
}
});
};
};
export const laudDeleEnrollEvent=(params,callBack)=>{
return dispatch=> {
NetWork.post(API.trainReviewBad, params, response => {
console.log(response);
try {
if (Number.parseFloat(response.code) === 1000) {
if(callBack){
callBack();
}
dispatch({
type: actions.LAUD_DELE_TYPE_EVENT,
status: 0,
itemId: params.tpCommentId
});
}
} catch (e) {
console.log(e);
}
});
}
//签到
export function sign(params, callBack) {
return (dispatch) => {
return excute.post(API.signIn, params, (res) => {
callBack(res);
dispatch({
type: SIGN_ACTION,
data: res,
});
});
};
}
export const laudDeleEnrollEvent = (params, callBack) => {
return (dispatch) => {
NetWork.post(API.trainReviewBad, params, (response) => {
console.log(response);
try {
if (Number.parseFloat(response.code) === 1000) {
if (callBack) {
callBack();
}
dispatch({
type: actions.LAUD_DELE_TYPE_EVENT,
status: 0,
itemId: params.tpCommentId,
});
}
} catch (e) {
console.log(e);
}
});
};
};
export const reviewReplyList=(params,callBack)=>{
let contactUrl = API.trainReviewReplyLis+'?commentId='+params.commentId+'&pageNo='+params.pageNo+'&pageSize=10';
export const reviewReplyList = (params, callBack) => {
let contactUrl =
API.trainReviewReplyLis +
"?commentId=" +
params.commentId +
"&pageNo=" +
params.pageNo +
"&pageSize=10";
return dispatch=> {
NetWork.get(contactUrl, response => {
console.log(response,'评论列表');
try {
if (Number.parseFloat(response.code) === 1000) {
dispatch({
type: actions.REVIEW_COMMIT_LIST,
list: response.data.records,
page:{currentPage:params.pageNo,pageTotal: response.data.total, pageNo: response.data.pages, pageSize:response.data.size}
});
callBack();
}
} catch (e) {
console.log(e);
}
});
}
}
return (dispatch) => {
NetWork.get(contactUrl, (response) => {
console.log(response, "评论列表");
try {
if (Number.parseFloat(response.code) === 1000) {
dispatch({
type: actions.REVIEW_COMMIT_LIST,
list: response.data.records,
page: {
currentPage: params.pageNo,
pageTotal: response.data.total,
pageNo: response.data.pages,
pageSize: response.data.size,
},
});
callBack();
}
} catch (e) {
console.log(e);
}
});
};
};
export const reviewReplyCommit=(params,callBack)=>{
return dispatch=> {
NetWork.post(API.trainReviewReplyCommit, params, response => {
console.log(response,'提交评论');
try {
if (Number.parseFloat(response.code) === 1000) {
callBack();
}
} catch (e) {
console.log(e);
}
});
}
}
export const reviewReplyCommit = (params, callBack) => {
return (dispatch) => {
NetWork.post(API.trainReviewReplyCommit, params, (response) => {
console.log(response, "提交评论");
try {
if (Number.parseFloat(response.code) === 1000) {
callBack();
}
} catch (e) {
console.log(e);
}
});
};
};
//初始化数据
export const initailData = ()=>{
return dispatch=>{
dispatch({type:actions.INITAIL_TRAIN_DATA});
}
}
export const trainClickLog = (id)=>{
let url = API.trainUrl+"api/trainingProject/tpPlanActivity/view/record/add";
return dispatch =>{
NetWork.post(url,{
"id":id
},(data)=>{});
}
export const initailData = () => {
return (dispatch) => {
dispatch({ type: actions.INITAIL_TRAIN_DATA });
};
};
export const trainCertificateGet = (data,callback)=>{
let url = API.trainUrl+"api/trainingProject/certificate/grant";
return dispatch =>{
NetWork.post(url,data,(response)=>{
callback(response);
});
}
}
export const trainClickLog = (id) => {
let url = API.trainUrl + "api/trainingProject/tpPlanActivity/view/record/add";
return (dispatch) => {
NetWork.post(
url,
{
id: id,
},
(data) => {}
);
};
};
export const trainCertificateGet = (data, callback) => {
let url = API.trainUrl + "api/trainingProject/certificate/grant";
return (dispatch) => {
NetWork.post(url, data, (response) => {
callback(response);
});
};
};
/**
* 请求精选作品详情接口,验证是否可进入
* @param {*} requestUrl
* @param {*} requestData
* @param {*} callback
* @param {*} requestUrl
* @param {*} requestData
* @param {*} callback
*/
export function validatePickOutCaseDetail (requestUrl, requestData, callback) {
return dispatch => {
NetWork.getNetwork(requestUrl, requestData, (response)=> {
console.log("trainingStepsAction-response", response);
callback(response);
});
}
}
\ No newline at end of file
export function validatePickOutCaseDetail(requestUrl, requestData, callback) {
return (dispatch) => {
NetWork.getNetwork(requestUrl, requestData, (response) => {
console.log("trainingStepsAction-response", response);
callback(response);
});
};
}
.singleLineOverflow {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
.train-complete-icon,
.train-in-complete-icon,
.train-progress-icon {
width: 40px;
height: 40px;
}
.BraftEditor-content {
font-size: 0.25rem;
}
.am-accordion .am-accordion-item .am-accordion-header {
position: inherit !important;
}
.training-done-view {
overflow: hidden;
}
.training-done-view .my-accordion {
padding-left: 0.82rem;
}
.training-done-view .my-accordion .am-accordion-item .am-accordion-content {
overflow: inherit;
}
.training-done-view .my-accordion .am-accordion-item .am-accordion-content .am-list-item {
padding-left: 0;
}
.training-done-view .my-accordion .am-accordion-item .am-accordion-content .training-done-info {
margin: 0;
line-height: 0.65rem;
padding-right: 0.15rem;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
max-width: 63%;
font-size: 0.3rem;
color: #666666;
}
.training-done-view .my-accordion .am-accordion-item .am-accordion-content .tip-text {
margin: 0.1rem;
font-size: 0.2rem;
color: #4285f4;
line-height: 0.28rem;
border-radius: 0.3rem;
border: 1px solid #4285f4;
padding: 0.05rem 0.1rem;
overflow: visible;
}
.training-done-view .my-accordion .am-accordion-item .am-accordion-content .tip-text-green {
margin: 0.1rem;
font-size: 0.2rem;
color: #559906;
line-height: 0.28rem;
border-radius: 0.3rem;
border: 1px solid #559906;
padding: 0.05rem 0.1rem;
overflow: visible;
}
.training-done-view .my-accordion .am-accordion-item .am-accordion-content .am-list-body div:not(:last-child) .am-list-line:after {
left: -0.33rem;
width: 105%;
}
.training-done-view .my-accordion .am-accordion-item .am-accordion-content .am-list-line:after {
left: -0.33rem;
border-bottom: 2px solid #ddd;
}
.training-done-view .my-accordion .am-accordion-item .am-accordion-content-box:after {
left: -0.33rem;
width: 105%;
border-bottom: 2px solid #ddd;
}
.list-item-box {
width: 100%;
padding-top: 0;
padding-bottom: 0;
position: relative;
display: flex;
flex-direction: row;
align-items: center;
}
.list-item-box i.dom {
position: absolute;
width: 0.16rem;
height: 0.16rem;
border-radius: 50%;
left: -0.42rem;
top: 0.26rem;
}
.list-item-box .smallDian {
background: #d2d2d2;
}
.list-item-box .activeDian {
background-color: #4285f4;
}
.review-text-style {
font-size: 0.24rem;
}
.product-info {
padding: 0.1rem;
}
.list-item-div {
display: flex;
overflow: hidden;
padding: 0.2rem 0.2rem 0.2rem 0;
flex-direction: row;
flex: 1;
margin-left: 0.2rem;
border-bottom: solid 1px #f6f6f6;
}
.list-item-div .list-item-img-box {
width: 0.6rem;
margin-right: 0.1rem;
}
.list-item-div .list-item-img-box .list-item-img {
width: 0.6rem;
height: 0.6rem;
border-radius: 0.6rem;
background-color: #ccc;
overflow: hidden;
}
.list-item-div .list-item-content {
display: flex;
flex: 1;
flex-direction: column;
}
.list-item-div .list-item-content .item-footer-box {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.list-item-div .list-item-content .item-footer-box > p {
font-size: 20px;
}
.list-item-div .list-item-content .item-title-style {
font-size: 0.26rem !important;
}
.list-item-div .list-item-content .item-text-style {
padding-top: 0.1rem;
padding-bottom: 0.2rem;
font-size: 0.24rem;
}
.list-item-div .list-item-content .item-time-style {
font-size: 0.24rem;
color: #ccc;
}
.list-item-div .list-item-content .item-time-style .item-btn-style {
border: 0;
border-radius: 0.2rem;
margin-left: 0.2rem;
padding: 0 0.3rem;
color: #999;
background-color: transparent;
}
.list-item-div .list-item-content .item-time-style .item-btn-style-active {
background-color: #999;
border: 0;
border-radius: 0.2rem;
margin-left: 0.2rem;
padding: 0 0.3rem;
color: #fff;
}
.list-item-div .list-item-content .item-header-box {
display: flex;
flex: 1;
height: 274px;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.list-item-div .list-item-content .item-header-box .item-zhan-style {
border: 0;
background-color: transparent;
padding: 0;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
font-size: 0.24rem;
color: #ccc;
}
.list-item-div .list-item-content .item-header-box .item-zhan-style .item-zhan-icon-active {
display: flex;
justify-content: center;
align-items: center;
margin-left: 0.05rem;
color: slategray;
}
.list-item-div .list-item-content .item-header-box .item-zhan-style .item-zhan-icon {
display: flex;
justify-content: center;
align-items: center;
color: gainsboro;
}
.train-logo {
width: 100%;
height: 3.6rem;
position: relative;
display: flex;
background-image: url("active-bg.png");
background-repeat: no-repeat;
background-size: cover;
padding-left: 30px;
padding-top: 40px;
}
.train-logo img {
width: 40%;
height: 2rem;
}
.train-logo .signing_location_container {
position: absolute;
right: 0.2rem;
bottom: 0.32rem;
display: flex;
align-items: center;
justify-content: center;
width: 1.4rem;
height: 0.64rem;
background: #e4eeff;
box-shadow: 0 0.02rem 0.1rem 0 rgba(0, 46, 123, 0.25);
border-radius: 0.32rem;
}
.train-logo .signing_location_container .signing_icon_container .signing_icon {
width: 0.32rem;
height: 0.32rem;
}
.train-logo .signing_location_container .signing_location_text {
font-size: 0.28rem;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #4285f4;
line-height: 0.36rem;
text-shadow: 0 0.02rem 0.1rem rgba(0, 46, 123, 0.25);
}
.train-footer-box {
display: flex;
border-top: solid 1px #dddddd;
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 1rem;
background-color: #fff;
overflow: hidden;
z-index: 999;
}
.train-footer-box div {
height: 0.6rem;
-webkit-box-flex: 6;
-webkit-flex: 6;
-ms-flex: 6;
flex: 6;
}
.train-footer-box input {
margin: auto;
height: 0.6rem;
background-color: #f5f5f5;
border-radius: 0.3rem;
display: inline-block;
border: none;
padding-left: 0.3rem !important;
font-size: 0.25rem;
color: #333333;
}
.train-footer-box .enroll-submit {
-webkit-box-flex: 2;
-webkit-flex: 2;
-ms-flex: 2;
flex: 2;
border: 0;
border-radius: 0;
font-size: 0.25rem;
}
.train-footer-box .enroll-submitInfo {
-webkit-box-flex: 3;
-webkit-flex: 3;
-ms-flex: 3;
flex: 3;
color: white;
font-size: 0.28rem;
border-radius: 0;
border: 0;
background-color: #4285f4;
padding: 0;
margin: 0;
}
.header {
display: flex;
flex-direction: row;
padding: 0.2rem 0;
border-bottom: solid 0.15rem #f4f4f4;
padding: 44px 25px 25px 18px;
}
.header .header-img {
height: 0.8rem;
border-radius: 50%;
margin-top: 10px;
background-color: #dddddd;
width: 0.8rem;
}
.header .header-img .img {
width: 0.8rem;
height: 0.8rem;
}
.header .header-contain {
display: flex;
flex-direction: column;
justify-content: flex-start;
width: 60%;
align-items: left;
flex: 1;
padding-left: 10px;
padding-top: 25px;
}
.header .header-contain .item-zhan-icon-active {
display: flex;
justify-content: center;
align-items: center;
margin-left: 0.05rem;
color: slategray;
}
.header .header-contain .item-zhan-icon {
display: flex;
justify-content: center;
align-items: center;
color: gainsboro;
}
.header .header-contain > p {
padding: 5px;
}
.header .header-contain > p :nth-child(2) {
font-size: 30px;
color: #333333;
}
.header .header-contain .item-header-box {
display: flex;
flex-direction: row;
width: 100%;
justify-content: space-between;
padding: 5px;
}
.header .header-contain .item-header-box p {
font-size: 20px;
color: #999999;
}
.header .header-title {
text-align: left;
width: 80%;
font-size: 0.25rem;
}
.header .header-time {
text-align: left;
width: 80%;
font-size: 0.2rem;
color: #b3b3b3;
}
.about-footer-button {
position: fixed;
left: 0;
bottom: 0;
widtheader-contain: 100%;
height: 0.8rem;
overflow: hidden;
z-index: 999;
}
.comment-title {
padding-top: 0.2rem;
background-color: white;
}
.segement-slider {
height: 0.2rem;
background-color: #f5f5f5;
}
.segement {
height: 2px;
background-color: #f5f5f5;
margin: 0 0.2rem;
}
.product-info-view {
font-size: 0.31rem;
width: 92%;
margin: 0 auto;
background-color: #fff;
border-radius: 12px;
padding-top: 30px;
padding-bottom: 30px;
}
.train-up-info {
font-size: 0.31rem;
color: #9b9b9b;
width: 92%;
margin: 0 auto;
background-color: #fff;
border-radius: 12px;
margin-bottom: 30px;
padding-left: 40px;
padding-top: 30px;
padding-bottom: 30px;
}
.train-up-info p {
line-height: 0.46rem;
margin: 0;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
/** 对象作为伸缩盒子模型显示 **/
-webkit-box-orient: vertical;
/** 设置或检索伸缩盒对象的子元素的排列方式 **/
-webkit-line-clamp: 2;
/** 显示的行数 **/
overflow: hidden;
/** 隐藏超出的内容 **/
font-size: 30px;
color: #333;
display: block;
margin-bottom: 20px;
}
.train-up-info p span {
color: #888;
}
.train-info {
font-size: 0.31rem;
color: #fff;
width: 100%;
height: 200px;
display: flex;
flex-direction: column;
justify-content: space-between;
padding-left: 40px;
}
.train-info .enroll {
width: 120px;
background-color: #53af5c;
color: #fff;
text-align: center;
padding: 5px 8px;
}
.train-info .enrolled {
width: 120px;
background-color: #ffba19;
color: #fff;
text-align: center;
padding: 5px 8px;
}
.train-info .overed {
width: 100px;
background-color: #e5e6e8;
color: #a1a1a1;
text-align: center;
padding: 5px 8px;
}
.train-info p {
color: #fff;
line-height: 0.48rem;
margin: 0;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
/** 对象作为伸缩盒子模型显示 **/
-webkit-box-orient: vertical;
/** 设置或检索伸缩盒对象的子元素的排列方式 **/
-webkit-line-clamp: 2;
/** 显示的行数 **/
overflow: hidden;
/** 隐藏超出的内容 **/
font-size: 40px;
}
.train-info .descr p {
-webkit-line-clamp: unset;
}
.train-info div {
color: #fff;
font-size: 0.24rem;
}
.train-info .train-info-contain audio {
width: 100%;
margin-bottom: 0.6rem !important;
}
.train-info .train-info-contain video {
width: 100%;
height: 5rem;
margin-bottom: 0.3rem !important;
}
.train-info .train-info-contain a {
text-decoration: underline;
color: blue;
}
.train-info .train-info-contain p {
font-size: 24px !important;
padding: 0 !important;
color: #4a4a4a !important;
}
.product-rule {
padding: 0.2rem 0.4rem;
}
.am-accordion-header {
border-bottom: 0 !important;
}
.am-accordion .am-accordion-item .am-accordion-header {
padding-right: 0;
}
.train-contain-header {
padding: 0.2rem;
padding-left: 0;
white-space: pre-wrap !important;
height: 100% !important;
display: flex;
align-items: center;
justify-content: space-between;
flex-direction: column;
align-items: flex-start;
}
.train-contain-header div:nth-child(1) {
font-size: 34px !important;
width: 100%;
word-wrap: normal;
height: auto;
color: #4a4a4a;
}
.train-contain-header div:nth-child(2) {
font-size: 24px !important;
padding-top: 0.05rem;
color: #666666;
}
.train-contain-header div .train-progress-count {
position: absolute;
right: 0;
background-color: #4285f4;
bottom: 10px;
color: white;
width: 88px;
text-align: center;
font-size: 20px !important;
border-radius: 44px;
}
.train-contain-header div .train-compete-tag {
font-size: 20px !important;
color: #9999;
position: absolute;
width: fit-content;
right: 0;
bottom: 0;
}
.am-accordion-header {
height: auto !important;
line-height: inherit !important;
background-color: #f4f4f4 !important;
}
.train-content-cell {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding-right: 0.2rem;
padding-top: 0.1rem;
padding-bottom: 0.1rem;
border-bottom: solid 1px #f6f6f6;
height: 1rem;
position: relative;
}
.train-content-cell .training-done-info-name,
.train-content-cell p {
font-family: PingFangSC-Regular;
font-size: 0.25rem;
color: #595959;
/*多行省略注释 liyua*/
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
/* autoprefixer: ignore next */
-webkit-box-orient: vertical;
display: -webkit-box;
}
.train-content-cell .train-content-status-cell {
position: absolute;
right: 20px;
bottom: 0;
width: fit-content;
text-align: center;
}
.train-content-cell .train-content-status-cell .circle {
width: 32px;
height: 32px;
border-radius: 100%;
background-color: #ecf3ff;
position: absolute;
top: -14px;
right: 22px;
}
.tip-text-green {
margin: 0.1rem;
font-size: 0.2rem;
color: #559906;
line-height: 0.28rem;
border-radius: 0.3rem;
border: 1px solid #559906;
padding: 0.05rem 0.1rem;
overflow: visible;
}
.tip-text {
font-size: 0.2rem;
color: #999;
line-height: 0.28rem;
border-radius: 0.3rem;
border: 1px solid #e5e5e5;
padding: 0.05rem 0.1rem;
overflow: visible;
}
.tip-text-simple {
margin: 0.1rem;
font-size: 0.2rem;
color: #000;
line-height: 0.28rem;
border-radius: 0.3rem;
border: 1px solid #eee;
padding: 0.05rem 0.1rem;
overflow: visible;
margin-right: 0;
}
.train-contain-listcell {
display: flex;
flex-direction: row;
width: 80%;
align-items: center;
padding-left: 0.2rem;
}
.train-contain-listcell > img {
max-width: 32px;
max-height: 32px;
display: block;
margin: 0 20px;
}
.train-contain-listcell .certificate-icon {
height: 40px;
display: block;
max-width: unset;
max-height: unset;
margin: 0 0 0 40px;
}
.train-contain-listcell .am-accordion-header {
margin-right: 0px !important;
}
.train-comment {
display: flex;
flex-direction: column;
width: 92%;
margin: 0 auto;
transform: translateY(-80px);
}
.train-comment > p {
background-color: white;
}
.train-comment .train-comment-contain {
background-color: white;
height: 162px;
padding: 58px 54px 58px 26px;
align-items: center;
border-bottom: solid 1px #e4e4e4;
}
.train-comment .train-comment-contain .cell-left-icon {
height: 43px;
margin-left: 9px;
width: auto;
margin-top: 5px;
}
.train-comment .train-comment-contain .comment-slider {
background: #f4f4f4;
border-radius: 23px;
width: 90%;
height: 60px;
display: flex;
align-items: center;
padding-left: 0.2rem;
font-size: 17pt;
color: #959595;
letter-spacing: 0.1px;
float: right;
}
.comment-body {
height: 2.5rem;
border-top: 2px solid #eee;
overflow: scroll;
background-color: #f4f4f4;
border-radius: 2px;
}
.signup-button {
display: block;
width: 100%;
height: 0.81rem;
position: fixed;
bottom: 0;
font-size: 0.35rem;
line-height: 0.71rem;
color: white;
text-align: center;
}
.train-pay-button-container {
width: 100%;
height: 128px;
position: fixed;
bottom: 0;
left: 0;
background-color: #fff;
padding: 0 40px;
box-shadow: 0px -2px 0px 0px rgba(0, 0, 0, 0.05);
}
.train-pay-button-container .train-pay-button {
width: 100%;
height: 88px;
line-height: 86px;
border-radius: 88px;
background-color: #ff8400;
margin-top: 20px;
text-align: center;
color: #fff;
font-size: 28px;
font-weight: 500;
}
.train-pay-button-container .train-pay-button .train-actualPrice {
font-size: 40px;
margin-left: 10px;
margin-right: 5px;
}
.train-pay-button-container .train-pay-button .train-originalPrice {
font-size: 24px;
font-weight: 400;
margin-left: 10px;
text-decoration: line-through;
}
.train-contain-list .ant-list-item {
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
/* align-items: center; */
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
padding-top: 0px;
padding-bottom: 0px;
}
.train-contain-list i.arrow {
display: none !important;
}
.train-comment-replay {
width: 100%;
background-color: #f4f4f4;
display: flex;
flex-direction: column;
padding: 15px;
margin-top: 12px;
}
.train-comment-replay > div:nth-child(1) {
font-family: PingFangSC-Regular;
font-size: 0.21rem;
color: #4a90e2;
}
.train-comment-replay > div:nth-child(2) {
padding: 10px 0px;
font-size: 0.21rem;
}
.train-comment-replay > div:nth-child(3) {
font-family: PingFangSC-Regular;
font-size: 0.17rem;
color: #999999;
}
.item-footer-box {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.item-footer-box > p {
font-size: 20px;
}
.item-footer-box .item-zhan-style {
border: 0;
background-color: transparent;
padding: 0;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
font-size: 0.24rem;
color: #ccc;
}
.item-footer-box .item-zhan-style img {
width: 30px;
height: 30px;
}
.item-footer-box .item-zhan-style span {
font-size: 24px;
color: #333;
opacity: 0.65;
margin-right: 10px;
padding-top: 8px;
}
.item-footer-box .item-zhan-style .item-zhan-icon-active {
display: flex;
justify-content: center;
align-items: center;
margin-left: 0.05rem;
color: slategray;
}
.item-footer-box .item-zhan-style .item-zhan-icon {
display: flex;
justify-content: center;
align-items: center;
color: gainsboro;
}
.train-plan-studytime {
display: flex;
justify-content: space-between;
padding: 0.2rem 0.3rem;
border-bottom: solid 2px #f4f4f4;
}
.train-plan-studytime span {
font-size: 0.3rem;
}
.train-plan-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.train-plan-row span {
font-size: 0.15rem;
}
.train-plan-row .train-plan-cell {
border-radius: 0.05rem;
display: flex;
width: 50%;
margin: 0.1rem 0.3rem;
justify-content: space-around;
background-color: #f4f4f4;
height: 0.6rem;
align-items: center;
}
.train-plan-row .train-plan-cell > div > img {
width: 30px;
margin-right: 22px;
margin-top: -15px;
}
.train-plan-row .train-plan-cell > div > span {
font-size: 28px;
}
.train-header {
padding-bottom: 0.5rem;
transform: translateY(-80px);
}
.train-info .train-info-contain a {
color: #1890ff;
text-decoration: none;
}
.train-comment-modal {
width: 80% !important;
}
.train-comment-modal .am-modal-content {
border-radius: 14px !important;
}
.train-comment-modal .coment-header {
height: 84px;
background-color: white;
}
.train-comment-modal .modal-rate {
width: 100%;
height: 78px;
font-size: 42px;
text-align: center;
border-bottom: 2px solid #ddd;
padding-top: 5px;
}
.train-comment-modal .modal-rate .ant-rate {
font-size: 42px;
color: #4285f4;
}
.train-comment-modal .modal-textarea-container {
width: 100%;
height: 234px;
overflow-y: auto;
overflow-x: hidden;
border-radius: 14px !important;
}
.train-comment-modal .modal-textarea-container .modal-textarea {
width: 100%;
font-size: 28px;
color: #959595;
background-color: #f4f4f4;
}
.train-comment-modal .modal-button {
width: 50%;
height: 104px;
line-height: 104px;
text-align: center;
color: #4285f4;
border-top: 2px solid #eee;
border-right: 2px solid #eee;
background: #fff;
}
.train-comment-modal .modal-button2 {
width: 50%;
height: 104px;
line-height: 104px;
text-align: center;
border-top: 2px solid #eee;
border-left: 2px solid #eee;
background: #fff;
}
.train-comment-modal .am-modal-content {
padding: 0 !important;
}
.train-comment-modal .am-modal-content .am-modal-body {
padding: 0 !important;
}
.train-comment-input {
overflow-y: hidden;
}
.train-comment-input .am-modal-body {
padding: 0 !important;
}
.train-comment-input .am-modal-button-group-h .am-modal-button {
color: #108ee9;
}
.train-comment-input .am-modal-button-group-h .am-modal-button:first-child {
color: #000;
}
.train-comment-input .comment-body {
background: #fff;
}
.train-comment-input .comment-body .am-list-item {
padding-left: 22px;
padding-right: 22px;
}
.train-comment-input .comment-body .am-textarea-control textarea {
font-size: 28px;
}
.train-contain .am-tabs-tab div div {
padding-bottom: 0px !important;
}
.train-contain .am-tabs-tabpane-active {
background-color: #f4f4f4;
}
.train-contain .am-accordion-header {
padding-right: 0px !important;
}
.train-review .am-list-view-scrollview {
background-color: #f4f4f4 !important;
}
......@@ -9,7 +9,7 @@
}
.color-4a() {
color: #4A4A4A;
color: #4a4a4a;
}
.color-666() {
......@@ -17,19 +17,19 @@
}
.font32() {
font-size: .32rem;
font-size: 0.32rem;
}
.font30() {
font-size: .3rem;
font-size: 0.3rem;
}
.font34() {
font-size: .34rem;
font-size: 0.34rem;
}
.font24() {
font-size: .24rem;
font-size: 0.24rem;
}
.BraftEditor-content {
......@@ -50,8 +50,6 @@
/** 隐藏超出的内容 **/
}
;
.am-accordion .am-accordion-item .am-accordion-header {
position: inherit !important;
}
......@@ -59,13 +57,12 @@
.training-done-view {
// overflow-x:hidden;
overflow: hidden;
background: #fff;
// background: #fff;
.my-accordion {
padding-left: .82rem;
padding-left: 0.82rem;
.am-accordion-item {
//列表头部
// .am-accordion-header{
// position: absolute;
......@@ -127,12 +124,13 @@
.am-list-item {
padding-left: 0;
.am-list-content {}
.am-list-content {
}
}
.training-done-info {
margin: 0;
line-height: .65rem;
line-height: 0.65rem;
padding-right: 0.15rem;
white-space: nowrap;
text-overflow: ellipsis;
......@@ -140,49 +138,45 @@
max-width: 63%;
.font30;
.color-666;
}
.tip-text {
margin: 0.1rem;
font-size: .2rem;
font-size: 0.2rem;
color: @themeColor;
line-height: .28rem;
border-radius: .3rem;
line-height: 0.28rem;
border-radius: 0.3rem;
border: 1px solid @themeColor;
padding: .05rem .1rem;
padding: 0.05rem 0.1rem;
overflow: visible;
}
.tip-text-green {
margin: 0.1rem;
font-size: .2rem;
font-size: 0.2rem;
color: #559906;
line-height: .28rem;
border-radius: .3rem;
line-height: 0.28rem;
border-radius: 0.3rem;
border: 1px solid #559906;
padding: .05rem .1rem;
padding: 0.05rem 0.1rem;
overflow: visible;
}
.am-list-body div:not(:last-child) .am-list-line:after {
left: -.33rem;
left: -0.33rem;
width: 105%;
}
.am-list-line:after {
left: -.33rem;
left: -0.33rem;
border-bottom: 2px solid #ddd;
}
}
.am-accordion-content-box:after {
left: -.33rem;
left: -0.33rem;
width: 105%;
border-bottom: 2px solid #ddd;
}
}
}
......@@ -199,19 +193,19 @@
i.dom {
position: absolute;
width: .16rem;
height: .16rem;
width: 0.16rem;
height: 0.16rem;
border-radius: 50%;
left: -0.42rem;
top: .26rem;
top: 0.26rem;
}
.smallDian {
background: #D2D2D2;
background: #d2d2d2;
}
.activeDian {
background-color: @themeColor
background-color: @themeColor;
}
}
......@@ -231,7 +225,7 @@
flex: 1;
margin-left: 0.2rem;
border-bottom: solid 1px #F6F6F6;
border-bottom: solid 1px #f6f6f6;
.list-item-img-box {
width: 0.6rem;
......@@ -257,7 +251,7 @@
justify-content: space-between;
align-items: center;
>p {
> p {
font-size: 20px;
}
}
......@@ -311,7 +305,7 @@
flex-direction: row;
justify-content: center;
align-items: center;
font-Size: 0.24rem;
font-size: 0.24rem;
color: #ccc;
.item-zhan-icon-active {
......@@ -329,18 +323,23 @@
color: gainsboro;
}
}
}
}
}
.train-logo {
width: 100%;
height: 3.6rem;
position: relative;
display: flex;
background-image: url("./active-bg.png");
background-repeat: no-repeat;
background-size: cover;
padding-left: 30px;
padding-top: 40px;
img {
width: 100%;
width: 40%;
height: 2rem;
}
.signing_location_container {
......@@ -377,7 +376,6 @@
}
.train-footer-box {
display: flex;
border-top: solid 1px rgb(221, 221, 221);
position: fixed;
......@@ -407,9 +405,6 @@
padding-left: 0.3rem !important;
font-size: 0.25rem;
color: #333333;
}
.enroll-submit {
......@@ -431,15 +426,13 @@
font-size: 0.28rem;
border-radius: 0;
border: 0;
background-color: @themeColor ;
background-color: @themeColor;
padding: 0;
margin: 0;
}
}
.header {
display: flex;
flex-direction: row;
padding: 0.2rem 0;
......@@ -456,7 +449,6 @@
.img {
width: 0.8rem;
height: 0.8rem;
}
}
......@@ -485,12 +477,11 @@
color: gainsboro;
}
>p {
> p {
padding: 5px;
}
>p :nth-child(2) {
> p :nth-child(2) {
font-size: 30px;
color: #333333;
}
......@@ -518,10 +509,9 @@
.header-time {
text-align: left;
width: 80%;
font-size: 0.20rem;
font-size: 0.2rem;
color: rgb(179, 179, 179);
}
}
.about-footer-button {
......@@ -538,57 +528,90 @@
.comment-title {
padding-top: 0.2rem;
background-color: white;
}
.segement-slider {
height: 0.2rem;
background-color: #f5f5f5;
}
.segement {
height: 2px;
background-color: rgb(245, 245, 245);
margin: 0 0.2rem;
}
.product-info-view {
font-size: 0.31rem;
width: 92%;
margin: 0 auto;
background-color: #fff;
border-radius: 12px;
padding-top: 30px;
padding-bottom: 30px;
.video-my-play {
// height: 350px !important;
// padding-top: 0% !important;
}
}
.train-up-info {
font-size: 0.31rem;
color: #9B9B9B;
padding: 0.22rem 0.3rem;
width: 100%;
color: #9b9b9b;
width: 92%;
margin: 0 auto;
background-color: #fff;
border-radius: 12px;
margin-bottom: 30px;
padding-left: 40px;
padding-top: 30px;
padding-bottom: 30px;
p {
line-height: .46rem;
line-height: 0.46rem;
.line-hidden;
font-size: 24px;
.color-4a;
font-size: 30px;
color: #333;
display: block;
margin-bottom: 20px;
span {
color: #888;
}
}
}
.train-info {
font-size: 0.31rem;
color: #9B9B9B;
padding: 0.2rem auto;
color: #fff;
width: 100%;
height: 200px;
display: flex;
flex-direction: column;
justify-content: space-between;
padding-left: 40px;
padding-bottom: 30px;
padding-top: 40px;
padding-right: 40px;
background-color: #fff;
.enroll {
width: 120px;
background-color: #53af5c;
color: #fff;
text-align: center;
padding: 5px 8px;
}
.enrolled {
width: 120px;
background-color: #ffba19;
color: #fff;
text-align: center;
padding: 5px 8px;
}
.overed {
width: 100px;
background-color: #e5e6e8;
color: #a1a1a1;
text-align: center;
padding: 5px 8px;
}
p {
line-height: .48rem;
color: #fff;
line-height: 0.48rem;
.line-hidden;
font-size: 40px;
.color-4a;
}
.descr {
......@@ -598,23 +621,20 @@
}
div {
color: #9B9B9B;
font-size: .24rem;
color: #fff;
font-size: 0.24rem;
}
.train-info-contain {
audio {
width: 100%;
margin-bottom: .6rem !important;
margin-bottom: 0.6rem !important;
}
video {
width: 100%;
height: 5rem;
margin-bottom: .3rem !important;
margin-bottom: 0.3rem !important;
}
a {
......@@ -625,7 +645,7 @@
p {
font-size: 24px !important;
padding: 0 !important;
color: #4A4A4A !important;
color: #4a4a4a !important;
}
}
}
......@@ -642,7 +662,6 @@
padding-right: 0;
}
//UI修改后的新增样式
.train-contain-header {
padding: 0.2rem;
......@@ -660,7 +679,7 @@
width: 100%;
word-wrap: normal;
height: auto;
color: #4A4A4A;
color: #4a4a4a;
}
div:nth-child(2) {
......@@ -689,13 +708,12 @@
right: 0;
bottom: 0;
}
}
.am-accordion-header {
height: auto !important;
line-height: inherit !important;
background-color: #F4F4F4 !important;
background-color: #f4f4f4 !important;
}
.train-content-cell {
......@@ -708,7 +726,7 @@
padding-right: 0.2rem;
padding-top: 0.1rem;
padding-bottom: 0.1rem;
border-bottom: solid 1px #F6F6F6;
border-bottom: solid 1px #f6f6f6;
height: 1rem;
position: relative;
......@@ -737,50 +755,45 @@
width: 32px;
height: 32px;
border-radius: 100%;
background-color: #ECF3FF;
background-color: #ecf3ff;
position: absolute;
top: -14px;
right: 22px;
}
}
}
.tip-text-green {
margin: 0.1rem;
font-size: .2rem;
font-size: 0.2rem;
color: #559906;
line-height: .28rem;
border-radius: .3rem;
line-height: 0.28rem;
border-radius: 0.3rem;
border: 1px solid #559906;
padding: .05rem .1rem;
padding: 0.05rem 0.1rem;
overflow: visible;
}
.tip-text {
font-size: .2rem;
font-size: 0.2rem;
color: #999;
line-height: .28rem;
border-radius: .3rem;
line-height: 0.28rem;
border-radius: 0.3rem;
border: 1px solid #e5e5e5;
padding: .05rem .1rem;
padding: 0.05rem 0.1rem;
overflow: visible;
}
.tip-text-simple {
margin: 0.1rem;
font-size: .2rem;
font-size: 0.2rem;
color: #000;
line-height: .28rem;
border-radius: .3rem;
line-height: 0.28rem;
border-radius: 0.3rem;
border: 1px solid #eee;
padding: .05rem .1rem;
padding: 0.05rem 0.1rem;
overflow: visible;
margin-right: 0;
}
.train-contain-listcell {
......@@ -790,7 +803,7 @@
align-items: center;
padding-left: 0.2rem;
>img {
> img {
max-width: 32px;
max-height: 32px;
display: block;
......@@ -810,19 +823,19 @@
.am-accordion-header {
margin-right: 0px !important;
}
}
.train-comment {
display: flex;
flex-direction: column;
>p {
width: 92%;
margin: 0 auto;
transform: translateY(-80px);
> p {
background-color: white;
}
.train-comment-contain {
background-color: white;
height: 162px;
padding: 58px 54px 58px 26px;
......@@ -834,11 +847,10 @@
margin-left: 9px;
width: auto;
margin-top: 5px;
}
.comment-slider {
background: #F4F4F4;
background: #f4f4f4;
border-radius: 23px;
width: 90%;
height: 60px;
......@@ -851,17 +863,13 @@
float: right;
}
}
}
.comment-body {
height: 2.5rem;
border-top: 2px solid #eee;
overflow: scroll;
background-color: #F4F4F4;
background-color: #f4f4f4;
border-radius: 2px;
}
......@@ -887,7 +895,6 @@
background-color: #fff;
padding: 0 40px;
box-shadow: 0px -2px 0px 0px rgba(0, 0, 0, 0.05);
.train-pay-button {
......@@ -903,16 +910,16 @@
font-size: 28px;
font-weight: 500;
.train-actualPrice{
.train-actualPrice {
font-size: 40px;
margin-left: 10px;
margin-right: 5px;
}
.train-originalPrice{
.train-originalPrice {
font-size: 24px;
font-weight: 400;
margin-left: 10px;
text-decoration:line-through ;
text-decoration: line-through;
}
}
}
......@@ -929,7 +936,6 @@
display: flex;
padding-top: 0px;
padding-bottom: 0px;
}
i.arrow {
......@@ -939,28 +945,27 @@
.train-comment-replay {
width: 100%;
background-color: #F4F4F4;
background-color: #f4f4f4;
display: flex;
flex-direction: column;
padding: 15px;
margin-top: 12px;
>div:nth-child(1) {
> div:nth-child(1) {
font-family: PingFangSC-Regular;
font-size: 0.21rem;
color: #4A90E2;
color: #4a90e2;
}
>div:nth-child(2) {
> div:nth-child(2) {
padding: 10px 0px;
font-size: 0.21rem;
}
>div:nth-child(3) {
> div:nth-child(3) {
font-family: PingFangSC-Regular;
font-size: 0.17rem;
color: #999999;
}
}
......@@ -970,7 +975,7 @@
justify-content: space-between;
align-items: center;
>p {
> p {
font-size: 20px;
}
......@@ -982,7 +987,7 @@
flex-direction: row;
justify-content: center;
align-items: center;
font-Size: 0.24rem;
font-size: 0.24rem;
color: #ccc;
img {
......@@ -1046,22 +1051,21 @@
height: 0.6rem;
align-items: center;
>div>img {
> div > img {
width: 30px;
margin-right: 22px;
margin-top: -15px;
}
>div>span {
> div > span {
font-size: 28px;
}
}
}
.train-header {
background-color: white;
padding-bottom: 0.5rem;
transform: translateY(-80px);
}
.train-info .train-info-contain a {
......@@ -1172,9 +1176,7 @@
.am-textarea-control textarea {
font-size: 28px;
}
}
}
.train-contain {
......@@ -1195,9 +1197,8 @@
}
}
.train-review {
.am-list-view-scrollview {
background-color: #f4f4f4 !important;
}
}
\ No newline at end of file
}
.singleLineOverflow {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
.carousel-index-container {
position: relative;
overflow: hidden;
}
.carousel-index-container .slider-decorator-0 {
bottom: 15px!important;
}
.carousel-index-container .my-index-carousel {
background-color: #f5f5f5;
}
.carousel-index-container .slider-frame {
height: auto;
}
.my-index-carousel .am-carousel-wrap {
text-align: right;
padding-right: 50px;
}
.my-index-carousel .am-carousel-wrap-dot > span {
width: 16px;
height: 16px;
background: #fff;
opacity: 0.45;
}
.my-index-carousel .am-carousel-wrap-dot-active > span {
background: #fff;
opacity: 1;
width: 32px;
border-radius: 16px;
}
@import "../../../static/theme.less";
.carousel-index-container {
position: relative;
padding: 0 30px;
overflow: hidden;
.slider-decorator-0{
bottom: 15px!important;
......
import React, { Component } from 'react';
import { Icon, } from 'antd';
import { ListView, Tabs, Toast } from 'antd-mobile';
import { connect } from 'react-redux'
import * as MyExamAction from './MyExamAction';
import React, { Component } from "react";
import { Icon } from "antd";
import { ListView, Tabs, Toast } from "antd-mobile";
import { connect } from "react-redux";
import * as MyExamAction from "./MyExamAction";
import moment from "moment/moment";
import FooterLine from "../../common/footer/footer";
//搜索
import func from "../../util/commonFunc";
import { hashHistory } from "react-router";
import './examitem/examitem.less';
import finishIcon from '../../image/finishIcon.png'
import "./less/myexam.less"
import "./examitem/examitem.less";
import createByName from "./images/createByName.png";
import createTime from "./images/createTime.png";
import "./less/myexam.less";
import intl from "react-intl-universal";
class MyExam extends Component {
constructor(props) {
super(props);
let dataSource = new ListView.DataSource({ rowHasChanged: (row1, row2) => row1 !== row2 });
this.state = {
offExamList: dataSource,
inExamList: dataSource,
doneExamList: dataSource,
dieExamList: dataSource,
underway: [],
changeIndex: "2",
isLoading: true,
offHeight: document.documentElement.clientHeight - (Number.parseFloat(document.documentElement.style.fontSize) * 0.84),
inHeight: document.documentElement.clientHeight - (Number.parseFloat(document.documentElement.style.fontSize) * 0.84),
doneHeight: document.documentElement.clientHeight - (Number.parseFloat(document.documentElement.style.fontSize) * 0.84),
dieHeight: document.documentElement.clientHeight - (Number.parseFloat(document.documentElement.style.fontSize) * 0.84),
pageSize: 10,
reset: true,
};
document.title = intl.get("MyExam") || '我的考试'
}
componentDidMount() {
let params = {
pageNo: 1,
pageSize: 10,
};
this.props.myExamList({ ...params, state: 0 }, false);
this.props.myExamList({ ...params, state: 1 }, false);
this.props.myExamList({ ...params, state: 2 }, false);
//this.props.myExamList({...params, state:3}, false);
}
componentWillReceiveProps = (props) => {
this.setState({
offExamList: this.state.offExamList.cloneWithRows(props.MyExamReducer.offExamList),
inExamList: this.state.inExamList.cloneWithRows(props.MyExamReducer.inExamList),
doneExamList: this.state.doneExamList.cloneWithRows(props.MyExamReducer.doneExamList),
//dieExamList:this.state.dieExamList.cloneWithRows(props.MyExamReducer.dieExamList),
});
constructor(props) {
super(props);
let dataSource = new ListView.DataSource({
rowHasChanged: (row1, row2) => row1 !== row2,
});
this.state = {
bannerList: [],
offExamList: dataSource,
inExamList: dataSource,
changeIndex: "2",
isLoading: true,
offHeight:
document.documentElement.clientHeight -
Number.parseFloat(document.documentElement.style.fontSize) * 0.84,
inHeight:
document.documentElement.clientHeight -
Number.parseFloat(document.documentElement.style.fontSize) * 0.84,
pageSize: 10,
reset: true,
};
document.title = intl.get("MyExam") || "我的考试";
}
tabsChange(key) {
this.setState({
changeIndex: key.key
});
}
renderTabBar = (props) => {
return <Tabs.DefaultTabBar {...props} />;
}
renderContent = (tab) => {
let { inHeight, doneHeight, offHeight, dieHeight, inExamList, doneExamList, offExamList, dieExamList } = this.state;
let { isInMore, isFulMore, isOffMore } = this.props.MyExamReducer;
let separator = (sectionID, rowID) => (
<div
key={`${sectionID}-${rowID}`}
className="separator-box"
style={{ background: "#f6f6f6" }}
/>
);
switch (tab.key) {
case "1":
return <ListView
className="list-view-box"
dataSource={offExamList}
renderFooter={() => (
<FooterLine onlyText={true} footText={isOffMore ? (intl.get("PublishKey47") || '没有更多了') : (intl.get("PublishKey23") || '加载中...')} />
)}
style={{ width: "100%", height: offHeight, overflow: "auto" }}
pageSize={1}
renderRow={(rowData, sectionID, rowID) => this.inExamRow(rowData, sectionID, rowID)}
renderSeparator={separator}
scrollRenderAheadDistance={500}
onEndReached={() => this.onEndReached()}
onEndReachedThreshold={10}
/>
case "2":
return <ListView
className="list-view-box"
dataSource={inExamList}
renderFooter={() => (
<FooterLine onlyText={true} footText={isInMore ? (intl.get("PublishKey47") || '没有更多了') : (intl.get("PublishKey23") || '加载中...')} />
)}
style={{ width: "100%", height: inHeight, overflow: "auto" }}
pageSize={1}
renderRow={(rowData, sectionID, rowID) => this.inExamRow(rowData, sectionID, rowID)}
renderSeparator={separator}
scrollRenderAheadDistance={500}
onEndReached={() => this.onEndReached()}
onEndReachedThreshold={10}
/>
case "3":
return <ListView
dataSource={doneExamList}
renderFooter={() => (
<FooterLine onlyText={true} footText={isFulMore ? (intl.get("PublishKey47") || '没有更多了') : (intl.get("PublishKey23") || '加载中...')} />
)}
className="list-view-box"
style={{ width: "100%", height: doneHeight, overflow: "auto" }}
pageSize={1}
initialListSize={10}
renderRow={(rowData, sectionID, rowID) => this.doneExamRow(rowData, sectionID, rowID)}
renderSeparator={separator}
scrollRenderAheadDistance={500}
onEndReached={() => this.onEndReached()}
onEndReachedThreshold={10}
/>
}
}
//搜索
searchBtn = () => {
hashHistory.push({
pathname: func.routerBefore() + '/TrainSearch',
})
componentDidMount() {
let params = {
pageNo: 1,
pageSize: 10,
};
let params1 = {
pageNo: 1,
pageSize: 10,
bizType: 2,
};
this.props.myTrainingList({ ...params1 }, false);
this.props.myExamList({ ...params }, false);
this.props.myBannerList((res) => {
this.setState({
bannerList: res[0],
});
console.log(res, 433333333);
});
}
render() {
const tabsData = [
{
key: "1",
title: <span className="tabspan">{intl.get("NotStarted") || "未开始"}</span>
},
{
key: "2",
title: <span className="tabspan">{intl.get("Ongoing") || "进行中"}</span>
},
{
key: "3",
title: <span className="tabspan">{intl.get("Ended") || "已结束"}</span>
},
];
componentWillReceiveProps = (props) => {
this.setState({
offExamList: this.state.offExamList.cloneWithRows(
props.MyExamReducer.offExamList
),
inExamList: this.state.inExamList.cloneWithRows(
props.MyExamReducer.inExamList
),
});
};
return (
<div style={{width:"100%",height:"100%",overflow:"hidden"}} className="myExamBody">
<Tabs defaultActiveKey="1" swipeable={false}
onChange={(event) => this.tabsChange(event)}
tabs={tabsData}
renderTabBar={(props) => this.renderTabBar(props)}
className="my-exam-tab-container"
>
{this.renderContent}
</Tabs>
</div>
);
}
tabsChange(key) {
this.setState({
changeIndex: key.key,
});
}
inExamRow = (item, sectionID, rowID) => {
let passStr = "", passColor = "";
if (String(item.isQualified) === "2") {
passStr = intl.get("ToBeReviewed") || "待评阅";
passColor = "ing";
}
renderTabBar = (props) => {
return <Tabs.DefaultTabBar {...props} />;
};
renderContent = (tab) => {
let { inHeight, offHeight, inExamList, offExamList, bannerList } =
this.state;
let { isInMore } = this.props.MyExamReducer;
let separator = (sectionID, rowID) => (
<div
key={`${sectionID}-${rowID}`}
className="separator-box"
style={{ background: "#f6f6f6" }}
/>
);
switch (tab.key) {
// 培训
case "1":
return (
<div key={rowID} className="exam-item-box">
<div className="examItem" onClick={() => this.listItemClick(item)}>
<p className={`exam-tag ${passColor}`} style={{ background: '#F5A623' }}>{passStr}</p>
<p className="exam-title">{item.name}</p>
<p className="exam-time"><Icon
type={"clock-circle-o"} />{`${moment(item.startTime).format("YYYY-MM-DD HH:mm:SS")} ${intl.get("To") || "至"} ${moment(item.endTime).format("YYYY-MM-DD HH:mm:SS")}`}
</p>
<ListView
className="list-view-box"
dataSource={offExamList}
renderHeader={() => (
<div className="list-view-header">
<img
className="list-view-bg"
src={bannerList.bannerPath}
alt="Header Image"
/>
<h3>{bannerList.imgTitle}</h3>
<div className="list-view-header-cont">
<p>
<img src={createByName} alt="" /> {bannerList.createByName}
</p>
<p>
<img src={createTime} alt="" />{" "}
{`${moment(bannerList.createTime).format("YYYY-MM-DD")}`}
</p>
</div>
</div>
</div>
)}
renderFooter={() => (
<FooterLine
onlyText={true}
footText={intl.get("PublishKey47") || "没有更多了"}
/>
)}
style={{ width: "100%", height: offHeight, overflow: "auto" }}
pageSize={1}
renderRow={(rowData, sectionID, rowID) =>
this.inExamRow(rowData, sectionID, rowID, tab.key)
}
renderSeparator={separator}
scrollRenderAheadDistance={500}
onEndReached={() => this.onEndReached()}
onEndReachedThreshold={10}
/>
);
};
doneExamRow = (item, sectionID, rowID) => {
let passStr = "", passColor = "";
if (String(item.isQualified) === "0") {
passStr = intl.get("Failed") || "未通过";
passColor = "no";
} else if (String(item.isQualified) === "1") {
passStr = intl.get("Passed") || "已通过";
passColor = "yes";
} else if (String(item.isQualified) === "2") {
passStr = intl.get("PublishKey5") || "批阅中";
passColor = "ing";
} else if (String(item.isQualified) === "3") {
passStr = intl.get("Expired") || "已逾期";
passColor = "no";
} else {
passStr = intl.get("PublishKey5") || "批阅中";
passColor = "ing";
}
//考试
case "2":
return (
<div key={rowID} className="exam-item-box">
<div className="examItem" onClick={() => this.listItemClick(item)}>
<p className={`exam-tag ${passColor}`}>{passStr}</p>
<p className="exam-title">{item.name}</p>
<p className="exam-time"><img src={finishIcon} style={{
width: '24px',
height: '24px'
}} /> {`${intl.get("FinishedTime") || "完成时间"}:${moment(item.endTime).format("YYYY-MM-DD HH:mm:SS")}`}</p>
<ListView
className="list-view-box"
dataSource={inExamList}
renderFooter={() => (
<FooterLine
onlyText={true}
footText={
isInMore
? intl.get("PublishKey47") || "没有更多了"
: intl.get("PublishKey23") || "加载中..."
}
/>
)}
style={{ width: "100%", height: inHeight, overflow: "auto" }}
pageSize={1}
renderRow={(rowData, sectionID, rowID) =>
this.inExamRow(rowData, sectionID, rowID, tab.key)
}
renderSeparator={separator}
scrollRenderAheadDistance={500}
onEndReached={() => this.onEndReached()}
onEndReachedThreshold={10}
/>
);
}
};
render() {
const tabsData = [
{
key: "1",
title: <span className="tabspan">培训</span>,
},
{
key: "2",
title: <span className="tabspan">考试</span>,
},
];
</div>
return (
<div
style={{ width: "100%", height: "100%", overflow: "hidden" }}
className="myExamBody"
>
<Tabs
defaultActiveKey="1"
swipeable={false}
onChange={(event) => this.tabsChange(event)}
tabs={tabsData}
renderTabBar={(props) => this.renderTabBar(props)}
className="my-exam-tab-container"
>
{this.renderContent}
</Tabs>
</div>
);
}
inExamRow = (item, sectionID, rowID, key) => {
if (key == "2") {
return (
<div
key={rowID}
className="exam-item-box"
style={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
}}
>
<div>
<img
style={{ width: "3.5rem", height: "90%" }}
src={item.logoImg}
alt=""
/>
</div>
<div
className="examItem"
onClick={() => this.listItemClick(item, key)}
>
<p className="exam-title">{item.name}</p>
<p className="exam-time">
{`${moment(item.startTime).format("YYYY-MM-DD")} ${"-"} ${moment(
item.endTime
).format("YYYY-MM-DD")}`}
</p>
<div
style={{
display: "flex",
alignItems: "center",
}}
>
<div
className={
item.handle == 0
? "exam-statu-icon"
: item.handle == 5
? "exam-statu-icon1"
: "exam-statu-icon2"
}
>
{item.handle == 0
? "开始考试"
: item.handle == 5
? "待补考"
: "已完成"}
</div>
<div className={item.score > 60 ? "exam-score" : "exam-score1"}>
{item.score ? item.score : ""}
<span style={{ fontSize: "0.28rem", color: "#333" }}>
{item.score ? "分" : ""}
</span>{" "}
</div>
</div>
);
};
onEndReached = () => {
let { isOffMore, isOffFirst, offPageNumber, isInMore, isInFirst, inPageNumber, isFulMore, isFulFirst, fulPageNumber, isDieMore, isDieFirst, diePageNumber, } = this.props.MyExamReducer;
let { changeIndex } = this.state;
let params = {
pageSize: 10,
};
if (String(changeIndex) === "1") {
if (!isOffMore && !isOffFirst) {
this.props.myExamList({ ...params, state: 0, pageNo: offPageNumber }, true);
}
} else if (String(changeIndex) === "2") {
if (!isInMore && !isInFirst) {
this.props.myExamList({ ...params, state: 1, pageNo: inPageNumber }, true);
}
} else if (String(changeIndex) === "3") {
if (!isFulMore && !isFulFirst) {
this.props.myExamList({ ...params, state: 2, pageNo: fulPageNumber }, true);
}
} else if (String(changeIndex) === "4") {
// if(!isDieMore && !isDieFirst){
// this.props.myExamList({...params, state:3, pageNo:diePageNumber}, true);
// }
}
};
listItemClick = (item) => {
if (item.isQualified === '3') {
Toast.info(intl.get("PublishKey48") || '考试已逾期,不可查看')
return false;
}
let { changeIndex } = this.state;
if (String(changeIndex) === "1" || String(changeIndex) === '2') {
hashHistory.push({
pathname: func.routerBefore() + '/examdetail',
query: {
tpId: item.trainingProjectId,
id: item.id
},
})
} else if (String(changeIndex) === "3") {
hashHistory.push({
pathname: func.routerBefore() + '/examFinishDetail',
query: {
trainingProjectId: item.trainingProjectId,
id: item.id
},
})
} else if (String(changeIndex) === "4") {
console.log(changeIndex);
}
</div>
</div>
);
} else {
return (
<div
key={rowID}
className="exam-item-box"
style={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
}}
>
<div>
<img
style={{ width: "3.5rem", height: "90%" }}
src={item.logoImg}
alt=""
/>
</div>
<div
className="examItem"
onClick={() => this.listItemClick(item, key)}
>
<p className="exam-title" style={{ marginBottom: "1rem" }}>
{item.name}
</p>
<p className="exam-time" style={{ marginBottom: "0" }}>
{item.createbyName} | {item.startTimeString}
</p>
</div>
</div>
);
}
};
onEndReached = () => {
let {
isOffMore,
isOffFirst,
offPageNumber,
isInMore,
isInFirst,
inPageNumber,
isFulMore,
isFulFirst,
fulPageNumber,
isDieMore,
isDieFirst,
diePageNumber,
} = this.props.MyExamReducer;
let { changeIndex } = this.state;
let params = {
pageSize: 10,
};
if (String(changeIndex) === "1") {
if (!isOffMore && !isOffFirst) {
this.props.myExamList(
{ ...params, state: 0, pageNo: offPageNumber },
true
);
}
} else if (String(changeIndex) === "2") {
if (!isInMore && !isInFirst) {
this.props.myExamList(
{ ...params, state: 1, pageNo: inPageNumber },
true
);
}
} else if (String(changeIndex) === "3") {
if (!isFulMore && !isFulFirst) {
this.props.myExamList(
{ ...params, state: 2, pageNo: fulPageNumber },
true
);
}
} else if (String(changeIndex) === "4") {
// if(!isDieMore && !isDieFirst){
// this.props.myExamList({...params, state:3, pageNo:diePageNumber}, true);
// }
}
};
listItemClick = (item, key) => {
if (key == "2") {
if (item.isQualified === "3") {
Toast.info(intl.get("PublishKey48") || "考试已逾期,不可查看");
return false;
}
let { changeIndex } = this.state;
if (String(changeIndex) === "1" || String(changeIndex) === "2") {
hashHistory.push({
pathname: func.routerBefore() + "/examdetail",
query: {
tpId: item.trainingProjectId,
id: item.id,
},
});
} else if (String(changeIndex) === "3") {
hashHistory.push({
pathname: func.routerBefore() + "/examFinishDetail",
query: {
trainingProjectId: item.trainingProjectId,
id: item.id,
},
});
} else if (String(changeIndex) === "4") {
console.log(changeIndex);
}
} else {
console.log(item);
hashHistory.push({
pathname: func.routerBefore() + "/trainingsteps",
query: {
id: item.id,
finished: item.finished,
activityStateCode: item.activityStateCode,
},
});
}
};
}
export default connect(state => {
let { MyExamReducer } = state;
return {
MyExamReducer
}
}, MyExamAction)(MyExam);
\ No newline at end of file
export default connect((state) => {
let { MyExamReducer } = state;
return {
MyExamReducer,
};
}, MyExamAction)(MyExam);
import * as actions from './MyExamReduxType';
import Network from '../../util/fetchUtil';
import API from '../../util/urlconfig';
export const myExamList=(params, isUpData)=>{
return dispatch=>{
Network.post(API.myExamListLink, params,
response=>{
try {
if(Number.parseInt(response.code)===1000){
if(Number.parseInt(params.state)===0){
//未开始
let offPageNumber=Number.parseInt(response.page.pageNo)+1;
let isOffMore=JSON.stringify(response.data)==='[]' || response.data.length<params.pageSize;
dispatch({
type:actions.MY_EXAMS_LIST_OFF,
offExamList:response.data,
offPageNumber:offPageNumber,
isOffMore:isOffMore,
isUpData:isUpData
});
}else if(Number.parseInt(params.state)===1){
//进行中
console.log("我的考试1");
console.log(response);
let inPageNumber=Number.parseInt(response.page.pageNo)+1;
let isInMore=JSON.stringify(response.data)==='[]' || response.data.length<params.pageSize;
dispatch({
type:actions.MY_EXAMS_LIST_IN,
inExamList:response.data,
inPageNumber:inPageNumber,
isInMore:isInMore,
isUpData:isUpData
});
}else if(Number.parseInt(params.state)===2){
//己完成
console.log("我的考试2");
console.log(response);
let fulPageNumber=Number.parseInt(response.page.pageNo)+1;
let isFulMore=JSON.stringify(response.data)==='[]'|| response.data.length<params.pageSize;
dispatch({
type:actions.MY_EXAMS_LIST_DONE,
doneExamList:response.data,
fulPageNumber:fulPageNumber,
isFulMore:isFulMore,
isUpData:isUpData
});
}else if(Number.parseInt(params.state)===3){
//己完成
console.log("我的考试3");
let diePageNumber=Number.parseInt(response.page.pageNo)+1;
let isDieMore=JSON.stringify(response.data)==='[]'|| response.data.length<params.pageSize;
dispatch({
type:actions.MY_EXAMS_LIST_DIE,
dieExamList:response.data,
diePageNumber:diePageNumber,
isDieMore:isDieMore,
isUpData:isUpData
});
}
}else{
console.log(response.code);
}
} catch (e){
console.log(e);
}
})
}
}
\ No newline at end of file
import * as actions from "./MyExamReduxType";
import Network from "../../util/fetchUtil";
import excute from '../../util/fetchUtil';
import API from "../../util/urlconfig";
export const myExamList = (params, isUpData) => {
return (dispatch) => {
Network.post(API.myExamListLink, params, (response) => {
try {
if (Number.parseInt(response.code) === 1000) {
let inPageNumber = Number.parseInt(response.page.pageNo) + 1;
let isInMore =
JSON.stringify(response.data) === "[]" ||
response.data.length < params.pageSize;
dispatch({
type: actions.MY_EXAMS_LIST_IN,
inExamList: response.data,
inPageNumber: inPageNumber,
isInMore: isInMore,
isUpData: isUpData,
});
} else {
console.log(response.code);
}
} catch (e) {
console.log(e);
}
});
};
};
export const myTrainingList = (params, isUpData) => {
return (dispatch) => {
Network.post(API.trainList, params, (response) => {
try {
if (Number.parseInt(response.code) === 1000) {
//未开始
let offPageNumber = Number.parseInt(response.page.pageNo) + 1;
let isOffMore =
JSON.stringify(response.data) === "[]" ||
response.data.length < params.pageSize;
dispatch({
type: actions.MY_EXAMS_LIST_OFF,
offExamList: response.data.records,
offPageNumber: offPageNumber,
isOffMore: isOffMore,
isUpData: isUpData,
});
} else {
console.log(response.code);
}
} catch (e) {
console.log(e);
}
});
};
};
export function myBannerList(callback) {
return (dispatch) => {
return excute.post(
API.banner,
{
bannerName: "TRAIN_EXAM",
terminalName: "WECHAT",
},
(response) => {
if (callback) {
callback(response.data);
}
}
);
};
}
import * as actions from './MyExamReduxType';
const initial={
offExamList:[],
inExamList:[],
doneExamList:[],
dieExamList:[],
isInMore:false,
isInFirst:true,
isOffMore:false,
isOffFirst:true,
offPageNumber:1,
inPageNumber:1,
fulPageNumber:1,
diePageNumber:1,
isFulMore:false,
isFulFirst:true,
isDieMore:false,
isDieFirst:true,
import * as actions from "./MyExamReduxType";
const initial = {
offExamList: [],
inExamList: [],
doneExamList: [],
dieExamList: [],
bannerList: [],
isInMore: false,
isInFirst: true,
isOffMore: false,
isOffFirst: true,
offPageNumber: 1,
inPageNumber: 1,
fulPageNumber: 1,
diePageNumber: 1,
isFulMore: false,
isFulFirst: true,
isDieMore: false,
isDieFirst: true,
};
export default (state = initial, action) => {
switch (action.type) {
case actions.MY_EXAMS_LIST_OFF:
let offExamList = null;
if (!action.isUpData) {
offExamList = action.offExamList;
} else {
offExamList = state.offExamList.concat(action.offExamList);
}
return {
...state,
offExamList: offExamList,
offPageNumber: action.offPageNumber,
isOffMore: action.isOffMore,
isOffFirst: false,
};
case actions.MY_EXAMS_LIST_IN:
let inExamList = null;
if (!action.isUpData) {
inExamList = action.inExamList;
} else {
inExamList = state.inExamList.concat(action.inExamList);
}
return {
...state,
inExamList: inExamList,
inPageNumber: action.inPageNumber,
isInMore: action.isInMore,
isInFirst: false,
};
case actions.MY_EXAMS_LIST_DONE:
let doneExamList = null;
if (!action.isUpData) {
doneExamList = action.doneExamList;
} else {
doneExamList = state.doneExamList.concat(action.doneExamList);
}
return {
...state,
doneExamList: doneExamList,
fulPageNumber: action.fulPageNumber,
isFulMore: action.isFulMore,
isFulFirst: false,
};
case actions.MY_EXAMS_LIST_DIE:
let dieExamList = null;
if (!action.isUpData) {
dieExamList = action.dieExamList;
} else {
dieExamList = state.dieExamList.concat(action.dieExamList);
}
return {
...state,
dieExamList: dieExamList,
diePageNumber: action.diePageNumber,
isDieMore: action.isDieMore,
isDieFirst: false,
};
case actions.MY_TRAINING_BANNER:
return {
bannerList: bannerList,
};
default:
return state;
}
};
export default (state=initial, action)=>{
switch (action.type){
case actions.MY_EXAMS_LIST_OFF:
let offExamList=null;
if(!action.isUpData){
offExamList=action.offExamList;
}else{
offExamList=state.offExamList.concat(action.offExamList);
}
return {
...state,
offExamList:offExamList,
offPageNumber:action.offPageNumber,
isOffMore:action.isOffMore,
isOffFirst:false,
};
case actions.MY_EXAMS_LIST_IN:
let inExamList=null;
if(!action.isUpData){
inExamList=action.inExamList;
}else{
inExamList=state.inExamList.concat(action.inExamList);
}
return {
...state,
inExamList:inExamList,
inPageNumber:action.inPageNumber,
isInMore:action.isInMore,
isInFirst:false,
};
case actions.MY_EXAMS_LIST_DONE:
let doneExamList=null;
if(!action.isUpData){
doneExamList=action.doneExamList;
}else{
doneExamList=state.doneExamList.concat(action.doneExamList);
}
return {
...state,
doneExamList:doneExamList,
fulPageNumber:action.fulPageNumber,
isFulMore:action.isFulMore,
isFulFirst:false,
};
case actions.MY_EXAMS_LIST_DIE:
let dieExamList=null;
if(!action.isUpData){
dieExamList=action.dieExamList;
}else{
dieExamList=state.dieExamList.concat(action.dieExamList);
}
return {
...state,
dieExamList:dieExamList,
diePageNumber:action.diePageNumber,
isDieMore:action.isDieMore,
isDieFirst:false,
};
default :
return state;
}
}
// 我的考试列表 - 未开始
export const MY_EXAMS_LIST_OFF="MY_EXAMS_LIST_OFF";
//培训header banner图
export const MY_TRAINING_BANNER="MY_TRAINING_BANNER";
// 我的考试列表 - 处理中
export const MY_EXAMS_LIST_IN="MY_EXAMS_LIST_IN";
......
.singleLineOverflow {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
.am-list-header {
padding: 0 !important;
}
.load-more {
border: 0;
width: 100%;
height: 0.7rem;
background-color: #f6f6f6;
color: #999;
font-size: 0.26rem;
line-height: 0.7rem;
text-align: center;
}
.tab-box {
width: 100%;
height: 100%;
}
.tab-header-box {
height: 46px;
overflow: hidden;
}
.separator-box {
height: 0.2rem;
overflow: hidden;
}
.list-view-box {
padding-top: 0.2rem;
background-color: #f6f6f6;
}
.exam-item-box {
padding: 0 0.2rem;
overflow: hidden;
}
.examItem {
width: 100%;
background: #fff;
border-radius: 0.08rem;
border-radius: 0.2rem;
padding: 0.4rem 0.3rem;
position: relative;
}
.examItem .exam-title {
color: #000000;
font-size: 0.4rem;
line-height: 0.4rem;
margin-bottom: 0.2rem;
}
.examItem .exam-project {
color: #9b9b9b;
font-size: 0.24rem;
line-height: 0.28rem;
}
.examItem .exam-time {
color: #9b9b9b;
font-size: 0.32rem;
line-height: 0.28rem;
margin-bottom: 0.5rem;
}
.examItem .exam-tag {
position: absolute;
top: 0;
left: 0;
font-size: 0.2rem;
text-align: center;
border-top-left-radius: 0.14rem;
border-bottom-right-radius: 0.14rem;
color: #fff;
padding: 0 0.2rem;
}
.examItem .no {
background: #fe3824;
}
.examItem .yes {
background: #47d5b5;
}
.examItem .ing {
background: #e48600;
}
.examItem .exam-statu-icon {
width: 1.6rem;
height: 0.56rem;
padding: 0.04rem;
text-align: center;
background: rgba(253, 63, 52, 0.05);
border: 1px solid #f3ab9f;
border-radius: 45px;
color: #e6624a;
font-size: 0.3rem;
}
.examItem .exam-statu-icon1 {
width: 1.6rem;
height: 0.56rem;
padding: 0.04rem;
text-align: center;
background: linear-gradient(90deg, #ff8058, #ffb865 100%);
border-radius: 45px;
color: #fff;
font-size: 0.3rem;
}
.examItem .exam-statu-icon2 {
width: 1.6rem;
height: 0.56rem;
padding: 0.04rem;
text-align: center;
background: #cbeecd;
border: 1px solid #cbeecd;
border-radius: 45px;
color: #53af5c;
font-size: 0.3rem;
}
.examItem .exam-score {
margin-left: 0.1rem;
font-size: 0.36rem;
color: #53AF5C;
}
.examItem .exam-score1 {
margin-left: 0.1rem;
font-size: 0.36rem;
color: #FC7A43;
}
.top-search-div {
width: 100%;
height: 44px;
padding: 5px 20px;
background-color: #fff;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.top-search-div .top-search-btn {
width: 100%;
height: 100%;
background-color: #f6f6f6;
border-radius: 1rem;
border: 0;
}
@import "../less/config";
.am-list-header{
padding:0 !important;
.am-list-header {
padding: 0 !important;
}
.load-more{
border:0;
width:100%;
height:0.7rem;
background-color:#f6f6f6;
color:#999;
font-size:0.26rem;
line-height:0.7rem;
text-align:center;
.load-more {
border: 0;
width: 100%;
height: 0.7rem;
background-color: #f6f6f6;
color: #999;
font-size: 0.26rem;
line-height: 0.7rem;
text-align: center;
}
.tab-box{
width:100%;
height:100%;
.tab-box {
width: 100%;
height: 100%;
}
.tab-header-box{
height:46px;
overflow:hidden;
.tab-header-box {
height: 46px;
overflow: hidden;
}
.separator-box{
height:0.2rem;
overflow:hidden;
.separator-box {
height: 0.2rem;
overflow: hidden;
}
.list-view-box{
padding-top:0.2rem;
.list-view-box {
padding-top: 0.2rem;
background-color: #f6f6f6;
}
.exam-item-box{
padding:0 0.2rem;
overflow:hidden;
.exam-item-box {
padding: 0 0.2rem;
overflow: hidden;
}
.examItem {
width: 100%;
background: #fff;
border-radius:4*@len;
border-radius:0.2rem;
padding:0.4rem 0.3rem;
position:relative;
border-radius: 4 * @len;
border-radius: 0.2rem;
padding: 0.4rem 0.3rem;
position: relative;
.exam-title {
color: #505050;
font-size: 17*@len;
line-height: 20*@len;
padding-bottom:0.5rem;
color: #000000;
font-size: 20 * @len;
line-height: 20 * @len;
margin-bottom: 0.2rem;
}
.exam-project{
.exam-project {
color: #9b9b9b;
font-size: 12*@len;
line-height: 14*@len;
font-size: 12 * @len;
line-height: 14 * @len;
}
.exam-time{
.exam-time {
color: #9b9b9b;
font-size: 12*@len;
line-height: 14*@len;
font-size: 16 * @len;
line-height: 14 * @len;
margin-bottom: 0.5rem;
}
.exam-tag{
.exam-tag {
position: absolute;
top: 0; left: 0;
font-size: 10*@len;
top: 0;
left: 0;
font-size: 10 * @len;
text-align: center;
border-top-left-radius: 7*@len;
border-bottom-right-radius: 7*@len;
border-top-left-radius: 7 * @len;
border-bottom-right-radius: 7 * @len;
color: #fff;
padding:0 0.2rem;
padding: 0 0.2rem;
}
.no{
.no {
background: #fe3824;
}
.yes{
background: #47d5b5;
}
.ing{
background:#e48600
.yes {
background: #47d5b5;
}
.ing {
background: #e48600;
}
.exam-statu-icon {
width: 80 * @len;
height: 28 * @len;
padding: 0.04rem;
text-align: center;
background: rgba(253, 63, 52, 0.05);
border: 1px solid #f3ab9f;
border-radius: 45px;
color: #e6624a;
font-size: 15 * @len;
}
.exam-statu-icon1 {
width: 80 * @len;
height: 28 * @len;
padding: 0.04rem;
text-align: center;
background: linear-gradient(90deg, #ff8058, #ffb865 100%);
border-radius: 45px;
color: #fff;
font-size: 15 * @len;
}
.exam-statu-icon2 {
width: 80 * @len;
height: 28 * @len;
padding: 0.04rem;
text-align: center;
background: #cbeecd;
border: 1px solid #cbeecd;
border-radius: 45px;
color: #53af5c;
font-size: 15 * @len;
}
.exam-score {
margin-left: 5 * @len;
font-size: 18 * @len;
color: #53AF5C;
}
.exam-score1 {
margin-left: 5 * @len;
font-size: 18 * @len;
color: #FC7A43;
}
}
.top-search-div{
width:100%;
height:44px;
padding:5px 20px;
background-color:#fff;
.top-search-div {
width: 100%;
height: 44px;
padding: 5px 20px;
background-color: #fff;
display: flex;
flex-direction:row;
flex-direction: row;
justify-content: center;
align-items:center;
.top-search-btn{
width:100%;
height:100%;
background-color:#f6f6f6;
border-radius:1rem;
border:0;
align-items: center;
.top-search-btn {
width: 100%;
height: 100%;
background-color: #f6f6f6;
border-radius: 1rem;
border: 0;
}
}
\ No newline at end of file
}
.myExamBody .am-list-body::before {
height: 0 !important;
}
.myExamBody .am-list-body::after {
height: 0 !important;
}
.list-view-header {
width: 96%;
margin: 0 auto;
margin-bottom: 20px;
}
.list-view-header .list-view-bg {
width: 100%;
height: 4rem;
}
.list-view-header h3 {
color: #4a4a4a;
margin: 15px 0;
}
.list-view-header .list-view-header-cont {
display: flex;
align-items: center;
}
.list-view-header .list-view-header-cont img {
width: 28px;
height: 28px;
}
.list-view-header .list-view-header-cont p {
font-size: 30px;
margin-right: 20px;
}
......@@ -6,4 +6,29 @@
.am-list-body::after {
height: 0 !important;
}
}
.list-view-header{
width:96%;
margin: 0 auto;
margin-bottom: 20px;
.list-view-bg{
width: 100%;
height: 4rem;
}
h3{
color:#4a4a4a;
margin: 15px 0;
}
.list-view-header-cont{
display: flex;
align-items: center;
img{
width: 28px;
height: 28px;
}
p{
font-size: 30px;
margin-right: 20px;
}
}
}
\ No newline at end of file
......@@ -54,7 +54,7 @@ class IndexBtnScroll extends Component {
<div
className="index-btn-scroll-item-container"
id="index-simple-scroll-bar-id"
autoHide={false}
// autoHide={false}
>
<div
className="index-btn-scroll-single-wrap-container"
......
......@@ -56,9 +56,9 @@
align-items: center;
}
.login .login-container .login-form .login-form-item .login-form-top-logo .login-input-top-icon {
width: 160px;
height: 160px;
margin-bottom: 20px;
width: 120px;
height: 120px;
margin-bottom: 60px;
}
.login .login-container .login-form .login-form-item .login-form-top-logo .login-input-top-font {
color: #F5222D;
......@@ -69,7 +69,8 @@
border-radius: 12px;
}
.login .login-container .login-form .login-form-item .login-form-input-container .login-form-single-label {
font-size: 36px ;
font-size: 36px;
font-weight: bold;
}
.login .login-container .login-form .login-form-item .login-form-input-container .login-form-single-container {
width: 100%;
......
......@@ -254,12 +254,13 @@ class Login extends Component {
</div>
<div style={{ bottom: '60px',
fontSize: '21px',
fontSize: '26px',
position: 'fixed',
textAlign: 'center',
zIndex:99999,
width: '100%'}}>
备案号:<a href="https://beian.miit.gov.cn" target="_blank" rel="noopener" >沪ICP备11042121号-5</a>
width: '100%',
color:'#fff'}}>
机电信息保障部
</div>
</div>
);
......
......@@ -47,9 +47,9 @@
justify-content: center;
align-items: center;
.login-input-top-icon{
width: 160px;
height: 160px;
margin-bottom: 20px;
width: 120px;
height: 120px;
margin-bottom: 60px;
}
.login-input-top-font{
color:#F5222D;
......@@ -60,7 +60,8 @@
width: 100%;
border-radius: 12px;
.login-form-single-label{
font-size:36px ;
font-size:36px;
font-weight: bold;
}
.login-form-single-container{
width: 100%;
......
import React, { Component } from 'react';
import { Icon, Button } from 'antd';
import { Toast } from 'antd-mobile';
import { hashHistory } from 'react-router';
import $ from 'jquery';
import './login.less';
import './index.css';
import { connect } from 'react-redux';
import { login, loginAuthen } from '../../redux/action/login';
import func from '../../util/commonFunc';
import CheckBox from './checkbox/index';
import jsCookie from 'js-cookie';
import moment from 'moment'
import React, { Component } from "react";
import { Icon, Button } from "antd";
import { Toast } from "antd-mobile";
import { hashHistory } from "react-router";
import $ from "jquery";
import "./login.less";
import "./index.css";
import { connect } from "react-redux";
import { login, loginAuthen } from "../../redux/action/login";
import func from "../../util/commonFunc";
import CheckBox from "./checkbox/index";
import jsCookie from "js-cookie";
import moment from "moment";
import md5 from "md5";
import { sm2 } from 'sm-crypto'
import { sm2 } from "sm-crypto";
import intl from "react-intl-universal";
import PickerCommon from './pickerCommon';
import API from '../../util/urlconfig';
import Network from '../../util/fetchUtil';
import PickerCommon from "./pickerCommon";
import API from "../../util/urlconfig";
import Network from "../../util/fetchUtil";
import loginUserIcon from "../../common/iconImage/login-user.png";
import loginPasswordIcon from "../../common/iconImage/login-pwd.png";
import loginTopLogoImg from "../../common/iconImage/a-danghuikaobei.png";
const notReady = { backgroundColor: '#D23A29', color: '#fff' };
const isReady = { backgroundColor: '#D23A29', color: '#fff' };
const USERNAMECOOKIE = 'username';
const PASSWORDCOOKIE = 'password';
const USERNAMECOOKIE = "username";
const PASSWORDCOOKIE = "password";
class LoginForm extends Component {
constructor(props) {
super(props);
this.state = {
passwordType: 'password',
account: '',
password: '',
passwordType: "password",
account: "",
password: "",
redirectInfo: {},
isReady: false,
currentScreenHeight: 0,
rememberPassword: false,
hasLoginInfoCookie: false,
loginPwdDesc: '',
loginNameDesc: '',
loginPwdDesc: "",
loginNameDesc: "",
};
this.getAccount = this.getAccount.bind(this);
this.getPassword = this.getPassword.bind(this);
......@@ -52,9 +47,7 @@ class LoginForm extends Component {
this.onRememberPassword = this.onRememberPassword.bind(this);
this.rememberPasswordByConfig = this.rememberPasswordByConfig.bind(this);
this.usernameInputClick = this.usernameInputClick.bind(this);
this.passwordInputClick = this.passwordInputClick.bind(this)
this.passwordInputClick = this.passwordInputClick.bind(this);
}
componentDidMount() {
console.log(this.props.redirect);
......@@ -66,9 +59,9 @@ class LoginForm extends Component {
loginNameDesc: this.props.loginNameDesc,
});
const { autoLogin, username, password } = this.props;
console.log('888888888======', autoLogin)
console.log("888888888======", autoLogin);
if (autoLogin) {
console.log('autoLogin0000进来')
console.log("autoLogin0000进来");
this.setState(
{
account: username,
......@@ -83,14 +76,13 @@ class LoginForm extends Component {
}
let cookieUsername = jsCookie.get(USERNAMECOOKIE) || "";
let cookiePassword = jsCookie.get(PASSWORDCOOKIE) || "";
console.log('autoLogin·······没有进去')
console.log("autoLogin·······没有进去");
if (cookieUsername.length > 0 && cookiePassword.length > 0) {
this.setState({
rememberPassword: true,
hasLoginInfoCookie: true,
account: cookieUsername,
password: cookiePassword,
isReady: true,
});
} else {
this.setState({
......@@ -102,7 +94,7 @@ class LoginForm extends Component {
currentScreenHeight: window.innerHeight,
});
window.onresize = function () {
if (location.href.indexOf('/login') != -1) {
if (location.href.indexOf("/login") != -1) {
_this.setState({
currentScreenHeight: window.innerHeight,
});
......@@ -110,7 +102,7 @@ class LoginForm extends Component {
};
}
componentWillReceiveProps(nextProps) {
console.log('pppppppp66666componentWillReceiveProps')
console.log("pppppppp66666componentWillReceiveProps");
if (nextProps.loginNameDesc != this.props.loginNameDesc) {
this.setState({
loginPwdDesc: nextProps.loginPwdDesc,
......@@ -131,39 +123,73 @@ class LoginForm extends Component {
}
}
} else {
jsCookie.remove(USERNAMECOOKIE, { path: '' });
jsCookie.remove(PASSWORDCOOKIE, { path: '' });
jsCookie.remove(USERNAMECOOKIE, { path: "" });
jsCookie.remove(PASSWORDCOOKIE, { path: "" });
}
}
getAccount(e) {
let value = e.target.value;
this.setState({
account: value,
isReady: this.state.password && value,
});
}
getPassword(e) {
let value = e.target.value;
this.setState({
password: value,
isReady: this.state.account && value,
});
}
changeType() {
const { passwordType } = this.state
if (passwordType === 'password') {
const { passwordType } = this.state;
if (passwordType === "password") {
this.setState({
passwordType: 'text',
passwordType: "text",
});
} else {
this.setState({
passwordType: 'password',
passwordType: "password",
});
}
}
generateCharacter(n) {
var chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
var chars = [
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
];
var res = "";
for (var i = 0; i < n; i++) {
var id = Math.ceil(Math.random() * 35);
......@@ -174,49 +200,57 @@ class LoginForm extends Component {
}
getCurrentDay() {
let date = ""
date = moment(new Date()).format("YYYYMMDD")
return date
let date = "";
date = moment(new Date()).format("YYYYMMDD");
return date;
}
getlanguage = (tips, resCallback) => {
const _this = this;
console.log('bbbbbbbbbbbbbbbbbbbbbbbbb')
console.log("bbbbbbbbbbbbbbbbbbbbbbbbb");
// Network.getNetwork(API.siteLanguageGet,{},(res)=>{
// console.log(res);
// if(res.code==1000){
// sessionStorage.setItem("lang_type",sessionStorage.getItem("lang_type")||res.data);
Network.normalGet(API.siteLanguageGet, (res) => {
console.log(res);
if (res.code == 1000) {
sessionStorage.setItem("lang_type", res.data || sessionStorage.getItem("lang_type"));
Network.getNetwork(API.getLanguageData, { languageCode: res.data || sessionStorage.getItem("lang_type"), type: 1 }, resv => {
if (resv.code == 1000) {
let languageCode = sessionStorage.getItem("lang_type");
intl.init({
currentLocale: languageCode,
locales: { [languageCode]: resv.data || sumLocales },
});
_this.languageCallback(tips, resCallback)
} else {
let sumLocales = Object.assign({}, tempZh_Cn);
intl.init({
currentLocale: languageCode,
locales: { [languageCode]: sumLocales },
});
_this.languageCallback(tips, resCallback)
sessionStorage.setItem(
"lang_type",
res.data || sessionStorage.getItem("lang_type")
);
Network.getNetwork(
API.getLanguageData,
{
languageCode: res.data || sessionStorage.getItem("lang_type"),
type: 1,
},
(resv) => {
if (resv.code == 1000) {
let languageCode = sessionStorage.getItem("lang_type");
intl.init({
currentLocale: languageCode,
locales: { [languageCode]: resv.data || sumLocales },
});
_this.languageCallback(tips, resCallback);
} else {
let sumLocales = Object.assign({}, tempZh_Cn);
intl.init({
currentLocale: languageCode,
locales: { [languageCode]: sumLocales },
});
_this.languageCallback(tips, resCallback);
}
}
})
);
}
})
});
// }
// })
}
};
login() {
console.log('1111111111111111111111-----lllllllllll')
console.log("1111111111111111111111-----lllllllllll");
let _this = this;
clearInterval(this.loginTimer);
if (!this.state.account) {
......@@ -227,187 +261,180 @@ class LoginForm extends Component {
Toast.info(intl.get("Password"));
return;
}
let openid = sessionStorage.getItem('openid');
const lang_type = sessionStorage.getItem("lang_type");//新增国际化-cwj-152
let openid = sessionStorage.getItem("openid");
const lang_type = sessionStorage.getItem("lang_type"); //新增国际化-cwj-152
if (openid) {
console.log('222222222222222222-----lllllllllll')
console.log("222222222222222222-----lllllllllll");
this.props.loginAuthen(
{
account: this.state.account,
password: this.state.password,
openId: openid,
languageCode: lang_type,//新增国际化-cwj-152
languageCode: lang_type, //新增国际化-cwj-152
},
this.props.redirect.hash,
this.props.appid,
(res) => {
console.log('loginAuthen-----lllllllllll')
console.log("loginAuthen-----lllllllllll");
this.getlanguage("loginAuthen", res);
// _this.rememberPasswordByConfig(
// _this.state.account,
// _this.state.password
// );
// _this.queryControl(res);
}
);
} else {
const public_key = '047214fe3a249b75b6ba92ee494e0a8a68c0a19893a480b3c28bf06cd5b7d621243c7f6704caa3b43ade6be15de11cabd185611a9edfdcf1b11d7a2478c67b4c1c'
const private_key = '00a2bbe941a177ca9f200d1c4d37e8f0b43b9cd2ea662304a05c064c6416e74d49'
let salt = ""
let date = ""
let key = ""
let sign = ""
let password = ""
let account = ""
salt = this.generateCharacter(16)
console.log("validate-salt", salt)
date = this.getCurrentDay()
console.log("validate-date", date)
const public_key =
"047214fe3a249b75b6ba92ee494e0a8a68c0a19893a480b3c28bf06cd5b7d621243c7f6704caa3b43ade6be15de11cabd185611a9edfdcf1b11d7a2478c67b4c1c";
const private_key =
"00a2bbe941a177ca9f200d1c4d37e8f0b43b9cd2ea662304a05c064c6416e74d49";
let salt = "";
let date = "";
let key = "";
let sign = "";
let password = "";
let account = "";
salt = this.generateCharacter(16);
console.log("validate-salt", salt);
date = this.getCurrentDay();
console.log("validate-date", date);
password = sm2.doEncrypt(this.state.password + salt, public_key, 1);
account = sm2.doEncrypt(this.state.account + salt, public_key, 1)
account = sm2.doEncrypt(this.state.account + salt, public_key, 1);
password = "04" + password
account = "04" + account
password = "04" + password;
account = "04" + account;
if (salt && date) {
key = salt + date
console.log("validate-key", key)
key = salt + date;
console.log("validate-key", key);
}
sign = "account=" + account + "&password=" + password + "&salt=" + salt + "&key=" + key
console.log("validate-sign", md5(sign))
sign =
"account=" +
account +
"&password=" +
password +
"&salt=" +
salt +
"&key=" +
key;
console.log("validate-sign", md5(sign));
let parms = {
account,
password,
salt: salt,
sign: md5(sign),
languageCode: lang_type,//新增国际化-cwj-152
}
_this.props.login(
parms,
(res) => {
this.getlanguage("login", res);
// console.log("login----", res)
// _this.rememberPasswordByConfig(
// _this.state.account,
// _this.state.password
// );
// _this.queryControl(res);
// if (_this.state.redirectInfo.state) {
// let { redirectHash } = _this.state.redirectInfo.state;
// console.log(redirectHash);
// if (
// redirectHash.split('#')[1].split('?')[0].indexOf('login') != -1
// ) {
// hashHistory.replace({
// pathname: func.routerBefore() + '/',
// });
// } else if (redirectHash.split('#')[1].split('?')[1]) {
// hashHistory.replace({
// pathname: redirectHash.split('#')[1].split('?')[0],
// query: func.urlDivide(
// redirectHash.split('#')[1].split('?')[1]
// ),
// });
// } else {
// hashHistory.replace({
// pathname: redirectHash.split('#')[1].split('?')[0],
// });
// }
// } else {
// hashHistory.replace({
// pathname: func.routerBefore() + '/',
// });
// }
}
);
languageCode: lang_type, //新增国际化-cwj-152
};
_this.props.login(parms, (res) => {
this.getlanguage("login", res);
// console.log("login----", res)
// _this.rememberPasswordByConfig(
// _this.state.account,
// _this.state.password
// );
// _this.queryControl(res);
// if (_this.state.redirectInfo.state) {
// let { redirectHash } = _this.state.redirectInfo.state;
// console.log(redirectHash);
// if (
// redirectHash.split('#')[1].split('?')[0].indexOf('login') != -1
// ) {
// hashHistory.replace({
// pathname: func.routerBefore() + '/',
// });
// } else if (redirectHash.split('#')[1].split('?')[1]) {
// hashHistory.replace({
// pathname: redirectHash.split('#')[1].split('?')[0],
// query: func.urlDivide(
// redirectHash.split('#')[1].split('?')[1]
// ),
// });
// } else {
// hashHistory.replace({
// pathname: redirectHash.split('#')[1].split('?')[0],
// });
// }
// } else {
// hashHistory.replace({
// pathname: func.routerBefore() + '/',
// });
// }
});
}
}
//为了解决语言异步问题,登录成功后的所有操作,都放在语言回调中
languageCallback = (tip, res) => {
const _this = this;
console.log('为了解决语言异步问题,登录成功后的所有操作,都放在语言回调中')
console.log("为了解决语言异步问题,登录成功后的所有操作,都放在语言回调中");
if (tip == "loginAuthen") {
_this.rememberPasswordByConfig(
_this.state.account,
_this.state.password
);
_this.rememberPasswordByConfig(_this.state.account, _this.state.password);
_this.queryControl(res);
} else {
console.log("login----", res)
_this.rememberPasswordByConfig(
_this.state.account,
_this.state.password
);
console.log("login----", res);
_this.rememberPasswordByConfig(_this.state.account, _this.state.password);
_this.queryControl(res);
if (_this.state.redirectInfo.state) {
let { redirectHash } = _this.state.redirectInfo.state;
console.log(redirectHash);
if (
redirectHash.split('#')[1].split('?')[0].indexOf('login') != -1
) {
if (redirectHash.split("#")[1].split("?")[0].indexOf("login") != -1) {
hashHistory.replace({
pathname: func.routerBefore() + '/',
pathname: func.routerBefore() + "/",
});
} else if (redirectHash.split('#')[1].split('?')[1]) {
} else if (redirectHash.split("#")[1].split("?")[1]) {
hashHistory.replace({
pathname: redirectHash.split('#')[1].split('?')[0],
query: func.urlDivide(
redirectHash.split('#')[1].split('?')[1]
),
pathname: redirectHash.split("#")[1].split("?")[0],
query: func.urlDivide(redirectHash.split("#")[1].split("?")[1]),
});
} else {
hashHistory.replace({
pathname: redirectHash.split('#')[1].split('?')[0],
pathname: redirectHash.split("#")[1].split("?")[0],
});
}
} else {
hashHistory.replace({
pathname: func.routerBefore() + '/',
pathname: func.routerBefore() + "/",
});
}
}
}
};
//用户控制台权限
queryControl = (res) => {
if (res.dev == true) {
let cacheScript = document.getElementById('erudaScript');
let cacheScript = document.getElementById("erudaScript");
// if(cacheScript){
// eruda.init();
// }
} else {
let cacheScript = document.getElementById('erudaScript');
let HTmls = document.getElementById('example');
let cacheScript = document.getElementById("erudaScript");
let HTmls = document.getElementById("example");
if (cacheScript) {
cacheScript.parentNode.removeChild(cacheScript);
}
}
}
};
preLogin() {
console.log('preLogin................preLogin')
console.log("preLogin................preLogin");
const { fullScreenHeight } = this.props;
var userInput = document.getElementById('login-user-input');
var passwordInput = document.getElementById('login-password-input');
var userInput = document.getElementById("login-user-input");
var passwordInput = document.getElementById("login-password-input");
userInput.blur();
passwordInput.blur();
let _this = this;
this.loginTimer = setInterval(() => {
if (_this.state.currentScreenHeight >= fullScreenHeight) {
console.log('preLogin-----------fullScreenHeight')
console.log("preLogin-----------fullScreenHeight");
Toast.hide();
clearInterval(_this.loginTimer);
_this.login();
......@@ -421,7 +448,6 @@ class LoginForm extends Component {
}
usernameInputClick() {
$("#login-user-input").focus();
}
passwordInputClick() {
......@@ -433,57 +459,89 @@ class LoginForm extends Component {
return (
<div className="login-form-item">
<div className="login-form-top-logo">
<img src={loginTopLogoImg} alt="" className="login-input-top-icon" />
<div className="login-input-top-font" style={{fontSize:'56px'}}>机电e先锋</div>
<div className="login-input-top-font" style={{fontSize:'32px'}}>智慧党建平台</div>
</div>
<div className="login-form-top-logo">
<img src={loginTopLogoImg} alt="" className="login-input-top-icon" />
<div className="login-input-top-font" style={{ fontSize: "52px" }}>
机电e先锋
</div>
<div className="login-input-top-font" style={{ fontSize: "32px" }}>
智慧党建平台
</div>
</div>
<div className="login-form-input-container">
<div className="login-form-single-label">用户名:</div>
<div className="login-form-single-container"
<div
className="login-form-single-container"
onClick={this.usernameInputClick}
>
<div className="form-item" >
<img src={loginUserIcon} alt="" className="login-input-item-icon" />
<div className="form-item">
<img
src={loginUserIcon}
alt=""
className="login-input-item-icon"
/>
<input
id="login-user-input"
value={this.state.account}
onChange={this.getAccount}
style={{ fill: 'unset' }}
placeholder={loginNameDesc ? loginNameDesc : intl.get("pleaseInputUsername")}
style={{ fill: "unset" }}
placeholder={
loginNameDesc
? loginNameDesc
: intl.get("pleaseInputUsername")
}
/>
</div>
</div>
<div className="login-form-single-label" style={{ marginTop: '15px' }}>密码:</div>
<div className="login-form-single-container" onClick={this.passwordInputClick} >
<div className="form-item" >
<img src={loginPasswordIcon} alt="" className="login-input-item-icon" />
<div
className="login-form-single-label"
style={{ marginTop: "15px" }}
>
密码:
</div>
<div
className="login-form-single-container"
onClick={this.passwordInputClick}
>
<div className="form-item">
<img
src={loginPasswordIcon}
alt=""
className="login-input-item-icon"
/>
<div className="paswDiv">
<input
id="login-password-input"
value={this.state.password}
type={passwordType}
onChange={this.getPassword}
placeholder={loginPwdDesc ? loginPwdDesc : intl.get("Password")}
placeholder={
loginPwdDesc ? loginPwdDesc : intl.get("Password")
}
/>
</div>
{passwordType === 'text' ?
<Icon className="login-password-eye" onClick={this.changeType} type="eye" /> :
<Icon className="login-password-eye" onClick={this.changeType} type="eye-invisible" />
}
{passwordType === "text" ? (
<Icon
className="login-password-eye"
onClick={this.changeType}
type="eye"
/>
) : (
<Icon
className="login-password-eye"
onClick={this.changeType}
type="eye-invisible"
/>
)}
</div>
</div>
</div>
<Button
style={this.state.isReady ? isReady : notReady}
style={{
background: "#d23a29",
color:'#FFF'
}}
onClick={this.preLogin}
>
{intl.get("LogIn")}
......
......@@ -396,7 +396,7 @@ class Menulearn extends React.Component {
display: "inline-block",
width: "9px",
height: "34px",
backgroundColor: "#FC5B2B",
background: 'linear-gradient(180deg,#fe742b, #fc5b2b 100%)',
marginLeft: "4%",
marginRight: "1%",
}}
......
......@@ -280,13 +280,13 @@ class Menume extends React.Component {
return
}
this.props.getMyStudyInfo2(param, (res) => {
this.setState({
myStudyInfo2: res.data,
currentParam: param,
PickerView: false,
})
});
// this.props.getMyStudyInfo2(param, (res) => {
// this.setState({
// myStudyInfo2: res.data,
// currentParam: param,
// PickerView: false,
// })
// });
}
numFormat = (num) => {
let newNum = num;
......
import React, { Component } from 'react';
import { hashHistory } from 'react-router';
import func from '../../util/commonFunc';
//共通组件 搜索
import TrainTopSearch from "./trainTopSearch";
//共通组件 轮播图
import Mycarousel from '../common/carousel';
//选项卡,4个
import HotTrainArea from './hotTrainArea';
import React, { Component } from "react";
import { hashHistory } from "react-router";
import func from "../../util/commonFunc";
// //共通组件 搜索
// import TrainTopSearch from "./trainTopSearch";
// //共通组件 轮播图
// import Mycarousel from "../common/carousel";
// //选项卡,4个
// import HotTrainArea from "./hotTrainArea";
//列表卡片
import { connect } from 'react-redux';
import * as MenuTrainAction from './MenuTrainAction';
import moment from 'moment';
import './MenuTrain.less';
import { connect } from "react-redux";
import * as MenuTrainAction from "./MenuTrainAction";
import moment from "moment";
import "./style.less";
import "./MenuTrain.less";
import TaskCalendar from "./TaskCalendar/index";
import intl from "react-intl-universal";
import TrainIndexList from "./trainIndexList";
class MenuTrain extends Component {
constructor(props) {
super(props);
let carouselHeight = (document.body.clientWidth - 60) * (230 / 690);
this.state = {
pageNo: 1,
enablePay: 0,
inHeight: document.documentElement.clientHeight,
isLoading: false,
trainDataList: [],
carouselParam: {
height: carouselHeight,
radius: '0.1rem',
},
refreshList:""
}
}
componentDidMount() {
let params = {
bannerName: "TRAIN",
terminalName: "WECHAT",
};
this.props.trainTabData(params, "");
constructor(props) {
super(props);
var today = new Date();
let carouselHeight = (document.body.clientWidth - 60) * (230 / 690);
this.state = {
today: today,
pageNo: 1,
enablePay: 0,
inHeight: document.documentElement.clientHeight,
isLoading: false,
trainDataList: [],
trainDataList: [],
carouselParam: {
height: carouselHeight,
radius: "0.1rem",
},
refreshList: "",
activeId: "",
activeList: [],
nowData: "",
};
}
this.getHotEnroll();
this.getTrainDataList(1);
componentDidMount() {
// this.getHotEnroll();
this.getNewsList();
let siteCode = location.hash.split("/")[2];
if (siteCode == 'cpicCourses') {
func.changeDocumentTitle(intl.get("taixue"));
}
let siteCode = location.hash.split("/")[2];
if (siteCode == "cpicCourses") {
func.changeDocumentTitle(intl.get("taixue"));
}
}
getTrainDataList = (page) => {
const { activeId } = this.state;
let params = {
bizType: 1,
activityType: activeId,
pageNo: page,
pageSize: 10,
enablePay: this.state.enablePay,
};
getHotEnroll = () => {
let params = {
bannerName: "TRAIN",
terminalName: "WECHAT",
};
let hotParams = {
now: moment().format("YYYY-MM-DD HH:ss:DD"),
pageNo: this.state.pageNo,
pageSize: 50,
};
this.domeClick(params, hotParams);
hotParams.enablePay = this.state.enablePay;
this.props.hotEnrollData(hotParams);
let _this = this;
this.setState({
isLoading: true,
});
this.props.trainListData(params, false, () => {
const { MenuTrainReducer } = _this.props;
_this.setState({
isLoading: false,
pageNo: page,
refreshList: new Date().getTime(),
trainDataList: MenuTrainReducer.trainList,
});
});
};
listScroll = (e) => {
let thisObj = e.target;
var listScrollListener = func.throttle(func.onListScrollToEnd, 100);
listScrollListener(
thisObj,
"train-scroll-listen-container",
this.onEndReached,
200
);
};
newsClassifyClick = (data) => {
console.log(data, "点击情况~~~~~~~~~");
const { activeId } = this.state;
let _this = this;
if (activeId != data.activityType) {
this.setState(
{
activeId: data.activityType,
},
() => {
_this.getNewsList();
this.getTrainDataList(1);
}
);
}
getTrainDataList = (page) => {
let params = {
now: moment().format("YYYY-MM-DD HH:ss:DD"),
pageNo: page,
pageSize: 10,
enablePay: this.state.enablePay
};
let _this = this;
this.setState({
isLoading: true
})
this.props.trainListData(params, false, () => {
const { MenuTrainReducer } = _this.props;
var { trainDataList } = _this.state;
_this.setState({
isLoading: false,
pageNo: page,
refreshList:new Date().getTime(),
trainDataList: page == 1 ? MenuTrainReducer.trainList : trainDataList.concat(MenuTrainReducer.trainList)
})
};
getNewsList = () => {
let _this = this;
this.props.getActiveList("", () => {
const { MenuTrainReducer } = _this.props;
let allClassify = MenuTrainReducer.activityType;
if (allClassify && allClassify.length > 0) {
allClassify.unshift({
activityType: "",
activityName: intl.get("AllActive"),
});
}
filterTheTrainList = (type) => {
let enablePay = 0;
if (parseInt(type) == 2) {
enablePay = 1;
}
let _this = this;
this.setState({
enablePay
}, () => {
_this.getHotEnroll();
_this.getTrainDataList(1);
}
this.setState({ activeList: allClassify });
});
};
//更改日期,每次更改日期去获取新的任务列表,默认打开课程,第一页
onChangeDateListener = (data, viewData) => {
let _this = this;
let { activeId, page, trainDataList } = this.state;
let params = {
bizType: 1,
activityType: activeId,
pageNo: page,
pageSize: 10,
now: data.All_date + ` 00:00:00`,
};
if (trainDataList.length > 0) {
_this.props.trainListData(params, () => {
const { MenuTrainReducer } = _this.props;
console.log(MenuTrainReducer.trainList, "获取数据展示1111");
_this.setState({
isLoading: false,
pageNo: page,
refreshList: new Date().getTime(),
trainDataList: MenuTrainReducer.trainList,
});
console.log(this.state.trainDataList,'33333')
});
}
domeClick = (...item) => {
item.reduce((m, n) => console.log(JSON.stringify(m) + ',' + JSON.stringify(n)));
};
imgRest = (data) => {
let newData = [];
data.map((item) => {
newData.push({ ...item, imageSrc: item.bannerPath })
};
//获取某天的任务列表
getTaskList = (nowData) => {};
/*
*获取日历中的每个月的任务列表
*/
getCalendarTaskNum = (date) => {
const { activeId, page, trainDataList } = this.state;
let _this = this;
let thisMonth = this.getMonthData(date);
if (trainDataList.length <= 0) {
let params = {
bizType: 1,
activityType: activeId,
pageNo: page,
pageSize: 10,
now: "",
};
_this.props.trainListData(params, (res) => {
const { MenuTrainReducer } = _this.props;
trainDataList[thisMonth] = res;
_this.setState({
trainDataList:MenuTrainReducer.trainList,
isLoading: false,
});
return newData;
};
listScroll = (e) => {
let thisObj = e.target;
var listScrollListener = func.throttle(func.onListScrollToEnd, 100);
listScrollListener(thisObj, "train-scroll-listen-container", this.onEndReached, 200);
});
console.log(this.state.trainDataList,'33333')
}
render() {
let { bannerList, hotEnroll } = this.props.MenuTrainReducer;
let { trainDataList, carouselParam, isLoading,refreshList } = this.state;
return (
<div className="train-index-container" onScroll={this.listScroll}>
<div className="train-container" id="train-scroll-listen-container">
<div style={{ backgroundColor: "#fff" }}>
<TrainTopSearch filterTheTrainList={this.filterTheTrainList} />
{JSON.stringify(bannerList) === "[]" ?
null
: <div className='carousel'>
<Mycarousel
data={this.imgRest(bannerList)}
carouselparam={carouselParam}
frameOverflow={"hidden"}
/>
</div>
}
{hotEnroll.length ?
<div className="hotenroll">
<HotTrainArea
key={refreshList}
data={hotEnroll}
hotItemClick={this.hotItemClick}
/>
</div>
: null}
</div>
<TrainIndexList
key={refreshList}
list={trainDataList}
itemClick={this.itemClick}
isLoading={isLoading}
/>
</div>
<div style={{ width: "100%", height: 100 }}></div>
};
//获取年月信息
getMonthData = (date) => {
let _date = new Date(date);
let years = _date.getFullYear();
let months = _date.getMonth() + 1;
let thisMonth = years + "_" + months;
return thisMonth;
};
render() {
let { trainDataList, isLoading, refreshList, activeList, activeId } =
this.state;
return (
<div className="train-index-container" onScroll={this.listScroll}>
<div className="train-container" id="train-scroll-listen-container">
<div style={{ backgroundColor: "#fff" }}>
<NewsClassifyList
list={activeList}
activeId={activeId}
onClick={this.newsClassifyClick}
/>
</div>
<div className="taskView">
<div className={"taskCalendarView moveDown"} id="taskCalendarView">
<TaskCalendar
timestamp={this.state.today}
onChangeDateListener={this.onChangeDateListener}
getCalendarTaskNum={this.getCalendarTaskNum}
isLoading={this.state.isLoading}
taskList={trainDataList}
/>
</div>
);
</div>
<TrainIndexList
key={refreshList}
list={trainDataList}
itemClick={this.itemClick}
isLoading={isLoading}
/>
</div>
<div style={{ width: "100%", height: 100 }}></div>
</div>
);
}
onEndReached = () => {
if (this.state.isLoading) {
return;
}
onEndReached = () => {
if (this.state.isLoading) {
return;
}
console.log("加载")
if (this.props.MenuTrainReducer.isMore) {
const { pageNo } = this.state;
this.getTrainDataList(pageNo + 1);
}
};
//火热报名
hotItemClick = (item) => {
console.log(item);
hashHistory.push({
pathname: func.routerBefore() + "/trainingsteps",
query: {
id: item.trainingProjectId,
text: item.tpName
}
})
};
//list item
itemClick = (item) => {
console.log(item);
hashHistory.push({
pathname: func.routerBefore() + '/trainingsteps',
query: {
id: item.id,
finished: item.finished
},
})
};
console.log("加载");
if (this.props.MenuTrainReducer.isMore) {
const { pageNo } = this.state;
this.getTrainDataList(pageNo + 1);
}
};
//list item
itemClick = (item) => {
console.log(item,'555555555555');
hashHistory.push({
pathname: func.routerBefore() + "/trainingsteps",
query: {
id: item.id,
finished: item.finished,
activityStateCode: item.activityStateCode
},
});
};
}
export default connect(state => {
let { MenuTrainReducer } = state;
return {
MenuTrainReducer
};
export default connect((state) => {
let { MenuTrainReducer } = state;
return {
MenuTrainReducer,
};
}, MenuTrainAction)(MenuTrain);
const NewsClassifyList = ({ list, activeId, onClick }) => {
return (
<div className="news-classify-list-container">
<div className="news-classify-list-container-bg"></div>
<div
className="news-classify-list-scroll-container"
id={"news-classify-list-scroll-id"}
>
{list.map((item, index) => {
return (
<NewsClassifyItem
key={index}
data={item}
isActive={activeId == item.activityType ? true : false}
onClick={() => onClick(item)}
/>
);
})}
</div>
</div>
);
};
const NewsClassifyItem = ({ data, isActive, onClick }) => {
return (
<div className="news-classify-item-container" onClick={onClick}>
{isActive ? <span>{data.activityName}</span> : data.activityName}
</div>
);
};
import Network from '../../util/fetchUtil';
import excute from '../../util/fetchUtil';
import API from '../../util/urlconfig';
import * as actions from "./TrainReduxTypes";
export const trainTabData=(params)=>{
return dispatch=>{
Network.post(API.banner, params,
response => {
dispatch({
type: actions.TRAIN_PAGE_DATA_EVENTS,
bannerList: response.data
});
}
);
}
};
//火热报名中.....
export const hotEnrollData=(params)=>{
return dispatch=>{
Network.post(API.hotEnrolling, params,
response=>{
export const getActiveList = (data,callback) => {
return dispatch => {
excute.get(API.activeList + '?bizType=1',
(res) => {
if (String(res.code) == "1000") {
dispatch({
type:actions.HOT_ENROLL_DATA_EVENT,
hotEnroll:response.data.records
type: actions.TRAIN_ACTIVE_LIST,
activityType: res.data.activityType,
theDay:res.data.theDay
})
if (callback) {
callback();
}
}
)
}
)
}
};
//培训列表
export const trainListData=(params, isUpData ,callBack)=>{
return dispatch=>{
export const trainListData = (params, callBack) => {
return dispatch => {
Network.post(API.trainList, params,
response=>{
let pageNo=Number.parseInt(response.data.current)+1;
let isMore=pageNo > response.data.pages?false:true;
response => {
let pageNo = Number.parseInt(response.data.current) + 1;
let isMore = pageNo > response.data.pages ? false : true;
dispatch({
type:actions.TRAIN_LIST_DATAS,
trainList:itemList(response.data.records),
isUpData:isUpData,
isMore:isMore,
pageNo:pageNo,
pageTotle:response.data.total,
type: actions.TRAIN_LIST_DATAS,
trainList: itemList(response.data.records),
isMore: isMore,
pageNo: pageNo,
pageTotle: response.data.total,
});
if(callBack){
if (callBack) {
callBack();
}
}
)
}
};
function itemList(item){
let newItem=[];
item.map(item=>{
function itemList(item) {
let newItem = [];
item.map(item => {
newItem.push({
image:item.logoImg,
text:item.name,
image: item.logoImg,
text: item.name,
people: item.joinNumber,
start:item.startTime,
end:item.endTime,
id:item.id,
finished:item.finished,
activitieNum:item.activitieNum,
period:item.period,
trainingDurationShow:item.trainingDurationShow,
enablePay:item.enablePay
start: item.startTime,
end: item.endTime,
id: item.id,
finished: item.finished,
activitieNum: item.activitieNum,
activityStateCode:item.activityStateCode,
period: item.period,
trainingDurationShow: item.trainingDurationShow,
enablePay: item.enablePay
})
});
return newItem;
}
//初始化
export const initialTrainReducer=()=>{
export const initialTrainReducer = () => {
return {
type:actions.INITIAL_TRAIN_REDUCER
type: actions.INITIAL_TRAIN_REDUCER
}
}
\ No newline at end of file
......@@ -3,6 +3,8 @@ const initial={
bannerList:[],
trainList:[],
hotEnroll:[],
activityType:[],
theDay:[],
pageNo:1,
isMore:false,
pageTotle:0,
......@@ -19,14 +21,14 @@ export default (state=initial, action)=>{
...state,
hotEnroll:action.hotEnroll
};
case actions.TRAIN_ACTIVE_LIST:
return {
activityType:action.activityType,
theDay:action.theDay
};
case actions.TRAIN_LIST_DATAS:
let dataList=[];
dataList=action.trainList
return {
...state,
trainList:dataList,
trainList:action.trainList,
pageNo:action.pageNo,
isMore:action.isMore,
pageTotle:action.pageTotle
......
import React, { Component } from 'react';
import './style/index.less';
import { Icon } from 'antd';
import intl from "react-intl-universal";
export default class CalendarHeader extends Component {
constructor(props) {
super(props);
this.state = {
monthArr: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
}
}
render() {
let { month, currentMonth, year } = this.props;
const { monthArr } = this.state;
let preDisabled = month == currentMonth + 1 || (month == 1 && currentMonth == 12);
let monthStr = intl.get(monthArr[month - 1])
return (
<div className="calendarHeader">
<div className="monthTitle">
{year}{intl.get('year')}{monthStr}
</div>
<div className="leftArrow">
<Icon type="left" className={preDisabled ? "prevBtn" : "prevBtn disabled"} onClick={this.props.prevMonth} />
</div>
<div>
<Icon type="right" className={month == currentMonth ? "nextBtn" : "nextBtn disabled"} onClick={this.props.nextMonth} />
</div>
</div>
)
}
}
import React from "react";
// import {PanResponder} from 'react-native';
import "./style/index.less";
import $ from "jquery";
// import {Motion, spring, presets} from 'react-motion'
import intl from "react-intl-universal";
class CalenderMain extends React.Component {
constructor(props) {
super(props);
this.state = {
current_day:
this.props.year + "" + this.props.month + "" + this.props.day,
week_names: [
intl.get("Sunday"),
intl.get("One"),
intl.get("Two"),
intl.get("Three"),
intl.get("Four"),
intl.get("Five"),
intl.get("Six"),
],
current_rowIndex: "row_" + this.getCurrentRowIndex(),
};
}
//当调用者的state发生改变时
componentWillReceiveProps() {}
//获取当前月显示数据
getCurrentMonth = () => {
let view_data = this.props.viewData;
let current_month_data = view_data.months[this.props.month - 1].days;
let rowsInMonth = [];
current_month_data.forEach((day, index) => {
if (index % 7 === 0) {
rowsInMonth.push(current_month_data.slice(index, index + 7));
}
});
let currentMonth = this.props.year + "_" + this.props.month;
let currentTaskList = this.props.taskList
? this.props.taskList[currentMonth]
: null;
if (currentTaskList) {
rowsInMonth.map((list, index) => {
if (list.length) {
list.map((data) => {
if (currentTaskList[data.All_date] > 0) {
data.hasTask = true;
}
});
}
});
}
return rowsInMonth;
};
//获取当前日期在第几行
getCurrentRowIndex = () => {
let current_month_data = this.getCurrentMonth();
for (let [index, data] of current_month_data.entries()) {
for (let value of data) {
if (value.day === this.props.day && value.month === this.props.month) {
return index;
}
}
}
};
//选择日期
onDatePickListener = (data, rowindex, evn) => {
evn.preventDefault();
if (this.props.isLoading) {
return;
}
let days = data.year + "" + data.month + "" + data.day;
if (this.checkDateStatus(data)) {
this.props.onDatePickListener(data.day);
if (data.isHaveData) {
this.props.onChangeDateListener(data);
}
this.setState({
current_day: days,
current_rowIndex: rowindex,
});
this.props.onChangeDateListener(data);
}
};
//星期标题
_renderWeekHeader = () => {
return (
<div className="calendar_header_row" ref="header">
{this.state.week_names.map((name, index) => {
return (
<div className="calendar_box" key={index}>
{name}
</div>
);
})}
</div>
);
};
componentDidMount() {}
//其他日期的效果
_renderViewItem = (data) => {
let showFlag =
data.hasTask &&
(data.month != this.props.defaultDate.getMonth() + 1 ||
data.day >= this.props.defaultDate.getDate())
? true
: false;
if (data.isGetReport) {
return (
<div
style={{
backgroundImage: `url('${getImg("birthday_icon")}')`,
backgroundSize: "contain",
}}
className="calendar_box_hava_data"
>
<span style={{ color: "#fff" }}>{data.day}</span>
</div>
);
}
switch (data.flag) {
//不可以修改
case 1:
if (data.isTodays) {
return <div className="calendar_box_click_red">{data.day}</div>;
} else {
return (
<div
style={{
backgroundImage: `url('${getImg("hava_data")}')`,
backgroundSize: "contain",
}}
className="calendar_box_hava_data"
></div>
);
}
case 2:
if (data.isTodays) {
return <div className="calendar_box_click_red">{data.day}</div>;
} else {
return <div className="calendar_box_other_gray">{data.day}</div>;
}
//显示补
case 3:
case 4:
case 6:
case 7:
return (
<div
style={{
backgroundImage: `url('${getImg("no_hava_data")}')`,
backgroundSize: "contain",
}}
className="calendar_box_hava_data"
></div>
);
//显示对勾
case 5:
case 8:
return (
<div
style={{
backgroundImage: `url('${getImg("hava_data")}')`,
backgroundSize: "contain",
}}
className="calendar_box_hava_data"
></div>
);
//显示未来
case 9:
return <div className="calendar_box_furture">{data.day}</div>;
default:
if (data.isTodays) {
return (
<div className="calendar_box_click_blue_two calendar_box_item">
{data.day}
{data.hasTask ? <span className="calendar_today_pot"></span> : ""}
</div>
);
} else {
return (
<div
className={
this.checkDateStatus(data)
? "calendar_box_other_gray calendar_box_item"
: "calendar_box_other_disabled calendar_box_item"
}
>
{data.day}
{showFlag ? <span className="calendar_pot"></span> : ""}
</div>
);
}
}
};
checkDateStatus = (data) => {
var nowMonth = this.props.defaultDate.getMonth() + 1;
var nowDay = this.props.defaultDate.getDate();
var flag = false;
if (nowMonth == data.month) {
if (data.day >= nowDay) {
flag = true;
} else {
if ((nowMonth == 12 && data.month == 1) || nowMonth + 1 == data.month) {
flag = true;
} else {
flag = false;
}
}
} else {
if ((nowMonth == 12 && data.month == 1) || nowMonth + 1 == data.month) {
flag = true;
} else {
flag = false;
}
}
return flag;
};
_renderViewCurrentDay = (data) => {
if (
this.state.current_day ===
data.year + "" + data.month + "" + data.day
) {
if (data.isTodays) {
return (
<div className="calendar_box_click_red calendar_box_item">
{data.day}
{data.hasTask ? <span className="calendar_today_pot"></span> : ""}
</div>
);
}
switch (data.flag) {
case 3:
case 4:
case 6:
case 7:
return (
<div className="calendar_box_click_red calendar_box_item">
{data.day}
</div>
);
default:
return (
<div className="calendar_box_click_blue calendar_box_item">
{data.day}
{data.hasTask ? <span className="calendar_pot"></span> : ""}
</div>
);
}
} else {
return this._renderViewItem(data);
}
};
_renderMain = () => {
let current_month_data = this.getCurrentMonth();
return (
<div className="main">
<div className="mainContainer" ref="main">
{current_month_data.map((row, rowindex) => {
return (
<div
key={rowindex}
className="calendar_box_row"
ref={"row_" + rowindex}
>
{row.map((data, index) => {
return (
<div
className={
data.isCurrentMonth && !data._isFutureTime
? "calendar_box_current_month"
: "calendar_box_other_month"
}
key={data.All_date}
onClick={this.onDatePickListener.bind(
this,
data,
"row_" + rowindex
)}
>
{this._renderViewCurrentDay(data)}
</div>
);
})}
</div>
);
})}
</div>
</div>
);
};
render() {
let view_data = this.props.viewData;
return <div className="calendar_layout">{this._renderMain()}</div>;
}
}
export default CalenderMain;
/**
* 年的对象
* @param year
* @returns {{year: *, months: Array}}
*/
const getYearInstance = (year) => {
return { year, months: [] }
}
/**
*
* @param month 月
* @param year 年
* @returns {{month: *, days: Array}}
*/
const getMonthInstance = (month, year) => {
return { month, year, days: [] };
}
/**
* 日对象
* @param day 日
* @param month 月 已加1
* @param year 年
* @param timestamp 时间戳
* @param isCurrentMonth 是否是当前月,只有当前月份的日期可以点击
* @parm flag -1 默认值
* @returns {{day: *, month: *, year: *, week: number, isOnClick: boolean}}
*/
const getDayInstance = (day, month, year, isCurrentMonth = false, isPost = false) => {
year = getYear(month, year);
month = getMonth(month);
let date = new Date();
let hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
let minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
let second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
let time = " " + hour + ":" + minute + ":" + second;
let current_date = year + '-' + month + '-' + day;
let current_timestamp = parseInt(getTimestamp(current_date + time, 1));
let timestamp = parseInt(getTimestamp(current_date, 1));
let start_timestamp = parseInt(getTimestamp(current_date + " 00:00:00", 1));
let end_timestamp = parseInt(getTimestamp(current_date + " 23:59:59", 1));
let week = new Date(year, month, day).getDay();
let months = month;
let days = day;
let flag = -1;
let _isFutureTime = isFutureTime(timestamp);
let isTodays = isToday(year, month, day);
let hasTask = false;
if (month < 10) {
months = '0' + month;
}
if (day < 10) {
days = '0' + day;
}
let All_date = year + '-' + months + '-' + days;
return { day, month, year, week, current_timestamp, timestamp, start_timestamp, end_timestamp, isCurrentMonth, All_date, isPost, flag, isTodays, _isFutureTime, hasTask };
}
//获取month
const getMonth = (month) => {
if (month == 0) {
return 12;
} else if (month == 13) {
return 1;
}
return month;
}
//获取year
const getYear = (month, year) => {
if (month == 0) {
return --year;
} else if (month == 13) {
return ++year;
}
return year;
}
//获取一年的数据
export const displayDaysPerMonth = (year) => {
//定义每个月的天数,如果是闰年第二月改为29天
let daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) {
daysInMonth[1] = 29
}
let daysInPreviousMonth = [].concat(daysInMonth);
daysInPreviousMonth.unshift(daysInPreviousMonth.pop());
//获取每一个月显示数据中需要补足上个月的天数
let addDaysFromPreMonth = new Array(12)
.fill(null)
.map((item, index) => {
let day = new Date(year, index, 1).getDay();
if (day === 0) {
return 7
} else {
return day
}
});
let year_bean = getYearInstance(year);
for (let monthIndex = 0; monthIndex < 12; monthIndex++) {
let addDays = addDaysFromPreMonth[monthIndex],
daysCount = daysInMonth[monthIndex],
daysCountPrevious = daysInPreviousMonth[monthIndex],
monthData = [];
//定义当前月的对象,以保存当前月中日的数据
let month_bean = getMonthInstance(monthIndex + 1, year);
//添加上个月补齐的数据
for (; addDays > 0; addDays--) {
let day_bean = getDayInstance(daysCountPrevious--, monthIndex, year, false);
monthData.unshift(day_bean)
}
//添加当月的数据
for (let i = 1; i <= daysCount; i++) {
let day_bean = getDayInstance(i, monthIndex + 1, year, true);
monthData.push(day_bean)
}
//补足下一个月
for (let i = 42 - monthData.length, j = 0; j < i;) {
let day_bean = getDayInstance(++j, monthIndex + 2, year, false);
monthData.push(day_bean)
}
month_bean.days.push(...monthData);
year_bean.months.push(month_bean);
}
return year_bean;
}
/**
* 切换月份的日期切换,month和year是切换前的
* @param month
* @param year
* @param isNext true 下一个月 false 上一个月
*/
export const changeMonthToDate = (year, month, day, isNext = false) => {
if (isNext) {
if (month === 12) {
month = 1;
year++;
} else {
month++;
}
} else {
if (month === 1) {
month = 12;
year--;
} else {
month--;
}
}
day = handleDay(day, month, year);
return getDayInstance(day, month, year);
}
/**
* 获取当前数据
* @param year
* @param month
* @param day
* @returns {{year: *, month: *, day: *, timestamp: Number}}
*/
export const getCurrentData = (year, month, day) => {
return getDayInstance(day, month, year);
}
/**
*
* @param day
* @param oldMonth 切换前的月
* @param newMonth 切换后的月
* @param year 切换后的年
* @returns {*}
*/
export const handleDay = (day, newMonth, year) => {
let daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) {
daysInMonth[1] = 29
}
if (daysInMonth.indexOf(day) !== -1) {
day = daysInMonth[--newMonth];
}
return day;
}
//是否是今天
export const isToday = (year, month, day) => {
let all_date = year + '-' + month + '-' + day;
let todaysDate = new Date();
let years = todaysDate.getFullYear();
let months = todaysDate.getMonth() + 1;
let days = todaysDate.getDate();
let all_dates = years + '-' + months + '-' + days;
return all_dates === all_date;
}
//是否是同一天
export const isToday_V2 = (all_date, date) => {
let _date = date.toString().replace(/-/g, "/");
_date = new Date(_date);
let years = _date.getFullYear();
let months = _date.getMonth() + 1;
let days = _date.getDate();
let all_dates = years + '' + months + '' + days;
return all_date === all_dates;
}
//判断时间是否是未来
export const isFutureTime = (timestamp) => {
return timestamp > getTimestamp();
}
export const getDate = (timestamp) => {
let todaysDate = new Date(timestamp);
return todaysDate
}
export const getTimestamp = (date) => {
if (date) {
return date.valueOf();
} else {
return new Date().valueOf();
}
}
\ No newline at end of file
/**
* 1.建立数据
* 2.render
* 3.提供接口
*/
import React, { Component } from 'react';
import CalenderMain from './CalenderMain';
import './style/index.less'
import { displayDaysPerMonth, changeMonthToDate, getCurrentData, getDate, getTimestamp } from './DayUtils';
class TaskCalendar extends Component {
constructor(props) {
super(props)
const default_date = getDate(this.props.timestamp);
this.state = {
defaultDate: default_date,
year: default_date.getFullYear(),
month: default_date.getMonth() + 1,
day: default_date.getDate(),
viewData: this.props.viewData ? this.props.viewData : displayDaysPerMonth(default_date.getFullYear()),
up_img_url: 'up_month',
}
}
//当调用者的state发生改变时
componentWillReceiveProps(nextProps) {
if (nextProps.default_date) {
const default_date = getDate(getTimestamp(nextProps.default_date));
this.setState({
year: default_date.getFullYear(),
month: default_date.getMonth() + 1,
day: default_date.getDate(),
});
}
//判断是否有购买日期,如果有,则获取购买日期的年和月,在购买日期之前的按钮是不可以切换的
if (nextProps.purchasing_date) {
let purchasing_date = nextProps.purchasing_date;
purchasing_date = getDate(getTimestamp(purchasing_date));
let month = purchasing_date.getMonth() + 1;
let year = purchasing_date.getFullYear();
if (year === this.state.year && month === (this.state.month)) {
this.setState({ up_img_url: 'up_month_gray' });
} else {
this.setState({ up_img_url: 'up_month' });
}
}
}
//初始化获取当前数据
componentDidMount() {
let data = getCurrentData(this.state.year, this.state.month, this.state.day);
this.onChangeDateListener(data);
}
//获取日历状态
getReportDailyStatus = (data) => {
// this.props.getReportDailyStatus(data,this.state.viewData);
}
//当时间发生改变时
onChangeDateListener = (data) => {
this.getReportDailyStatus(data);
let viewData = displayDaysPerMonth(data.year);
if (!this.props.taskList[data.year + "_" + data.month]) {
this.props.getCalendarTaskNum(new Date(data.year, data.month - 1).getTime());
}
this.setState({
year: data.year,
month: data.month,
day: data.day,
viewData: viewData
}, () => {
this.props.onChangeDateListener(data, this.state.viewData);
})
}
//切换到下一个月(只限当月和下一个月可翻页)
nextMonth = () => {
let { year, month, day, defaultDate } = this.state;
let currentMonth = defaultDate.getMonth() + 1;
if (month == currentMonth) {
let data = changeMonthToDate(year, month, day, true);
let viewData = displayDaysPerMonth(data.year);
this.setState({
year: data.year,
month: data.month,
day: data.day,
viewData: viewData
}, () => {
this.onChangeDateListener(data);
})
}
}
//切换到上一个月(只限当月和下一个月可翻页)
prevMonth = () => {
let { year, month, day, defaultDate } = this.state;
let currentMonth = defaultDate.getMonth() + 1;
if (month == currentMonth + 1 || (month == 1 && currentMonth == 12)) {
let data = changeMonthToDate(year, month, day, false);
if (data.day < defaultDate.getDate()) {
data.day = defaultDate.getDate()
}
let viewData = displayDaysPerMonth(data.year);
this.setState({
year: data.year,
month: data.month,
day: data.day,
viewData: viewData
}, () => {
this.onChangeDateListener(data);
})
}
}
//选择日期
onDatePickListener = (day) => {
this.setState({ day })
}
datePickerToggle = () => {
let row_data = ['row_0', 'row_1', 'row_2', 'row_3', 'row_4', 'row_5'];
//确定是在哪一行
for (let row of row_data) {
if (row !== this.state.current_rowIndex) {
this.refs[row].style.height = this.refs[row].style.height === '45px' ? '0px' : '45px';
}
}
if (this.state.current_status === 'bottom_arrow') {
this.setState({ current_status: 'top_arrow' });
} else {
this.setState({ current_status: 'bottom_arrow' });
}
}
render() {
let props = {
viewData: this.state.viewData
};
return (
<div className="calendarContainer">
<CalenderMain {...props}
ref='CalendarMain'
onDatePickListener={this.onDatePickListener.bind(this)}
onChangeDateListener={this.onChangeDateListener.bind(this)}
year={this.state.year}
month={this.state.month}
day={this.state.day}
viewData={this.state.viewData}
defaultDate={this.state.defaultDate}
prevMonth={this.prevMonth}
nextMonth={this.nextMonth}
taskList={this.props.taskList}
isLoading = {this.state.isLoading}
moveUp = {this.props.moveUp}
changeCalendarState ={this.props.changeCalendarState}
/>
</div>
);
}
}
export default TaskCalendar;
\ No newline at end of file
@import "../../../../static/theme.less";
.calendarContainer {
width: 100%;
height: 100%;
padding-left: 0.2rem;
padding-right: 0.2rem;
border-bottom: 1px solid rgba(229, 229, 229, 1);
.calendarHeader {
margin: 0.36rem auto;
// padding: 0.36rem 0;
width: 90%;
height: 0.5rem;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
.leftArrow {
position: absolute;
right: 150px;
}
.prevBtn {
height: 0.26rem;
color: @themeColor;
font-size: 0.36rem;
font-weight: 600;
line-height: 0.26rem;
}
.prevBtn.disabled {
color: #E3E3E3
}
.nextBtn {
height: 0.26rem;
color: @themeColor;
font-size: 0.36rem;
font-weight: 600;
line-height: 0.26rem;
}
.nextBtn.disabled {
color: #E3E3E3;
}
.monthTitle {
width: 2rem;
height: 0.5rem;
text-align: center;
font-size: 0.36rem;
font-weight: bold;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 0.5rem;
}
}
}
.calendar_header_row {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
}
.calendar_box {
height: 0.36rem;
font-size: 0.26rem;
font-family: AvenirNext-DemiBold, AvenirNext;
font-weight: 600;
color: rgba(152, 157, 179, 1);
line-height: 0.36rem;
}
.calendar_box_row {
width: 100%;
height: 1.04rem;
display: flex;
align-items: center;
justify-content: space-around;
}
.calendar_box_click_red {
// background: linear-gradient(135deg, rgba(115, 174, 252, 1) 0%, rgba(63, 117, 246, 1) 100%);
background: #4285F4;
color: rgba(255, 255, 255, 1);
border-radius: 50%;
}
.calendar_box_click_blue_two {
color: rgba(66, 133, 244, 1);
}
.calendar_box_click_blue {
background: linear-gradient(135deg, rgba(54, 102, 166, 1) 0%, rgba(69, 79, 94, 1) 100%);
color: rgba(255, 255, 255, 1);
border-radius: 50%;
}
.calendar_box_other_gray {
color: rgba(51, 51, 51, 1);
}
.calendar_box_other_disabled {
color: rgba(153, 153, 153, 1);
}
.calendar_today_pot {
display: block;
margin: 0.02rem auto;
width: 0.08rem;
height: 0.08rem;
background: rgba(66, 133, 244, 1);
border-radius: 50%;
}
.calendar_pot {
display: block;
margin: 0.02rem auto;
width: 0.08rem;
height: 0.08rem;
background: rgba(66, 133, 244, 1);
opacity: 0.5;
border-radius: 50%;
}
.calendar_box_item {
width: 0.64rem;
height: 0.64rem;
font-size: 0.28rem;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 600;
line-height: 0.64rem;
text-align: center;
margin: 0 auto;
cursor: pointer;
}
.calendar_bottom {
width: 100%;
padding-top: 0.2rem;
height: 0.46rem;
}
.calendar_bottom_line {
margin: 0rem auto;
width: 0.64rem;
height: 0.06rem;
background: rgba(218, 222, 240, 1);
border-radius: 2px;
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ export const HOT_ENROLL_DATA_EVENT="HOT_ENROLL_DATA_EVENT";
export const TRAIN_LIST_DATAS="TRAIN_LIST_DATAS";
//初始化
export const INITIAL_TRAIN_REDUCER="INITIAL_TRAIN_REDUCER";
//活动list
export const TRAIN_ACTIVE_LIST="TRAIN_ACTIVE_LIST";
//搜索
export const TRAIN_SEARCH_DATA="TRAIN_SEARCH_DATA";
\ No newline at end of file
.singleLineOverflow {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
.news-banner-carsouel-container {
width: 100%;
padding: 24px 30px;
}
.news-classify-list-container {
width: 100%;
height: 88px;
position: sticky;
background-color: #fff;
left: 0;
top: 0;
z-index: 9;
overflow-y: hidden;
overflow-x: auto;
}
.news-classify-list-container .news-classify-list-container-bg {
width: 100%;
height: 88px;
position: absolute;
left: 0;
top: 0;
background-color: #D23A29;
z-index: 1;
}
.news-classify-list-container .news-classify-list-scroll-container {
width: max-content;
height: 88px;
position: relative;
z-index: 2;
padding: 0 10px;
}
.news-classify-list-container .news-classify-list-scroll-container .news-classify-item-container {
max-width: 324px;
height: 88px;
line-height: 88px;
text-align: center;
margin: 0 25px;
display: inline-block;
vertical-align: middle;
font-size: 32px;
color: #fff;
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
.news-classify-list-container .news-classify-list-scroll-container .news-classify-item-container span {
border-bottom: 4px solid #fff;
padding-bottom: 12px;
}
.news-classify-list-container .news-third-classify-list-scroll-container {
width: max-content;
height: 60px;
position: relative;
z-index: 2;
padding: 0 10px;
}
.news-classify-list-container .news-third-classify-list-scroll-container .news-third-classify-item-container {
max-width: 324px;
height: 60px;
line-height: 60px;
text-align: center;
margin: 0 25px;
display: inline-block;
vertical-align: middle;
font-size: 30px;
color: #666;
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
.news-classify-list-container .news-third-classify-list-scroll-container .news-third-classify-item-container span {
color: #4285f4;
}
.news-item-list-container {
width: 100%;
}
@import "../../static/theme.less";
.news-banner-carsouel-container {
width: 100%;
padding: 24px 30px;
}
.news-classify-list-container {
width: 100%;
height: 88px;
position: sticky;
background-color: #fff;
left: 0;
top: 0;
z-index: 9;
overflow-y: hidden;
overflow-x: auto;
.news-classify-list-container-bg {
width: 100%;
height: 88px;
position: absolute;
left: 0;
top: 0;
background-color: #D23A29;
z-index: 1;
}
.news-classify-list-scroll-container{
width: max-content;
height: 88px;
position: relative;
z-index: 2;
padding: 0 10px;
.news-classify-item-container{
max-width: 324px;
height: 88px;
line-height: 88px;
text-align: center;
margin: 0 25px;
display: inline-block;
vertical-align: middle;
font-size: 32px;
color:#fff;
font-weight:400;
.singleLineOverflow;
span{
border-bottom: 4px solid #fff;
padding-bottom: 12px;
}
}
}
.news-third-classify-list-scroll-container{
width: max-content;
height: 60px;
position: relative;
z-index: 2;
padding: 0 10px;
.news-third-classify-item-container{
max-width: 324px;
height: 60px;
line-height: 60px;
text-align: center;
margin: 0 25px;
display: inline-block;
vertical-align: middle;
font-size: 30px;
color:#666;
font-weight:400;
.singleLineOverflow;
span{
color: @themeColor;
}
}
}
}
.news-item-list-container{
width: 100%;
}
\ No newline at end of file
import React, { Component } from 'react';
import React, { Component } from "react";
import "./style.less";
import intl from "react-intl-universal";
import { IndexTitle, IndexModuleBg, IndexNotMore } from "../../indexComponent/indexComponent";
import {
IndexTitle,
IndexModuleBg,
IndexNotMore,
} from "../../indexComponent/indexComponent";
import IconfontD from "../../../common/iconfontd";
import TrigleTagComponent from "../../../common/trigleTag";
class TrainIndexList extends Component {
constructor(props) {
super(props)
constructor(props) {
super(props);
}
renderTrainItemByItemList = () => {
const { list, itemClick } = this.props;
let _this = this;
return list.map((item, index) => {
item.trainTimeStr =
_this.formatTimeToStr(item.start) +
"~" +
_this.formatTimeToStr(item.end);
return (
<TrainItem key={index} data={item} onClick={() => itemClick(item)} />
);
});
};
formatTimeToStr = (timeStr) => {
let dateObj = new Date(timeStr);
let year = dateObj.getFullYear();
let month = dateObj.getMonth() + 1;
if (month < 10) {
month = "0" + month;
}
renderTrainItemByItemList = () => {
const { list, itemClick } = this.props;
let _this = this;
return list.map((item, index) => {
item.trainTimeStr = _this.formatTimeToStr(item.start) + "~" + _this.formatTimeToStr(item.end);
return <TrainItem
key={index}
data={item}
onClick={() => itemClick(item)}
/>;
})
let day = dateObj.getDate();
if (day < 10) {
day = "0" + day;
}
formatTimeToStr = (timeStr) => {
let dateObj = new Date(timeStr);
let year = dateObj.getFullYear();
let month = dateObj.getMonth() + 1;
if (month < 10) {
month = "0" + month;
}
let day = dateObj.getDate();
if (day < 10) {
day = "0" + day;
}
return year + "-" + month + "-" + day;
}
return year + "-" + month + "-" + day;
};
render() {
const { isLoading } = this.props;
return <div className="train-index-list-container">
<IndexTitle title={intl.get("studyActivity")} />
<IndexModuleBg >
{this.renderTrainItemByItemList()}
</IndexModuleBg>
<div style={{ width: "100%", backgroundColor: "#f5f5f5" }}>
<IndexNotMore text={isLoading ? intl.get("PublishKey66") : ""} />
</div>
</div>;
}
render() {
const { isLoading } = this.props;
return (
<div className="train-index-list-container">
<IndexTitle title={intl.get("studyActivity")} />
<IndexModuleBg>{this.renderTrainItemByItemList()}</IndexModuleBg>
<div style={{ width: "100%", backgroundColor: "#f5f5f5" }}>
<IndexNotMore text={isLoading ? intl.get("PublishKey66") : ""} />
</div>
</div>
);
}
}
export default TrainIndexList;
const TrainItem = ({ data, onClick }) => {
return <div className="train-index-list-item-container" onClick={onClick}>
<img src={data.image} alt="" className="train-index-list-item-image" />
return (
<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-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}
</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
className="train-index-list-item-info-text"
style={{ marginTop: 16 }}
>
{data.trainTimeStr}
</div>
</div>
<div
className={
data.activityStateCode == 4
? "train-sign-status"
: data.activityStateCode == 6
? "train-end-status"
: "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
? "未签到"
: ""}
</div>
</div>;
}
\ No newline at end of file
</div>
</div>
);
};
.singleLineOverflow {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
.train-index-list-container {
width: 100%;
}
.train-index-list-container .train-index-list-item-container {
width: 100%;
height: 160px;
padding-left: 266px;
position: relative;
margin-bottom: 32px;
}
.train-index-list-container .train-index-list-item-container .train-index-list-item-image {
width: 266px;
height: 160px;
border-radius: 10px;
position: absolute;
left: 0;
top: 0;
}
.train-index-list-container .train-index-list-item-container .train-index-list-item-info {
width: 100%;
height: 160px;
padding-left: 20px;
}
.train-index-list-container .train-index-list-item-container .train-index-list-item-info .train-index-list-item-info-name {
width: 100%;
height: 40px;
line-height: 40px;
font-size: 32px;
color: #333;
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
.train-index-list-container .train-index-list-item-container .train-index-list-item-info .train-index-list-item-info-text {
width: 100%;
height: 32px;
line-height: 32px;
font-size: 24px;
color: #999;
font-weight: 400;
margin-top: 24px;
}
.train-index-list-container .train-index-list-item-container .train-status {
width: 150px;
border-radius: 50px;
padding: 5px 15px;
font-size: 30px;
text-align: center;
}
.train-index-list-container .train-index-list-item-container .train-enroll-status {
width: 150px;
border-radius: 50px;
padding: 5px 15px;
font-size: 30px;
text-align: center;
border: 1px solid #d23a29;
color: #d23a29;
}
.train-index-list-container .train-index-list-item-container .train-sign-status {
width: 150px;
border-radius: 50px;
padding: 5px 15px;
font-size: 30px;
text-align: center;
background: linear-gradient(90deg, #d23a29, #eb6c53 100%);
color: #fff;
}
.train-index-list-container .train-index-list-item-container .train-end-status {
width: 150px;
border-radius: 50px;
padding: 5px 15px;
font-size: 30px;
text-align: center;
background: #f2f2f4;
color: #999;
}
@import "../../../static/theme.less";
.train-index-list-container{
.train-index-list-container {
width: 100%;
.train-index-list-item-container {
width: 100%;
.train-index-list-item-container{
height: 160px;
padding-left: 266px;
position: relative;
margin-bottom: 32px;
.train-index-list-item-image {
width: 266px;
height: 160px;
border-radius: 10px;
position: absolute;
left: 0;
top: 0;
}
.train-index-list-item-info {
width: 100%;
height: 160px;
padding-left: 20px;
.train-index-list-item-info-name {
width: 100%;
height: 40px;
line-height: 40px;
font-size: 32px;
color: #333;
font-weight: 400;
.singleLineOverflow;
}
.train-index-list-item-info-text {
width: 100%;
height: 160px;
padding-left: 266px;
position: relative;
margin-bottom: 32px;
.train-index-list-item-image{
width: 266px;
height: 160px;
border-radius: 10px;
position: absolute;
left: 0;
top: 0;
}
.train-index-list-item-info{
width: 100%;
height: 160px;
padding-left: 20px;
.train-index-list-item-info-name{
width: 100%;
height: 40px;
line-height: 40px;
font-size: 32px;
color: #333;
font-weight: 400;
.singleLineOverflow;
}
.train-index-list-item-info-text{
width: 100%;
height: 32px;
line-height: 32px;
font-size: 24px;
color: #999;
font-weight: 400;
margin-top: 24px;
}
}
height: 32px;
line-height: 32px;
font-size: 24px;
color: #999;
font-weight: 400;
margin-top: 24px;
}
}
.train-status {
width: 150px;
border-radius: 50px;
padding: 5px 15px;
font-size: 30px;
text-align: center;
}
.train-enroll-status {
width: 150px;
border-radius: 50px;
padding: 5px 15px;
font-size: 30px;
text-align: center;
border: 1px solid #d23a29;
color: #d23a29;
}
.train-sign-status {
width: 150px;
border-radius: 50px;
padding: 5px 15px;
font-size: 30px;
text-align: center;
background: linear-gradient(90deg, #d23a29, #eb6c53 100%);
color: #fff;
}
}
\ No newline at end of file
.train-end-status {
width: 150px;
border-radius: 50px;
padding: 5px 15px;
font-size: 30px;
text-align: center;
background: #f2f2f4;
color: #999;
}
}
}
......@@ -144,7 +144,6 @@ class TaskCalendar extends Component {
let props = {
viewData: this.state.viewData
};
console.log("currentDay:"+this.state.day);
return (
<div className="calendarContainer">
<CalendarHeader
......
......@@ -55,15 +55,10 @@ class SurveyAnswer extends Component {
if (String(isExam) == 1) {
this.props.examQuestionListData({...params, answerId: answerId}, false, isExam);
}
// else {
// // this.props.examQuestionListData({...params}, false, isExam);
// this.props.examQuestionListData({...params}, false, 0);
// }
}
componentWillReceiveProps = (nextProps) => {
console.log(nextProps)
//if (JSON.stringify(nextProps.DetailReducer.questions) != JSON.stringify(this.props.DetailReducer.questions)) {
this.setState({
questions: this.state.questions.cloneWithRows(nextProps.DetailReducer.questions),
});
......@@ -73,33 +68,7 @@ class SurveyAnswer extends Component {
componentWillUnmount() {
this.props.questionIntialReducer();
this._timer && clearInterval(this._timer);
// let {isUpMount}=this.state;
// let {questionsKey}=this.props.DetailReducer;
// if (JSON.stringify(questionsKey.epList) !== '[]' && isUpMount) {
// this.props.evolveSave(questionsKey)
// }
}
// timeDuration = (time) => {
// if (this._timer) return;
// this._timer = setInterval(() => {
// time--;
// if (time <= 0) {
// clearInterval(this._timer);
// this.setState({timeStr: "考试结束"});
// return false;
// }
// let h = this.addZero(Number.parseInt(time / 3600 % 24));
// let m = this.addZero(Number.parseInt(time / 60 % 60));
// let s = this.addZero(Number.parseInt(time % 60));
// this.setState({
// timeStr: h + ":" + m + ":" + s,
// });
// }, 1000);
// };
// addZero = (n) => {
// return n < 10 ? '0' + n : n;
// };
timeDuration=(time)=>{
let h=this.addZero(Number.parseInt(time/3600%24));
let m=this.addZero(Number.parseInt(time/60%60));
......@@ -108,9 +77,8 @@ class SurveyAnswer extends Component {
};
addZero=(n)=> n<10? '0'+n : n;
render() {
let {questions, height, timeStr}=this.state;
let {isMore, pageIndex, duration, questionsKey ,submitTime}=this.props.DetailReducer;
//if (Number.parseFloat(duration) > 0) this.timeDuration(Number.parseFloat(duration) * 60);
let {questions, height}=this.state;
let {isMore}=this.props.DetailReducer;
let separator = (sectionID, rowID) => (
<div
className="separator"
......
......@@ -80,7 +80,7 @@ class details extends Component {
}
})
}
//单选题其他txt回现
//单选题其他txt回现1
if (data.question && data.question.type == 1) {
console.log('danxuan', data.question.options)
data.question.options.map((v, i) => {
......@@ -183,9 +183,7 @@ class details extends Component {
{item.isFrist == 1 && item.remark !== '' ?
<div style={{ fontSize: '.28rem', padding: ' 0.1rem 0.3rem', borderBottom: '5px solid rgba(248,248,248,1)' }} >
<div >
<h4 style={{ float: 'left', padding: '15px 0', fontSize: '32px' }}>{intl.get('Info')||'调研说明'}</h4><span style={{ float: 'right', color: 'rgba(93,168,225,1)', padding: '15px 0' }}
onClick={() => this.open()}>{this.state.open ? intl.get('More')||'展开' : intl.get('Hide')||'收起'}{this.state.open ? <Icon type="down" /> : <Icon type="up" />}
</span>
<h4 style={{ float: 'left', padding: '15px 0', fontSize: '32px' }}>投票</h4>
</div>
<div style={{ clear: 'both' }}></div>
{/** task-1133-jmy 修改文字颜色 #ccc --> #4A4A4A */}
......
#hometitle .am-badge-dot {
width: 20px;
height: 20px;
top: 2px;
right: -9px;
}
#hometitle .am-search-input {
background-color: #f5f5f5;
border-radius: 56px;
}
#example .am-search-input .am-search-synthetic-ph {
text-align: left;
margin-left: 20px;
}
.menuhomeNav {
background: #d23a29;
color: #fff;
padding: 20px;
display: flex;
align-items: center;
}
.menuhomeNav .am-search {
background-color: #fff;
border-radius: 45px;
height: 70px !important;
line-height: 70px !important;
}
#hometitle{
.am-badge-dot{
#hometitle {
.am-badge-dot {
width: 20px;
height: 20px;
top: 2px;
right: -9px;
}
.am-search-input{
.am-search-input {
background-color: #f5f5f5;
border-radius: 56px;
}
}
#example .am-search-input .am-search-synthetic-ph{
#example .am-search-input .am-search-synthetic-ph {
text-align: left;
margin-left: 20px;
}
.menuhomeNav{
background: #FCFCFC;
color: #4A4A4A;
background-color: rgba(255,255,255,1);
height: 0.9rem;
width: 100%;
.menuhomeNav {
background: #d23a29;
color: #fff;
padding: 20px;
display: flex;
flex-direction: row;
justify-content: space-between;
.am-search{background-color: #fff}
}
\ No newline at end of file
align-items: center;
.am-search {
background-color: #fff;
border-radius: 45px;
height: 70px !important;
line-height: 70px !important;
}
}
import React from 'react';
import { hashHistory } from 'react-router';
import { SearchBar, Badge, Toast, Modal } from 'antd-mobile';
import { connect } from 'react-redux';
import { search } from '../../redux/action/nav/navSearch';
import func from '../../util/commonFunc'
import { sign, ticket, noReadCount } from '../../redux/action/myModel'
import React from "react";
import { hashHistory } from "react-router";
import { SearchBar, Badge, Toast, Modal } from "antd-mobile";
import { connect } from "react-redux";
import { search } from "../../redux/action/nav/navSearch";
import func from "../../util/commonFunc";
import { sign, ticket, noReadCount } from "../../redux/action/myModel";
import "./less/nav.less";
import saoyisao from '../../image/saoyisao.png'
import xiaoxi from '../../image/xiaoxi.png'
import saoyisao from "../../image/saoyisao.png";
import xiaoxi from "../../image/xiaoxi.png";
const alert = Modal.alert;
import SignResultModal from "./signResultModal/";
import intl from "react-intl-universal";
import { Fragment } from 'react';
import { Fragment } from "react";
class mehomeNav extends React.Component {
constructor(props) {
super(props);
this.state = {
title: 'title',
selectedTab: 'menuhome',
sign: false,
noreadCount: 0,
signResultVisible: false,
signResultCode: 0,
reasonFromApi: ""
};
this.getKeyword = this.getKeyword.bind(this);
this.closeSignResultModal = this.closeSignResultModal.bind(this);
}
componentDidMount() {
// let store = this.props.store.getState();
// let _this = this;
// this.props.noReadCount(() => {
// _this.setState({
// noreadCount: _this.props.readCount
// })
// })
// let appid = sessionStorage.getItem('appid');
}
getKeyword(value) {
if (!value) {
Toast.info(intl.get('PublishKey168') || "请输入关键词");
} else {
this.props.search(value);
}
}
signIn = (e) => {
//需要再有些优化
e.preventDefault();
let comecodeToken = sessionStorage.getItem(func.companyCode() + 'daying') || '';
let accountId = sessionStorage.getItem("accountId") || '';
// 交银康联RN
const msg = {
method: 'scannerAction', //这一行表明调用RN的相机功能
params: {
comecodeToken,
accountId
}
};
// 空白页不需要传递了terminalMp 使用判断终端即可
if (parseInt(terminalMp) == 0) {//ios
window.webkit.messageHandlers.scannerAction.postMessage(JSON.stringify(msg));
} else if (parseInt(terminalMp) == 1) {//安卓
let orgId = sessionStorage.getItem("orgId");
nativeView.scannerAction(accountId, comecodeToken, orgId);
} else {//微信
let that = this;
let appid = sessionStorage.getItem("appid");
wx.ready(function () {
wx.scanQRCode({
// 默认为0,扫描结果由微信处理,1则直接返回扫描结果
needResult: 1,
desc: 'scanQRCode desc',
success: function (res) {
console.log(res, '扫描结果');
if (typeof res.resultStr == "string" && (res.resultStr.includes("http://") || res.resultStr.includes("https://"))) {
window.location.href = res.resultStr;
return;
}
let resultParam = JSON.parse(res.resultStr);
if (resultParam.type == 'sign') {
delete resultParam.type;
let resultStr = JSON.stringify(resultParam);
that.props.sign(resultStr, (backData) => {
that.setState({
signResultVisible: true,
signResultCode: parseInt(backData.data.code),
reasonFromApi: backData.data.name
});
});
} else {
/*跳转规则
扫码用的type:
项目:project
签到:sign(这是好的)
投票:vote
课程:course
调研:research
考试:exam
专辑:Album */
let url = resultParam.type == 'exam' ? 'exam/examdetail'
: resultParam.type == 'course' ? 'course/courseplay'
: resultParam.type == 'project' ? 'train/trainingsteps'
: resultParam.type == 'research' ? 'SurveyDetails'
: resultParam.type == 'train' ? 'train/trainingdetail'
: resultParam.type == 'vote' ? 'vote'
: resultParam.type == 'lecturer' ? 'teacher/detail'
: resultParam.type == 'Album' ? 'AlbumDetail'
: '';
//跳转页面
hashHistory.push({
pathname: func.routerBefore() + '/' + url,
query: { id: resultParam.id }
});
}
}
});
wx.error(function (res) {
//alert(res);
console.log("签名错误")
console.log(res);
});
});
}
}
closeSignResultModal() {
this.setState({
signResultVisible: false
});
}
render() {
return (
<Fragment>
<div style={{ position: "fixed", left: 0, top: 0, zIndex: 998, width: "100%" }}>
<div
id='hometitle'
iconname={""}
className="menuhomeNav"
>
<div style={{
textAlign: 'center',
marginTop: '.2rem',
width: '10%',
marginLeft: '.2rem'
}} onClick={(e) => this.signIn(e)} >
{/* <FontAwesome name=""className='iconfont icon-daohang-saomascan' style={{fontSize:38}}/></span>*/}
<img style={{ width: 50, height: 50 }} src={saoyisao} /></div>
<div style={{ width: '80%' }} onClick={() => hashHistory.push(func.routerBefore() + '/search')}>
<SearchBar placeholder={intl.get('Search') || "搜索"} maxLength={8} />
</div>
<div style={{
textAlign: 'center',
width: '10%',
alignSelf: 'center',
marginRight: '.2rem',
}} onClick={() => hashHistory.push(func.routerBefore() + '/sendmessage')}>
{
this.state.noreadCount == 0 || isNaN(parseInt(this.state.noreadCount)) ?
<Badge>
<img style={{ width: 50, height: 50 }} src={xiaoxi} />
</Badge>
:
<Badge dot>
<img style={{ width: 50, height: 50 }} src={xiaoxi} />
</Badge>
}
</div>
</div>
<SignResultModal
visible={this.state.signResultVisible}
status={this.state.signResultCode}
reasonFromApi={this.state.reasonFromApi}
closeSignResultModal={this.closeSignResultModal}
/>
</div>
<div style={{width:"100%",height:90}}></div>
</Fragment>
);
constructor(props) {
super(props);
this.state = {
title: "title",
selectedTab: "menuhome",
sign: false,
noreadCount: 0,
signResultVisible: false,
signResultCode: 0,
reasonFromApi: "",
};
this.getKeyword = this.getKeyword.bind(this);
// this.closeSignResultModal = this.closeSignResultModal.bind(this);
}
componentDidMount() {
// let store = this.props.store.getState();
// let _this = this;
// this.props.noReadCount(() => {
// _this.setState({
// noreadCount: _this.props.readCount
// })
// })
// let appid = sessionStorage.getItem('appid');
}
getKeyword(value) {
if (!value) {
Toast.info(intl.get("PublishKey168") || "请输入关键词");
} else {
this.props.search(value);
}
}
// signIn = (e) => {
// //需要再有些优化
// e.preventDefault();
// let comecodeToken = sessionStorage.getItem(func.companyCode() + 'daying') || '';
// let accountId = sessionStorage.getItem("accountId") || '';
// // 交银康联RN
// const msg = {
// method: 'scannerAction', //这一行表明调用RN的相机功能
// params: {
// comecodeToken,
// accountId
// }
// };
// // 空白页不需要传递了terminalMp 使用判断终端即可
// if (parseInt(terminalMp) == 0) {//ios
// window.webkit.messageHandlers.scannerAction.postMessage(JSON.stringify(msg));
// } else if (parseInt(terminalMp) == 1) {//安卓
// let orgId = sessionStorage.getItem("orgId");
// nativeView.scannerAction(accountId, comecodeToken, orgId);
// } else {//微信
// let that = this;
// let appid = sessionStorage.getItem("appid");
// wx.ready(function () {
// wx.scanQRCode({
// // 默认为0,扫描结果由微信处理,1则直接返回扫描结果
// needResult: 1,
// desc: 'scanQRCode desc',
// success: function (res) {
// console.log(res, '扫描结果');
// if (typeof res.resultStr == "string" && (res.resultStr.includes("http://") || res.resultStr.includes("https://"))) {
// window.location.href = res.resultStr;
// return;
// }
// let resultParam = JSON.parse(res.resultStr);
// if (resultParam.type == 'sign') {
// delete resultParam.type;
// let resultStr = JSON.stringify(resultParam);
// that.props.sign(resultStr, (backData) => {
// that.setState({
// signResultVisible: true,
// signResultCode: parseInt(backData.data.code),
// reasonFromApi: backData.data.name
// });
// });
// } else {
// /*跳转规则
// 扫码用的type:
// 项目:project
// 签到:sign(这是好的)
// 投票:vote
// 课程:course
// 调研:research
// 考试:exam
// 专辑:Album */
// let url = resultParam.type == 'exam' ? 'exam/examdetail'
// : resultParam.type == 'course' ? 'course/courseplay'
// : resultParam.type == 'project' ? 'train/trainingsteps'
// : resultParam.type == 'research' ? 'SurveyDetails'
// : resultParam.type == 'train' ? 'train/trainingdetail'
// : resultParam.type == 'vote' ? 'vote'
// : resultParam.type == 'lecturer' ? 'teacher/detail'
// : resultParam.type == 'Album' ? 'AlbumDetail'
// : '';
// //跳转页面
// hashHistory.push({
// pathname: func.routerBefore() + '/' + url,
// query: { id: resultParam.id }
// });
// }
// }
// });
// wx.error(function (res) {
// //alert(res);
// console.log("签名错误")
// console.log(res);
// });
// });
// }
// }
// closeSignResultModal() {
// this.setState({
// signResultVisible: false,
// });
// }
render() {
return (
<Fragment>
<div
style={{
position: "fixed",
left: 0,
top: 0,
zIndex: 998,
width: "100%",
}}
>
<div id="hometitle" iconname={""} className="menuhomeNav">
<div
style={{ width: "25%", fontSize: "36px", marginRight: "20px",paddingLeft:'40px' }}
>
智慧党建
</div>
<div
style={{ width: "50%" }}
onClick={() => hashHistory.push(func.routerBefore() + "/search")}
>
<SearchBar
placeholder={intl.get("Search") || "搜索"}
maxLength={8}
/>
</div>
{/* <div
style={{
textAlign: "center",
width: "10%",
alignSelf: "center",
marginRight: ".2rem",
}}
onClick={() =>
hashHistory.push(func.routerBefore() + "/sendmessage")
}
>
{this.state.noreadCount == 0 ||
isNaN(parseInt(this.state.noreadCount)) ? (
<Badge>
<img style={{ width: 50, height: 50 }} src={xiaoxi} />
</Badge>
) : (
<Badge dot>
<img style={{ width: 50, height: 50 }} src={xiaoxi} />
</Badge>
)}
</div> */}
</div>
{/* <SignResultModal
visible={this.state.signResultVisible}
status={this.state.signResultCode}
reasonFromApi={this.state.reasonFromApi}
closeSignResultModal={this.closeSignResultModal}
/> */}
</div>
<div style={{ width: "100%", height: 90 }}></div>
</Fragment>
);
}
}
// }} onClick={() => hashHistory.push(func.routerBefore() + '/sendmessage')}>
function mapStateToProps(state, ownProps) {
const { myModel } = state;
const { myModel } = state;
return {
code: myModel.loginCode,
appid: myModel.appid,
readCount: myModel.noReadCount,
}
return {
code: myModel.loginCode,
appid: myModel.appid,
readCount: myModel.noReadCount,
};
}
function mapDispatchToProps(dispatch) {
return {
search: (data) => dispatch(search(data)),
sign: (data, callback) => dispatch(sign(data, callback)),
ticket: (url, callback) => dispatch(ticket(url, callback)),
noReadCount: (callback) => dispatch(noReadCount(callback)),
}
return {
search: (data) => dispatch(search(data)),
sign: (data, callback) => dispatch(sign(data, callback)),
ticket: (url, callback) => dispatch(ticket(url, callback)),
noReadCount: (callback) => dispatch(noReadCount(callback)),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(mehomeNav);
......@@ -243,7 +243,7 @@ function mapDispatchToProps(dispatch) {
export default connect(mapStateToProps, mapDispatchToProps)(NewsListPage);
const NewsClassifyList = ({ list, currentClassifyId, onClick }) => {
let bgWidth = func.getDomOffsetWidthById("news-classify-list-scroll-id");
return (
<div className="news-classify-list-container">
<div
......
......@@ -307,6 +307,7 @@ module.exports = {
"Hours": "hrs",
"News": "News",
"AllNews": "All News",
"AllActive": "All Active",
"ReleaseTime": "Time",
"Author": "Author",
"Messages": "Messages",
......
......@@ -1232,6 +1232,7 @@
"LatestReply": "最新回复",
"item": "条",
"AllNews": "所有新闻",
"AllActive": "所有活动",
"hasSelectOption": "已选条件",
"studyNum": "学习人数",
"QuizGotIt": "我知道了",
......
......@@ -305,6 +305,7 @@
"Hours": "小时",
"News": "新闻",
"AllNews": "所有新闻",
"AllActive": "所有活动",
"ReleaseTime": "发布时间",
"Author": "作者",
"Notices": "公告",
......
......@@ -427,6 +427,7 @@ module.exports = {
"LatestReply": "最新回复",
"item": "条",
"AllNews": "所有新闻",
"AllActive": "所有活动",
"hasSelectOption": "已选条件",
"studyNum": "学习人数",
"QuizGotIt": "我知道了",
......@@ -1237,6 +1238,7 @@ module.exports = {
"Hours": "小时",
"News": "新闻",
"AllNews": "所有新闻",
"AllActive": "所有活动",
"ReleaseTime": "发布时间",
"Author": "作者",
"Notices": "公告",
......
......@@ -69,11 +69,13 @@ const linkMap = {
name: '我的项目',
list: '/train/mytraining',
detail: '/mytraining/trainingsteps',
}, myhome: {
},
myhome: {
name: '我的',
list: '/menume',
detail: '/menume',
}, mycourse: {
},
mycourse: {
name: '我的课程',
list: '/mycourse',
detail: '/mycourse/course',
......@@ -139,7 +141,7 @@ const linkMap = {
},
case_upload: {
name: '作品上传',
list:'/UploadMyCase',
list: '/UploadMyCase',
detail: false,
},
course: {
......@@ -213,67 +215,67 @@ const linkMap = {
list: "/signplaycard",
detail: false,
},
lecturer:{
name:"讲师库",
list:"/teachers/list",
detail:false
},
mytask:{
name:'日历任务',
list:"/myCalendarTask",
detail:false,
},
course_classify_group:{
name:"分类组",
list:"/classifygroup",
detail:false
},
album:{
name:"专辑",
list:"/AlbumList",
detail:false
},
album_detail:{
name:"专辑详情",
list:"/AlbumDetail",
detail:'/AlbumDetail'
},
myalbum:{
name:"我的专辑",
list:"/MyAlbumList",
detail:false
},
mysubscriptions:{
name:"我的订阅",
list:"/MySubscribeList",
detail:false
},
forum:{
name:"论坛",
list:"/forumIndex",
detail:"/postDetail",
},
myforum:{
name:"我的论坛",
list:"/MyForum",
detail:false,
},
practice:{
name:"我的陪练",
list:"/smart/smartPractices",
detail:false
},
boutique:{
name:"精品内容",
list:"/boutiqueContent",
detail:false
},
wallet:{
name:"我的钱包",
list:"/myWallet",
detail:false
lecturer: {
name: "讲师库",
list: "/teachers/list",
detail: false
},
mytask: {
name: '日历任务',
list: "/myCalendarTask",
detail: false,
},
course_classify_group: {
name: "分类组",
list: "/classifygroup",
detail: false
},
album: {
name: "专辑",
list: "/AlbumList",
detail: false
},
album_detail: {
name: "专辑详情",
list: "/AlbumDetail",
detail: '/AlbumDetail'
},
myalbum: {
name: "我的专辑",
list: "/MyAlbumList",
detail: false
},
mysubscriptions: {
name: "我的订阅",
list: "/MySubscribeList",
detail: false
},
forum: {
name: "论坛",
list: "/forumIndex",
detail: "/postDetail",
},
myforum: {
name: "我的论坛",
list: "/MyForum",
detail: false,
},
practice: {
name: "我的陪练",
list: "/smart/smartPractices",
detail: false
},
boutique: {
name: "精品内容",
list: "/boutiqueContent",
detail: false
},
wallet: {
name: "我的钱包",
list: "/myWallet",
detail: false
}
}
window.hashHistory = hashHistory;
......@@ -282,15 +284,15 @@ window.routerBefore = func.routerBefore();
const fnNavigate = (item, jumpType) => {
// sessionStorage.setItem("dontAPI","no")
// 根据type判断跳转
const { type, kind, relationId } = item;
let clearTime="";//bug-12616-cwj
console.log('kind',kind);
console.log('type',type);
console.log('item',item);
let clearTime = "";//bug-12616-cwj
console.log('kind', kind);
console.log('type', type);
console.log('item', item);
let url = '';
let queryId = '';
/*跳转规则:
......@@ -307,14 +309,14 @@ const fnNavigate = (item, jumpType) => {
} else if (jumpType == 'navigateList') {
/*首页上方navigator跳转*/
url = type == 'outerchain' ? item.relationFuncUrl : linkMap[type][kind];
url = type == 'outerchain' ? item.relationFuncUrl : linkMap[type][kind];
} else {
/*剩下跳转方式*/
url = type == 'outerchain' ? item.linkUrl : linkMap[type][kind];
queryId = item.relaId;
}
console.log(url,'url')
console.log(url, 'url')
window.directorType = type;
window.directorUrl = url;
if (type == 'outerchain') {
......@@ -359,72 +361,72 @@ const fnNavigate = (item, jumpType) => {
if (type == "course" && relationId != "0") {
hashHistory.push({
pathname: routerBefore + "/courseClassifylist",
query:{
id:relationId
query: {
id: relationId
}
});
} else if(type=="case_upload"){
} else if (type == "case_upload") {
hashHistory.push({
pathname: routerBefore + url,
query:{
id:relationId
query: {
id: relationId
}
});
}else if(type=="course_classify_group"){
} else if (type == "course_classify_group") {
hashHistory.push({
pathname: routerBefore + url,
query:{
id:relationId
query: {
id: relationId
}
});
}else if(type=="rankinglist"&&item.relationNum){
} else if (type == "rankinglist" && item.relationNum) {
hashHistory.push({
pathname: routerBefore + url,
query:{
relationNum:item.relationNum
query: {
relationNum: item.relationNum
}
});
}else if(type=="album_detail"){
} else if (type == "album_detail") {
hashHistory.push({
pathname: routerBefore + url,
query:{
id:relationId
query: {
id: relationId
}
});
}else if(type=="album"&& relationId != "0"){
} else if (type == "album" && relationId != "0") {
hashHistory.push({
pathname: routerBefore + "/AlbumClaList",
query:{
id:relationId
query: {
id: relationId
}
});
}else if(type=="album"&& relationId == "0") {
});
} else if (type == "album" && relationId == "0") {
hashHistory.push({
pathname: routerBefore + url,
});
}
else {
clearTimeout(clearTime)//bug-12616-cwj
clearTime= setTimeout(() => {//bug-12616-cwj
clearTimeout(clearTime)//bug-12616-cwj
clearTime = setTimeout(() => {//bug-12616-cwj
hashHistory.push({
pathname: routerBefore + url,
query:{
id:relationId
query: {
id: relationId
}
});
}, 10);
}
} else if (queryId) {
hashHistory.push({
pathname: routerBefore + url,
query: type == "course" ? { id: queryId} : { id: queryId, accountId: accountId }
query: type == "course" ? { id: queryId } : { id: queryId, accountId: accountId }
});
}
}
......
......@@ -427,6 +427,7 @@ export default {
"LatestReply": "最新回复",
"item": "条",
"AllNews": "所有新闻",
"AllActive": "所有活动",
"hasSelectOption": "已选条件",
"studyNum": "学习人数",
"QuizGotIt": "我知道了",
......
......@@ -112,7 +112,8 @@ const url = {
COURSE_MAIN: `${baseUrl}${WEBSTUDENT}api/course/homePage/list`,
// banner
banner: `${baseUrl}${WEBSTUDENT}api/banner/home/image/list`,
//活动list
activeList:`${baseUrl}${WEBSTUDENT}api/trainingProject/getTrainingActivity`,
//火热报名中
hotEnrolling: `${baseUrl}${WEBSTUDENT}api/trainingProject/hot/page/list`,
//项目列表
......
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