|
|
|
|
@ -1,6 +1,551 @@
|
|
|
|
|
"use strict";
|
|
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[54056],{
|
|
|
|
|
|
|
|
|
|
/***/ 36579:
|
|
|
|
|
/*!*********************************************************!*\
|
|
|
|
|
!*** ./src/components/PreviewAll/index.tsx + 1 modules ***!
|
|
|
|
|
\*********************************************************/
|
|
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
|
|
"Z": function() { return /* binding */ PreviewAll; }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules
|
|
|
|
|
var style = __webpack_require__(39871);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
|
|
|
var es_button = __webpack_require__(6889);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/style/index.js + 1 modules
|
|
|
|
|
var tooltip_style = __webpack_require__(90320);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/index.js + 3 modules
|
|
|
|
|
var tooltip = __webpack_require__(60047);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
|
|
|
var objectSpread2 = __webpack_require__(71402);
|
|
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
|
|
|
var slicedToArray = __webpack_require__(2488);
|
|
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
|
|
var react = __webpack_require__(978);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/components/PreviewAll/index.less?modules
|
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
/* harmony default export */ var PreviewAllmodules = ({"wrp":"wrp___dq7YK","bgBlack":"bgBlack___ARIUV","monaco":"monaco___VnZC3","darkBlue":"darkBlue___UprA9","close":"close___LKoWu","embed":"embed___hvpEJ"});
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/ArrowDownOutlined.js + 1 modules
|
|
|
|
|
var ArrowDownOutlined = __webpack_require__(4774);
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 3 modules
|
|
|
|
|
var monaco_editor = __webpack_require__(8691);
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
|
|
var util = __webpack_require__(29427);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
|
|
var jsx_runtime = __webpack_require__(50107);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/components/PreviewAll/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var PreviewAll = (function (_ref) {
|
|
|
|
|
var name = _ref.name,
|
|
|
|
|
data = _ref.data,
|
|
|
|
|
theme = _ref.theme,
|
|
|
|
|
type = _ref.type,
|
|
|
|
|
filename = _ref.filename,
|
|
|
|
|
monacoEditor = _ref.monacoEditor,
|
|
|
|
|
className = _ref.className,
|
|
|
|
|
style = _ref.style,
|
|
|
|
|
close = _ref.close,
|
|
|
|
|
onClose = _ref.onClose,
|
|
|
|
|
hasMask = _ref.hasMask;
|
|
|
|
|
var _useState = (0,react.useState)('https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt'),
|
|
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
|
|
src = _useState2[0],
|
|
|
|
|
setSrc = _useState2[1];
|
|
|
|
|
var _useState3 = (0,react.useState)(""),
|
|
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
|
|
token = _useState4[0],
|
|
|
|
|
setToken = _useState4[1];
|
|
|
|
|
var size;
|
|
|
|
|
var unit = 1024 * 1024;
|
|
|
|
|
var maxSize = 10 * unit;
|
|
|
|
|
var closeRef = (0,react.useRef)();
|
|
|
|
|
if (type === "office") {
|
|
|
|
|
size = (0,util/* parseUrl */.en)(data).filesize;
|
|
|
|
|
if (size > maxSize) {
|
|
|
|
|
type = "other";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (filename) monacoEditor.filename = filename;
|
|
|
|
|
(0,react.useEffect)(function () {
|
|
|
|
|
var _document$cookie, _document$cookie$repl;
|
|
|
|
|
var cookies = (_document$cookie = document.cookie) === null || _document$cookie === void 0 ? void 0 : (_document$cookie$repl = _document$cookie.replace(/\s/g, "")) === null || _document$cookie$repl === void 0 ? void 0 : _document$cookie$repl.split(";");
|
|
|
|
|
cookies === null || cookies === void 0 ? void 0 : cookies.map(function (item) {
|
|
|
|
|
var i = item.split("=");
|
|
|
|
|
if (i[0] === '_educoder_session') {
|
|
|
|
|
setToken(i[1]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}, []);
|
|
|
|
|
var handleClick = function handleClick() {
|
|
|
|
|
if (data.startsWith("http") || data.startsWith('blob:')) {
|
|
|
|
|
handleDown();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
(0,util/* downloadFile */.Sv)(filename || 'educoder', data, filename);
|
|
|
|
|
};
|
|
|
|
|
var handleDown = function handleDown() {
|
|
|
|
|
(0,util/* downLoadLink */.Nd)(filename || 'educoder', decodeURIComponent(data));
|
|
|
|
|
};
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
style: objectSpread2_default()({}, style || {}),
|
|
|
|
|
className: "".concat(hasMask && PreviewAllmodules.bgBlack, " ").concat(!!type ? PreviewAllmodules.wrp : "hide"),
|
|
|
|
|
children: [close && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: PreviewAllmodules.close,
|
|
|
|
|
ref: closeRef,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
|
|
title: "\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",
|
|
|
|
|
getPopupContainer: function getPopupContainer() {
|
|
|
|
|
return closeRef.current;
|
|
|
|
|
},
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
onClick: handleDown,
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
|
|
className: "icon-quxiaozhiding"
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
|
|
title: "\u5173\u95ED",
|
|
|
|
|
getPopupContainer: function getPopupContainer() {
|
|
|
|
|
return closeRef.current;
|
|
|
|
|
},
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
className: "",
|
|
|
|
|
onClick: onClose,
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
|
|
className: "icon-guanbi1"
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: "".concat(PreviewAllmodules[className], " ").concat(className, " ").concat(PreviewAllmodules.monaco, " ").concat(type === "txt" ? "show" : "hide"),
|
|
|
|
|
children: type === "txt" && /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, objectSpread2_default()({}, monacoEditor))
|
|
|
|
|
}), type === "audio" && /*#__PURE__*/(0,jsx_runtime.jsx)("audio", {
|
|
|
|
|
src: "".concat((data === null || data === void 0 ? void 0 : data.indexOf("http://")) > -1 || (data === null || data === void 0 ? void 0 : data.indexOf("https://")) > -1 ? "" : "data:audio/mp3;base64,").concat(data),
|
|
|
|
|
autoPlay: true
|
|
|
|
|
}), type === "video" && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
|
|
children: (data === null || data === void 0 ? void 0 : data.indexOf("http")) > -1 ? /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
|
|
|
|
|
controls: true,
|
|
|
|
|
src: "".concat(data),
|
|
|
|
|
autoPlay: true
|
|
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
|
|
|
|
|
controls: true,
|
|
|
|
|
src: "data:video/mp4;base64,".concat(data),
|
|
|
|
|
autoPlay: true
|
|
|
|
|
})
|
|
|
|
|
}), type === 'office' && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
|
|
|
|
|
src: "https://view.officeapps.live.com/op/embed.aspx?src=".concat(data, "?").concat(encodeURIComponent("disposition=office&token=".concat(token)))
|
|
|
|
|
}), type === 'html' && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
|
|
|
|
|
src: data + '&disposition=inline'
|
|
|
|
|
}), type === 'pdf' && /*#__PURE__*/(0,jsx_runtime.jsx)("embed", {
|
|
|
|
|
className: PreviewAllmodules.embed,
|
|
|
|
|
src: data
|
|
|
|
|
}), type === "image" && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
|
|
src: "".concat((data === null || data === void 0 ? void 0 : data.indexOf("http://")) > -1 || (data === null || data === void 0 ? void 0 : data.indexOf("https://")) > -1 ? "" : "data:image/png;base64,").concat(data)
|
|
|
|
|
}), type === "other" && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.Z, {
|
|
|
|
|
type: "primary",
|
|
|
|
|
size: "large",
|
|
|
|
|
onClick: handleClick,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ArrowDownOutlined/* default */.Z, {}), "\u70B9\u51FB\u4E0B\u8F7D"]
|
|
|
|
|
})
|
|
|
|
|
}), type === "download" && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.Z, {
|
|
|
|
|
type: "primary",
|
|
|
|
|
size: "large",
|
|
|
|
|
onClick: handleClick,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ArrowDownOutlined/* default */.Z, {}), "\u70B9\u51FB\u4E0B\u8F7D"]
|
|
|
|
|
})]
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 12768:
|
|
|
|
|
/*!*********************************************************!*\
|
|
|
|
|
!*** ./src/components/RenderHtml/index.tsx + 1 modules ***!
|
|
|
|
|
\*********************************************************/
|
|
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
|
|
"Z": function() { return /* binding */ RenderHtml; }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
|
|
|
var objectSpread2 = __webpack_require__(71402);
|
|
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
|
|
|
var slicedToArray = __webpack_require__(2488);
|
|
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
|
|
var react = __webpack_require__(978);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/katex/dist/katex.min.css
|
|
|
|
|
var katex_min = __webpack_require__(81897);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/marked/lib/marked.js
|
|
|
|
|
var marked = __webpack_require__(55278);
|
|
|
|
|
var marked_default = /*#__PURE__*/__webpack_require__.n(marked);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/marked/src/helpers.js
|
|
|
|
|
var helpers = __webpack_require__(15682);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/utils/marked.ts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function indentCodeCompensation(raw, text) {
|
|
|
|
|
var matchIndentToCode = raw.match(/^(\s+)(?:```)/);
|
|
|
|
|
if (matchIndentToCode === null) {
|
|
|
|
|
return text;
|
|
|
|
|
}
|
|
|
|
|
var indentToCode = matchIndentToCode[1];
|
|
|
|
|
return text.split('\n').map(function (node) {
|
|
|
|
|
var matchIndentInNode = node.match(/^\s+/);
|
|
|
|
|
if (matchIndentInNode === null) {
|
|
|
|
|
return node;
|
|
|
|
|
}
|
|
|
|
|
var _matchIndentInNode = slicedToArray_default()(matchIndentInNode, 1),
|
|
|
|
|
indentInNode = _matchIndentInNode[0];
|
|
|
|
|
if (indentInNode.length >= indentToCode.length) {
|
|
|
|
|
return node.slice(indentToCode.length);
|
|
|
|
|
}
|
|
|
|
|
return node;
|
|
|
|
|
}).join('\n');
|
|
|
|
|
}
|
|
|
|
|
//兼容之前的 ##标题式写法
|
|
|
|
|
var toc = [];
|
|
|
|
|
var ctx = ["<ul>"];
|
|
|
|
|
var renderer = new (marked_default()).Renderer();
|
|
|
|
|
var headingRegex = /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;
|
|
|
|
|
function cleanToc() {
|
|
|
|
|
toc.length = 0;
|
|
|
|
|
ctx = ["<ul>"];
|
|
|
|
|
}
|
|
|
|
|
var lines = {
|
|
|
|
|
overflow: "hidden",
|
|
|
|
|
WebkitBoxOrient: "vertical",
|
|
|
|
|
display: "-webkit-box",
|
|
|
|
|
WebkitLineClamp: 2
|
|
|
|
|
};
|
|
|
|
|
function buildToc(coll, k, level, ctx) {
|
|
|
|
|
if (k >= coll.length || coll[k].level <= level) {
|
|
|
|
|
return k;
|
|
|
|
|
}
|
|
|
|
|
var node = coll[k];
|
|
|
|
|
ctx.push("<li><a href='#" + node.anchor + "'>" + node.text + "</a>");
|
|
|
|
|
k++;
|
|
|
|
|
var childCtx = [];
|
|
|
|
|
k = buildToc(coll, k, node.level, childCtx);
|
|
|
|
|
if (childCtx.length > 0) {
|
|
|
|
|
ctx.push("<ul>");
|
|
|
|
|
childCtx.forEach(function (idm) {
|
|
|
|
|
ctx.push(idm);
|
|
|
|
|
});
|
|
|
|
|
ctx.push("</ul>");
|
|
|
|
|
}
|
|
|
|
|
ctx.push("</li>");
|
|
|
|
|
k = buildToc(coll, k, level, ctx);
|
|
|
|
|
return k;
|
|
|
|
|
}
|
|
|
|
|
function getTocContent() {
|
|
|
|
|
buildToc(toc, 0, 0, ctx);
|
|
|
|
|
ctx.push("</ul>");
|
|
|
|
|
return ctx.join("");
|
|
|
|
|
}
|
|
|
|
|
var tokenizer = {
|
|
|
|
|
heading: function heading(src) {
|
|
|
|
|
var cap = headingRegex.exec(src);
|
|
|
|
|
if (cap) {
|
|
|
|
|
return {
|
|
|
|
|
type: 'heading',
|
|
|
|
|
raw: cap[0],
|
|
|
|
|
depth: cap[1].length,
|
|
|
|
|
text: cap[2]
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
fences: function fences(src) {
|
|
|
|
|
var cap = this.rules.block.fences.exec(src);
|
|
|
|
|
if (cap) {
|
|
|
|
|
var raw = cap[0];
|
|
|
|
|
var text = indentCodeCompensation(raw, cap[3] || '');
|
|
|
|
|
var lang = cap[2] ? cap[2].trim() : cap[2];
|
|
|
|
|
if (['latex', 'katex', 'math'].indexOf(lang) >= 0) {
|
|
|
|
|
var id = next_id();
|
|
|
|
|
var expression = text;
|
|
|
|
|
text = id;
|
|
|
|
|
math_expressions[id] = {
|
|
|
|
|
type: 'block',
|
|
|
|
|
expression: expression
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
return {
|
|
|
|
|
type: 'code',
|
|
|
|
|
raw: raw,
|
|
|
|
|
lang: lang,
|
|
|
|
|
text: text
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
var latexRegex = /(?:\${2})([^\n`]+?)(?:\${2})/gi;
|
|
|
|
|
var katex_count = 0;
|
|
|
|
|
var next_id = function next_id() {
|
|
|
|
|
return "__special_katext_id_".concat(katex_count++, "__");
|
|
|
|
|
};
|
|
|
|
|
var math_expressions = {};
|
|
|
|
|
function getMathExpressions() {
|
|
|
|
|
return math_expressions;
|
|
|
|
|
}
|
|
|
|
|
function resetMathExpressions() {
|
|
|
|
|
katex_count = 0;
|
|
|
|
|
math_expressions = {};
|
|
|
|
|
}
|
|
|
|
|
function replace_math_with_ids(text) {
|
|
|
|
|
text = text.replace(latexRegex, function (_match, expression) {
|
|
|
|
|
var id = next_id();
|
|
|
|
|
math_expressions[id] = {
|
|
|
|
|
type: 'inline',
|
|
|
|
|
expression: expression
|
|
|
|
|
};
|
|
|
|
|
return id;
|
|
|
|
|
});
|
|
|
|
|
return text;
|
|
|
|
|
}
|
|
|
|
|
var original_listitem = renderer.listitem;
|
|
|
|
|
renderer.listitem = function (text) {
|
|
|
|
|
return original_listitem(replace_math_with_ids(text));
|
|
|
|
|
};
|
|
|
|
|
var original_paragraph = renderer.paragraph;
|
|
|
|
|
renderer.paragraph = function (text) {
|
|
|
|
|
return original_paragraph(replace_math_with_ids(text));
|
|
|
|
|
};
|
|
|
|
|
var original_tablecell = renderer.tablecell;
|
|
|
|
|
renderer.tablecell = function (content, flags) {
|
|
|
|
|
return original_tablecell(replace_math_with_ids(content), flags);
|
|
|
|
|
};
|
|
|
|
|
renderer.code = function (code, infostring, escaped) {
|
|
|
|
|
var lang = (infostring || '').match(/\S*/)[0];
|
|
|
|
|
if (!lang) {
|
|
|
|
|
return '<pre class="prettyprint linenums"><code>' + (escaped ? code : (0,helpers.escape)(code, true)) + '</code></pre>';
|
|
|
|
|
}
|
|
|
|
|
if (['latex', 'katex', 'math'].indexOf(lang) >= 0) {
|
|
|
|
|
return "<p class='editormd-tex'>".concat(code, "</p>");
|
|
|
|
|
} else {
|
|
|
|
|
return "<pre class=\"prettyprint linenums\"><code class=\"language-".concat(infostring, "\">").concat(escaped ? code : (0,helpers.escape)(code, true), "</code></pre>\n");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
renderer.heading = function (text, level, raw) {
|
|
|
|
|
var anchor = this.options.headerPrefix + raw.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g, '-');
|
|
|
|
|
toc.push({
|
|
|
|
|
anchor: anchor,
|
|
|
|
|
level: level,
|
|
|
|
|
text: text
|
|
|
|
|
});
|
|
|
|
|
return '<h' + level + ' id="' + anchor + '">' + text + '</h' + level + '>';
|
|
|
|
|
};
|
|
|
|
|
marked_default().setOptions({
|
|
|
|
|
silent: true,
|
|
|
|
|
gfm: true,
|
|
|
|
|
pedantic: false
|
|
|
|
|
});
|
|
|
|
|
marked_default().use({
|
|
|
|
|
tokenizer: tokenizer,
|
|
|
|
|
renderer: renderer
|
|
|
|
|
});
|
|
|
|
|
/* harmony default export */ var utils_marked = ((marked_default()));
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/code-prettify/src/prettify.js
|
|
|
|
|
var prettify = __webpack_require__(86966);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/hls.js/dist/hls.js
|
|
|
|
|
var dist_hls = __webpack_require__(36144);
|
|
|
|
|
var hls_default = /*#__PURE__*/__webpack_require__.n(dist_hls);
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
|
|
var env = __webpack_require__(59758);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/katex/dist/katex.js
|
|
|
|
|
var katex = __webpack_require__(78673);
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/PreviewAll/index.tsx + 1 modules
|
|
|
|
|
var PreviewAll = __webpack_require__(36579);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
|
|
var jsx_runtime = __webpack_require__(50107);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/components/RenderHtml/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var preRegex = /<pre[^>]*>/g;
|
|
|
|
|
function _unescape(str) {
|
|
|
|
|
var div = document.createElement('div');
|
|
|
|
|
div.innerHTML = str;
|
|
|
|
|
return div.childNodes.length === 0 ? '' : div.childNodes[0].nodeValue;
|
|
|
|
|
}
|
|
|
|
|
/* harmony default export */ var RenderHtml = (function (_ref) {
|
|
|
|
|
var _ref$value = _ref.value,
|
|
|
|
|
value = _ref$value === void 0 ? '' : _ref$value,
|
|
|
|
|
className = _ref.className,
|
|
|
|
|
showTextOnly = _ref.showTextOnly,
|
|
|
|
|
showLines = _ref.showLines,
|
|
|
|
|
_ref$style = _ref.style,
|
|
|
|
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
|
|
|
_ref$stylesPrev = _ref.stylesPrev,
|
|
|
|
|
stylesPrev = _ref$stylesPrev === void 0 ? {} : _ref$stylesPrev;
|
|
|
|
|
var str = String(value);
|
|
|
|
|
var _useState = (0,react.useState)(""),
|
|
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
|
|
data = _useState2[0],
|
|
|
|
|
setData = _useState2[1];
|
|
|
|
|
var _useState3 = (0,react.useState)("office"),
|
|
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
|
|
type = _useState4[0],
|
|
|
|
|
setType = _useState4[1];
|
|
|
|
|
var html = (0,react.useMemo)(function () {
|
|
|
|
|
try {
|
|
|
|
|
var reg = /\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g;
|
|
|
|
|
var reg2 = /\"\/api\/attachments\/|\"\/attachments\/download\//g;
|
|
|
|
|
var reg3 = /\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;
|
|
|
|
|
str = str.replace(reg, "(" + env/* default.API_SERVER */.Z.API_SERVER + "/api/attachments/").replace(reg2, '"' + env/* default.API_SERVER */.Z.API_SERVER + "/api/attachments/").replace(reg3, '"' + env/* default.API_SERVER */.Z.API_SERVER + "/files/uploads/").replaceAll("http://video.educoder", "https://video.educoder").replaceAll("http://www.educoder.net/api", "https://data.educoder.net/api").replaceAll("https://www.educoder.net/api", "https://data.educoder.net/api").replace(/\r\n/g, "\n");
|
|
|
|
|
// str = str.replace(new RegExp("(?<!\\n)\\n(?!\\n)", "g"), " \n")
|
|
|
|
|
} catch (e) {}
|
|
|
|
|
;
|
|
|
|
|
var rs = utils_marked(str);
|
|
|
|
|
var math_expressions = getMathExpressions();
|
|
|
|
|
if (str.match(/\[TOC\]/)) {
|
|
|
|
|
rs = rs.replace('<p>[TOC]</p>', getTocContent());
|
|
|
|
|
cleanToc();
|
|
|
|
|
}
|
|
|
|
|
rs = rs.replace(/(__special_katext_id_\d+__)/g, function (_match, capture) {
|
|
|
|
|
var _math_expressions$cap = math_expressions[capture],
|
|
|
|
|
type = _math_expressions$cap.type,
|
|
|
|
|
expression = _math_expressions$cap.expression;
|
|
|
|
|
return (0,katex.renderToString)(_unescape(expression) || '', {
|
|
|
|
|
displayMode: type === 'block',
|
|
|
|
|
throwOnError: false,
|
|
|
|
|
output: 'html'
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
rs = rs.replace(/▁/g, '▁▁▁');
|
|
|
|
|
resetMathExpressions();
|
|
|
|
|
// return dompurify.sanitize(rs)
|
|
|
|
|
if (showTextOnly) {
|
|
|
|
|
var dom = document.createElement('div');
|
|
|
|
|
dom.innerHTML = rs;
|
|
|
|
|
return dom.innerText;
|
|
|
|
|
}
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
return onLoad();
|
|
|
|
|
}, 500);
|
|
|
|
|
return rs;
|
|
|
|
|
}, [str]);
|
|
|
|
|
var el = (0,react.useRef)();
|
|
|
|
|
lines.WebkitLineClamp = showLines;
|
|
|
|
|
if (showLines) {
|
|
|
|
|
style = objectSpread2_default()(objectSpread2_default()({}, style), lines);
|
|
|
|
|
}
|
|
|
|
|
function onAncherHandler(e) {
|
|
|
|
|
var target = e.target;
|
|
|
|
|
if (target.tagName.toUpperCase() === 'A') {
|
|
|
|
|
var ancher = target.getAttribute('href');
|
|
|
|
|
if (ancher.indexOf("office") > -1) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
setData(ancher);
|
|
|
|
|
setType("office");
|
|
|
|
|
} else if (ancher.indexOf("application/pdf") > -1) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
setData(ancher);
|
|
|
|
|
setType("pdf");
|
|
|
|
|
} else if (ancher.indexOf("text/html") > -1) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
setData(ancher);
|
|
|
|
|
setType("html");
|
|
|
|
|
} else if (ancher.startsWith('#')) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
var viewEl = document.getElementById(ancher.replace('#', ''));
|
|
|
|
|
if (viewEl) {
|
|
|
|
|
viewEl.scrollIntoView(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
var onLoad = function onLoad() {
|
|
|
|
|
var _el$current;
|
|
|
|
|
var videoElement = (_el$current = el.current) === null || _el$current === void 0 ? void 0 : _el$current.querySelectorAll('video');
|
|
|
|
|
videoElement === null || videoElement === void 0 ? void 0 : videoElement.forEach(function (item) {
|
|
|
|
|
item.oncontextmenu = function () {
|
|
|
|
|
return false;
|
|
|
|
|
};
|
|
|
|
|
if (item.src.indexOf('.m3u8') > -1) {
|
|
|
|
|
if (item.canPlayType('application/vnd.apple.mpegurl')) {} else if (hls_default().isSupported()) {
|
|
|
|
|
var hls = new (hls_default())();
|
|
|
|
|
hls.loadSource(item.src);
|
|
|
|
|
hls.attachMedia(item);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
(0,react.useEffect)(function () {
|
|
|
|
|
if (el.current && html) {
|
|
|
|
|
if (html.match(preRegex)) {
|
|
|
|
|
window.PR.prettyPrint();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (el.current) {
|
|
|
|
|
el.current.addEventListener('click', onAncherHandler);
|
|
|
|
|
return function () {
|
|
|
|
|
var _el$current2;
|
|
|
|
|
(_el$current2 = el.current) === null || _el$current2 === void 0 ? void 0 : _el$current2.removeEventListener('click', onAncherHandler);
|
|
|
|
|
resetMathExpressions();
|
|
|
|
|
cleanToc();
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}, [html, el.current, onAncherHandler]);
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
ref: el,
|
|
|
|
|
style: objectSpread2_default()({}, style),
|
|
|
|
|
className: "".concat(className ? className : '', " markdown-body "),
|
|
|
|
|
dangerouslySetInnerHTML: {
|
|
|
|
|
__html: html
|
|
|
|
|
}
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(PreviewAll/* default */.Z, {
|
|
|
|
|
close: true,
|
|
|
|
|
data: data,
|
|
|
|
|
type: !!(data !== null && data !== void 0 && data.length) ? type : "",
|
|
|
|
|
style: objectSpread2_default()({}, stylesPrev),
|
|
|
|
|
onClose: function onClose() {
|
|
|
|
|
return setData("");
|
|
|
|
|
}
|
|
|
|
|
})]
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 68063:
|
|
|
|
|
/*!********************************************************!*\
|
|
|
|
|
!*** ./src/pages/IntrainCourse/index.tsx + 14 modules ***!
|
|
|
|
|
@ -73,7 +618,7 @@ var react = __webpack_require__(978);
|
|
|
|
|
var _umi_production_exports = __webpack_require__(88275);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/IntrainCourse/index.less?modules
|
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
/* harmony default export */ var IntrainCoursemodules = ({"flex_box_center":"flex_box_center___Mk6YD","flex_space_between":"flex_space_between___MZT3e","flex_box_vertical_center":"flex_box_vertical_center___l2tif","flex_box_center_end":"flex_box_center_end___KdCKH","flex_box_column":"flex_box_column___zGqWK","TopTitle":"TopTitle___NtQws","TopName":"TopName____juq8","BannerComponent":"BannerComponent___cA8Rz","Swiper":"Swiper___WCEkn","BannerListItemDiv":"BannerListItemDiv___i6OHa","BannerListItem":"BannerListItem___WRjxL","BannerListItemImg":"BannerListItemImg___VST7T","BannerListItemInfo":"BannerListItemInfo___Maz5j","BannerListItemInfoTitle":"BannerListItemInfoTitle___NbUj7","BannerListItemInfoTeacher":"BannerListItemInfoTeacher___adanB","BannerListItemInfoRate":"BannerListItemInfoRate___Iiz8R","span":"span___Q5aOf","BannerListItemInfoTime":"BannerListItemInfoTime___hGPBk","countdown":"countdown___yDGAq","timeprice":"timeprice___r1rB5","But":"But___n8EMs","span1":"span1___c81QL","ButStyles":"ButStyles___g4vAm","order":"order___T1t73","study":"study___O8gTF","PrevNext":"PrevNext___hsSaR","buttonStyle":"buttonStyle___QfHso","LeftButton":"LeftButton___xv8Cd","RightButton":"RightButton___CCgMW","AllCourse":"AllCourse___XLXVP","AllCourseTop":"AllCourseTop___ra4rb","ButList":"ButList___JDlsR","icon":"icon___VoVSC","Select":"Select___PmCfz","clear":"clear___DtGmH","Search":"Search___nX6r4","AllCourseCent":"AllCourseCent___tr2ln","AllCourseCentLeft":"AllCourseCentLeft___CKuX4","AllCourseCentLeftItem":"AllCourseCentLeftItem___lqiIv","AllCourseCentLeftItemName":"AllCourseCentLeftItemName___Uz0_G","checkboxDiv":"checkboxDiv___ttZ2D","checkboxDivClose":"checkboxDivClose___pLnfq","checkbox":"checkbox___sKZ1f","AllCourseCentRight":"AllCourseCentRight___PvNud","AllCourseCentRightItem":"AllCourseCentRightItem___HZtBN","AllCourseCentRightItemLeft":"AllCourseCentRightItemLeft___ppfeb","AllCourseCentRightItemCent":"AllCourseCentRightItemCent___QH6kE","AllCourseCentRightItemCentTitle":"AllCourseCentRightItemCentTitle___MkSs3","AllCourseCentRightItemCentIntro":"AllCourseCentRightItemCentIntro___AaW2U","AllCourseCentRightItemCentTeacher":"AllCourseCentRightItemCentTeacher___K9JM9","AllCourseCentRightItemCentRate":"AllCourseCentRightItemCentRate___nvP_8","AllCourseCentRightItemCentNum":"AllCourseCentRightItemCentNum___NdRPW","AllCourseCentRightItemRight":"AllCourseCentRightItemRight___oc_it","AllCourseCentRightItemRightPrice":"AllCourseCentRightItemRightPrice___dliDz","AllCourseCentRightItemRightAll":"AllCourseCentRightItemRightAll___OeRQn","AllStyles":"AllStyles___zTjGA","one":"one___iLZWS","span2":"span2___iCDNr","two":"two___Xhngl","Pagination":"Pagination___qKPNH","UserReview":"UserReview___KmjLd","UserReviewInfo":"UserReviewInfo___FQdRQ","UserReviewWords":"UserReviewWords___ByZG7","body":"body___CgzAR","BannerList":"BannerList___UAlhX","BannerDiv":"BannerDiv___Y_iJx","Banner":"Banner___pjKbp","Cent":"Cent___ISiU9","InfoDiv":"InfoDiv___HPQcD","infoStyle":"infoStyle___XrEMW","Img":"Img___h9Y_0","Info":"Info___UCa4P","Info1":"Info1___jkSAI","Info2":"Info2___ye3YF","userInfoDiv":"userInfoDiv___UJuyG","Detailed":"Detailed___WSFSZ","CustomTags":"CustomTags___fDxDW","centNavDiv":"centNavDiv___J7CEL","centNavDivOpen":"centNavDivOpen___S9xEP","centNav":"centNav___jBalL","centNavActive":"centNavActive___j2oo_","OpenClose":"OpenClose___pb09k","OpenIcon":"OpenIcon___bVCdt","CloseIcon":"CloseIcon___SI85g","FixeRight":"FixeRight___YVyTP","FixeAbout":"FixeAbout___vzDzf","FixeInfo":"FixeInfo___GOZo3","Qrcode":"Qrcode___p1quP","FixeRightOpen":"FixeRightOpen___qALtO"});
|
|
|
|
|
/* harmony default export */ var IntrainCoursemodules = ({"flex_box_center":"flex_box_center___Mk6YD","flex_space_between":"flex_space_between___MZT3e","flex_box_vertical_center":"flex_box_vertical_center___l2tif","flex_box_center_end":"flex_box_center_end___KdCKH","flex_box_column":"flex_box_column___zGqWK","AllButStyle":"AllButStyle___nZyt2","ButStyles":"ButStyles___g4vAm","order":"order___T1t73","study":"study___O8gTF","studyActive":"studyActive____XjIl","TopTitle":"TopTitle___NtQws","TopName":"TopName____juq8","BannerComponent":"BannerComponent___cA8Rz","Swiper":"Swiper___WCEkn","BannerListItemDiv":"BannerListItemDiv___i6OHa","BannerListItem":"BannerListItem___WRjxL","BannerListItemImg":"BannerListItemImg___VST7T","BannerListItemInfo":"BannerListItemInfo___Maz5j","BannerListItemInfoTitle":"BannerListItemInfoTitle___NbUj7","BannerListItemInfoTeacher":"BannerListItemInfoTeacher___adanB","BannerListItemInfoRate":"BannerListItemInfoRate___Iiz8R","span":"span___Q5aOf","BannerListItemInfoTime":"BannerListItemInfoTime___hGPBk","countdown":"countdown___yDGAq","timeprice":"timeprice___r1rB5","But":"But___n8EMs","span1":"span1___c81QL","PrevNext":"PrevNext___hsSaR","buttonStyle":"buttonStyle___QfHso","LeftButton":"LeftButton___xv8Cd","RightButton":"RightButton___CCgMW","AllCourse":"AllCourse___XLXVP","AllCourseTop":"AllCourseTop___ra4rb","ButList":"ButList___JDlsR","icon":"icon___VoVSC","Select":"Select___PmCfz","clear":"clear___DtGmH","Search":"Search___nX6r4","AllCourseCent":"AllCourseCent___tr2ln","AllCourseCentLeft":"AllCourseCentLeft___CKuX4","AllCourseCentLeftItem":"AllCourseCentLeftItem___lqiIv","AllCourseCentLeftItemName":"AllCourseCentLeftItemName___Uz0_G","checkboxDiv":"checkboxDiv___ttZ2D","checkboxDivClose":"checkboxDivClose___pLnfq","checkbox":"checkbox___sKZ1f","AllCourseCentRight":"AllCourseCentRight___PvNud","AllCourseCentRightItem":"AllCourseCentRightItem___HZtBN","AllCourseCentRightItemLeft":"AllCourseCentRightItemLeft___ppfeb","AllCourseCentRightItemCent":"AllCourseCentRightItemCent___QH6kE","AllCourseCentRightItemCentTitle":"AllCourseCentRightItemCentTitle___MkSs3","AllCourseCentRightItemCentIntro":"AllCourseCentRightItemCentIntro___AaW2U","topicTitle":"topicTitle___XNbLV","AllCourseCentRightItemCentTeacher":"AllCourseCentRightItemCentTeacher___K9JM9","AllCourseCentRightItemCentRate":"AllCourseCentRightItemCentRate___nvP_8","AllCourseCentRightItemCentNum":"AllCourseCentRightItemCentNum___NdRPW","AllStyles":"AllStyles___zTjGA","AllCourseCentRightItemRight":"AllCourseCentRightItemRight___oc_it","PriceStyles":"PriceStyles___elfNF","OriginPrice":"OriginPrice___g_WQa","IsDiscount":"IsDiscount___nm8g9","IsDiscountPrice":"IsDiscountPrice___vcPDt","IsDiscountCountdown":"IsDiscountCountdown___ED5GI","span2":"span2___iCDNr","IsDiscountOriginPrice":"IsDiscountOriginPrice___dHu5H","two":"two___Xhngl","Pagination":"Pagination___qKPNH","UserReview":"UserReview___KmjLd","UserReviewInfo":"UserReviewInfo___FQdRQ","UserReviewWords":"UserReviewWords___ByZG7","body":"body___CgzAR","BannerList":"BannerList___UAlhX","BannerDiv":"BannerDiv___Y_iJx","Banner":"Banner___pjKbp","Cent":"Cent___ISiU9","InfoDiv":"InfoDiv___HPQcD","infoStyle":"infoStyle___XrEMW","Img":"Img___h9Y_0","Info":"Info___UCa4P","Info1":"Info1___jkSAI","Info2":"Info2___ye3YF","userInfoDiv":"userInfoDiv___UJuyG","Detailed":"Detailed___WSFSZ","CustomTags":"CustomTags___fDxDW","centNavDiv":"centNavDiv___J7CEL","centNavDivOpen":"centNavDivOpen___S9xEP","centNav":"centNav___jBalL","centNavActive":"centNavActive___j2oo_","OpenClose":"OpenClose___pb09k","OpenIcon":"OpenIcon___bVCdt","CloseIcon":"CloseIcon___SI85g","FixeRight":"FixeRight___YVyTP","FixeAbout":"FixeAbout___vzDzf","FixeInfo":"FixeInfo___GOZo3","Qrcode":"Qrcode___p1quP","FixeRightOpen":"FixeRightOpen___qALtO"});
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/LeftOutlined.js
|
|
|
|
|
var LeftOutlined = __webpack_require__(86521);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/RightOutlined.js
|
|
|
|
|
@ -143,6 +688,8 @@ var tx_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAq
|
|
|
|
|
var verifyLogin = __webpack_require__(72551);
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
|
|
var fetch = __webpack_require__(84519);
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
|
|
|
|
|
var RenderHtml = __webpack_require__(12768);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
|
|
var jsx_runtime = __webpack_require__(50107);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/IntrainCourse/index.tsx
|
|
|
|
|
@ -181,6 +728,7 @@ var jsx_runtime = __webpack_require__(50107);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TopTitle = function TopTitle(_ref) {
|
|
|
|
|
@ -445,7 +993,7 @@ var IntrainCoursePage = function IntrainCoursePage(_ref2) {
|
|
|
|
|
className: IntrainCoursemodules.BannerListItemInfoRate,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
className: IntrainCoursemodules.span,
|
|
|
|
|
children: item.averge_star
|
|
|
|
|
children: item.averge_star.toFixed(1)
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(rate/* default */.Z, {
|
|
|
|
|
style: {
|
|
|
|
|
color: '#E59819',
|
|
|
|
|
@ -454,7 +1002,7 @@ var IntrainCoursePage = function IntrainCoursePage(_ref2) {
|
|
|
|
|
},
|
|
|
|
|
allowHalf: true,
|
|
|
|
|
disabled: true,
|
|
|
|
|
defaultValue: parseFloat(item.averge_star)
|
|
|
|
|
value: item.averge_star || 0
|
|
|
|
|
})]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.BannerListItemInfoTime,
|
|
|
|
|
@ -482,11 +1030,11 @@ var IntrainCoursePage = function IntrainCoursePage(_ref2) {
|
|
|
|
|
className: IntrainCoursemodules.span1,
|
|
|
|
|
children: [item.learn_count / 10000 > 1 ? (item.learn_count / 10000).toFixed(1) + 'W' : item.learn_count, "\u4EBA\u6B63\u5728\u5B66"]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
|
|
|
className: "".concat(item.user_paid_subject ? IntrainCoursemodules.study : IntrainCoursemodules.order),
|
|
|
|
|
className: "".concat(item.user_paid_subject ? IntrainCoursemodules.study : IntrainCoursemodules.order, " ").concat(item.user_paid_subject ? item.progress.current == 0 ? '' : IntrainCoursemodules.studyActive : ''),
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
item.user_paid_subject ? _umi_production_exports.history.push("/paths/".concat(item.identifier)) : handleImmediatelyPay(item.identifier);
|
|
|
|
|
},
|
|
|
|
|
children: item.user_paid_subject ? item.is_free ? '开始学习' : '继续学习' : '立即购买'
|
|
|
|
|
children: item.user_paid_subject ? item.progress.current == 0 ? '开始学习' : '继续学习' : '立即购买'
|
|
|
|
|
})]
|
|
|
|
|
})]
|
|
|
|
|
})
|
|
|
|
|
@ -530,7 +1078,7 @@ var IntrainCoursePage = function IntrainCoursePage(_ref2) {
|
|
|
|
|
className: IntrainCoursemodules.BannerListItemInfoRate,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
className: IntrainCoursemodules.span,
|
|
|
|
|
children: item.averge_star
|
|
|
|
|
children: item.averge_star.toFixed(1)
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(rate/* default */.Z, {
|
|
|
|
|
style: {
|
|
|
|
|
color: '#E59819',
|
|
|
|
|
@ -539,7 +1087,7 @@ var IntrainCoursePage = function IntrainCoursePage(_ref2) {
|
|
|
|
|
},
|
|
|
|
|
allowHalf: true,
|
|
|
|
|
disabled: true,
|
|
|
|
|
defaultValue: item.averge_star
|
|
|
|
|
value: item.averge_star || 0
|
|
|
|
|
})]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.BannerListItemInfoTime,
|
|
|
|
|
@ -567,11 +1115,11 @@ var IntrainCoursePage = function IntrainCoursePage(_ref2) {
|
|
|
|
|
className: IntrainCoursemodules.span1,
|
|
|
|
|
children: [item.learn_count / 10000 > 1 ? (item.learn_count / 10000).toFixed(1) + 'W' : item.learn_count, "\u4EBA\u6B63\u5728\u5B66"]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
|
|
|
className: "".concat(item.user_paid_subject ? IntrainCoursemodules.study : IntrainCoursemodules.order),
|
|
|
|
|
className: "".concat(item.user_paid_subject ? IntrainCoursemodules.study : IntrainCoursemodules.order, "\n ").concat(item.user_paid_subject ? item.progress.current == 0 ? '' : IntrainCoursemodules.studyActive : ''),
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
item.user_paid_subject ? _umi_production_exports.history.push("/paths/".concat(item.identifier)) : handleImmediatelyPay(item.identifier);
|
|
|
|
|
},
|
|
|
|
|
children: item.user_paid_subject ? item.is_free ? '开始学习' : '继续学习' : '立即购买'
|
|
|
|
|
children: item.user_paid_subject ? item.progress.current == 0 ? '开始学习' : '继续学习' : '立即购买'
|
|
|
|
|
})]
|
|
|
|
|
})]
|
|
|
|
|
})
|
|
|
|
|
@ -1033,17 +1581,16 @@ var IntrainCoursePage = function IntrainCoursePage(_ref2) {
|
|
|
|
|
width: '100%'
|
|
|
|
|
},
|
|
|
|
|
children: (_intraincourse$Subjec = intraincourse.SubjectList.list) === null || _intraincourse$Subjec === void 0 ? void 0 : _intraincourse$Subjec.map(function (item, index) {
|
|
|
|
|
console.log(parseFloat(item.averge_star));
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
style: {
|
|
|
|
|
position: 'relative'
|
|
|
|
|
},
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: IntrainCoursemodules.AllCourseCentRightItem,
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
return _umi_production_exports.history.push("/paths/".concat(item.identifier));
|
|
|
|
|
},
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
style: {
|
|
|
|
|
flex: '1',
|
|
|
|
|
display: 'flex'
|
|
|
|
|
@ -1056,17 +1603,23 @@ var IntrainCoursePage = function IntrainCoursePage(_ref2) {
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.AllCourseCentRightItemCent,
|
|
|
|
|
style: {
|
|
|
|
|
maxWidth: "".concat(leftNavSate ? '530px' : '680px')
|
|
|
|
|
maxWidth: "".concat(leftNavSate ? '500px' : '680px')
|
|
|
|
|
},
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
|
|
title: item.name,
|
|
|
|
|
placement: "topLeft",
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: IntrainCoursemodules.AllCourseCentRightItemCentTitle,
|
|
|
|
|
children: item.name
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: IntrainCoursemodules.AllCourseCentRightItemCentIntro,
|
|
|
|
|
children: item.description
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
|
|
showLines: 1,
|
|
|
|
|
className: IntrainCoursemodules.topicTitle,
|
|
|
|
|
showTextOnly: true,
|
|
|
|
|
value: item.description || ''
|
|
|
|
|
}, 1)
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.AllCourseCentRightItemCentTeacher,
|
|
|
|
|
children: ["\u8BB2\u5E08\uFF1A", item.teacher]
|
|
|
|
|
@ -1074,7 +1627,7 @@ var IntrainCoursePage = function IntrainCoursePage(_ref2) {
|
|
|
|
|
className: IntrainCoursemodules.AllCourseCentRightItemCentRate,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
className: IntrainCoursemodules.span,
|
|
|
|
|
children: item.averge_star
|
|
|
|
|
children: item.averge_star.toFixed(1)
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(rate/* default */.Z, {
|
|
|
|
|
style: {
|
|
|
|
|
color: '#E59819',
|
|
|
|
|
@ -1083,44 +1636,49 @@ var IntrainCoursePage = function IntrainCoursePage(_ref2) {
|
|
|
|
|
},
|
|
|
|
|
allowHalf: true,
|
|
|
|
|
disabled: true,
|
|
|
|
|
defaultValue: item.averge_star
|
|
|
|
|
value: item.averge_star || 0
|
|
|
|
|
})]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.AllCourseCentRightItemCentNum,
|
|
|
|
|
children: [item.subject_statics.shixun_count > 0 ? item.subject_statics.shixun_count + '个项目实战' : '', item.subject_statics.stages_count > 0 ? '·' + item.subject_statics.stages_count + '个课程章节' : '', item.subject_statics.shixun_challeng_count > 0 ? '·' + item.subject_statics.shixun_challeng_count + '个实践关卡' : '', item.subject_statics.video_items_count > 0 ? '·' + item.subject_statics.video_items_count + '节视频' : '']
|
|
|
|
|
children: [item.subject_statics.shixun_count > 0 ? item.subject_statics.shixun_count + '个项目实战·' : '', item.subject_statics.stages_count > 0 ? item.subject_statics.stages_count + '个课程章节·' : '', item.subject_statics.shixun_challeng_count > 0 ? item.subject_statics.shixun_challeng_count + '个实践关卡·' : '', item.subject_statics.video_items_count > 0 ? item.subject_statics.video_items_count + '节视频' : '']
|
|
|
|
|
})]
|
|
|
|
|
})]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.AllCourseCentRightItemRight,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.AllCourseCentRightItemRightPrice,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
|
|
children: ["\uFFE5", item.is_discount ? item.price : item.origin_price]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("del", {
|
|
|
|
|
style: {
|
|
|
|
|
display: "".concat(item.is_discount ? 'block' : 'none')
|
|
|
|
|
},
|
|
|
|
|
children: item.origin_price
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.AllCourseCentRightItemRight,
|
|
|
|
|
children: [item.user_paid_subject ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.two,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(progress/* default */.Z, {
|
|
|
|
|
style: {
|
|
|
|
|
width: '100%'
|
|
|
|
|
},
|
|
|
|
|
percent: item.progress.current / item.progress.total * 100,
|
|
|
|
|
strokeWidth: 6,
|
|
|
|
|
showInfo: false,
|
|
|
|
|
strokeColor: '#FCD78F'
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.span2,
|
|
|
|
|
children: ["\u5B66\u4E60\u81F3", /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
|
|
children: ["\u7B2C", ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'][item.progress.current], "\u7AE0"]
|
|
|
|
|
})]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: IntrainCoursemodules.AllCourseCentRightItemRightAll,
|
|
|
|
|
children: item.user_paid_subject ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.two,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(progress/* default */.Z, {
|
|
|
|
|
percent: item.progress.current / item.progress.total * 100,
|
|
|
|
|
strokeWidth: 6,
|
|
|
|
|
showInfo: false,
|
|
|
|
|
strokeColor: '#FCD78F'
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.span2,
|
|
|
|
|
children: ["\u5B66\u4E60\u81F3", /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
|
|
children: ["\u7B2C", ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'][item.progress.current], "\u7AE0"]
|
|
|
|
|
})]
|
|
|
|
|
})]
|
|
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: item.is_discount ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.IsDiscount,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.IsDiscountPrice,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
|
|
children: ["\uFFE5", item.is_discount ? item.price : item.origin_price]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("del", {
|
|
|
|
|
style: {
|
|
|
|
|
display: "".concat(item.is_discount && item.countdown ? 'block' : 'none')
|
|
|
|
|
},
|
|
|
|
|
children: item.origin_price
|
|
|
|
|
})]
|
|
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.one,
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.IsDiscountCountdown,
|
|
|
|
|
style: {
|
|
|
|
|
opacity: "".concat(item.countdown ? '1' : '0')
|
|
|
|
|
display: "".concat(item.countdown ? 'block' : 'none')
|
|
|
|
|
},
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: IntrainCoursemodules.span1,
|
|
|
|
|
@ -1129,24 +1687,26 @@ var IntrainCoursePage = function IntrainCoursePage(_ref2) {
|
|
|
|
|
className: IntrainCoursemodules.span2,
|
|
|
|
|
children: item.countdown
|
|
|
|
|
})]
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
style: {
|
|
|
|
|
height: '65px'
|
|
|
|
|
}
|
|
|
|
|
})]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.IsDiscountOriginPrice,
|
|
|
|
|
style: {
|
|
|
|
|
display: "".concat(item.countdown ? 'none' : 'block')
|
|
|
|
|
},
|
|
|
|
|
children: ["\u8BFE\u7A0B\u539F\u4EF7\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsxs)("del", {
|
|
|
|
|
children: ["\uFFE5", item.origin_price]
|
|
|
|
|
})]
|
|
|
|
|
})]
|
|
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: IntrainCoursemodules.OriginPrice,
|
|
|
|
|
children: ["\uFFE5", item.origin_price]
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
|
|
|
className: "".concat(item.user_paid_subject ? IntrainCoursemodules.study : IntrainCoursemodules.order, "\n ").concat(item.user_paid_subject ? item.progress.current == 0 ? '' : IntrainCoursemodules.studyActive : ''),
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
item.user_paid_subject ? _umi_production_exports.history.push("/paths/".concat(item.identifier)) : handleImmediatelyPay(item.identifier);
|
|
|
|
|
},
|
|
|
|
|
children: item.user_paid_subject ? item.progress.current == 0 ? '开始学习' : '继续学习' : '立即购买'
|
|
|
|
|
})]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
|
|
|
style: {
|
|
|
|
|
position: 'absolute',
|
|
|
|
|
bottom: '45px',
|
|
|
|
|
right: '35px'
|
|
|
|
|
},
|
|
|
|
|
className: "".concat(item.user_paid_subject ? IntrainCoursemodules.study : IntrainCoursemodules.order),
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
item.user_paid_subject ? _umi_production_exports.history.push("/paths/".concat(item.identifier)) : handleImmediatelyPay(item.identifier);
|
|
|
|
|
},
|
|
|
|
|
children: item.user_paid_subject ? item.progress.current == 0 ? '开始学习' : '继续学习' : '立即购买'
|
|
|
|
|
})]
|
|
|
|
|
}, index);
|
|
|
|
|
})
|
|
|
|
|
@ -1162,7 +1722,7 @@ var IntrainCoursePage = function IntrainCoursePage(_ref2) {
|
|
|
|
|
getAllCourse();
|
|
|
|
|
},
|
|
|
|
|
defaultPageSize: allParamet.per_page,
|
|
|
|
|
defaultCurrent: allParamet.page,
|
|
|
|
|
defaultCurrent: 1,
|
|
|
|
|
current: allParamet.page
|
|
|
|
|
})]
|
|
|
|
|
})]
|