Commit 2b03989c by yanglang123

首页活动

parent 7139b9a3
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
"react-html5video": "^2.5.1", "react-html5video": "^2.5.1",
"react-infinite-scroller": "^1.2.4", "react-infinite-scroller": "^1.2.4",
"react-photo-view": "^0.5.2", "react-photo-view": "^0.5.2",
"react-player": "^2.16.0",
"react-redux": "^4.4.6", "react-redux": "^4.4.6",
"react-router": "^3.2.6", "react-router": "^3.2.6",
"react-router-redux": "^4.0.7", "react-router-redux": "^4.0.7",
...@@ -94,7 +95,6 @@ ...@@ -94,7 +95,6 @@
"svg-sprite-loader": "^0.3.1", "svg-sprite-loader": "^0.3.1",
"terser-webpack-plugin": "^2.2.1", "terser-webpack-plugin": "^2.2.1",
"thread-loader": "^2.1.3", "thread-loader": "^2.1.3",
"url-loader": "^0.5.9",
"video-react": "^0.11.2", "video-react": "^0.11.2",
"webpack": "^4.44.2", "webpack": "^4.44.2",
"webpack-bundle-analyzer": "^2.8.1", "webpack-bundle-analyzer": "^2.8.1",
...@@ -6591,6 +6591,14 @@ ...@@ -6591,6 +6591,14 @@
"integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
"dev": true "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": { "node_modules/default-gateway": {
"version": "4.2.0", "version": "4.2.0",
"resolved": "https://registry.npmmirror.com/default-gateway/-/default-gateway-4.2.0.tgz", "resolved": "https://registry.npmmirror.com/default-gateway/-/default-gateway-4.2.0.tgz",
...@@ -12233,8 +12241,7 @@ ...@@ -12233,8 +12241,7 @@
"node_modules/load-script": { "node_modules/load-script": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmmirror.com/load-script/-/load-script-1.0.0.tgz", "resolved": "https://registry.npmmirror.com/load-script/-/load-script-1.0.0.tgz",
"integrity": "sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA==", "integrity": "sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA=="
"dev": true
}, },
"node_modules/loader-runner": { "node_modules/loader-runner": {
"version": "2.4.0", "version": "2.4.0",
...@@ -12580,6 +12587,11 @@ ...@@ -12580,6 +12587,11 @@
"node": ">=4" "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": { "node_modules/memory-fs": {
"version": "0.4.1", "version": "0.4.1",
"resolved": "https://registry.npmmirror.com/memory-fs/-/memory-fs-0.4.1.tgz", "resolved": "https://registry.npmmirror.com/memory-fs/-/memory-fs-0.4.1.tgz",
...@@ -18260,8 +18272,7 @@ ...@@ -18260,8 +18272,7 @@
"dependencies": { "dependencies": {
"babel-runtime": "6.x", "babel-runtime": "6.x",
"classnames": "2.x", "classnames": "2.x",
"rc-gesture": "~0.0.22", "rc-gesture": "~0.0.22"
"react-native-swipeout": "^2.2.2"
} }
}, },
"node_modules/rc-switch": { "node_modules/rc-switch": {
...@@ -18502,6 +18513,11 @@ ...@@ -18502,6 +18513,11 @@
"react": "^16.14.0" "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": { "node_modules/react-fontawesome": {
"version": "1.7.1", "version": "1.7.1",
"resolved": "https://registry.npmmirror.com/react-fontawesome/-/react-fontawesome-1.7.1.tgz", "resolved": "https://registry.npmmirror.com/react-fontawesome/-/react-fontawesome-1.7.1.tgz",
...@@ -18654,17 +18670,6 @@ ...@@ -18654,17 +18670,6 @@
"react": "*" "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": { "node_modules/react-pdf": {
"version": "5.7.2", "version": "5.7.2",
"resolved": "https://registry.npmmirror.com/react-pdf/-/react-pdf-5.7.2.tgz", "resolved": "https://registry.npmmirror.com/react-pdf/-/react-pdf-5.7.2.tgz",
...@@ -18746,6 +18751,21 @@ ...@@ -18746,6 +18751,21 @@
"react-dom": ">=16.8.0" "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": { "node_modules/react-redux": {
"version": "4.4.10", "version": "4.4.10",
"resolved": "https://registry.npmmirror.com/react-redux/-/react-redux-4.4.10.tgz", "resolved": "https://registry.npmmirror.com/react-redux/-/react-redux-4.4.10.tgz",
...@@ -18901,15 +18921,6 @@ ...@@ -18901,15 +18921,6 @@
"csstype": "^3.0.2" "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": { "node_modules/read-pkg": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmmirror.com/read-pkg/-/read-pkg-1.1.0.tgz", "resolved": "https://registry.npmmirror.com/read-pkg/-/read-pkg-1.1.0.tgz",
...@@ -22050,11 +22061,6 @@ ...@@ -22050,11 +22061,6 @@
"node": "*" "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": { "node_modules/tweetnacl": {
"version": "0.14.5", "version": "0.14.5",
"resolved": "https://registry.npmmirror.com/tweetnacl/-/tweetnacl-0.14.5.tgz", "resolved": "https://registry.npmmirror.com/tweetnacl/-/tweetnacl-0.14.5.tgz",
...@@ -22444,54 +22450,6 @@ ...@@ -22444,54 +22450,6 @@
"node": ">= 0.4" "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": { "node_modules/url-parse": {
"version": "1.5.10", "version": "1.5.10",
"resolved": "https://registry.npmmirror.com/url-parse/-/url-parse-1.5.10.tgz", "resolved": "https://registry.npmmirror.com/url-parse/-/url-parse-1.5.10.tgz",
...@@ -29465,6 +29423,11 @@ ...@@ -29465,6 +29423,11 @@
"integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
"dev": true "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": { "default-gateway": {
"version": "4.2.0", "version": "4.2.0",
"resolved": "https://registry.npmmirror.com/default-gateway/-/default-gateway-4.2.0.tgz", "resolved": "https://registry.npmmirror.com/default-gateway/-/default-gateway-4.2.0.tgz",
...@@ -33967,8 +33930,7 @@ ...@@ -33967,8 +33930,7 @@
"load-script": { "load-script": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmmirror.com/load-script/-/load-script-1.0.0.tgz", "resolved": "https://registry.npmmirror.com/load-script/-/load-script-1.0.0.tgz",
"integrity": "sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA==", "integrity": "sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA=="
"dev": true
}, },
"loader-runner": { "loader-runner": {
"version": "2.4.0", "version": "2.4.0",
...@@ -34265,6 +34227,11 @@ ...@@ -34265,6 +34227,11 @@
"mimic-fn": "^1.0.0" "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": { "memory-fs": {
"version": "0.4.1", "version": "0.4.1",
"resolved": "https://registry.npmmirror.com/memory-fs/-/memory-fs-0.4.1.tgz", "resolved": "https://registry.npmmirror.com/memory-fs/-/memory-fs-0.4.1.tgz",
...@@ -38725,8 +38692,7 @@ ...@@ -38725,8 +38692,7 @@
"requires": { "requires": {
"babel-runtime": "6.x", "babel-runtime": "6.x",
"classnames": "2.x", "classnames": "2.x",
"rc-gesture": "~0.0.22", "rc-gesture": "~0.0.22"
"react-native-swipeout": "^2.2.2"
} }
}, },
"rc-switch": { "rc-switch": {
...@@ -38943,6 +38909,11 @@ ...@@ -38943,6 +38909,11 @@
"scheduler": "^0.19.1" "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": { "react-fontawesome": {
"version": "1.7.1", "version": "1.7.1",
"resolved": "https://registry.npmmirror.com/react-fontawesome/-/react-fontawesome-1.7.1.tgz", "resolved": "https://registry.npmmirror.com/react-fontawesome/-/react-fontawesome-1.7.1.tgz",
...@@ -39059,16 +39030,6 @@ ...@@ -39059,16 +39030,6 @@
"prop-types": "^15.5.0" "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": { "react-pdf": {
"version": "5.7.2", "version": "5.7.2",
"resolved": "https://registry.npmmirror.com/react-pdf/-/react-pdf-5.7.2.tgz", "resolved": "https://registry.npmmirror.com/react-pdf/-/react-pdf-5.7.2.tgz",
...@@ -39119,6 +39080,18 @@ ...@@ -39119,6 +39080,18 @@
"lodash.uniqueid": "^4.0.1" "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": { "react-redux": {
"version": "4.4.10", "version": "4.4.10",
"resolved": "https://registry.npmmirror.com/react-redux/-/react-redux-4.4.10.tgz", "resolved": "https://registry.npmmirror.com/react-redux/-/react-redux-4.4.10.tgz",
...@@ -39259,15 +39232,6 @@ ...@@ -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": { "read-pkg": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmmirror.com/read-pkg/-/read-pkg-1.1.0.tgz", "resolved": "https://registry.npmmirror.com/read-pkg/-/read-pkg-1.1.0.tgz",
...@@ -41880,11 +41844,6 @@ ...@@ -41880,11 +41844,6 @@
"safe-buffer": "^5.0.1" "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": { "tweetnacl": {
"version": "0.14.5", "version": "0.14.5",
"resolved": "https://registry.npmmirror.com/tweetnacl/-/tweetnacl-0.14.5.tgz", "resolved": "https://registry.npmmirror.com/tweetnacl/-/tweetnacl-0.14.5.tgz",
...@@ -42175,44 +42134,6 @@ ...@@ -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": { "url-parse": {
"version": "1.5.10", "version": "1.5.10",
"resolved": "https://registry.npmmirror.com/url-parse/-/url-parse-1.5.10.tgz", "resolved": "https://registry.npmmirror.com/url-parse/-/url-parse-1.5.10.tgz",
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
"react-html5video": "^2.5.1", "react-html5video": "^2.5.1",
"react-infinite-scroller": "^1.2.4", "react-infinite-scroller": "^1.2.4",
"react-photo-view": "^0.5.2", "react-photo-view": "^0.5.2",
"react-player": "^2.16.0",
"react-redux": "^4.4.6", "react-redux": "^4.4.6",
"react-router": "^3.2.6", "react-router": "^3.2.6",
"react-router-redux": "^4.0.7", "react-router-redux": "^4.0.7",
...@@ -85,7 +86,6 @@ ...@@ -85,7 +86,6 @@
"svg-sprite-loader": "^0.3.1", "svg-sprite-loader": "^0.3.1",
"terser-webpack-plugin": "^2.2.1", "terser-webpack-plugin": "^2.2.1",
"thread-loader": "^2.1.3", "thread-loader": "^2.1.3",
"url-loader": "^0.5.9",
"video-react": "^0.11.2", "video-react": "^0.11.2",
"webpack": "^4.44.2", "webpack": "^4.44.2",
"webpack-bundle-analyzer": "^2.8.1", "webpack-bundle-analyzer": "^2.8.1",
......
...@@ -446,7 +446,6 @@ class App extends React.Component { ...@@ -446,7 +446,6 @@ class App extends React.Component {
let companyCode = location.hash.split("/")[1]; let companyCode = location.hash.split("/")[1];
let siteCode = location.hash.split("/")[2]; let siteCode = location.hash.split("/")[2];
console.log(this.state.selectedTab, companyCode, siteCode, location, '当前选定tab');
let { showTab, tabInfo } = this.state; let { showTab, tabInfo } = this.state;
// if (this.props.showInfo.portalBlockList) { // if (this.props.showInfo.portalBlockList) {
// this.props.showInfo.portalBlockList.map((rowData) => { // this.props.showInfo.portalBlockList.map((rowData) => {
......
import React, { Component, Fragment } from "react"; 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 "../../menumarketing/MarketingDetail.less";
import trainComment from "./comment-icon.jpg";
import trainCommentReplay from "../../../image/train-comment.png"; import trainCommentReplay from "../../../image/train-comment.png";
import intl, { init } from "react-intl-universal"; import intl, { init } from "react-intl-universal";
import { hashHistory } from "react-router"; import { hashHistory } from "react-router";
import "./index.less"; import "./index.less";
import moment from "moment"; import moment from "moment";
import { connect } from "react-redux"; import { connect } from "react-redux";
import * as TrainingStepsAction from "./TrainingStepsAction"; import * as TrainingStepsAction from "./TrainingStepsAction";
import func from "../../../util/commonFunc"; import func from "../../../util/commonFunc";
import SecListView from "../../common/listview/secListView"; import SecListView from "../../common/listview/secListView";
import trainComment from "./comment-icon.jpg"; import $ from "jquery";
import zan from "../../../image/zan.png"; import zan from "../../../image/zan.png";
import alreadyzan from "../../../image/alreadyzan.png"; import alreadyzan from "../../../image/alreadyzan.png";
import myIcon from "../../../image/my.png"; import myIcon from "../../../image/my.png";
import ReactPlayer from "react-player";
const TabPane = Tabs.TabPane;
class TrainingSteps extends Component { class TrainingSteps extends Component {
constructor(props) { constructor(props) {
...@@ -25,11 +43,19 @@ class TrainingSteps extends Component { ...@@ -25,11 +43,19 @@ class TrainingSteps extends Component {
this.state = { this.state = {
displayProgress: false, displayProgress: false,
courseInfo:
"IC1金融法规与银行从业人员职业操守认证考试试题20170901项目名称项目名称项目名称项...", //课程信息
successTimer: "2018-02-28 至 2018-03-28", //报名成功时间
successTxt: "开始时间:", //开始时间
learningCountTxt: "总学习时长", //学习时长
hour: "10", //总共小时
minute: "30", //总共分钟
loading: false,
visible: false, visible: false,
confirmLoading: false, confirmLoading: false,
commitContent: "", commitContent: "",
currentType: 1,
//showEnroll :0评论 >=1:报名 (具体处理到下周接口出来)
showEnroll: 1, showEnroll: 1,
showComment: false, showComment: false,
comment: "", comment: "",
...@@ -38,49 +64,50 @@ class TrainingSteps extends Component { ...@@ -38,49 +64,50 @@ class TrainingSteps extends Component {
commentType: 1, commentType: 1,
replyCommentTypeId: 0, replyCommentTypeId: 0,
showProgress: true, showProgress: true,
trainLogoHeight: 400, defaultTabKey: "1",
commentHasMore: true, commentHasMore: true,
showContentOccupy: false, showContentOccupy: false,
isNative: false,
enablePosition: 0, enablePosition: 0,
refreshTrainComment: "", 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() { componentDidMount() {
let _this = this; let _this = this;
this.logoHeightListen(); if (parseInt(terminalMp) == 0 || parseInt(terminalMp) == 1) {
console.log("原生", terminalMp);
_this.setState({ isNative: true });
}
this.props.initailData(); this.props.initailData();
let { id, finished, tabkey, bizType } = this.props.location.query; let { id, finished } = this.props.location.query;
let params = { let params = {
id: id, id: id,
}; };
if (bizType != "2") { this.props.trainStepsData(finished, params, () => {
this.props.trainStepsData(finished, params, () => { let { introductionVo } = _this.props.TrainingStepsReducer;
let { introductionVo } = _this.props.TrainingStepsReducer; let { activityStateCode,signTimeId,signType } = introductionVo;
let { _this.setState({
needEnroll, activityStateCode: activityStateCode,
needAudit, signTimeId: signTimeId,
hasEnrolled, signType: signType,
audited,
enablePosition,
enableSign,
} = introductionVo;
_this.setState({
showProgress: this.showProgressJudge(
needEnroll,
hasEnrolled,
needAudit,
audited
),
enablePosition,
enableSign,
});
_this.contentDomHeightSetForSticky();
}); });
} _this.contentDomHeightSetForSticky();
});
this.setState({ this.setState({
isLoading: true, isLoading: true,
}); });
...@@ -99,13 +126,8 @@ class TrainingSteps extends Component { ...@@ -99,13 +126,8 @@ class TrainingSteps extends Component {
}); });
} }
); );
func.changeDocumentTitle(intl.get("TrainingProgram2") || "项目");
} }
logoHeightListen() {
this.setState({
trainLogoHeight: document.body.clientWidth * (225 / 375),
});
}
contentDomHeightSetForSticky() { contentDomHeightSetForSticky() {
let domHeight = document.getElementById( let domHeight = document.getElementById(
"train-contain-list-sticky-div" "train-contain-list-sticky-div"
...@@ -120,27 +142,6 @@ class TrainingSteps extends Component { ...@@ -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 = () => { onLoadMore = () => {
let { id } = this.props.location.query; let { id } = this.props.location.query;
let _this = this; let _this = this;
...@@ -175,6 +176,16 @@ class TrainingSteps extends Component { ...@@ -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 = () => { trainCommitVerb = () => {
if (!this.state.commitContent) { if (!this.state.commitContent) {
...@@ -230,9 +241,18 @@ class TrainingSteps extends Component { ...@@ -230,9 +241,18 @@ class TrainingSteps extends Component {
this.setState({ showEnroll: 1, showComment: false }); 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 ? ( let loadMore = isMore ? (
<button className="load-more" onClick={() => this.onLoadMore()}> <button className="load-more" onClick={() => this.onLoadMore()}>
{intl.get("PublishKey74") || "点击加载更多"} {intl.get("PublishKey74") || "点击加载更多"}
...@@ -245,18 +265,264 @@ class TrainingSteps extends Component { ...@@ -245,18 +265,264 @@ class TrainingSteps extends Component {
this.state.dataSource = this.state.dataSource.cloneWithRows( this.state.dataSource = this.state.dataSource.cloneWithRows(
this.props.TrainingStepsReducer.reviewListData 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 ( return (
<div <div
className="train-contain" className="train-contain"
style={{ backgroundColor: "#f4f4f4", width: "100%", height: "100%" }} 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 }}> <div style={{ width: "100%", marginTop: 0 }}>
<Fragment>{this.renderComment(reviewListData, loadMore)}</Fragment> <StickyContainer>{this.renderContent()}</StickyContainer>
</div> </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> </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) => { renderComment = (reviewListData, loadMore) => {
let { reviewPageNo, reviewListTotle } = this.props.TrainingStepsReducer; let { reviewPageNo, reviewListTotle } = this.props.TrainingStepsReducer;
...@@ -370,7 +636,7 @@ class TrainingSteps extends Component { ...@@ -370,7 +636,7 @@ class TrainingSteps extends Component {
pageNo: reviewPageNo, pageNo: reviewPageNo,
pageSize: 10, pageSize: 10,
}} }}
footText={intl.get("PublishKey47") || "没有更多了"} // footText={intl.get("PublishKey47") || "没有更多了"}
/> />
<Modal <Modal
title={intl.get("Comment") || "评论"} title={intl.get("Comment") || "评论"}
...@@ -431,6 +697,46 @@ class TrainingSteps extends Component { ...@@ -431,6 +697,46 @@ class TrainingSteps extends Component {
commitContent: "", 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) => { reviewDetail = (item) => {
console.log(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:hh:SS");
...@@ -457,7 +763,6 @@ class TrainingSteps extends Component { ...@@ -457,7 +763,6 @@ class TrainingSteps extends Component {
let { id } = this.props.location.query; let { id } = this.props.location.query;
let param = { id: id }; let param = { id: id };
let _this = this; let _this = this;
if (String(item.status) === "0") { if (String(item.status) === "0") {
// item.thumbsUps++; // item.thumbsUps++;
// this.props.TrainingStepsReducer.reviewListData[index].thumbsUps++; // this.props.TrainingStepsReducer.reviewListData[index].thumbsUps++;
...@@ -474,8 +779,6 @@ class TrainingSteps extends Component { ...@@ -474,8 +779,6 @@ class TrainingSteps extends Component {
); );
}); });
} else { } else {
// this.props.TrainingStepsReducer.reviewListData[index].thumbsUps--;
// item.thumbsUps--;
this.props.laudDeleEnrollEvent(params, () => { this.props.laudDeleEnrollEvent(params, () => {
Toast.info(intl.get("Unlike") || "取消点赞"); Toast.info(intl.get("Unlike") || "取消点赞");
this.props.reviewListData( this.props.reviewListData(
...@@ -490,6 +793,13 @@ class TrainingSteps extends Component { ...@@ -490,6 +793,13 @@ class TrainingSteps extends Component {
}); });
} }
}; };
// 跳转到投稿
toSurvey = (id) => {
hashHistory.push({
pathname: func.routerBefore() + "/SurveyDetails",
query: { id: id },
});
};
} }
export default connect((state) => { 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 * as actions from "./TrainReduxTypes";
import NetWork from '../../../util/fetchUtil'; import excute from "../../../util/fetchUtil";
import API from '../../../util/urlconfig'; import NetWork from "../../../util/fetchUtil";
import {Toast} from 'antd-mobile'; import API from "../../../util/urlconfig";
import func from '../../../util/commonFunc' import { Toast } from "antd-mobile";
import func from "../../../util/commonFunc";
import intl, { init } from "react-intl-universal"; import intl, { init } from "react-intl-universal";
import { INITIAL_TRAIN_REDUCER } from '../../menutrain/TrainReduxTypes'; export const trainStepsData = (finished, params, callback) => {
export const trainStepsData=(finished,params,callback)=>{ return (dispatch) => {
return dispatch=>{ let url = finished ? API.trainStepsFinish : API.trainSteps;
let url = finished?API.trainStepsFinish:API.trainSteps; NetWork.post(url, params, (response) => {
NetWork.post(url, params, // 数据反转
response=>{ if (
response.data.progressVo &&
response.data.progressVo.courseRecentVos
) {
response.data.progressVo.courseRecentVos.reverse();
}
// 数据反转 dispatch({
if( response.data.progressVo && response.data.progressVo.courseRecentVos ) { type: actions.TRAIN_STEPS_DATA_EVENT,
response.data.progressVo.courseRecentVos.reverse() introductionVo: response.data.introductionVo,
} contentVo: pacePer(response.data.contentVo),
progressVo: response.data.progressVo,
dispatch({ hasEnrolled: response.data.hasEnrolled,
type:actions.TRAIN_STEPS_DATA_EVENT, });
introductionVo:response.data.introductionVo, if (callback) {
contentVo:pacePer(response.data.contentVo), callback();
progressVo:response.data.progressVo, }
hasEnrolled:response.data.hasEnrolled });
}) };
if(callback){
callback();
}
}
)
}
}; };
/** /**
...@@ -41,248 +41,273 @@ export const trainStepsData=(finished,params,callback)=>{ ...@@ -41,248 +41,273 @@ export const trainStepsData=(finished,params,callback)=>{
* @param termialType 1、pc端;2、微信端 * @param termialType 1、pc端;2、微信端
* @constructor * @constructor
*/ */
export const CheckDownloadingStatus = (needEnroll, hasEnroll, projectStartTime, projectEndTime) => { export const CheckDownloadingStatus = (
return dispatch => { needEnroll,
let paramsData = { hasEnroll,
needEnroll: needEnroll, projectStartTime,
hasEnroll: hasEnroll, projectEndTime
projectStartTime: projectStartTime, ) => {
projectEndTime: projectEndTime, return (dispatch) => {
termialType: 2 let paramsData = {
}; needEnroll: needEnroll,
NetWork.getNetwork(API.trainDataLibraryDataStatus, paramsData, hasEnroll: hasEnroll,
response => { projectStartTime: projectStartTime,
console.log("response1", response.data); projectEndTime: projectEndTime,
// dispatch({ termialType: 2,
// type: actions.CHECK_DOWNLOADING_STATUS, };
// }); NetWork.getNetwork(
} API.trainDataLibraryDataStatus,
); paramsData,
} (response) => {
} console.log("response1", response.data);
// dispatch({
let pacePer=(obj)=> { // type: actions.CHECK_DOWNLOADING_STATUS,
//添加百分比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 reviewListData=(params, isUpData,callBack)=>{
return dispatch=>{
let urlParams=API.reviewListLink; let pacePer = (obj) => {
if (params) { //添加百分比ratio
let paramsArray = []; obj.plans.map((item) => {
//拼接参数 let ratio = 0;
Object.keys(params).forEach(key => paramsArray.push(key + '=' + params[key])) item.activities.map((childItem) => {
if (urlParams.indexOf('?')==-1) { if (String(childItem.type) === "0") {
urlParams += '?' + paramsArray.join('&') if (childItem.finished) {
} else { ratio += 1;
urlParams += '&' + paramsArray.join('&') } else {
} ratio += 0.5;
}
} else {
if (childItem.finished) {
ratio += 1;
} else {
ratio += 0;
} }
NetWork.get(urlParams, }
response=>{ });
item["ratio"] = Number.parseFloat(ratio / item.activities.length).toFixed(
console.log('评论'); 2
console.log(response); );
});
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{ try {
if(String(response.code)==="1000"){ if (String(response.code) === "1000") {
let reviewPageNo=Number.parseInt(response.data.current)+1; 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);
}
}) 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)=>{ export const commitVerb = (params, callBack) => {
return dispatch=>{ return (dispatch) => {
NetWork.post(API.reviewCommit, params, response=>{ NetWork.post(API.reviewCommit, params, (response) => {
try { try {
if(Number.parseFloat(response.code)===1000){ if (Number.parseFloat(response.code) === 1000) {
dispatch({
dispatch({ type: actions.REVIEW_COMMIT_SUCCESS,
type:actions.REVIEW_COMMIT_SUCCESS, status: 1,
status:1, });
}); Toast.info(intl.get("CommentSuccess") || "评论成功");
Toast.info(intl.get("CommentSuccess")||"评论成功"); callBack();
callBack(); }
} } catch (e) {}
}catch (e) { });
};
}
});
}
}; };
//点赞保存功能 //点赞保存功能
export const laudSaveEnrollEvent=(params,callBack)=>{ export const laudSaveEnrollEvent = (params, callBack) => {
return dispatch=>{ return (dispatch) => {
NetWork.post(API.trainReviewGood, params, response=>{ NetWork.post(API.trainReviewGood, params, (response) => {
try { try {
if(Number.parseFloat(response.code)===1000){ if (Number.parseFloat(response.code) === 1000) {
dispatch({
dispatch({ type: actions.LAUD_SAVE_SUCCESS_EVENT,
type:actions.LAUD_SAVE_SUCCESS_EVENT, status: 1,
status:1, itemId: params.tpCommentId,
itemId:params.tpCommentId });
}); if (callBack) {
if(callBack){ callBack();
callBack(); }
} }
} } catch (e) {
}catch (e) { console.log(e);
console.log(e); }
} });
}); };
}
}; };
//报名 //报名
export const lessonEnrollEvent=(params,callBack)=>{ export const lessonEnrollEvent = (params, callBack) => {
return dispatch=>{ return (dispatch) => {
NetWork.post(API.courseSignUp, params, response=>{ NetWork.post(API.courseSignUp, params, (response) => {
try { try {
if(Number.parseInt(response.code)===1000){ if (Number.parseInt(response.code) === 1000) {
Toast.info(intl.get("PublishKey70")||"报名成功"); Toast.info(intl.get("PublishKey70") || "报名成功");
callBack && callBack(); callBack && callBack();
}else{ } else {
Toast.info(intl.get("PublishKey70")||"报名成功"); Toast.info(intl.get("PublishKey70") || "报名成功");
} }
}catch (e) { } catch (e) {
console.log(e) console.log(e);
} }
}); });
} };
}; };
export const laudDeleEnrollEvent=(params,callBack)=>{ //签到
return dispatch=> { export function sign(params, callBack) {
NetWork.post(API.trainReviewBad, params, response => { return (dispatch) => {
console.log(response); return excute.post(API.signIn, params, (res) => {
try { callBack(res);
if (Number.parseFloat(response.code) === 1000) { dispatch({
if(callBack){ type: SIGN_ACTION,
callBack(); data: res,
} });
dispatch({ });
type: actions.LAUD_DELE_TYPE_EVENT, };
status: 0, }
itemId: params.tpCommentId export const laudDeleEnrollEvent = (params, callBack) => {
}); return (dispatch) => {
} NetWork.post(API.trainReviewBad, params, (response) => {
} catch (e) { console.log(response);
console.log(e); 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)=>{ export const reviewReplyList = (params, callBack) => {
let contactUrl = API.trainReviewReplyLis+'?commentId='+params.commentId+'&pageNo='+params.pageNo+'&pageSize=10'; let contactUrl =
API.trainReviewReplyLis +
"?commentId=" +
params.commentId +
"&pageNo=" +
params.pageNo +
"&pageSize=10";
return dispatch=> { return (dispatch) => {
NetWork.get(contactUrl, response => { NetWork.get(contactUrl, (response) => {
console.log(response,'评论列表'); console.log(response, "评论列表");
try { try {
if (Number.parseFloat(response.code) === 1000) { if (Number.parseFloat(response.code) === 1000) {
dispatch({ dispatch({
type: actions.REVIEW_COMMIT_LIST, type: actions.REVIEW_COMMIT_LIST,
list: response.data.records, list: response.data.records,
page:{currentPage:params.pageNo,pageTotal: response.data.total, pageNo: response.data.pages, pageSize:response.data.size} page: {
currentPage: params.pageNo,
}); pageTotal: response.data.total,
callBack(); pageNo: response.data.pages,
} pageSize: response.data.size,
} catch (e) { },
console.log(e); });
} callBack();
}); }
} } catch (e) {
} console.log(e);
}
});
};
};
export const reviewReplyCommit=(params,callBack)=>{ export const reviewReplyCommit = (params, callBack) => {
return dispatch=> { return (dispatch) => {
NetWork.post(API.trainReviewReplyCommit, params, response => { NetWork.post(API.trainReviewReplyCommit, params, (response) => {
console.log(response,'提交评论'); console.log(response, "提交评论");
try { try {
if (Number.parseFloat(response.code) === 1000) { if (Number.parseFloat(response.code) === 1000) {
callBack(); callBack();
} }
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }
}); });
} };
} };
//初始化数据 //初始化数据
export const initailData = ()=>{ export const initailData = () => {
return dispatch=>{ return (dispatch) => {
dispatch({type:actions.INITAIL_TRAIN_DATA}); 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 trainCertificateGet = (data,callback)=>{ export const trainClickLog = (id) => {
let url = API.trainUrl+"api/trainingProject/certificate/grant"; let url = API.trainUrl + "api/trainingProject/tpPlanActivity/view/record/add";
return dispatch =>{ return (dispatch) => {
NetWork.post(url,data,(response)=>{ NetWork.post(
callback(response); 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 {*} requestUrl
* @param {*} requestData * @param {*} requestData
* @param {*} callback * @param {*} callback
*/ */
export function validatePickOutCaseDetail (requestUrl, requestData, callback) { export function validatePickOutCaseDetail(requestUrl, requestData, callback) {
return dispatch => { return (dispatch) => {
NetWork.getNetwork(requestUrl, requestData, (response)=> { NetWork.getNetwork(requestUrl, requestData, (response) => {
console.log("trainingStepsAction-response", response); console.log("trainingStepsAction-response", response);
callback(response); callback(response);
}); });
} };
} }
\ No newline at end of file
.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 @@ ...@@ -9,7 +9,7 @@
} }
.color-4a() { .color-4a() {
color: #4A4A4A; color: #4a4a4a;
} }
.color-666() { .color-666() {
...@@ -17,19 +17,19 @@ ...@@ -17,19 +17,19 @@
} }
.font32() { .font32() {
font-size: .32rem; font-size: 0.32rem;
} }
.font30() { .font30() {
font-size: .3rem; font-size: 0.3rem;
} }
.font34() { .font34() {
font-size: .34rem; font-size: 0.34rem;
} }
.font24() { .font24() {
font-size: .24rem; font-size: 0.24rem;
} }
.BraftEditor-content { .BraftEditor-content {
...@@ -50,8 +50,6 @@ ...@@ -50,8 +50,6 @@
/** 隐藏超出的内容 **/ /** 隐藏超出的内容 **/
} }
;
.am-accordion .am-accordion-item .am-accordion-header { .am-accordion .am-accordion-item .am-accordion-header {
position: inherit !important; position: inherit !important;
} }
...@@ -59,13 +57,12 @@ ...@@ -59,13 +57,12 @@
.training-done-view { .training-done-view {
// overflow-x:hidden; // overflow-x:hidden;
overflow: hidden; overflow: hidden;
background: #fff; // background: #fff;
.my-accordion { .my-accordion {
padding-left: .82rem; padding-left: 0.82rem;
.am-accordion-item { .am-accordion-item {
//列表头部 //列表头部
// .am-accordion-header{ // .am-accordion-header{
// position: absolute; // position: absolute;
...@@ -127,12 +124,13 @@ ...@@ -127,12 +124,13 @@
.am-list-item { .am-list-item {
padding-left: 0; padding-left: 0;
.am-list-content {} .am-list-content {
}
} }
.training-done-info { .training-done-info {
margin: 0; margin: 0;
line-height: .65rem; line-height: 0.65rem;
padding-right: 0.15rem; padding-right: 0.15rem;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -140,49 +138,45 @@ ...@@ -140,49 +138,45 @@
max-width: 63%; max-width: 63%;
.font30; .font30;
.color-666; .color-666;
} }
.tip-text { .tip-text {
margin: 0.1rem; margin: 0.1rem;
font-size: .2rem; font-size: 0.2rem;
color: @themeColor; color: @themeColor;
line-height: .28rem; line-height: 0.28rem;
border-radius: .3rem; border-radius: 0.3rem;
border: 1px solid @themeColor; border: 1px solid @themeColor;
padding: .05rem .1rem; padding: 0.05rem 0.1rem;
overflow: visible; overflow: visible;
} }
.tip-text-green { .tip-text-green {
margin: 0.1rem; margin: 0.1rem;
font-size: .2rem; font-size: 0.2rem;
color: #559906; color: #559906;
line-height: .28rem; line-height: 0.28rem;
border-radius: .3rem; border-radius: 0.3rem;
border: 1px solid #559906; border: 1px solid #559906;
padding: .05rem .1rem; padding: 0.05rem 0.1rem;
overflow: visible; overflow: visible;
} }
.am-list-body div:not(:last-child) .am-list-line:after { .am-list-body div:not(:last-child) .am-list-line:after {
left: -.33rem; left: -0.33rem;
width: 105%; width: 105%;
} }
.am-list-line:after { .am-list-line:after {
left: -.33rem; left: -0.33rem;
border-bottom: 2px solid #ddd; border-bottom: 2px solid #ddd;
} }
} }
.am-accordion-content-box:after { .am-accordion-content-box:after {
left: -.33rem; left: -0.33rem;
width: 105%; width: 105%;
border-bottom: 2px solid #ddd; border-bottom: 2px solid #ddd;
} }
} }
} }
...@@ -199,19 +193,19 @@ ...@@ -199,19 +193,19 @@
i.dom { i.dom {
position: absolute; position: absolute;
width: .16rem; width: 0.16rem;
height: .16rem; height: 0.16rem;
border-radius: 50%; border-radius: 50%;
left: -0.42rem; left: -0.42rem;
top: .26rem; top: 0.26rem;
} }
.smallDian { .smallDian {
background: #D2D2D2; background: #d2d2d2;
} }
.activeDian { .activeDian {
background-color: @themeColor background-color: @themeColor;
} }
} }
...@@ -231,7 +225,7 @@ ...@@ -231,7 +225,7 @@
flex: 1; flex: 1;
margin-left: 0.2rem; margin-left: 0.2rem;
border-bottom: solid 1px #F6F6F6; border-bottom: solid 1px #f6f6f6;
.list-item-img-box { .list-item-img-box {
width: 0.6rem; width: 0.6rem;
...@@ -257,7 +251,7 @@ ...@@ -257,7 +251,7 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
>p { > p {
font-size: 20px; font-size: 20px;
} }
} }
...@@ -311,7 +305,7 @@ ...@@ -311,7 +305,7 @@
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-Size: 0.24rem; font-size: 0.24rem;
color: #ccc; color: #ccc;
.item-zhan-icon-active { .item-zhan-icon-active {
...@@ -329,18 +323,23 @@ ...@@ -329,18 +323,23 @@
color: gainsboro; color: gainsboro;
} }
} }
} }
} }
} }
.train-logo { .train-logo {
width: 100%; width: 100%;
height: 3.6rem;
position: relative; position: relative;
display: flex;
background-image: url("./active-bg.png");
background-repeat: no-repeat;
background-size: cover;
padding-left: 30px;
padding-top: 40px;
img { img {
width: 100%; width: 40%;
height: 2rem;
} }
.signing_location_container { .signing_location_container {
...@@ -377,7 +376,6 @@ ...@@ -377,7 +376,6 @@
} }
.train-footer-box { .train-footer-box {
display: flex; display: flex;
border-top: solid 1px rgb(221, 221, 221); border-top: solid 1px rgb(221, 221, 221);
position: fixed; position: fixed;
...@@ -407,9 +405,6 @@ ...@@ -407,9 +405,6 @@
padding-left: 0.3rem !important; padding-left: 0.3rem !important;
font-size: 0.25rem; font-size: 0.25rem;
color: #333333; color: #333333;
} }
.enroll-submit { .enroll-submit {
...@@ -431,15 +426,13 @@ ...@@ -431,15 +426,13 @@
font-size: 0.28rem; font-size: 0.28rem;
border-radius: 0; border-radius: 0;
border: 0; border: 0;
background-color: @themeColor ; background-color: @themeColor;
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
} }
.header { .header {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
padding: 0.2rem 0; padding: 0.2rem 0;
...@@ -456,7 +449,6 @@ ...@@ -456,7 +449,6 @@
.img { .img {
width: 0.8rem; width: 0.8rem;
height: 0.8rem; height: 0.8rem;
} }
} }
...@@ -485,12 +477,11 @@ ...@@ -485,12 +477,11 @@
color: gainsboro; color: gainsboro;
} }
>p { > p {
padding: 5px; padding: 5px;
} }
>p :nth-child(2) { > p :nth-child(2) {
font-size: 30px; font-size: 30px;
color: #333333; color: #333333;
} }
...@@ -518,10 +509,9 @@ ...@@ -518,10 +509,9 @@
.header-time { .header-time {
text-align: left; text-align: left;
width: 80%; width: 80%;
font-size: 0.20rem; font-size: 0.2rem;
color: rgb(179, 179, 179); color: rgb(179, 179, 179);
} }
} }
.about-footer-button { .about-footer-button {
...@@ -538,57 +528,90 @@ ...@@ -538,57 +528,90 @@
.comment-title { .comment-title {
padding-top: 0.2rem; padding-top: 0.2rem;
background-color: white; background-color: white;
} }
.segement-slider { .segement-slider {
height: 0.2rem; height: 0.2rem;
background-color: #f5f5f5; background-color: #f5f5f5;
} }
.segement { .segement {
height: 2px; height: 2px;
background-color: rgb(245, 245, 245); background-color: rgb(245, 245, 245);
margin: 0 0.2rem; 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 { .train-up-info {
font-size: 0.31rem; font-size: 0.31rem;
color: #9B9B9B; color: #9b9b9b;
padding: 0.22rem 0.3rem; width: 92%;
width: 100%; margin: 0 auto;
background-color: #fff; background-color: #fff;
border-radius: 12px;
margin-bottom: 30px;
padding-left: 40px;
padding-top: 30px;
padding-bottom: 30px;
p { p {
line-height: .46rem; line-height: 0.46rem;
.line-hidden; .line-hidden;
font-size: 24px; font-size: 30px;
.color-4a; color: #333;
display: block; display: block;
margin-bottom: 20px;
span {
color: #888;
}
} }
} }
.train-info { .train-info {
font-size: 0.31rem; font-size: 0.31rem;
color: #9B9B9B; color: #fff;
padding: 0.2rem auto;
width: 100%; width: 100%;
height: 200px;
display: flex;
flex-direction: column;
justify-content: space-between;
padding-left: 40px; padding-left: 40px;
padding-bottom: 30px; .enroll {
padding-top: 40px; width: 120px;
padding-right: 40px; background-color: #53af5c;
background-color: #fff; 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 { p {
line-height: .48rem; color: #fff;
line-height: 0.48rem;
.line-hidden; .line-hidden;
font-size: 40px; font-size: 40px;
.color-4a;
} }
.descr { .descr {
...@@ -598,23 +621,20 @@ ...@@ -598,23 +621,20 @@
} }
div { div {
color: #fff;
color: #9B9B9B; font-size: 0.24rem;
font-size: .24rem;
} }
.train-info-contain { .train-info-contain {
audio { audio {
width: 100%; width: 100%;
margin-bottom: .6rem !important; margin-bottom: 0.6rem !important;
} }
video { video {
width: 100%; width: 100%;
height: 5rem; height: 5rem;
margin-bottom: .3rem !important; margin-bottom: 0.3rem !important;
} }
a { a {
...@@ -625,7 +645,7 @@ ...@@ -625,7 +645,7 @@
p { p {
font-size: 24px !important; font-size: 24px !important;
padding: 0 !important; padding: 0 !important;
color: #4A4A4A !important; color: #4a4a4a !important;
} }
} }
} }
...@@ -642,7 +662,6 @@ ...@@ -642,7 +662,6 @@
padding-right: 0; padding-right: 0;
} }
//UI修改后的新增样式 //UI修改后的新增样式
.train-contain-header { .train-contain-header {
padding: 0.2rem; padding: 0.2rem;
...@@ -660,7 +679,7 @@ ...@@ -660,7 +679,7 @@
width: 100%; width: 100%;
word-wrap: normal; word-wrap: normal;
height: auto; height: auto;
color: #4A4A4A; color: #4a4a4a;
} }
div:nth-child(2) { div:nth-child(2) {
...@@ -689,13 +708,12 @@ ...@@ -689,13 +708,12 @@
right: 0; right: 0;
bottom: 0; bottom: 0;
} }
} }
.am-accordion-header { .am-accordion-header {
height: auto !important; height: auto !important;
line-height: inherit !important; line-height: inherit !important;
background-color: #F4F4F4 !important; background-color: #f4f4f4 !important;
} }
.train-content-cell { .train-content-cell {
...@@ -708,7 +726,7 @@ ...@@ -708,7 +726,7 @@
padding-right: 0.2rem; padding-right: 0.2rem;
padding-top: 0.1rem; padding-top: 0.1rem;
padding-bottom: 0.1rem; padding-bottom: 0.1rem;
border-bottom: solid 1px #F6F6F6; border-bottom: solid 1px #f6f6f6;
height: 1rem; height: 1rem;
position: relative; position: relative;
...@@ -737,50 +755,45 @@ ...@@ -737,50 +755,45 @@
width: 32px; width: 32px;
height: 32px; height: 32px;
border-radius: 100%; border-radius: 100%;
background-color: #ECF3FF; background-color: #ecf3ff;
position: absolute; position: absolute;
top: -14px; top: -14px;
right: 22px; right: 22px;
} }
} }
} }
.tip-text-green { .tip-text-green {
margin: 0.1rem; margin: 0.1rem;
font-size: .2rem; font-size: 0.2rem;
color: #559906; color: #559906;
line-height: .28rem; line-height: 0.28rem;
border-radius: .3rem; border-radius: 0.3rem;
border: 1px solid #559906; border: 1px solid #559906;
padding: .05rem .1rem; padding: 0.05rem 0.1rem;
overflow: visible; overflow: visible;
} }
.tip-text { .tip-text {
font-size: .2rem; font-size: 0.2rem;
color: #999; color: #999;
line-height: .28rem; line-height: 0.28rem;
border-radius: .3rem; border-radius: 0.3rem;
border: 1px solid #e5e5e5; border: 1px solid #e5e5e5;
padding: .05rem .1rem; padding: 0.05rem 0.1rem;
overflow: visible; overflow: visible;
} }
.tip-text-simple { .tip-text-simple {
margin: 0.1rem; margin: 0.1rem;
font-size: .2rem; font-size: 0.2rem;
color: #000; color: #000;
line-height: .28rem; line-height: 0.28rem;
border-radius: .3rem; border-radius: 0.3rem;
border: 1px solid #eee; border: 1px solid #eee;
padding: .05rem .1rem; padding: 0.05rem 0.1rem;
overflow: visible; overflow: visible;
margin-right: 0; margin-right: 0;
} }
.train-contain-listcell { .train-contain-listcell {
...@@ -790,7 +803,7 @@ ...@@ -790,7 +803,7 @@
align-items: center; align-items: center;
padding-left: 0.2rem; padding-left: 0.2rem;
>img { > img {
max-width: 32px; max-width: 32px;
max-height: 32px; max-height: 32px;
display: block; display: block;
...@@ -810,19 +823,19 @@ ...@@ -810,19 +823,19 @@
.am-accordion-header { .am-accordion-header {
margin-right: 0px !important; margin-right: 0px !important;
} }
} }
.train-comment { .train-comment {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 92%;
>p { margin: 0 auto;
transform: translateY(-80px);
> p {
background-color: white; background-color: white;
} }
.train-comment-contain { .train-comment-contain {
background-color: white; background-color: white;
height: 162px; height: 162px;
padding: 58px 54px 58px 26px; padding: 58px 54px 58px 26px;
...@@ -834,11 +847,10 @@ ...@@ -834,11 +847,10 @@
margin-left: 9px; margin-left: 9px;
width: auto; width: auto;
margin-top: 5px; margin-top: 5px;
} }
.comment-slider { .comment-slider {
background: #F4F4F4; background: #f4f4f4;
border-radius: 23px; border-radius: 23px;
width: 90%; width: 90%;
height: 60px; height: 60px;
...@@ -851,17 +863,13 @@ ...@@ -851,17 +863,13 @@
float: right; float: right;
} }
} }
} }
.comment-body { .comment-body {
height: 2.5rem; height: 2.5rem;
border-top: 2px solid #eee; border-top: 2px solid #eee;
overflow: scroll; overflow: scroll;
background-color: #F4F4F4; background-color: #f4f4f4;
border-radius: 2px; border-radius: 2px;
} }
...@@ -887,7 +895,6 @@ ...@@ -887,7 +895,6 @@
background-color: #fff; background-color: #fff;
padding: 0 40px; padding: 0 40px;
box-shadow: 0px -2px 0px 0px rgba(0, 0, 0, 0.05); box-shadow: 0px -2px 0px 0px rgba(0, 0, 0, 0.05);
.train-pay-button { .train-pay-button {
...@@ -903,16 +910,16 @@ ...@@ -903,16 +910,16 @@
font-size: 28px; font-size: 28px;
font-weight: 500; font-weight: 500;
.train-actualPrice{ .train-actualPrice {
font-size: 40px; font-size: 40px;
margin-left: 10px; margin-left: 10px;
margin-right: 5px; margin-right: 5px;
} }
.train-originalPrice{ .train-originalPrice {
font-size: 24px; font-size: 24px;
font-weight: 400; font-weight: 400;
margin-left: 10px; margin-left: 10px;
text-decoration:line-through ; text-decoration: line-through;
} }
} }
} }
...@@ -929,7 +936,6 @@ ...@@ -929,7 +936,6 @@
display: flex; display: flex;
padding-top: 0px; padding-top: 0px;
padding-bottom: 0px; padding-bottom: 0px;
} }
i.arrow { i.arrow {
...@@ -939,28 +945,27 @@ ...@@ -939,28 +945,27 @@
.train-comment-replay { .train-comment-replay {
width: 100%; width: 100%;
background-color: #F4F4F4; background-color: #f4f4f4;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 15px; padding: 15px;
margin-top: 12px; margin-top: 12px;
>div:nth-child(1) { > div:nth-child(1) {
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 0.21rem; font-size: 0.21rem;
color: #4A90E2; color: #4a90e2;
} }
>div:nth-child(2) { > div:nth-child(2) {
padding: 10px 0px; padding: 10px 0px;
font-size: 0.21rem; font-size: 0.21rem;
} }
>div:nth-child(3) { > div:nth-child(3) {
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 0.17rem; font-size: 0.17rem;
color: #999999; color: #999999;
} }
} }
...@@ -970,7 +975,7 @@ ...@@ -970,7 +975,7 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
>p { > p {
font-size: 20px; font-size: 20px;
} }
...@@ -982,7 +987,7 @@ ...@@ -982,7 +987,7 @@
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-Size: 0.24rem; font-size: 0.24rem;
color: #ccc; color: #ccc;
img { img {
...@@ -1046,22 +1051,21 @@ ...@@ -1046,22 +1051,21 @@
height: 0.6rem; height: 0.6rem;
align-items: center; align-items: center;
>div>img { > div > img {
width: 30px; width: 30px;
margin-right: 22px; margin-right: 22px;
margin-top: -15px; margin-top: -15px;
} }
>div>span { > div > span {
font-size: 28px; font-size: 28px;
} }
} }
} }
.train-header { .train-header {
background-color: white;
padding-bottom: 0.5rem; padding-bottom: 0.5rem;
transform: translateY(-80px);
} }
.train-info .train-info-contain a { .train-info .train-info-contain a {
...@@ -1172,9 +1176,7 @@ ...@@ -1172,9 +1176,7 @@
.am-textarea-control textarea { .am-textarea-control textarea {
font-size: 28px; font-size: 28px;
} }
} }
} }
.train-contain { .train-contain {
...@@ -1195,9 +1197,8 @@ ...@@ -1195,9 +1197,8 @@
} }
} }
.train-review { .train-review {
.am-list-view-scrollview { .am-list-view-scrollview {
background-color: #f4f4f4 !important; 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"; @import "../../../static/theme.less";
.carousel-index-container { .carousel-index-container {
position: relative; position: relative;
padding: 0 30px;
overflow: hidden; overflow: hidden;
.slider-decorator-0{ .slider-decorator-0{
bottom: 15px!important; bottom: 15px!important;
......
import React, { Component } from 'react'; import React, { Component } from "react";
import { Icon, } from 'antd'; import { Icon } from "antd";
import { ListView, Tabs, Toast } from 'antd-mobile'; import { ListView, Tabs, Toast } from "antd-mobile";
import { connect } from 'react-redux' import { connect } from "react-redux";
import * as MyExamAction from './MyExamAction'; import * as MyExamAction from "./MyExamAction";
import moment from "moment/moment"; import moment from "moment/moment";
import FooterLine from "../../common/footer/footer"; import FooterLine from "../../common/footer/footer";
//搜索 //搜索
import func from "../../util/commonFunc"; import func from "../../util/commonFunc";
import { hashHistory } from "react-router"; import { hashHistory } from "react-router";
import './examitem/examitem.less'; import "./examitem/examitem.less";
import finishIcon from '../../image/finishIcon.png' import createByName from "./images/createByName.png";
import "./less/myexam.less" import createTime from "./images/createTime.png";
import "./less/myexam.less";
import intl from "react-intl-universal"; import intl from "react-intl-universal";
class MyExam extends Component { class MyExam extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
let dataSource = new ListView.DataSource({ rowHasChanged: (row1, row2) => row1 !== row2 }); let dataSource = new ListView.DataSource({
this.state = { rowHasChanged: (row1, row2) => row1 !== row2,
offExamList: dataSource, });
inExamList: dataSource, this.state = {
doneExamList: dataSource, bannerList: [],
dieExamList: dataSource, offExamList: dataSource,
underway: [], inExamList: dataSource,
changeIndex: "2", changeIndex: "2",
isLoading: true, isLoading: true,
offHeight: document.documentElement.clientHeight - (Number.parseFloat(document.documentElement.style.fontSize) * 0.84), offHeight:
inHeight: document.documentElement.clientHeight - (Number.parseFloat(document.documentElement.style.fontSize) * 0.84), document.documentElement.clientHeight -
doneHeight: document.documentElement.clientHeight - (Number.parseFloat(document.documentElement.style.fontSize) * 0.84), Number.parseFloat(document.documentElement.style.fontSize) * 0.84,
dieHeight: document.documentElement.clientHeight - (Number.parseFloat(document.documentElement.style.fontSize) * 0.84), inHeight:
pageSize: 10, document.documentElement.clientHeight -
reset: true, Number.parseFloat(document.documentElement.style.fontSize) * 0.84,
}; pageSize: 10,
document.title = intl.get("MyExam") || '我的考试' reset: true,
}
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),
});
}; };
document.title = intl.get("MyExam") || "我的考试";
}
tabsChange(key) { componentDidMount() {
this.setState({ let params = {
changeIndex: key.key pageNo: 1,
}); pageSize: 10,
}
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',
})
}; };
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() { componentWillReceiveProps = (props) => {
this.setState({
const tabsData = [ offExamList: this.state.offExamList.cloneWithRows(
{ props.MyExamReducer.offExamList
key: "1", ),
title: <span className="tabspan">{intl.get("NotStarted") || "未开始"}</span> inExamList: this.state.inExamList.cloneWithRows(
}, props.MyExamReducer.inExamList
{ ),
key: "2", });
title: <span className="tabspan">{intl.get("Ongoing") || "进行中"}</span> };
},
{
key: "3",
title: <span className="tabspan">{intl.get("Ended") || "已结束"}</span>
},
];
return ( tabsChange(key) {
<div style={{width:"100%",height:"100%",overflow:"hidden"}} className="myExamBody"> this.setState({
<Tabs defaultActiveKey="1" swipeable={false} changeIndex: key.key,
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) => { renderTabBar = (props) => {
let passStr = "", passColor = ""; return <Tabs.DefaultTabBar {...props} />;
if (String(item.isQualified) === "2") { };
passStr = intl.get("ToBeReviewed") || "待评阅"; renderContent = (tab) => {
passColor = "ing"; 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 ( return (
<div key={rowID} className="exam-item-box"> <ListView
<div className="examItem" onClick={() => this.listItemClick(item)}> className="list-view-box"
<p className={`exam-tag ${passColor}`} style={{ background: '#F5A623' }}>{passStr}</p> dataSource={offExamList}
<p className="exam-title">{item.name}</p> renderHeader={() => (
<p className="exam-time"><Icon <div className="list-view-header">
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")}`} <img
</p> 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> </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) => { case "2":
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";
}
return ( return (
<div key={rowID} className="exam-item-box"> <ListView
<div className="examItem" onClick={() => this.listItemClick(item)}> className="list-view-box"
<p className={`exam-tag ${passColor}`}>{passStr}</p> dataSource={inExamList}
<p className="exam-title">{item.name}</p> renderFooter={() => (
<p className="exam-time"><img src={finishIcon} style={{ <FooterLine
width: '24px', onlyText={true}
height: '24px' footText={
}} /> {`${intl.get("FinishedTime") || "完成时间"}:${moment(item.endTime).format("YYYY-MM-DD HH:mm:SS")}`}</p> 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> </div>
); </div>
}; </div>
onEndReached = () => { );
let { isOffMore, isOffFirst, offPageNumber, isInMore, isInFirst, inPageNumber, isFulMore, isFulFirst, fulPageNumber, isDieMore, isDieFirst, diePageNumber, } = this.props.MyExamReducer; } else {
let { changeIndex } = this.state; return (
let params = { <div
pageSize: 10, key={rowID}
}; className="exam-item-box"
if (String(changeIndex) === "1") { style={{
if (!isOffMore && !isOffFirst) { display: "flex",
this.props.myExamList({ ...params, state: 0, pageNo: offPageNumber }, true); justifyContent: "space-between",
} alignItems: "center",
} else if (String(changeIndex) === "2") { }}
if (!isInMore && !isInFirst) { >
<div>
this.props.myExamList({ ...params, state: 1, pageNo: inPageNumber }, true); <img
} style={{ width: "3.5rem", height: "90%" }}
} else if (String(changeIndex) === "3") { src={item.logoImg}
if (!isFulMore && !isFulFirst) { alt=""
this.props.myExamList({ ...params, state: 2, pageNo: fulPageNumber }, true); />
} </div>
} else if (String(changeIndex) === "4") { <div
// if(!isDieMore && !isDieFirst){ className="examItem"
// this.props.myExamList({...params, state:3, pageNo:diePageNumber}, true); onClick={() => this.listItemClick(item, key)}
// } >
} <p className="exam-title" style={{ marginBottom: "1rem" }}>
}; {item.name}
listItemClick = (item) => { </p>
if (item.isQualified === '3') { <p className="exam-time" style={{ marginBottom: "0" }}>
Toast.info(intl.get("PublishKey48") || '考试已逾期,不可查看') {item.createbyName} | {item.startTimeString}
return false; </p>
} </div>
let { changeIndex } = this.state; </div>
if (String(changeIndex) === "1" || String(changeIndex) === '2') { );
hashHistory.push({ }
pathname: func.routerBefore() + '/examdetail', };
query: { onEndReached = () => {
tpId: item.trainingProjectId, let {
id: item.id isOffMore,
}, isOffFirst,
}) offPageNumber,
} else if (String(changeIndex) === "3") { isInMore,
hashHistory.push({ isInFirst,
pathname: func.routerBefore() + '/examFinishDetail', inPageNumber,
query: { isFulMore,
trainingProjectId: item.trainingProjectId, isFulFirst,
id: item.id fulPageNumber,
}, isDieMore,
}) isDieFirst,
} else if (String(changeIndex) === "4") { diePageNumber,
console.log(changeIndex); } = 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 => { export default connect((state) => {
let { MyExamReducer } = state; let { MyExamReducer } = state;
return { return {
MyExamReducer MyExamReducer,
} };
}, MyExamAction)(MyExam); }, MyExamAction)(MyExam);
\ No newline at end of file
import * as actions from './MyExamReduxType'; import * as actions from "./MyExamReduxType";
import Network from '../../util/fetchUtil'; import Network from "../../util/fetchUtil";
import API from '../../util/urlconfig'; import excute from '../../util/fetchUtil';
export const myExamList=(params, isUpData)=>{ import API from "../../util/urlconfig";
return dispatch=>{ export const myExamList = (params, isUpData) => {
Network.post(API.myExamListLink, params, return (dispatch) => {
response=>{ Network.post(API.myExamListLink, params, (response) => {
try { try {
if(Number.parseInt(response.code)===1000){ if (Number.parseInt(response.code) === 1000) {
if(Number.parseInt(params.state)===0){ let inPageNumber = Number.parseInt(response.page.pageNo) + 1;
//未开始 let isInMore =
let offPageNumber=Number.parseInt(response.page.pageNo)+1; JSON.stringify(response.data) === "[]" ||
let isOffMore=JSON.stringify(response.data)==='[]' || response.data.length<params.pageSize; response.data.length < params.pageSize;
dispatch({ dispatch({
type:actions.MY_EXAMS_LIST_OFF, type: actions.MY_EXAMS_LIST_IN,
offExamList:response.data, inExamList: response.data,
offPageNumber:offPageNumber, inPageNumber: inPageNumber,
isOffMore:isOffMore, isInMore: isInMore,
isUpData:isUpData isUpData: isUpData,
}); });
} else {
}else if(Number.parseInt(params.state)===1){ console.log(response.code);
//进行中 }
console.log("我的考试1"); } catch (e) {
console.log(response); console.log(e);
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, export const myTrainingList = (params, isUpData) => {
inPageNumber:inPageNumber, return (dispatch) => {
isInMore:isInMore, Network.post(API.trainList, params, (response) => {
isUpData:isUpData try {
}); if (Number.parseInt(response.code) === 1000) {
}else if(Number.parseInt(params.state)===2){ //未开始
//己完成 let offPageNumber = Number.parseInt(response.page.pageNo) + 1;
console.log("我的考试2"); let isOffMore =
console.log(response); JSON.stringify(response.data) === "[]" ||
let fulPageNumber=Number.parseInt(response.page.pageNo)+1; response.data.length < params.pageSize;
let isFulMore=JSON.stringify(response.data)==='[]'|| response.data.length<params.pageSize; dispatch({
dispatch({ type: actions.MY_EXAMS_LIST_OFF,
type:actions.MY_EXAMS_LIST_DONE, offExamList: response.data.records,
doneExamList:response.data, offPageNumber: offPageNumber,
fulPageNumber:fulPageNumber, isOffMore: isOffMore,
isFulMore:isFulMore, isUpData: isUpData,
isUpData:isUpData });
}); } else {
}else if(Number.parseInt(params.state)===3){ console.log(response.code);
//己完成 }
console.log("我的考试3"); } catch (e) {
let diePageNumber=Number.parseInt(response.page.pageNo)+1; console.log(e);
let isDieMore=JSON.stringify(response.data)==='[]'|| response.data.length<params.pageSize; }
dispatch({ });
type:actions.MY_EXAMS_LIST_DIE, };
dieExamList:response.data, };
diePageNumber:diePageNumber, export function myBannerList(callback) {
isDieMore:isDieMore, return (dispatch) => {
isUpData:isUpData return excute.post(
}); API.banner,
} {
}else{ bannerName: "TRAIN_EXAM",
console.log(response.code); terminalName: "WECHAT",
} },
} catch (e){ (response) => {
console.log(e); if (callback) {
} callback(response.data);
}) }
} }
} );
\ No newline at end of file };
}
import * as actions from './MyExamReduxType'; import * as actions from "./MyExamReduxType";
const initial={ const initial = {
offExamList:[], offExamList: [],
inExamList:[], inExamList: [],
doneExamList:[], doneExamList: [],
dieExamList:[], dieExamList: [],
isInMore:false, bannerList: [],
isInFirst:true, isInMore: false,
isOffMore:false, isInFirst: true,
isOffFirst:true, isOffMore: false,
offPageNumber:1, isOffFirst: true,
inPageNumber:1, offPageNumber: 1,
fulPageNumber:1, inPageNumber: 1,
diePageNumber:1, fulPageNumber: 1,
isFulMore:false, diePageNumber: 1,
isFulFirst:true, isFulMore: false,
isDieMore:false, isFulFirst: true,
isDieFirst: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"; 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"; 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"; @import "../less/config";
.am-list-header{ .am-list-header {
padding:0 !important; padding: 0 !important;
} }
.load-more{ .load-more {
border:0; border: 0;
width:100%; width: 100%;
height:0.7rem; height: 0.7rem;
background-color:#f6f6f6; background-color: #f6f6f6;
color:#999; color: #999;
font-size:0.26rem; font-size: 0.26rem;
line-height:0.7rem; line-height: 0.7rem;
text-align:center; text-align: center;
} }
.tab-box{ .tab-box {
width:100%; width: 100%;
height:100%; height: 100%;
} }
.tab-header-box{ .tab-header-box {
height:46px; height: 46px;
overflow:hidden; overflow: hidden;
} }
.separator-box{ .separator-box {
height:0.2rem; height: 0.2rem;
overflow:hidden; overflow: hidden;
} }
.list-view-box{ .list-view-box {
padding-top:0.2rem; padding-top: 0.2rem;
background-color: #f6f6f6; background-color: #f6f6f6;
} }
.exam-item-box{ .exam-item-box {
padding:0 0.2rem; padding: 0 0.2rem;
overflow:hidden; overflow: hidden;
} }
.examItem { .examItem {
width: 100%; width: 100%;
background: #fff; background: #fff;
border-radius:4*@len; border-radius: 4 * @len;
border-radius:0.2rem; border-radius: 0.2rem;
padding:0.4rem 0.3rem; padding: 0.4rem 0.3rem;
position:relative; position: relative;
.exam-title { .exam-title {
color: #505050; color: #000000;
font-size: 17*@len; font-size: 20 * @len;
line-height: 20*@len; line-height: 20 * @len;
padding-bottom:0.5rem; margin-bottom: 0.2rem;
} }
.exam-project{ .exam-project {
color: #9b9b9b; color: #9b9b9b;
font-size: 12*@len; font-size: 12 * @len;
line-height: 14*@len; line-height: 14 * @len;
} }
.exam-time{ .exam-time {
color: #9b9b9b; color: #9b9b9b;
font-size: 12*@len; font-size: 16 * @len;
line-height: 14*@len; line-height: 14 * @len;
margin-bottom: 0.5rem;
} }
.exam-tag{ .exam-tag {
position: absolute; position: absolute;
top: 0; left: 0; top: 0;
font-size: 10*@len; left: 0;
font-size: 10 * @len;
text-align: center; text-align: center;
border-top-left-radius: 7*@len; border-top-left-radius: 7 * @len;
border-bottom-right-radius: 7*@len; border-bottom-right-radius: 7 * @len;
color: #fff; color: #fff;
padding:0 0.2rem; padding: 0 0.2rem;
} }
.no{ .no {
background: #fe3824; background: #fe3824;
} }
.yes{ .yes {
background: #47d5b5; background: #47d5b5;
} }
.ing{ .ing {
background:#e48600 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{ .top-search-div {
width:100%; width: 100%;
height:44px; height: 44px;
padding:5px 20px; padding: 5px 20px;
background-color:#fff; background-color: #fff;
display: flex; display: flex;
flex-direction:row; flex-direction: row;
justify-content: center; justify-content: center;
align-items:center; align-items: center;
.top-search-btn{ .top-search-btn {
width:100%; width: 100%;
height:100%; height: 100%;
background-color:#f6f6f6; background-color: #f6f6f6;
border-radius:1rem; border-radius: 1rem;
border:0; 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 @@ ...@@ -6,4 +6,29 @@
.am-list-body::after { .am-list-body::after {
height: 0 !important; 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 { ...@@ -54,7 +54,7 @@ class IndexBtnScroll extends Component {
<div <div
className="index-btn-scroll-item-container" className="index-btn-scroll-item-container"
id="index-simple-scroll-bar-id" id="index-simple-scroll-bar-id"
autoHide={false} // autoHide={false}
> >
<div <div
className="index-btn-scroll-single-wrap-container" className="index-btn-scroll-single-wrap-container"
......
...@@ -56,9 +56,9 @@ ...@@ -56,9 +56,9 @@
align-items: center; align-items: center;
} }
.login .login-container .login-form .login-form-item .login-form-top-logo .login-input-top-icon { .login .login-container .login-form .login-form-item .login-form-top-logo .login-input-top-icon {
width: 160px; width: 120px;
height: 160px; height: 120px;
margin-bottom: 20px; margin-bottom: 60px;
} }
.login .login-container .login-form .login-form-item .login-form-top-logo .login-input-top-font { .login .login-container .login-form .login-form-item .login-form-top-logo .login-input-top-font {
color: #F5222D; color: #F5222D;
...@@ -69,7 +69,8 @@ ...@@ -69,7 +69,8 @@
border-radius: 12px; border-radius: 12px;
} }
.login .login-container .login-form .login-form-item .login-form-input-container .login-form-single-label { .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 { .login .login-container .login-form .login-form-item .login-form-input-container .login-form-single-container {
width: 100%; width: 100%;
......
...@@ -254,12 +254,13 @@ class Login extends Component { ...@@ -254,12 +254,13 @@ class Login extends Component {
</div> </div>
<div style={{ bottom: '60px', <div style={{ bottom: '60px',
fontSize: '21px', fontSize: '26px',
position: 'fixed', position: 'fixed',
textAlign: 'center', textAlign: 'center',
zIndex:99999, zIndex:99999,
width: '100%'}}> width: '100%',
备案号:<a href="https://beian.miit.gov.cn" target="_blank" rel="noopener" >沪ICP备11042121号-5</a> color:'#fff'}}>
机电信息保障部
</div> </div>
</div> </div>
); );
......
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.login-input-top-icon{ .login-input-top-icon{
width: 160px; width: 120px;
height: 160px; height: 120px;
margin-bottom: 20px; margin-bottom: 60px;
} }
.login-input-top-font{ .login-input-top-font{
color:#F5222D; color:#F5222D;
...@@ -60,7 +60,8 @@ ...@@ -60,7 +60,8 @@
width: 100%; width: 100%;
border-radius: 12px; border-radius: 12px;
.login-form-single-label{ .login-form-single-label{
font-size:36px ; font-size:36px;
font-weight: bold;
} }
.login-form-single-container{ .login-form-single-container{
width: 100%; width: 100%;
......
import React, { Component } from 'react'; import React, { Component } from "react";
import { Icon, Button } from 'antd'; import { Icon, Button } from "antd";
import { Toast } from 'antd-mobile'; import { Toast } from "antd-mobile";
import { hashHistory } from 'react-router'; import { hashHistory } from "react-router";
import $ from 'jquery'; import $ from "jquery";
import './login.less'; import "./login.less";
import './index.css'; import "./index.css";
import { connect } from 'react-redux'; import { connect } from "react-redux";
import { login, loginAuthen } from '../../redux/action/login'; import { login, loginAuthen } from "../../redux/action/login";
import func from '../../util/commonFunc'; import func from "../../util/commonFunc";
import CheckBox from './checkbox/index'; import CheckBox from "./checkbox/index";
import jsCookie from 'js-cookie'; import jsCookie from "js-cookie";
import moment from 'moment' import moment from "moment";
import md5 from "md5"; import md5 from "md5";
import { sm2 } from 'sm-crypto' import { sm2 } from "sm-crypto";
import intl from "react-intl-universal"; import intl from "react-intl-universal";
import PickerCommon from './pickerCommon'; import PickerCommon from "./pickerCommon";
import API from '../../util/urlconfig'; import API from "../../util/urlconfig";
import Network from '../../util/fetchUtil'; import Network from "../../util/fetchUtil";
import loginUserIcon from "../../common/iconImage/login-user.png"; import loginUserIcon from "../../common/iconImage/login-user.png";
import loginPasswordIcon from "../../common/iconImage/login-pwd.png"; import loginPasswordIcon from "../../common/iconImage/login-pwd.png";
import loginTopLogoImg from "../../common/iconImage/a-danghuikaobei.png"; import loginTopLogoImg from "../../common/iconImage/a-danghuikaobei.png";
const USERNAMECOOKIE = "username";
const notReady = { backgroundColor: '#D23A29', color: '#fff' }; const PASSWORDCOOKIE = "password";
const isReady = { backgroundColor: '#D23A29', color: '#fff' };
const USERNAMECOOKIE = 'username';
const PASSWORDCOOKIE = 'password';
class LoginForm extends Component { class LoginForm extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
passwordType: 'password', passwordType: "password",
account: '', account: "",
password: '', password: "",
redirectInfo: {}, redirectInfo: {},
isReady: false,
currentScreenHeight: 0, currentScreenHeight: 0,
rememberPassword: false, rememberPassword: false,
hasLoginInfoCookie: false, hasLoginInfoCookie: false,
loginPwdDesc: '', loginPwdDesc: "",
loginNameDesc: '', loginNameDesc: "",
}; };
this.getAccount = this.getAccount.bind(this); this.getAccount = this.getAccount.bind(this);
this.getPassword = this.getPassword.bind(this); this.getPassword = this.getPassword.bind(this);
...@@ -52,9 +47,7 @@ class LoginForm extends Component { ...@@ -52,9 +47,7 @@ class LoginForm extends Component {
this.onRememberPassword = this.onRememberPassword.bind(this); this.onRememberPassword = this.onRememberPassword.bind(this);
this.rememberPasswordByConfig = this.rememberPasswordByConfig.bind(this); this.rememberPasswordByConfig = this.rememberPasswordByConfig.bind(this);
this.usernameInputClick = this.usernameInputClick.bind(this); this.usernameInputClick = this.usernameInputClick.bind(this);
this.passwordInputClick = this.passwordInputClick.bind(this) this.passwordInputClick = this.passwordInputClick.bind(this);
} }
componentDidMount() { componentDidMount() {
console.log(this.props.redirect); console.log(this.props.redirect);
...@@ -66,9 +59,9 @@ class LoginForm extends Component { ...@@ -66,9 +59,9 @@ class LoginForm extends Component {
loginNameDesc: this.props.loginNameDesc, loginNameDesc: this.props.loginNameDesc,
}); });
const { autoLogin, username, password } = this.props; const { autoLogin, username, password } = this.props;
console.log('888888888======', autoLogin) console.log("888888888======", autoLogin);
if (autoLogin) { if (autoLogin) {
console.log('autoLogin0000进来') console.log("autoLogin0000进来");
this.setState( this.setState(
{ {
account: username, account: username,
...@@ -83,14 +76,13 @@ class LoginForm extends Component { ...@@ -83,14 +76,13 @@ class LoginForm extends Component {
} }
let cookieUsername = jsCookie.get(USERNAMECOOKIE) || ""; let cookieUsername = jsCookie.get(USERNAMECOOKIE) || "";
let cookiePassword = jsCookie.get(PASSWORDCOOKIE) || ""; let cookiePassword = jsCookie.get(PASSWORDCOOKIE) || "";
console.log('autoLogin·······没有进去') console.log("autoLogin·······没有进去");
if (cookieUsername.length > 0 && cookiePassword.length > 0) { if (cookieUsername.length > 0 && cookiePassword.length > 0) {
this.setState({ this.setState({
rememberPassword: true, rememberPassword: true,
hasLoginInfoCookie: true, hasLoginInfoCookie: true,
account: cookieUsername, account: cookieUsername,
password: cookiePassword, password: cookiePassword,
isReady: true,
}); });
} else { } else {
this.setState({ this.setState({
...@@ -102,7 +94,7 @@ class LoginForm extends Component { ...@@ -102,7 +94,7 @@ class LoginForm extends Component {
currentScreenHeight: window.innerHeight, currentScreenHeight: window.innerHeight,
}); });
window.onresize = function () { window.onresize = function () {
if (location.href.indexOf('/login') != -1) { if (location.href.indexOf("/login") != -1) {
_this.setState({ _this.setState({
currentScreenHeight: window.innerHeight, currentScreenHeight: window.innerHeight,
}); });
...@@ -110,7 +102,7 @@ class LoginForm extends Component { ...@@ -110,7 +102,7 @@ class LoginForm extends Component {
}; };
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
console.log('pppppppp66666componentWillReceiveProps') console.log("pppppppp66666componentWillReceiveProps");
if (nextProps.loginNameDesc != this.props.loginNameDesc) { if (nextProps.loginNameDesc != this.props.loginNameDesc) {
this.setState({ this.setState({
loginPwdDesc: nextProps.loginPwdDesc, loginPwdDesc: nextProps.loginPwdDesc,
...@@ -131,39 +123,73 @@ class LoginForm extends Component { ...@@ -131,39 +123,73 @@ class LoginForm extends Component {
} }
} }
} else { } else {
jsCookie.remove(USERNAMECOOKIE, { path: '' }); jsCookie.remove(USERNAMECOOKIE, { path: "" });
jsCookie.remove(PASSWORDCOOKIE, { path: '' }); jsCookie.remove(PASSWORDCOOKIE, { path: "" });
} }
} }
getAccount(e) { getAccount(e) {
let value = e.target.value; let value = e.target.value;
this.setState({ this.setState({
account: value, account: value,
isReady: this.state.password && value,
}); });
} }
getPassword(e) { getPassword(e) {
let value = e.target.value; let value = e.target.value;
this.setState({ this.setState({
password: value, password: value,
isReady: this.state.account && value,
}); });
} }
changeType() { changeType() {
const { passwordType } = this.state const { passwordType } = this.state;
if (passwordType === 'password') { if (passwordType === "password") {
this.setState({ this.setState({
passwordType: 'text', passwordType: "text",
}); });
} else { } else {
this.setState({ this.setState({
passwordType: 'password', passwordType: "password",
}); });
} }
} }
generateCharacter(n) { 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 = ""; var res = "";
for (var i = 0; i < n; i++) { for (var i = 0; i < n; i++) {
var id = Math.ceil(Math.random() * 35); var id = Math.ceil(Math.random() * 35);
...@@ -174,49 +200,57 @@ class LoginForm extends Component { ...@@ -174,49 +200,57 @@ class LoginForm extends Component {
} }
getCurrentDay() { getCurrentDay() {
let date = "" let date = "";
date = moment(new Date()).format("YYYYMMDD") date = moment(new Date()).format("YYYYMMDD");
return date return date;
} }
getlanguage = (tips, resCallback) => { getlanguage = (tips, resCallback) => {
const _this = this; const _this = this;
console.log('bbbbbbbbbbbbbbbbbbbbbbbbb') console.log("bbbbbbbbbbbbbbbbbbbbbbbbb");
// Network.getNetwork(API.siteLanguageGet,{},(res)=>{ // Network.getNetwork(API.siteLanguageGet,{},(res)=>{
// console.log(res); // console.log(res);
// if(res.code==1000){ // if(res.code==1000){
// sessionStorage.setItem("lang_type",sessionStorage.getItem("lang_type")||res.data); // sessionStorage.setItem("lang_type",sessionStorage.getItem("lang_type")||res.data);
Network.normalGet(API.siteLanguageGet, (res) => { Network.normalGet(API.siteLanguageGet, (res) => {
console.log(res); console.log(res);
if (res.code == 1000) { if (res.code == 1000) {
sessionStorage.setItem("lang_type", res.data || sessionStorage.getItem("lang_type")); sessionStorage.setItem(
Network.getNetwork(API.getLanguageData, { languageCode: res.data || sessionStorage.getItem("lang_type"), type: 1 }, resv => { "lang_type",
if (resv.code == 1000) { res.data || sessionStorage.getItem("lang_type")
let languageCode = sessionStorage.getItem("lang_type"); );
intl.init({ Network.getNetwork(
currentLocale: languageCode, API.getLanguageData,
locales: { [languageCode]: resv.data || sumLocales }, {
}); languageCode: res.data || sessionStorage.getItem("lang_type"),
_this.languageCallback(tips, resCallback) type: 1,
} else { },
let sumLocales = Object.assign({}, tempZh_Cn); (resv) => {
intl.init({ if (resv.code == 1000) {
currentLocale: languageCode, let languageCode = sessionStorage.getItem("lang_type");
locales: { [languageCode]: sumLocales }, intl.init({
}); currentLocale: languageCode,
_this.languageCallback(tips, resCallback) 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() { login() {
console.log('1111111111111111111111-----lllllllllll') console.log("1111111111111111111111-----lllllllllll");
let _this = this; let _this = this;
clearInterval(this.loginTimer); clearInterval(this.loginTimer);
if (!this.state.account) { if (!this.state.account) {
...@@ -227,187 +261,180 @@ class LoginForm extends Component { ...@@ -227,187 +261,180 @@ class LoginForm extends Component {
Toast.info(intl.get("Password")); Toast.info(intl.get("Password"));
return; return;
} }
let openid = sessionStorage.getItem('openid'); let openid = sessionStorage.getItem("openid");
const lang_type = sessionStorage.getItem("lang_type");//新增国际化-cwj-152 const lang_type = sessionStorage.getItem("lang_type"); //新增国际化-cwj-152
if (openid) { if (openid) {
console.log("222222222222222222-----lllllllllll");
console.log('222222222222222222-----lllllllllll')
this.props.loginAuthen( this.props.loginAuthen(
{ {
account: this.state.account, account: this.state.account,
password: this.state.password, password: this.state.password,
openId: openid, openId: openid,
languageCode: lang_type,//新增国际化-cwj-152 languageCode: lang_type, //新增国际化-cwj-152
}, },
this.props.redirect.hash, this.props.redirect.hash,
this.props.appid, this.props.appid,
(res) => { (res) => {
console.log('loginAuthen-----lllllllllll') console.log("loginAuthen-----lllllllllll");
this.getlanguage("loginAuthen", res); this.getlanguage("loginAuthen", res);
// _this.rememberPasswordByConfig( // _this.rememberPasswordByConfig(
// _this.state.account, // _this.state.account,
// _this.state.password // _this.state.password
// ); // );
// _this.queryControl(res); // _this.queryControl(res);
} }
); );
} else { } else {
const public_key =
const public_key = '047214fe3a249b75b6ba92ee494e0a8a68c0a19893a480b3c28bf06cd5b7d621243c7f6704caa3b43ade6be15de11cabd185611a9edfdcf1b11d7a2478c67b4c1c' "047214fe3a249b75b6ba92ee494e0a8a68c0a19893a480b3c28bf06cd5b7d621243c7f6704caa3b43ade6be15de11cabd185611a9edfdcf1b11d7a2478c67b4c1c";
const private_key = '00a2bbe941a177ca9f200d1c4d37e8f0b43b9cd2ea662304a05c064c6416e74d49' const private_key =
"00a2bbe941a177ca9f200d1c4d37e8f0b43b9cd2ea662304a05c064c6416e74d49";
let salt = ""
let date = "" let salt = "";
let key = "" let date = "";
let sign = "" let key = "";
let password = "" let sign = "";
let account = "" let password = "";
let account = "";
salt = this.generateCharacter(16)
console.log("validate-salt", salt) salt = this.generateCharacter(16);
date = this.getCurrentDay() console.log("validate-salt", salt);
console.log("validate-date", date) date = this.getCurrentDay();
console.log("validate-date", date);
password = sm2.doEncrypt(this.state.password + salt, public_key, 1); 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 password = "04" + password;
account = "04" + account account = "04" + account;
if (salt && date) { if (salt && date) {
key = salt + date key = salt + date;
console.log("validate-key", key) console.log("validate-key", key);
} }
sign = "account=" + account + "&password=" + password + "&salt=" + salt + "&key=" + key sign =
"account=" +
console.log("validate-sign", md5(sign)) account +
"&password=" +
password +
"&salt=" +
salt +
"&key=" +
key;
console.log("validate-sign", md5(sign));
let parms = { let parms = {
account, account,
password, password,
salt: salt, salt: salt,
sign: md5(sign), sign: md5(sign),
languageCode: lang_type,//新增国际化-cwj-152 languageCode: lang_type, //新增国际化-cwj-152
} };
_this.props.login( _this.props.login(parms, (res) => {
parms, this.getlanguage("login", res);
(res) => { // console.log("login----", res)
this.getlanguage("login", res); // _this.rememberPasswordByConfig(
// console.log("login----", res) // _this.state.account,
// _this.rememberPasswordByConfig( // _this.state.password
// _this.state.account, // );
// _this.state.password // _this.queryControl(res);
// );
// _this.queryControl(res); // if (_this.state.redirectInfo.state) {
// let { redirectHash } = _this.state.redirectInfo.state;
// if (_this.state.redirectInfo.state) { // console.log(redirectHash);
// let { redirectHash } = _this.state.redirectInfo.state; // if (
// console.log(redirectHash); // redirectHash.split('#')[1].split('?')[0].indexOf('login') != -1
// if ( // ) {
// redirectHash.split('#')[1].split('?')[0].indexOf('login') != -1 // hashHistory.replace({
// ) { // pathname: func.routerBefore() + '/',
// hashHistory.replace({ // });
// pathname: func.routerBefore() + '/', // } else if (redirectHash.split('#')[1].split('?')[1]) {
// }); // hashHistory.replace({
// } else if (redirectHash.split('#')[1].split('?')[1]) { // pathname: redirectHash.split('#')[1].split('?')[0],
// hashHistory.replace({ // query: func.urlDivide(
// pathname: redirectHash.split('#')[1].split('?')[0], // redirectHash.split('#')[1].split('?')[1]
// query: func.urlDivide( // ),
// redirectHash.split('#')[1].split('?')[1] // });
// ), // } else {
// }); // hashHistory.replace({
// } else { // pathname: redirectHash.split('#')[1].split('?')[0],
// hashHistory.replace({ // });
// pathname: redirectHash.split('#')[1].split('?')[0], // }
// }); // } else {
// } // hashHistory.replace({
// } else { // pathname: func.routerBefore() + '/',
// hashHistory.replace({ // });
// pathname: func.routerBefore() + '/', // }
// }); });
// }
}
);
} }
} }
//为了解决语言异步问题,登录成功后的所有操作,都放在语言回调中 //为了解决语言异步问题,登录成功后的所有操作,都放在语言回调中
languageCallback = (tip, res) => { languageCallback = (tip, res) => {
const _this = this; const _this = this;
console.log('为了解决语言异步问题,登录成功后的所有操作,都放在语言回调中') console.log("为了解决语言异步问题,登录成功后的所有操作,都放在语言回调中");
if (tip == "loginAuthen") { if (tip == "loginAuthen") {
_this.rememberPasswordByConfig( _this.rememberPasswordByConfig(_this.state.account, _this.state.password);
_this.state.account,
_this.state.password
);
_this.queryControl(res); _this.queryControl(res);
} else { } else {
console.log("login----", res) console.log("login----", res);
_this.rememberPasswordByConfig( _this.rememberPasswordByConfig(_this.state.account, _this.state.password);
_this.state.account,
_this.state.password
);
_this.queryControl(res); _this.queryControl(res);
if (_this.state.redirectInfo.state) { if (_this.state.redirectInfo.state) {
let { redirectHash } = _this.state.redirectInfo.state; let { redirectHash } = _this.state.redirectInfo.state;
console.log(redirectHash); console.log(redirectHash);
if ( if (redirectHash.split("#")[1].split("?")[0].indexOf("login") != -1) {
redirectHash.split('#')[1].split('?')[0].indexOf('login') != -1
) {
hashHistory.replace({ hashHistory.replace({
pathname: func.routerBefore() + '/', pathname: func.routerBefore() + "/",
}); });
} else if (redirectHash.split('#')[1].split('?')[1]) { } else if (redirectHash.split("#")[1].split("?")[1]) {
hashHistory.replace({ hashHistory.replace({
pathname: redirectHash.split('#')[1].split('?')[0], pathname: redirectHash.split("#")[1].split("?")[0],
query: func.urlDivide( query: func.urlDivide(redirectHash.split("#")[1].split("?")[1]),
redirectHash.split('#')[1].split('?')[1]
),
}); });
} else { } else {
hashHistory.replace({ hashHistory.replace({
pathname: redirectHash.split('#')[1].split('?')[0], pathname: redirectHash.split("#")[1].split("?")[0],
}); });
} }
} else { } else {
hashHistory.replace({ hashHistory.replace({
pathname: func.routerBefore() + '/', pathname: func.routerBefore() + "/",
}); });
} }
} }
} };
//用户控制台权限 //用户控制台权限
queryControl = (res) => { queryControl = (res) => {
if (res.dev == true) { if (res.dev == true) {
let cacheScript = document.getElementById('erudaScript'); let cacheScript = document.getElementById("erudaScript");
// if(cacheScript){ // if(cacheScript){
// eruda.init(); // eruda.init();
// } // }
} else { } else {
let cacheScript = document.getElementById('erudaScript'); let cacheScript = document.getElementById("erudaScript");
let HTmls = document.getElementById('example'); let HTmls = document.getElementById("example");
if (cacheScript) { if (cacheScript) {
cacheScript.parentNode.removeChild(cacheScript); cacheScript.parentNode.removeChild(cacheScript);
} }
} }
} };
preLogin() { preLogin() {
console.log('preLogin................preLogin') console.log("preLogin................preLogin");
const { fullScreenHeight } = this.props; const { fullScreenHeight } = this.props;
var userInput = document.getElementById('login-user-input'); var userInput = document.getElementById("login-user-input");
var passwordInput = document.getElementById('login-password-input'); var passwordInput = document.getElementById("login-password-input");
userInput.blur(); userInput.blur();
passwordInput.blur(); passwordInput.blur();
let _this = this; let _this = this;
this.loginTimer = setInterval(() => { this.loginTimer = setInterval(() => {
if (_this.state.currentScreenHeight >= fullScreenHeight) { if (_this.state.currentScreenHeight >= fullScreenHeight) {
console.log('preLogin-----------fullScreenHeight') console.log("preLogin-----------fullScreenHeight");
Toast.hide(); Toast.hide();
clearInterval(_this.loginTimer); clearInterval(_this.loginTimer);
_this.login(); _this.login();
...@@ -421,7 +448,6 @@ class LoginForm extends Component { ...@@ -421,7 +448,6 @@ class LoginForm extends Component {
} }
usernameInputClick() { usernameInputClick() {
$("#login-user-input").focus(); $("#login-user-input").focus();
} }
passwordInputClick() { passwordInputClick() {
...@@ -433,57 +459,89 @@ class LoginForm extends Component { ...@@ -433,57 +459,89 @@ class LoginForm extends Component {
return ( return (
<div className="login-form-item"> <div className="login-form-item">
<div className="login-form-top-logo"> <div className="login-form-top-logo">
<img src={loginTopLogoImg} alt="" className="login-input-top-icon" /> <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: "52px" }}>
<div className="login-input-top-font" style={{fontSize:'32px'}}>智慧党建平台</div> 机电e先锋
</div> </div>
<div className="login-input-top-font" style={{ fontSize: "32px" }}>
智慧党建平台
</div>
</div>
<div className="login-form-input-container"> <div className="login-form-input-container">
<div className="login-form-single-label">用户名:</div> <div className="login-form-single-label">用户名:</div>
<div className="login-form-single-container" <div
className="login-form-single-container"
onClick={this.usernameInputClick} onClick={this.usernameInputClick}
> >
<div className="form-item" > <div className="form-item">
<img
<img src={loginUserIcon} alt="" className="login-input-item-icon" /> src={loginUserIcon}
alt=""
className="login-input-item-icon"
/>
<input <input
id="login-user-input" id="login-user-input"
value={this.state.account} value={this.state.account}
onChange={this.getAccount} onChange={this.getAccount}
style={{ fill: 'unset' }} style={{ fill: "unset" }}
placeholder={loginNameDesc ? loginNameDesc : intl.get("pleaseInputUsername")} placeholder={
loginNameDesc
? loginNameDesc
: intl.get("pleaseInputUsername")
}
/> />
</div> </div>
</div> </div>
<div className="login-form-single-label" style={{ marginTop: '15px' }}>密码:</div> <div
<div className="login-form-single-container" onClick={this.passwordInputClick} > className="login-form-single-label"
<div className="form-item" > style={{ marginTop: "15px" }}
<img src={loginPasswordIcon} alt="" className="login-input-item-icon" /> >
密码:
</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"> <div className="paswDiv">
<input <input
id="login-password-input" id="login-password-input"
value={this.state.password} value={this.state.password}
type={passwordType} type={passwordType}
onChange={this.getPassword} onChange={this.getPassword}
placeholder={loginPwdDesc ? loginPwdDesc : intl.get("Password")} placeholder={
loginPwdDesc ? loginPwdDesc : intl.get("Password")
}
/> />
</div> </div>
{passwordType === 'text' ? {passwordType === "text" ? (
<Icon className="login-password-eye" onClick={this.changeType} type="eye" /> : <Icon
<Icon className="login-password-eye" onClick={this.changeType} type="eye-invisible" /> className="login-password-eye"
} onClick={this.changeType}
type="eye"
/>
) : (
<Icon
className="login-password-eye"
onClick={this.changeType}
type="eye-invisible"
/>
)}
</div> </div>
</div> </div>
</div> </div>
<Button <Button
style={{
style={this.state.isReady ? isReady : notReady} background: "#d23a29",
color:'#FFF'
}}
onClick={this.preLogin} onClick={this.preLogin}
> >
{intl.get("LogIn")} {intl.get("LogIn")}
......
...@@ -396,7 +396,7 @@ class Menulearn extends React.Component { ...@@ -396,7 +396,7 @@ class Menulearn extends React.Component {
display: "inline-block", display: "inline-block",
width: "9px", width: "9px",
height: "34px", height: "34px",
backgroundColor: "#FC5B2B", background: 'linear-gradient(180deg,#fe742b, #fc5b2b 100%)',
marginLeft: "4%", marginLeft: "4%",
marginRight: "1%", marginRight: "1%",
}} }}
......
...@@ -280,13 +280,13 @@ class Menume extends React.Component { ...@@ -280,13 +280,13 @@ class Menume extends React.Component {
return return
} }
this.props.getMyStudyInfo2(param, (res) => { // this.props.getMyStudyInfo2(param, (res) => {
this.setState({ // this.setState({
myStudyInfo2: res.data, // myStudyInfo2: res.data,
currentParam: param, // currentParam: param,
PickerView: false, // PickerView: false,
}) // })
}); // });
} }
numFormat = (num) => { numFormat = (num) => {
let newNum = num; let newNum = num;
......
import React, { Component } from 'react'; import React, { Component } from "react";
import { hashHistory } from 'react-router'; import { hashHistory } from "react-router";
import func from "../../util/commonFunc";
import func from '../../util/commonFunc'; // //共通组件 搜索
//共通组件 搜索 // import TrainTopSearch from "./trainTopSearch";
import TrainTopSearch from "./trainTopSearch"; // //共通组件 轮播图
//共通组件 轮播图 // import Mycarousel from "../common/carousel";
import Mycarousel from '../common/carousel'; // //选项卡,4个
//选项卡,4个 // import HotTrainArea from "./hotTrainArea";
import HotTrainArea from './hotTrainArea';
//列表卡片 //列表卡片
import { connect } from 'react-redux'; import { connect } from "react-redux";
import * as MenuTrainAction from './MenuTrainAction'; import * as MenuTrainAction from "./MenuTrainAction";
import moment from 'moment'; import moment from "moment";
import './MenuTrain.less'; import "./style.less";
import "./MenuTrain.less";
import TaskCalendar from "./TaskCalendar/index";
import intl from "react-intl-universal"; import intl from "react-intl-universal";
import TrainIndexList from "./trainIndexList"; import TrainIndexList from "./trainIndexList";
class MenuTrain extends Component { class MenuTrain extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
let carouselHeight = (document.body.clientWidth - 60) * (230 / 690); var today = new Date();
this.state = { let carouselHeight = (document.body.clientWidth - 60) * (230 / 690);
pageNo: 1, this.state = {
enablePay: 0, today: today,
inHeight: document.documentElement.clientHeight, pageNo: 1,
isLoading: false, enablePay: 0,
trainDataList: [], inHeight: document.documentElement.clientHeight,
carouselParam: { isLoading: false,
height: carouselHeight, trainDataList: [],
radius: '0.1rem', trainDataList: [],
}, carouselParam: {
refreshList:"" height: carouselHeight,
} radius: "0.1rem",
} },
refreshList: "",
componentDidMount() { activeId: "",
let params = { activeList: [],
bannerName: "TRAIN", nowData: "",
terminalName: "WECHAT", };
}; }
this.props.trainTabData(params, "");
this.getHotEnroll(); componentDidMount() {
this.getTrainDataList(1); // this.getHotEnroll();
this.getNewsList();
let siteCode = location.hash.split("/")[2]; let siteCode = location.hash.split("/")[2];
if (siteCode == 'cpicCourses') { if (siteCode == "cpicCourses") {
func.changeDocumentTitle(intl.get("taixue")); 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 _this = this;
let params = { this.setState({
bannerName: "TRAIN", isLoading: true,
terminalName: "WECHAT", });
}; this.props.trainListData(params, false, () => {
let hotParams = { const { MenuTrainReducer } = _this.props;
now: moment().format("YYYY-MM-DD HH:ss:DD"), _this.setState({
pageNo: this.state.pageNo, isLoading: false,
pageSize: 50, pageNo: page,
refreshList: new Date().getTime(),
}; trainDataList: MenuTrainReducer.trainList,
this.domeClick(params, hotParams); });
hotParams.enablePay = this.state.enablePay; });
this.props.hotEnrollData(hotParams); };
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);
}
);
} }
};
getNewsList = () => {
getTrainDataList = (page) => { let _this = this;
let params = { this.props.getActiveList("", () => {
now: moment().format("YYYY-MM-DD HH:ss:DD"), const { MenuTrainReducer } = _this.props;
pageNo: page, let allClassify = MenuTrainReducer.activityType;
pageSize: 10, if (allClassify && allClassify.length > 0) {
enablePay: this.state.enablePay allClassify.unshift({
}; activityType: "",
activityName: intl.get("AllActive"),
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)
})
}); });
}
} this.setState({ activeList: allClassify });
});
filterTheTrainList = (type) => { };
let enablePay = 0; //更改日期,每次更改日期去获取新的任务列表,默认打开课程,第一页
if (parseInt(type) == 2) { onChangeDateListener = (data, viewData) => {
enablePay = 1; let _this = this;
} let { activeId, page, trainDataList } = this.state;
let _this = this; let params = {
this.setState({ bizType: 1,
enablePay activityType: activeId,
}, () => { pageNo: page,
_this.getHotEnroll(); pageSize: 10,
_this.getTrainDataList(1); 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')
});
} }
};
//获取某天的任务列表
getTaskList = (nowData) => {};
/*
*获取日历中的每个月的任务列表
domeClick = (...item) => { */
item.reduce((m, n) => console.log(JSON.stringify(m) + ',' + JSON.stringify(n))); getCalendarTaskNum = (date) => {
}; const { activeId, page, trainDataList } = this.state;
let _this = this;
imgRest = (data) => { let thisMonth = this.getMonthData(date);
let newData = []; if (trainDataList.length <= 0) {
data.map((item) => { let params = {
newData.push({ ...item, imageSrc: item.bannerPath }) 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; });
}; console.log(this.state.trainDataList,'33333')
listScroll = (e) => {
let thisObj = e.target;
var listScrollListener = func.throttle(func.onListScrollToEnd, 100);
listScrollListener(thisObj, "train-scroll-listen-container", this.onEndReached, 200);
} }
};
render() { //获取年月信息
let { bannerList, hotEnroll } = this.props.MenuTrainReducer; getMonthData = (date) => {
let { trainDataList, carouselParam, isLoading,refreshList } = this.state; let _date = new Date(date);
let years = _date.getFullYear();
return ( let months = _date.getMonth() + 1;
<div className="train-index-container" onScroll={this.listScroll}> let thisMonth = years + "_" + months;
<div className="train-container" id="train-scroll-listen-container"> return thisMonth;
<div style={{ backgroundColor: "#fff" }}> };
<TrainTopSearch filterTheTrainList={this.filterTheTrainList} /> render() {
let { trainDataList, isLoading, refreshList, activeList, activeId } =
{JSON.stringify(bannerList) === "[]" ? this.state;
null
: <div className='carousel'> return (
<Mycarousel <div className="train-index-container" onScroll={this.listScroll}>
data={this.imgRest(bannerList)} <div className="train-container" id="train-scroll-listen-container">
carouselparam={carouselParam} <div style={{ backgroundColor: "#fff" }}>
frameOverflow={"hidden"} <NewsClassifyList
/> list={activeList}
activeId={activeId}
</div> onClick={this.newsClassifyClick}
} />
{hotEnroll.length ? </div>
<div className="hotenroll"> <div className="taskView">
<HotTrainArea <div className={"taskCalendarView moveDown"} id="taskCalendarView">
key={refreshList} <TaskCalendar
data={hotEnroll} timestamp={this.state.today}
hotItemClick={this.hotItemClick} onChangeDateListener={this.onChangeDateListener}
/> getCalendarTaskNum={this.getCalendarTaskNum}
isLoading={this.state.isLoading}
</div> taskList={trainDataList}
: null} />
</div>
<TrainIndexList
key={refreshList}
list={trainDataList}
itemClick={this.itemClick}
isLoading={isLoading}
/>
</div>
<div style={{ width: "100%", height: 100 }}></div>
</div> </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;
} }
console.log("加载");
onEndReached = () => { if (this.props.MenuTrainReducer.isMore) {
if (this.state.isLoading) { const { pageNo } = this.state;
return; this.getTrainDataList(pageNo + 1);
} }
console.log("加载") };
if (this.props.MenuTrainReducer.isMore) {
const { pageNo } = this.state; //list item
this.getTrainDataList(pageNo + 1); itemClick = (item) => {
} console.log(item,'555555555555');
hashHistory.push({
}; pathname: func.routerBefore() + "/trainingsteps",
query: {
//火热报名 id: item.id,
hotItemClick = (item) => { finished: item.finished,
console.log(item); activityStateCode: item.activityStateCode
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
},
})
};
} }
export default connect(state => { export default connect((state) => {
let { MenuTrainReducer } = state; let { MenuTrainReducer } = state;
return { return {
MenuTrainReducer MenuTrainReducer,
}; };
}, MenuTrainAction)(MenuTrain); }, 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 Network from '../../util/fetchUtil';
import excute from '../../util/fetchUtil';
import API from '../../util/urlconfig'; import API from '../../util/urlconfig';
import * as actions from "./TrainReduxTypes"; import * as actions from "./TrainReduxTypes";
export const trainTabData=(params)=>{
return dispatch=>{ export const getActiveList = (data,callback) => {
Network.post(API.banner, params, return dispatch => {
response => { excute.get(API.activeList + '?bizType=1',
dispatch({ (res) => {
type: actions.TRAIN_PAGE_DATA_EVENTS, if (String(res.code) == "1000") {
bannerList: response.data
});
}
);
}
};
//火热报名中.....
export const hotEnrollData=(params)=>{
return dispatch=>{
Network.post(API.hotEnrolling, params,
response=>{
dispatch({ dispatch({
type:actions.HOT_ENROLL_DATA_EVENT, type: actions.TRAIN_ACTIVE_LIST,
hotEnroll:response.data.records activityType: res.data.activityType,
theDay:res.data.theDay
}) })
if (callback) {
callback();
}
} }
) }
)
} }
}; };
//培训列表 //培训列表
export const trainListData=(params, isUpData ,callBack)=>{ export const trainListData = (params, callBack) => {
return dispatch=>{ return dispatch => {
Network.post(API.trainList, params, Network.post(API.trainList, params,
response=>{ response => {
let pageNo=Number.parseInt(response.data.current)+1; let pageNo = Number.parseInt(response.data.current) + 1;
let isMore=pageNo > response.data.pages?false:true; let isMore = pageNo > response.data.pages ? false : true;
dispatch({ dispatch({
type:actions.TRAIN_LIST_DATAS, type: actions.TRAIN_LIST_DATAS,
trainList:itemList(response.data.records), trainList: itemList(response.data.records),
isUpData:isUpData, isMore: isMore,
isMore:isMore, pageNo: pageNo,
pageNo:pageNo, pageTotle: response.data.total,
pageTotle:response.data.total,
}); });
if(callBack){ if (callBack) {
callBack(); callBack();
} }
} }
) )
} }
}; };
function itemList(item){ function itemList(item) {
let newItem=[]; let newItem = [];
item.map(item=>{ item.map(item => {
newItem.push({ newItem.push({
image:item.logoImg, image: item.logoImg,
text:item.name, text: item.name,
people: item.joinNumber, people: item.joinNumber,
start:item.startTime, start: item.startTime,
end:item.endTime, end: item.endTime,
id:item.id, id: item.id,
finished:item.finished, finished: item.finished,
activitieNum:item.activitieNum, activitieNum: item.activitieNum,
period:item.period, activityStateCode:item.activityStateCode,
trainingDurationShow:item.trainingDurationShow, period: item.period,
enablePay:item.enablePay trainingDurationShow: item.trainingDurationShow,
enablePay: item.enablePay
}) })
}); });
return newItem; return newItem;
} }
//初始化 //初始化
export const initialTrainReducer=()=>{ export const initialTrainReducer = () => {
return { return {
type:actions.INITIAL_TRAIN_REDUCER type: actions.INITIAL_TRAIN_REDUCER
} }
} }
\ No newline at end of file
...@@ -3,6 +3,8 @@ const initial={ ...@@ -3,6 +3,8 @@ const initial={
bannerList:[], bannerList:[],
trainList:[], trainList:[],
hotEnroll:[], hotEnroll:[],
activityType:[],
theDay:[],
pageNo:1, pageNo:1,
isMore:false, isMore:false,
pageTotle:0, pageTotle:0,
...@@ -19,14 +21,14 @@ export default (state=initial, action)=>{ ...@@ -19,14 +21,14 @@ export default (state=initial, action)=>{
...state, ...state,
hotEnroll:action.hotEnroll hotEnroll:action.hotEnroll
}; };
case actions.TRAIN_ACTIVE_LIST:
return {
activityType:action.activityType,
theDay:action.theDay
};
case actions.TRAIN_LIST_DATAS: case actions.TRAIN_LIST_DATAS:
let dataList=[];
dataList=action.trainList
return { return {
...state, trainList:action.trainList,
trainList:dataList,
pageNo:action.pageNo, pageNo:action.pageNo,
isMore:action.isMore, isMore:action.isMore,
pageTotle:action.pageTotle 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"; ...@@ -6,6 +6,7 @@ export const HOT_ENROLL_DATA_EVENT="HOT_ENROLL_DATA_EVENT";
export const TRAIN_LIST_DATAS="TRAIN_LIST_DATAS"; export const TRAIN_LIST_DATAS="TRAIN_LIST_DATAS";
//初始化 //初始化
export const INITIAL_TRAIN_REDUCER="INITIAL_TRAIN_REDUCER"; 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"; 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 "./style.less";
import intl from "react-intl-universal"; 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 IconfontD from "../../../common/iconfontd";
import TrigleTagComponent from "../../../common/trigleTag"; import TrigleTagComponent from "../../../common/trigleTag";
class TrainIndexList extends Component { class TrainIndexList extends Component {
constructor(props) { constructor(props) {
super(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;
} }
let day = dateObj.getDate();
if (day < 10) {
renderTrainItemByItemList = () => { day = "0" + day;
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) => { return year + "-" + month + "-" + day;
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;
}
render() { render() {
const { isLoading } = this.props; const { isLoading } = this.props;
return <div className="train-index-list-container"> return (
<IndexTitle title={intl.get("studyActivity")} /> <div className="train-index-list-container">
<IndexModuleBg > <IndexTitle title={intl.get("studyActivity")} />
{this.renderTrainItemByItemList()} <IndexModuleBg>{this.renderTrainItemByItemList()}</IndexModuleBg>
</IndexModuleBg> <div style={{ width: "100%", backgroundColor: "#f5f5f5" }}>
<div style={{ width: "100%", backgroundColor: "#f5f5f5" }}> <IndexNotMore text={isLoading ? intl.get("PublishKey66") : ""} />
<IndexNotMore text={isLoading ? intl.get("PublishKey66") : ""} /> </div>
</div> </div>
);
</div>; }
}
} }
export default TrainIndexList; export default TrainIndexList;
const TrainItem = ({ data, onClick }) => { const TrainItem = ({ data, onClick }) => {
return (
<div className="train-index-list-item-container" onClick={onClick}>
return <div className="train-index-list-item-container" onClick={onClick}> <img src={data.image} alt="" className="train-index-list-item-image" />
<img src={data.image} alt="" className="train-index-list-item-image" /> <div style={{ display: "flex", alignItems: "end" }}>
<div className="train-index-list-item-info"> <div className="train-index-list-item-info">
<div className="train-index-list-item-info-name"> <div className="train-index-list-item-info-name">{data.text}</div>
{data.text} <div className="train-index-list-item-info-text">
</div> <IconfontD
<div className="train-index-list-item-info-text"> code={"iconnumberofactivities"}
<IconfontD code={"iconnumberofactivities"} style={{ fontSize: 28, marginRight: 6 }} /> style={{ fontSize: 28, marginRight: 6 }}
{data.activitieNum}{intl.get("AtLeastFinish2")} />
{ {data.activitieNum}
parseInt(data.enablePay) == 1 ? {intl.get("AtLeastFinish2")}
<TrigleTagComponent text={intl.get("payTheBill") || "付费"} /> : "" {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="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>
</div>; </div>
} </div>
\ No newline at end of file );
};
.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"; @import "../../../static/theme.less";
.train-index-list-container{ .train-index-list-container {
width: 100%;
.train-index-list-item-container {
width: 100%; 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%; width: 100%;
height: 160px; height: 32px;
padding-left: 266px; line-height: 32px;
position: relative; font-size: 24px;
margin-bottom: 32px; color: #999;
.train-index-list-item-image{ font-weight: 400;
width: 266px; margin-top: 24px;
height: 160px; }
border-radius: 10px; }
position: absolute; .train-status {
left: 0; width: 150px;
top: 0; border-radius: 50px;
padding: 5px 15px;
} font-size: 30px;
.train-index-list-item-info{ text-align: center;
width: 100%; }
height: 160px; .train-enroll-status {
padding-left: 20px; width: 150px;
.train-index-list-item-info-name{ border-radius: 50px;
width: 100%; padding: 5px 15px;
height: 40px; font-size: 30px;
line-height: 40px; text-align: center;
font-size: 32px; border: 1px solid #d23a29;
color: #333; color: #d23a29;
font-weight: 400; }
.singleLineOverflow; .train-sign-status {
} width: 150px;
.train-index-list-item-info-text{ border-radius: 50px;
width: 100%; padding: 5px 15px;
height: 32px; font-size: 30px;
line-height: 32px; text-align: center;
font-size: 24px; background: linear-gradient(90deg, #d23a29, #eb6c53 100%);
color: #999; color: #fff;
font-weight: 400;
margin-top: 24px;
}
}
} }
} .train-end-status {
\ No newline at end of file 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 { ...@@ -144,7 +144,6 @@ class TaskCalendar extends Component {
let props = { let props = {
viewData: this.state.viewData viewData: this.state.viewData
}; };
console.log("currentDay:"+this.state.day);
return ( return (
<div className="calendarContainer"> <div className="calendarContainer">
<CalendarHeader <CalendarHeader
......
...@@ -55,15 +55,10 @@ class SurveyAnswer extends Component { ...@@ -55,15 +55,10 @@ class SurveyAnswer extends Component {
if (String(isExam) == 1) { if (String(isExam) == 1) {
this.props.examQuestionListData({...params, answerId: answerId}, false, isExam); this.props.examQuestionListData({...params, answerId: answerId}, false, isExam);
} }
// else {
// // this.props.examQuestionListData({...params}, false, isExam);
// this.props.examQuestionListData({...params}, false, 0);
// }
} }
componentWillReceiveProps = (nextProps) => { componentWillReceiveProps = (nextProps) => {
console.log(nextProps) console.log(nextProps)
//if (JSON.stringify(nextProps.DetailReducer.questions) != JSON.stringify(this.props.DetailReducer.questions)) {
this.setState({ this.setState({
questions: this.state.questions.cloneWithRows(nextProps.DetailReducer.questions), questions: this.state.questions.cloneWithRows(nextProps.DetailReducer.questions),
}); });
...@@ -73,33 +68,7 @@ class SurveyAnswer extends Component { ...@@ -73,33 +68,7 @@ class SurveyAnswer extends Component {
componentWillUnmount() { componentWillUnmount() {
this.props.questionIntialReducer(); this.props.questionIntialReducer();
this._timer && clearInterval(this._timer); 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)=>{ timeDuration=(time)=>{
let h=this.addZero(Number.parseInt(time/3600%24)); let h=this.addZero(Number.parseInt(time/3600%24));
let m=this.addZero(Number.parseInt(time/60%60)); let m=this.addZero(Number.parseInt(time/60%60));
...@@ -108,9 +77,8 @@ class SurveyAnswer extends Component { ...@@ -108,9 +77,8 @@ class SurveyAnswer extends Component {
}; };
addZero=(n)=> n<10? '0'+n : n; addZero=(n)=> n<10? '0'+n : n;
render() { render() {
let {questions, height, timeStr}=this.state; let {questions, height}=this.state;
let {isMore, pageIndex, duration, questionsKey ,submitTime}=this.props.DetailReducer; let {isMore}=this.props.DetailReducer;
//if (Number.parseFloat(duration) > 0) this.timeDuration(Number.parseFloat(duration) * 60);
let separator = (sectionID, rowID) => ( let separator = (sectionID, rowID) => (
<div <div
className="separator" className="separator"
......
...@@ -80,7 +80,7 @@ class details extends Component { ...@@ -80,7 +80,7 @@ class details extends Component {
} }
}) })
} }
//单选题其他txt回现 //单选题其他txt回现1
if (data.question && data.question.type == 1) { if (data.question && data.question.type == 1) {
console.log('danxuan', data.question.options) console.log('danxuan', data.question.options)
data.question.options.map((v, i) => { data.question.options.map((v, i) => {
...@@ -183,9 +183,7 @@ class details extends Component { ...@@ -183,9 +183,7 @@ class details extends Component {
{item.isFrist == 1 && item.remark !== '' ? {item.isFrist == 1 && item.remark !== '' ?
<div style={{ fontSize: '.28rem', padding: ' 0.1rem 0.3rem', borderBottom: '5px solid rgba(248,248,248,1)' }} > <div style={{ fontSize: '.28rem', padding: ' 0.1rem 0.3rem', borderBottom: '5px solid rgba(248,248,248,1)' }} >
<div > <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' }} <h4 style={{ float: 'left', padding: '15px 0', fontSize: '32px' }}>投票</h4>
onClick={() => this.open()}>{this.state.open ? intl.get('More')||'展开' : intl.get('Hide')||'收起'}{this.state.open ? <Icon type="down" /> : <Icon type="up" />}
</span>
</div> </div>
<div style={{ clear: 'both' }}></div> <div style={{ clear: 'both' }}></div>
{/** task-1133-jmy 修改文字颜色 #ccc --> #4A4A4A */} {/** 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{ #hometitle {
.am-badge-dot{ .am-badge-dot {
width: 20px; width: 20px;
height: 20px; height: 20px;
top: 2px; top: 2px;
right: -9px; right: -9px;
} }
.am-search-input{ .am-search-input {
background-color: #f5f5f5; background-color: #f5f5f5;
border-radius: 56px; border-radius: 56px;
} }
} }
#example .am-search-input .am-search-synthetic-ph{ #example .am-search-input .am-search-synthetic-ph {
text-align: left; text-align: left;
margin-left: 20px; margin-left: 20px;
} }
.menuhomeNav{ .menuhomeNav {
background: #FCFCFC; background: #d23a29;
color: #4A4A4A; color: #fff;
background-color: rgba(255,255,255,1); padding: 20px;
height: 0.9rem;
width: 100%;
display: flex; display: flex;
flex-direction: row; align-items: center;
justify-content: space-between; .am-search {
.am-search{background-color: #fff} background-color: #fff;
border-radius: 45px;
} height: 70px !important;
\ No newline at end of file line-height: 70px !important;
}
}
import React from 'react'; import React from "react";
import { hashHistory } from 'react-router'; import { hashHistory } from "react-router";
import { SearchBar, Badge, Toast, Modal } from 'antd-mobile'; import { SearchBar, Badge, Toast, Modal } from "antd-mobile";
import { connect } from 'react-redux'; import { connect } from "react-redux";
import { search } from '../../redux/action/nav/navSearch'; import { search } from "../../redux/action/nav/navSearch";
import func from '../../util/commonFunc' import func from "../../util/commonFunc";
import { sign, ticket, noReadCount } from '../../redux/action/myModel' import { sign, ticket, noReadCount } from "../../redux/action/myModel";
import "./less/nav.less"; import "./less/nav.less";
import saoyisao from '../../image/saoyisao.png' import saoyisao from "../../image/saoyisao.png";
import xiaoxi from '../../image/xiaoxi.png' import xiaoxi from "../../image/xiaoxi.png";
const alert = Modal.alert; const alert = Modal.alert;
import SignResultModal from "./signResultModal/"; import SignResultModal from "./signResultModal/";
import intl from "react-intl-universal"; import intl from "react-intl-universal";
import { Fragment } from 'react'; import { Fragment } from "react";
class mehomeNav extends React.Component { class mehomeNav extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
title: 'title', title: "title",
selectedTab: 'menuhome', selectedTab: "menuhome",
sign: false, sign: false,
noreadCount: 0, noreadCount: 0,
signResultVisible: false, signResultVisible: false,
signResultCode: 0, signResultCode: 0,
reasonFromApi: "" reasonFromApi: "",
}; };
this.getKeyword = this.getKeyword.bind(this); this.getKeyword = this.getKeyword.bind(this);
this.closeSignResultModal = this.closeSignResultModal.bind(this); // this.closeSignResultModal = this.closeSignResultModal.bind(this);
}
} componentDidMount() {
// let store = this.props.store.getState();
componentDidMount() { // let _this = this;
// let store = this.props.store.getState(); // this.props.noReadCount(() => {
// let _this = this; // _this.setState({
// this.props.noReadCount(() => { // noreadCount: _this.props.readCount
// _this.setState({ // })
// noreadCount: _this.props.readCount // })
// }) // let appid = sessionStorage.getItem('appid');
// }) }
// let appid = sessionStorage.getItem('appid');
getKeyword(value) {
if (!value) {
Toast.info(intl.get("PublishKey168") || "请输入关键词");
} } else {
this.props.search(value);
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>
);
} }
}
// 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')}> // }} onClick={() => hashHistory.push(func.routerBefore() + '/sendmessage')}>
function mapStateToProps(state, ownProps) { function mapStateToProps(state, ownProps) {
const { myModel } = state; const { myModel } = state;
return {
return { code: myModel.loginCode,
code: myModel.loginCode, appid: myModel.appid,
appid: myModel.appid, readCount: myModel.noReadCount,
readCount: myModel.noReadCount, };
}
} }
function mapDispatchToProps(dispatch) { function mapDispatchToProps(dispatch) {
return {
return { search: (data) => dispatch(search(data)),
search: (data) => dispatch(search(data)), sign: (data, callback) => dispatch(sign(data, callback)),
sign: (data, callback) => dispatch(sign(data, callback)), ticket: (url, callback) => dispatch(ticket(url, callback)),
ticket: (url, callback) => dispatch(ticket(url, callback)), noReadCount: (callback) => dispatch(noReadCount(callback)),
noReadCount: (callback) => dispatch(noReadCount(callback)), };
}
} }
export default connect(mapStateToProps, mapDispatchToProps)(mehomeNav); export default connect(mapStateToProps, mapDispatchToProps)(mehomeNav);
...@@ -243,7 +243,7 @@ function mapDispatchToProps(dispatch) { ...@@ -243,7 +243,7 @@ function mapDispatchToProps(dispatch) {
export default connect(mapStateToProps, mapDispatchToProps)(NewsListPage); export default connect(mapStateToProps, mapDispatchToProps)(NewsListPage);
const NewsClassifyList = ({ list, currentClassifyId, onClick }) => { const NewsClassifyList = ({ list, currentClassifyId, onClick }) => {
let bgWidth = func.getDomOffsetWidthById("news-classify-list-scroll-id");
return ( return (
<div className="news-classify-list-container"> <div className="news-classify-list-container">
<div <div
......
...@@ -307,6 +307,7 @@ module.exports = { ...@@ -307,6 +307,7 @@ module.exports = {
"Hours": "hrs", "Hours": "hrs",
"News": "News", "News": "News",
"AllNews": "All News", "AllNews": "All News",
"AllActive": "All Active",
"ReleaseTime": "Time", "ReleaseTime": "Time",
"Author": "Author", "Author": "Author",
"Messages": "Messages", "Messages": "Messages",
......
...@@ -1232,6 +1232,7 @@ ...@@ -1232,6 +1232,7 @@
"LatestReply": "最新回复", "LatestReply": "最新回复",
"item": "条", "item": "条",
"AllNews": "所有新闻", "AllNews": "所有新闻",
"AllActive": "所有活动",
"hasSelectOption": "已选条件", "hasSelectOption": "已选条件",
"studyNum": "学习人数", "studyNum": "学习人数",
"QuizGotIt": "我知道了", "QuizGotIt": "我知道了",
......
...@@ -305,6 +305,7 @@ ...@@ -305,6 +305,7 @@
"Hours": "小时", "Hours": "小时",
"News": "新闻", "News": "新闻",
"AllNews": "所有新闻", "AllNews": "所有新闻",
"AllActive": "所有活动",
"ReleaseTime": "发布时间", "ReleaseTime": "发布时间",
"Author": "作者", "Author": "作者",
"Notices": "公告", "Notices": "公告",
......
...@@ -427,6 +427,7 @@ module.exports = { ...@@ -427,6 +427,7 @@ module.exports = {
"LatestReply": "最新回复", "LatestReply": "最新回复",
"item": "条", "item": "条",
"AllNews": "所有新闻", "AllNews": "所有新闻",
"AllActive": "所有活动",
"hasSelectOption": "已选条件", "hasSelectOption": "已选条件",
"studyNum": "学习人数", "studyNum": "学习人数",
"QuizGotIt": "我知道了", "QuizGotIt": "我知道了",
...@@ -1237,6 +1238,7 @@ module.exports = { ...@@ -1237,6 +1238,7 @@ module.exports = {
"Hours": "小时", "Hours": "小时",
"News": "新闻", "News": "新闻",
"AllNews": "所有新闻", "AllNews": "所有新闻",
"AllActive": "所有活动",
"ReleaseTime": "发布时间", "ReleaseTime": "发布时间",
"Author": "作者", "Author": "作者",
"Notices": "公告", "Notices": "公告",
......
...@@ -69,11 +69,13 @@ const linkMap = { ...@@ -69,11 +69,13 @@ const linkMap = {
name: '我的项目', name: '我的项目',
list: '/train/mytraining', list: '/train/mytraining',
detail: '/mytraining/trainingsteps', detail: '/mytraining/trainingsteps',
}, myhome: { },
myhome: {
name: '我的', name: '我的',
list: '/menume', list: '/menume',
detail: '/menume', detail: '/menume',
}, mycourse: { },
mycourse: {
name: '我的课程', name: '我的课程',
list: '/mycourse', list: '/mycourse',
detail: '/mycourse/course', detail: '/mycourse/course',
...@@ -139,7 +141,7 @@ const linkMap = { ...@@ -139,7 +141,7 @@ const linkMap = {
}, },
case_upload: { case_upload: {
name: '作品上传', name: '作品上传',
list:'/UploadMyCase', list: '/UploadMyCase',
detail: false, detail: false,
}, },
course: { course: {
...@@ -213,67 +215,67 @@ const linkMap = { ...@@ -213,67 +215,67 @@ const linkMap = {
list: "/signplaycard", list: "/signplaycard",
detail: false, detail: false,
}, },
lecturer:{ lecturer: {
name:"讲师库", name: "讲师库",
list:"/teachers/list", list: "/teachers/list",
detail:false detail: false
}, },
mytask:{ mytask: {
name:'日历任务', name: '日历任务',
list:"/myCalendarTask", list: "/myCalendarTask",
detail:false, detail: false,
}, },
course_classify_group:{ course_classify_group: {
name:"分类组", name: "分类组",
list:"/classifygroup", list: "/classifygroup",
detail:false detail: false
}, },
album:{ album: {
name:"专辑", name: "专辑",
list:"/AlbumList", list: "/AlbumList",
detail:false detail: false
}, },
album_detail:{ album_detail: {
name:"专辑详情", name: "专辑详情",
list:"/AlbumDetail", list: "/AlbumDetail",
detail:'/AlbumDetail' detail: '/AlbumDetail'
}, },
myalbum:{ myalbum: {
name:"我的专辑", name: "我的专辑",
list:"/MyAlbumList", list: "/MyAlbumList",
detail:false detail: false
}, },
mysubscriptions:{ mysubscriptions: {
name:"我的订阅", name: "我的订阅",
list:"/MySubscribeList", list: "/MySubscribeList",
detail:false detail: false
}, },
forum:{ forum: {
name:"论坛", name: "论坛",
list:"/forumIndex", list: "/forumIndex",
detail:"/postDetail", detail: "/postDetail",
}, },
myforum:{ myforum: {
name:"我的论坛", name: "我的论坛",
list:"/MyForum", list: "/MyForum",
detail:false, detail: false,
}, },
practice:{ practice: {
name:"我的陪练", name: "我的陪练",
list:"/smart/smartPractices", list: "/smart/smartPractices",
detail:false detail: false
}, },
boutique:{ boutique: {
name:"精品内容", name: "精品内容",
list:"/boutiqueContent", list: "/boutiqueContent",
detail:false detail: false
}, },
wallet:{ wallet: {
name:"我的钱包", name: "我的钱包",
list:"/myWallet", list: "/myWallet",
detail:false detail: false
} }
} }
window.hashHistory = hashHistory; window.hashHistory = hashHistory;
...@@ -282,15 +284,15 @@ window.routerBefore = func.routerBefore(); ...@@ -282,15 +284,15 @@ window.routerBefore = func.routerBefore();
const fnNavigate = (item, jumpType) => { const fnNavigate = (item, jumpType) => {
// sessionStorage.setItem("dontAPI","no") // sessionStorage.setItem("dontAPI","no")
// 根据type判断跳转 // 根据type判断跳转
const { type, kind, relationId } = item; const { type, kind, relationId } = item;
let clearTime="";//bug-12616-cwj let clearTime = "";//bug-12616-cwj
console.log('kind',kind); console.log('kind', kind);
console.log('type',type); console.log('type', type);
console.log('item',item); console.log('item', item);
let url = ''; let url = '';
let queryId = ''; let queryId = '';
/*跳转规则: /*跳转规则:
...@@ -307,14 +309,14 @@ const fnNavigate = (item, jumpType) => { ...@@ -307,14 +309,14 @@ const fnNavigate = (item, jumpType) => {
} else if (jumpType == 'navigateList') { } else if (jumpType == 'navigateList') {
/*首页上方navigator跳转*/ /*首页上方navigator跳转*/
url = type == 'outerchain' ? item.relationFuncUrl : linkMap[type][kind]; url = type == 'outerchain' ? item.relationFuncUrl : linkMap[type][kind];
} else { } else {
/*剩下跳转方式*/ /*剩下跳转方式*/
url = type == 'outerchain' ? item.linkUrl : linkMap[type][kind]; url = type == 'outerchain' ? item.linkUrl : linkMap[type][kind];
queryId = item.relaId; queryId = item.relaId;
} }
console.log(url,'url') console.log(url, 'url')
window.directorType = type; window.directorType = type;
window.directorUrl = url; window.directorUrl = url;
if (type == 'outerchain') { if (type == 'outerchain') {
...@@ -359,72 +361,72 @@ const fnNavigate = (item, jumpType) => { ...@@ -359,72 +361,72 @@ const fnNavigate = (item, jumpType) => {
if (type == "course" && relationId != "0") { if (type == "course" && relationId != "0") {
hashHistory.push({ hashHistory.push({
pathname: routerBefore + "/courseClassifylist", pathname: routerBefore + "/courseClassifylist",
query:{ query: {
id:relationId id: relationId
} }
}); });
} else if(type=="case_upload"){ } else if (type == "case_upload") {
hashHistory.push({ hashHistory.push({
pathname: routerBefore + url, pathname: routerBefore + url,
query:{ query: {
id:relationId id: relationId
} }
}); });
}else if(type=="course_classify_group"){ } else if (type == "course_classify_group") {
hashHistory.push({ hashHistory.push({
pathname: routerBefore + url, pathname: routerBefore + url,
query:{ query: {
id:relationId id: relationId
} }
}); });
}else if(type=="rankinglist"&&item.relationNum){ } else if (type == "rankinglist" && item.relationNum) {
hashHistory.push({ hashHistory.push({
pathname: routerBefore + url, pathname: routerBefore + url,
query:{ query: {
relationNum:item.relationNum relationNum: item.relationNum
} }
}); });
}else if(type=="album_detail"){ } else if (type == "album_detail") {
hashHistory.push({ hashHistory.push({
pathname: routerBefore + url, pathname: routerBefore + url,
query:{ query: {
id:relationId id: relationId
} }
}); });
}else if(type=="album"&& relationId != "0"){ } else if (type == "album" && relationId != "0") {
hashHistory.push({ hashHistory.push({
pathname: routerBefore + "/AlbumClaList", pathname: routerBefore + "/AlbumClaList",
query:{ query: {
id:relationId id: relationId
} }
}); });
}else if(type=="album"&& relationId == "0") { } else if (type == "album" && relationId == "0") {
hashHistory.push({ hashHistory.push({
pathname: routerBefore + url, pathname: routerBefore + url,
}); });
} }
else { else {
clearTimeout(clearTime)//bug-12616-cwj clearTimeout(clearTime)//bug-12616-cwj
clearTime= setTimeout(() => {//bug-12616-cwj clearTime = setTimeout(() => {//bug-12616-cwj
hashHistory.push({ hashHistory.push({
pathname: routerBefore + url, pathname: routerBefore + url,
query:{ query: {
id:relationId id: relationId
} }
}); });
}, 10); }, 10);
} }
} else if (queryId) { } else if (queryId) {
hashHistory.push({ hashHistory.push({
pathname: routerBefore + url, 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 { ...@@ -427,6 +427,7 @@ export default {
"LatestReply": "最新回复", "LatestReply": "最新回复",
"item": "条", "item": "条",
"AllNews": "所有新闻", "AllNews": "所有新闻",
"AllActive": "所有活动",
"hasSelectOption": "已选条件", "hasSelectOption": "已选条件",
"studyNum": "学习人数", "studyNum": "学习人数",
"QuizGotIt": "我知道了", "QuizGotIt": "我知道了",
......
...@@ -112,7 +112,8 @@ const url = { ...@@ -112,7 +112,8 @@ const url = {
COURSE_MAIN: `${baseUrl}${WEBSTUDENT}api/course/homePage/list`, COURSE_MAIN: `${baseUrl}${WEBSTUDENT}api/course/homePage/list`,
// banner // banner
banner: `${baseUrl}${WEBSTUDENT}api/banner/home/image/list`, banner: `${baseUrl}${WEBSTUDENT}api/banner/home/image/list`,
//活动list
activeList:`${baseUrl}${WEBSTUDENT}api/trainingProject/getTrainingActivity`,
//火热报名中 //火热报名中
hotEnrolling: `${baseUrl}${WEBSTUDENT}api/trainingProject/hot/page/list`, 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