parent
1a3f62c6f5
commit
0ecb787cc4
@ -1,689 +0,0 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[8761],{
|
||||
|
||||
/***/ 8761:
|
||||
/*!******************************************************************!*\
|
||||
!*** ./src/pages/Broadcast/Detail/Comment/index.tsx + 2 modules ***!
|
||||
\******************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ Detail_Comment; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
|
||||
var regeneratorRuntime = __webpack_require__(7557);
|
||||
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
||||
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
|
||||
var toConsumableArray = __webpack_require__(37205);
|
||||
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
||||
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
|
||||
var objectSpread2 = __webpack_require__(82242);
|
||||
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
||||
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
||||
var asyncToGenerator = __webpack_require__(41498);
|
||||
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
||||
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
||||
var slicedToArray = __webpack_require__(79800);
|
||||
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
||||
var _umi_production_exports = __webpack_require__(88271);
|
||||
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.5.2@@ant-design/icons/es/icons/DeleteOutlined.js + 1 modules
|
||||
var DeleteOutlined = __webpack_require__(72295);
|
||||
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
||||
var env = __webpack_require__(69423);
|
||||
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.13@dayjs/dayjs.min.js
|
||||
var dayjs_min = __webpack_require__(61186);
|
||||
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
||||
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
|
||||
var markdown_editor = __webpack_require__(92042);
|
||||
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 2 modules
|
||||
var RenderHtml = __webpack_require__(85681);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
||||
var row = __webpack_require__(95237);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
|
||||
var col = __webpack_require__(43604);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
||||
var tooltip = __webpack_require__(6848);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
||||
var modal = __webpack_require__(43418);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
||||
var es_button = __webpack_require__(3113);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
||||
var message = __webpack_require__(8591);
|
||||
;// CONCATENATED MODULE: ./src/pages/Broadcast/Detail/Comment/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var Commentmodules = ({"flex_box_center":"flex_box_center___WsCNU","flex_space_between":"flex_space_between___uZefC","flex_box_vertical_center":"flex_box_vertical_center___oeaqU","flex_box_center_end":"flex_box_center_end___Y_NIe","flex_box_column":"flex_box_column___vEzjr","flex-col":"flex-col___H2Yz1","flex-row":"flex-row___hdXq3","justify-start":"justify-start___WxuPc","justify-center":"justify-center___XXszm","justify-end":"justify-end___WW0dX","justify-evenly":"justify-evenly___NGNtS","justify-around":"justify-around___SjV22","justify-between":"justify-between___aV8hv","align-start":"align-start___xWhD2","align-center":"align-center___n3s5n","align-end":"align-end___qf9eE","reply":"reply___jQQCK","replyList":"replyList___Ph7Kb","comment":"comment___PoJdF","content":"content___H9Z7I","commentItem":"commentItem___e0KUK","commentParItem":"commentParItem___xvW_0","submitStyle":"submitStyle___gMFsC"});
|
||||
// EXTERNAL MODULE: ./src/service/forums.ts
|
||||
var forums = __webpack_require__(35891);
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
||||
var jsx_runtime = __webpack_require__(37712);
|
||||
;// CONCATENATED MODULE: ./src/pages/Broadcast/Detail/Comment/components/Second.tsx
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
dayjs_min_default().locale("ZH-cn");
|
||||
function second(_ref) {
|
||||
var user = _ref.user,
|
||||
_ref$vlist = _ref.vlist,
|
||||
vlist = _ref$vlist === void 0 ? [] : _ref$vlist,
|
||||
dispatch = _ref.dispatch,
|
||||
params = _ref.params,
|
||||
id = _ref.id,
|
||||
memo_replies = _ref.memo_replies,
|
||||
forumsDetail = _ref.forumsDetail;
|
||||
return /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
||||
className: Commentmodules.comment,
|
||||
children: vlist.map(function (val, key) {
|
||||
var _user$userInfo, _user$userInfo2;
|
||||
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
||||
className: Commentmodules.commentItem,
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
||||
span: 24,
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
||||
flex: "1",
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
||||
href: "/users/".concat(val.user_login),
|
||||
target: "_blank",
|
||||
style: {
|
||||
color: '#9096A3',
|
||||
fontSize: '12px'
|
||||
},
|
||||
children: val === null || val === void 0 ? void 0 : val.username
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
||||
style: {
|
||||
color: '#9096A3',
|
||||
fontSize: '12px',
|
||||
marginLeft: '10px'
|
||||
},
|
||||
children: val.time
|
||||
})]
|
||||
}), (val.can_delete || val.user_id === ((_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.user_id) || val.user_login === ((_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.login)) && /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
||||
className: "forums-comment-delete",
|
||||
style: {
|
||||
display: 'none'
|
||||
},
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
||||
title: "\u5220\u9664",
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsx)(DeleteOutlined/* default */.Z, {
|
||||
className: "current",
|
||||
onClick: function onClick() {
|
||||
modal/* default */.Z.confirm({
|
||||
centered: true,
|
||||
width: 530,
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
title: '提示',
|
||||
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
||||
className: "font16 tc",
|
||||
children: "\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"
|
||||
}),
|
||||
onOk: function () {
|
||||
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
||||
var res, filterData;
|
||||
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
||||
while (1) switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
_context.next = 2;
|
||||
return (0,forums/* deleteForums */.sW)({
|
||||
id: val.id,
|
||||
memo_type: 'broadcast'
|
||||
});
|
||||
case 2:
|
||||
res = _context.sent;
|
||||
filterData = memo_replies.find(function (x) {
|
||||
return x.id === id;
|
||||
}).children.filter(function (y) {
|
||||
return y.id !== val.id;
|
||||
});
|
||||
memo_replies.find(function (x) {
|
||||
return x.id === id;
|
||||
}).children = filterData;
|
||||
dispatch({
|
||||
type: 'forumsDetail/setForumsDetailData',
|
||||
payload: objectSpread2_default()(objectSpread2_default()({}, forumsDetail.forumsDetailData), {}, {
|
||||
memo_replies: toConsumableArray_default()(memo_replies),
|
||||
memo_type: 'broadcast'
|
||||
})
|
||||
});
|
||||
case 6:
|
||||
case "end":
|
||||
return _context.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
function onOk() {
|
||||
return _onOk.apply(this, arguments);
|
||||
}
|
||||
return onOk;
|
||||
}()
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
})]
|
||||
})
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
||||
value: val.content,
|
||||
style: {
|
||||
color: '#232B40',
|
||||
fontSize: '14px'
|
||||
}
|
||||
})
|
||||
})]
|
||||
}, key);
|
||||
})
|
||||
});
|
||||
}
|
||||
/* harmony default export */ var Second = (second);
|
||||
// EXTERNAL MODULE: ./src/utils/util.tsx
|
||||
var util = __webpack_require__(95972);
|
||||
;// CONCATENATED MODULE: ./src/pages/Broadcast/Detail/Comment/index.tsx
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
dayjs_min_default().locale("ZH-cn");
|
||||
var Comment = function Comment(_ref, ref) {
|
||||
var user = _ref.user,
|
||||
forumsDetail = _ref.forumsDetail,
|
||||
globalSetting = _ref.globalSetting,
|
||||
loading = _ref.loading,
|
||||
dispatch = _ref.dispatch,
|
||||
handleClick = _ref.handleClick,
|
||||
memoId = _ref.memoId;
|
||||
var _ref2 = forumsDetail.forumsDetailData || {},
|
||||
memo = _ref2.memo,
|
||||
memo_replies = _ref2.memo_replies;
|
||||
var params = (0,_umi_production_exports.useParams)();
|
||||
var _useState = (0,_react_17_0_2_react.useState)(''),
|
||||
_useState2 = slicedToArray_default()(_useState, 2),
|
||||
value = _useState2[0],
|
||||
setValue = _useState2[1];
|
||||
var _useState3 = (0,_react_17_0_2_react.useState)(''),
|
||||
_useState4 = slicedToArray_default()(_useState3, 2),
|
||||
childValue = _useState4[0],
|
||||
setChildValue = _useState4[1];
|
||||
var _useState5 = (0,_react_17_0_2_react.useState)(-1),
|
||||
_useState6 = slicedToArray_default()(_useState5, 2),
|
||||
showItemReply = _useState6[0],
|
||||
setShowItemReply = _useState6[1];
|
||||
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
||||
_useState8 = slicedToArray_default()(_useState7, 2),
|
||||
hasMore = _useState8[0],
|
||||
setHasMore = _useState8[1];
|
||||
var _useState9 = (0,_react_17_0_2_react.useState)(false),
|
||||
_useState10 = slicedToArray_default()(_useState9, 2),
|
||||
isMdFouch = _useState10[0],
|
||||
setIsMdFouch = _useState10[1];
|
||||
var _useState11 = (0,_react_17_0_2_react.useState)(1),
|
||||
_useState12 = slicedToArray_default()(_useState11, 2),
|
||||
page = _useState12[0],
|
||||
setPage = _useState12[1];
|
||||
(0,_react_17_0_2_react.useEffect)(function () {
|
||||
setHasMore((memo === null || memo === void 0 ? void 0 : memo.replies_count) > 10);
|
||||
}, [memo === null || memo === void 0 ? void 0 : memo.replies_count]);
|
||||
(0,_react_17_0_2_react.useEffect)(function () {
|
||||
dispatch({
|
||||
type: 'forumsDetail/getForumsDetailData',
|
||||
payload: {
|
||||
id: memoId,
|
||||
memo_type: 'broadcast'
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
var handeGetMoreData = /*#__PURE__*/function () {
|
||||
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
||||
var currentPage, res, _res$memo_replies;
|
||||
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
||||
while (1) switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
currentPage = page + 1;
|
||||
setPage(currentPage);
|
||||
_context.next = 4;
|
||||
return (0,forums/* getMoreReply */.z5)({
|
||||
id: memoId,
|
||||
page: currentPage,
|
||||
memo_type: 'broadcast'
|
||||
});
|
||||
case 4:
|
||||
res = _context.sent;
|
||||
if (res !== null && res !== void 0 && res.memo_replies) {
|
||||
dispatch({
|
||||
type: 'forumsDetail/setForumsDetailData',
|
||||
payload: objectSpread2_default()(objectSpread2_default()({}, forumsDetail.forumsDetailData), {}, {
|
||||
memo_replies: [].concat(toConsumableArray_default()(memo_replies), toConsumableArray_default()(res.memo_replies))
|
||||
})
|
||||
});
|
||||
setHasMore(((_res$memo_replies = res.memo_replies) === null || _res$memo_replies === void 0 ? void 0 : _res$memo_replies.length) === 10);
|
||||
}
|
||||
case 6:
|
||||
case "end":
|
||||
return _context.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
return function handeGetMoreData() {
|
||||
return _ref3.apply(this, arguments);
|
||||
};
|
||||
}();
|
||||
var formatReplieData = function formatReplieData(data) {
|
||||
var _user$userInfo, _user$userInfo2, _user$userInfo3, _user$userInfo4;
|
||||
return objectSpread2_default()(objectSpread2_default()({}, data), {}, {
|
||||
image_url: (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.image_url,
|
||||
children: [],
|
||||
user_id: (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.user_id,
|
||||
user_login: (_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.login,
|
||||
username: (_user$userInfo4 = user.userInfo) === null || _user$userInfo4 === void 0 ? void 0 : _user$userInfo4.username,
|
||||
time: "".concat((0,util/* toTimeFormat */.li)((new Date().getTime() - new Date(data.created_at).getTime()) / 1000), "\u524D")
|
||||
});
|
||||
};
|
||||
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
||||
className: Commentmodules.wrap,
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
||||
children: ["\u5168\u90E8\u56DE\u590D(", (memo === null || memo === void 0 ? void 0 : memo.replies_count) || 0, ")"]
|
||||
}), !!(memo_replies !== null && memo_replies !== void 0 && memo_replies.length) && /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
||||
className: Commentmodules.content,
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
||||
className: Commentmodules.replyList,
|
||||
children: memo_replies === null || memo_replies === void 0 ? void 0 : memo_replies.map(function (v, k) {
|
||||
var _user$userInfo5, _user$userInfo6, _v$children;
|
||||
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
||||
gutter: [12, 12],
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
||||
flex: "40px",
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
||||
href: "/users/".concat(v.user_login),
|
||||
target: "_blank",
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
||||
alt: "\u7528\u6237\u5934\u50CF",
|
||||
width: "46",
|
||||
height: "46",
|
||||
src: "".concat(env/* default */.Z.IMG_SERVER, "/images/").concat(v === null || v === void 0 ? void 0 : v.image_url)
|
||||
})
|
||||
})
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
||||
flex: "1",
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
||||
align: "middle",
|
||||
className: Commentmodules.commentParItem,
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
||||
span: 24,
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
||||
flex: "1",
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
||||
href: "/users/".concat(v.user_login),
|
||||
target: "_blank",
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
||||
style: {
|
||||
color: '#9096A3',
|
||||
fontSize: '12px'
|
||||
},
|
||||
children: v === null || v === void 0 ? void 0 : v.username
|
||||
})
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
||||
style: {
|
||||
color: '#9096A3',
|
||||
fontSize: '12px',
|
||||
marginLeft: '10px'
|
||||
},
|
||||
children: v.time
|
||||
})]
|
||||
}), (v.can_delete || v.user_id === ((_user$userInfo5 = user.userInfo) === null || _user$userInfo5 === void 0 ? void 0 : _user$userInfo5.user_id) || v.user_login === ((_user$userInfo6 = user.userInfo) === null || _user$userInfo6 === void 0 ? void 0 : _user$userInfo6.login)) && /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
||||
className: "forums-comment-par-delete",
|
||||
style: {
|
||||
display: 'none'
|
||||
},
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
||||
title: "\u5220\u9664",
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsx)(DeleteOutlined/* default */.Z, {
|
||||
className: "current",
|
||||
onClick: function onClick() {
|
||||
modal/* default */.Z.confirm({
|
||||
centered: true,
|
||||
width: 530,
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
title: '提示',
|
||||
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
||||
className: "font16 tc",
|
||||
children: "\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"
|
||||
}),
|
||||
onOk: function () {
|
||||
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
||||
var res, filterData;
|
||||
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
||||
while (1) switch (_context2.prev = _context2.next) {
|
||||
case 0:
|
||||
_context2.next = 2;
|
||||
return (0,forums/* deleteForums */.sW)({
|
||||
id: v.id,
|
||||
memo_type: 'broadcast'
|
||||
});
|
||||
case 2:
|
||||
res = _context2.sent;
|
||||
filterData = memo_replies.filter(function (y) {
|
||||
return y.id !== v.id;
|
||||
});
|
||||
dispatch({
|
||||
type: 'forumsDetail/setForumsDetailData',
|
||||
payload: objectSpread2_default()(objectSpread2_default()({}, forumsDetail.forumsDetailData), {}, {
|
||||
memo_replies: toConsumableArray_default()(filterData),
|
||||
memo_type: 'broadcast'
|
||||
})
|
||||
});
|
||||
case 5:
|
||||
case "end":
|
||||
return _context2.stop();
|
||||
}
|
||||
}, _callee2);
|
||||
}));
|
||||
function onOk() {
|
||||
return _onOk.apply(this, arguments);
|
||||
}
|
||||
return onOk;
|
||||
}()
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
})]
|
||||
})
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
||||
span: 24,
|
||||
style: {
|
||||
marginTop: '5px'
|
||||
},
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
||||
onClick: handleClick,
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
||||
value: v.content,
|
||||
style: {
|
||||
color: '#232B40',
|
||||
fontSize: '14px'
|
||||
}
|
||||
})
|
||||
})
|
||||
}), !!(v !== null && v !== void 0 && (_v$children = v.children) !== null && _v$children !== void 0 && _v$children.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(Second, {
|
||||
user: user,
|
||||
id: v === null || v === void 0 ? void 0 : v.id,
|
||||
vlist: v === null || v === void 0 ? void 0 : v.children,
|
||||
dispatch: dispatch,
|
||||
params: params,
|
||||
memo_replies: memo_replies,
|
||||
forumsDetail: forumsDetail
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
||||
span: 24,
|
||||
className: "mt5 c-light-black",
|
||||
children: showItemReply === k ? /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
||||
onChange: function onChange(v) {
|
||||
setChildValue(v);
|
||||
},
|
||||
height: 150,
|
||||
isFocus: true,
|
||||
placeholder: "\u6211\u8981\u56DE\u590D..."
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
||||
span: 24,
|
||||
className: "tr",
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
||||
type: "primary",
|
||||
size: 'middle',
|
||||
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
||||
var res;
|
||||
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
||||
while (1) switch (_context3.prev = _context3.next) {
|
||||
case 0:
|
||||
if (!(childValue === '')) {
|
||||
_context3.next = 4;
|
||||
break;
|
||||
}
|
||||
message/* default */.ZP.error('请输入内容');
|
||||
_context3.next = 9;
|
||||
break;
|
||||
case 4:
|
||||
_context3.next = 6;
|
||||
return (0,forums/* reply */.ts)({
|
||||
parent_id: v.id,
|
||||
content: childValue,
|
||||
memo_type: 'broadcast'
|
||||
});
|
||||
case 6:
|
||||
res = _context3.sent;
|
||||
setChildValue(null);
|
||||
if (res) {
|
||||
setShowItemReply(-1);
|
||||
memo_replies.find(function (x) {
|
||||
return x.id === res.parent_id;
|
||||
}).children.push(formatReplieData(res));
|
||||
dispatch({
|
||||
type: 'forumsDetail/setForumsDetailData',
|
||||
payload: objectSpread2_default()(objectSpread2_default()({}, forumsDetail.forumsDetailData), {}, {
|
||||
memo: objectSpread2_default()(objectSpread2_default()({}, memo), {}, {
|
||||
replies_count: (memo === null || memo === void 0 ? void 0 : memo.replies_count) + 1
|
||||
}),
|
||||
memo_replies: toConsumableArray_default()(memo_replies),
|
||||
memo_type: 'broadcast'
|
||||
})
|
||||
});
|
||||
}
|
||||
case 9:
|
||||
case "end":
|
||||
return _context3.stop();
|
||||
}
|
||||
}, _callee3);
|
||||
})),
|
||||
children: "\u53D1\u9001"
|
||||
})
|
||||
})
|
||||
})]
|
||||
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
||||
className: "tr",
|
||||
style: {
|
||||
textAlign: 'right'
|
||||
},
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
||||
className: "iconfont icon-xiaopinglun mr30 current font14",
|
||||
onClick: function onClick() {
|
||||
return setShowItemReply(k);
|
||||
}
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
||||
title: v.user_praise ? "取消点赞" : "点赞",
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
||||
className: v.user_praise ? "c-orange" : "c-gery-888",
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
||||
className: "iconfont icon-dianzan4 current font14",
|
||||
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
||||
var res;
|
||||
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
||||
while (1) switch (_context4.prev = _context4.next) {
|
||||
case 0:
|
||||
_context4.next = 2;
|
||||
return (0,forums/* like */.vL)({
|
||||
id: v.id,
|
||||
container_type: 'Memo',
|
||||
type: v.user_praise ? 0 : 1,
|
||||
memo_type: 'broadcast'
|
||||
});
|
||||
case 2:
|
||||
res = _context4.sent;
|
||||
if ((res === null || res === void 0 ? void 0 : res.praise_count) >= 0) {
|
||||
memo_replies.find(function (x) {
|
||||
return x.id === v.id;
|
||||
}).user_praise = !v.user_praise;
|
||||
memo_replies.find(function (x) {
|
||||
return x.id === v.id;
|
||||
}).praise_count = res === null || res === void 0 ? void 0 : res.praise_count;
|
||||
dispatch({
|
||||
type: 'forumsDetail/setForumsDetailData',
|
||||
payload: objectSpread2_default()(objectSpread2_default()({}, forumsDetail.forumsDetailData), {}, {
|
||||
memo_replies: toConsumableArray_default()(memo_replies),
|
||||
memo_type: 'broadcast'
|
||||
})
|
||||
});
|
||||
}
|
||||
case 4:
|
||||
case "end":
|
||||
return _context4.stop();
|
||||
}
|
||||
}, _callee4);
|
||||
}))
|
||||
}), v.praise_count > 0 ? v.praise_count : '']
|
||||
})
|
||||
})]
|
||||
})
|
||||
})]
|
||||
})
|
||||
})]
|
||||
}, k);
|
||||
})
|
||||
})
|
||||
}), hasMore && /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
||||
className: "bg-white pb20",
|
||||
style: {
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
marginTop: '20px'
|
||||
},
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
||||
justify: "space-between",
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
||||
children: hasMore && /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
||||
style: {
|
||||
color: '#3061D0',
|
||||
fontSize: '14px'
|
||||
},
|
||||
onClick: handeGetMoreData,
|
||||
children: ["\u67E5\u770B\u66F4\u591A\u8BC4\u8BBA", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
||||
className: "icon icon-zhankaixiaojiantou ",
|
||||
style: {
|
||||
fontSize: '10px',
|
||||
marginLeft: '3px'
|
||||
}
|
||||
})]
|
||||
})
|
||||
})]
|
||||
})
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
||||
className: Commentmodules.reply,
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
||||
onBlur: function onBlur() {
|
||||
return setIsMdFouch(false);
|
||||
},
|
||||
isFocus: isMdFouch,
|
||||
defaultValue: value,
|
||||
id: "writeForumsReviewId",
|
||||
onChange: function onChange(v) {
|
||||
setValue(v);
|
||||
},
|
||||
placeholder: "\u6211\u8981\u56DE\u590D...",
|
||||
height: 240
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
||||
flex: "1"
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
||||
className: Commentmodules.submitStyle,
|
||||
style: {
|
||||
width: '60px',
|
||||
height: '32px',
|
||||
textAlign: 'center'
|
||||
},
|
||||
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
||||
var res;
|
||||
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
||||
while (1) switch (_context5.prev = _context5.next) {
|
||||
case 0:
|
||||
if (!(value === '')) {
|
||||
_context5.next = 4;
|
||||
break;
|
||||
}
|
||||
message/* default */.ZP.error('请输入内容');
|
||||
_context5.next = 9;
|
||||
break;
|
||||
case 4:
|
||||
_context5.next = 6;
|
||||
return (0,forums/* reply */.ts)({
|
||||
parent_id: memo === null || memo === void 0 ? void 0 : memo.id,
|
||||
content: value,
|
||||
memo_type: 'broadcast'
|
||||
});
|
||||
case 6:
|
||||
res = _context5.sent;
|
||||
setValue(null);
|
||||
if (res) {
|
||||
dispatch({
|
||||
type: 'forumsDetail/setForumsDetailData',
|
||||
payload: objectSpread2_default()(objectSpread2_default()({}, forumsDetail.forumsDetailData), {}, {
|
||||
memo: objectSpread2_default()(objectSpread2_default()({}, memo), {}, {
|
||||
replies_count: (memo === null || memo === void 0 ? void 0 : memo.replies_count) + 1
|
||||
}),
|
||||
memo_replies: [formatReplieData(res)].concat(toConsumableArray_default()(memo_replies)),
|
||||
memo_type: 'broadcast'
|
||||
})
|
||||
});
|
||||
}
|
||||
case 9:
|
||||
case "end":
|
||||
return _context5.stop();
|
||||
}
|
||||
}, _callee5);
|
||||
})),
|
||||
children: "\u53D1\u9001"
|
||||
})
|
||||
})]
|
||||
})]
|
||||
})]
|
||||
});
|
||||
};
|
||||
/* harmony default export */ var Detail_Comment = ((0,_umi_production_exports.connect)(function (_ref7) {
|
||||
var user = _ref7.user,
|
||||
forumsDetail = _ref7.forumsDetail,
|
||||
loading = _ref7.loading,
|
||||
globalSetting = _ref7.globalSetting;
|
||||
return {
|
||||
user: user,
|
||||
forumsDetail: forumsDetail,
|
||||
globalSetting: globalSetting,
|
||||
loading: loading.models.forumsDetail
|
||||
};
|
||||
}, null, null, {
|
||||
forwardRef: true
|
||||
})( /*#__PURE__*/(0,_react_17_0_2_react.forwardRef)(Comment)));
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue