systemrobotassistant 3.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of systemrobotassistant might be problematic. Click here for more details.

Files changed (369) hide show
  1. package/.eslintignore +6 -0
  2. package/.eslintrc +45 -0
  3. package/.gitlab-ci.yml +52 -0
  4. package/.lecprc.ts +76 -0
  5. package/.yarnrc +1 -0
  6. package/CHANGELOG.md +114 -0
  7. package/README.md +14 -0
  8. package/custom-amd-plugin.ts +46 -0
  9. package/es/component/answer-itme/index.d.ts +20 -0
  10. package/es/component/answer-itme/index.d.ts.map +1 -0
  11. package/es/component/answer-itme/index.js +41 -0
  12. package/es/component/answer-itme/style.css +35 -0
  13. package/es/component/data-container/index.d.ts +19 -0
  14. package/es/component/data-container/index.d.ts.map +1 -0
  15. package/es/component/data-container/index.js +37 -0
  16. package/es/component/data-container/style.css +26 -0
  17. package/es/component/days-tab/index.d.ts +6 -0
  18. package/es/component/days-tab/index.d.ts.map +1 -0
  19. package/es/component/days-tab/index.js +119 -0
  20. package/es/component/days-tab/style.css +43 -0
  21. package/es/component/days-tab/utils.d.ts +32 -0
  22. package/es/component/days-tab/utils.d.ts.map +1 -0
  23. package/es/component/days-tab/utils.js +98 -0
  24. package/es/component/error-boundary/index.d.ts +2 -0
  25. package/es/component/error-boundary/index.d.ts.map +1 -0
  26. package/es/component/error-boundary/index.js +33 -0
  27. package/es/component/it-notice-modal/columns.d.ts +11 -0
  28. package/es/component/it-notice-modal/columns.d.ts.map +1 -0
  29. package/es/component/it-notice-modal/columns.js +108 -0
  30. package/es/component/it-notice-modal/double-tab.d.ts +6 -0
  31. package/es/component/it-notice-modal/double-tab.d.ts.map +1 -0
  32. package/es/component/it-notice-modal/double-tab.js +94 -0
  33. package/es/component/it-notice-modal/index.d.ts +6 -0
  34. package/es/component/it-notice-modal/index.d.ts.map +1 -0
  35. package/es/component/it-notice-modal/index.js +488 -0
  36. package/es/component/it-notice-modal/server.d.ts +8 -0
  37. package/es/component/it-notice-modal/server.d.ts.map +1 -0
  38. package/es/component/it-notice-modal/server.js +43 -0
  39. package/es/component/it-notice-modal/single-tab.d.ts +6 -0
  40. package/es/component/it-notice-modal/single-tab.d.ts.map +1 -0
  41. package/es/component/it-notice-modal/single-tab.js +82 -0
  42. package/es/component/it-notice-modal/style.css +301 -0
  43. package/es/component/it-notice-modal/utils.d.ts +2 -0
  44. package/es/component/it-notice-modal/utils.d.ts.map +1 -0
  45. package/es/component/it-notice-modal/utils.js +8 -0
  46. package/es/component/it-notice-tab/index.d.ts +6 -0
  47. package/es/component/it-notice-tab/index.d.ts.map +1 -0
  48. package/es/component/it-notice-tab/index.js +206 -0
  49. package/es/component/it-notice-tab/server.d.ts +3 -0
  50. package/es/component/it-notice-tab/server.d.ts.map +1 -0
  51. package/es/component/it-notice-tab/server.js +13 -0
  52. package/es/component/it-notice-tab/style.css +103 -0
  53. package/es/component/mail-list-modal/index.d.ts +2 -0
  54. package/es/component/mail-list-modal/index.d.ts.map +1 -0
  55. package/es/component/mail-list-modal/index.js +306 -0
  56. package/es/component/mail-list-modal/server.d.ts +7 -0
  57. package/es/component/mail-list-modal/server.d.ts.map +1 -0
  58. package/es/component/mail-list-modal/server.js +38 -0
  59. package/es/component/mail-list-modal/style.css +132 -0
  60. package/es/component/myself-chat-card/index.d.ts +15 -0
  61. package/es/component/myself-chat-card/index.d.ts.map +1 -0
  62. package/es/component/myself-chat-card/index.js +25 -0
  63. package/es/component/myself-chat-card/style.css +22 -0
  64. package/es/component/need-answer/index.d.ts +15 -0
  65. package/es/component/need-answer/index.d.ts.map +1 -0
  66. package/es/component/need-answer/index.js +60 -0
  67. package/es/component/need-answer/style.css +19 -0
  68. package/es/component/opppsition-chat-card/index.d.ts +11 -0
  69. package/es/component/opppsition-chat-card/index.d.ts.map +1 -0
  70. package/es/component/opppsition-chat-card/index.js +25 -0
  71. package/es/component/opppsition-chat-card/style.css +23 -0
  72. package/es/component/question-library/index.d.ts +10 -0
  73. package/es/component/question-library/index.d.ts.map +1 -0
  74. package/es/component/question-library/index.js +291 -0
  75. package/es/component/question-library/server.d.ts +4 -0
  76. package/es/component/question-library/server.d.ts.map +1 -0
  77. package/es/component/question-library/server.js +19 -0
  78. package/es/component/question-library/style.css +75 -0
  79. package/es/component/question-tag/index.d.ts +11 -0
  80. package/es/component/question-tag/index.d.ts.map +1 -0
  81. package/es/component/question-tag/index.js +23 -0
  82. package/es/component/question-tag/style.css +12 -0
  83. package/es/component/recommend-questions-card/index.d.ts +10 -0
  84. package/es/component/recommend-questions-card/index.d.ts.map +1 -0
  85. package/es/component/recommend-questions-card/index.js +104 -0
  86. package/es/component/recommend-questions-card/style.css +54 -0
  87. package/es/component/scroll-view/index.d.ts +3 -0
  88. package/es/component/scroll-view/index.d.ts.map +1 -0
  89. package/es/component/scroll-view/index.js +2 -0
  90. package/es/component/scroll-view/scroll-view.d.ts +18 -0
  91. package/es/component/scroll-view/scroll-view.d.ts.map +1 -0
  92. package/es/component/scroll-view/scroll-view.js +66 -0
  93. package/es/component/scroll-view/style.css +34 -0
  94. package/es/component/tab/index.d.ts +2 -0
  95. package/es/component/tab/index.d.ts.map +1 -0
  96. package/es/component/tab/index.js +18 -0
  97. package/es/component/tab/style.css +26 -0
  98. package/es/component/tips-answer/index.d.ts +15 -0
  99. package/es/component/tips-answer/index.d.ts.map +1 -0
  100. package/es/component/tips-answer/index.js +28 -0
  101. package/es/component/tips-answer/style.css +10 -0
  102. package/es/images/expire-robot.svg +16 -0
  103. package/es/images/pc-invalid.svg +11 -0
  104. package/es/images/screenshot-5.png +0 -0
  105. package/es/index.d.ts +92 -0
  106. package/es/index.d.ts.map +1 -0
  107. package/es/index.js +506 -0
  108. package/es/js/const.d.ts +41 -0
  109. package/es/js/const.d.ts.map +1 -0
  110. package/es/js/const.js +46 -0
  111. package/es/js/gen-render-promise.d.ts +9 -0
  112. package/es/js/gen-render-promise.d.ts.map +1 -0
  113. package/es/js/gen-render-promise.js +30 -0
  114. package/es/js/get-time.d.ts +15 -0
  115. package/es/js/get-time.d.ts.map +1 -0
  116. package/es/js/get-time.js +35 -0
  117. package/es/js/hfc-space.d.ts +16 -0
  118. package/es/js/hfc-space.d.ts.map +1 -0
  119. package/es/js/hfc-space.js +71 -0
  120. package/es/js/render-special.d.ts +16 -0
  121. package/es/js/render-special.d.ts.map +1 -0
  122. package/es/js/render-special.js +53 -0
  123. package/es/js/request/fetch.d.ts +10 -0
  124. package/es/js/request/fetch.d.ts.map +1 -0
  125. package/es/js/request/fetch.js +81 -0
  126. package/es/js/request/request.d.ts +3 -0
  127. package/es/js/request/request.d.ts.map +1 -0
  128. package/es/js/request/request.js +63 -0
  129. package/es/js/showMessage.d.ts +15 -0
  130. package/es/js/showMessage.d.ts.map +1 -0
  131. package/es/js/showMessage.js +75 -0
  132. package/es/js/state-immer.d.ts +3 -0
  133. package/es/js/state-immer.d.ts.map +1 -0
  134. package/es/js/state-immer.js +19 -0
  135. package/es/js/timer-executor.d.ts +3 -0
  136. package/es/js/timer-executor.d.ts.map +1 -0
  137. package/es/js/timer-executor.js +83 -0
  138. package/es/js/to-hfc.d.ts +2 -0
  139. package/es/js/to-hfc.d.ts.map +1 -0
  140. package/es/js/to-hfc.js +8 -0
  141. package/es/js/utils.d.ts +3 -0
  142. package/es/js/utils.d.ts.map +1 -0
  143. package/es/js/utils.js +11 -0
  144. package/es/jsx/chat-modal.d.ts +16 -0
  145. package/es/jsx/chat-modal.d.ts.map +1 -0
  146. package/es/jsx/chat-modal.js +268 -0
  147. package/es/server.d.ts +8 -0
  148. package/es/server.d.ts.map +1 -0
  149. package/es/server.js +44 -0
  150. package/es/style.css +174 -0
  151. package/lib/component/answer-itme/index.d.ts +20 -0
  152. package/lib/component/answer-itme/index.d.ts.map +1 -0
  153. package/lib/component/answer-itme/index.js +51 -0
  154. package/lib/component/answer-itme/style.css +35 -0
  155. package/lib/component/data-container/index.d.ts +19 -0
  156. package/lib/component/data-container/index.d.ts.map +1 -0
  157. package/lib/component/data-container/index.js +45 -0
  158. package/lib/component/data-container/style.css +26 -0
  159. package/lib/component/days-tab/index.d.ts +6 -0
  160. package/lib/component/days-tab/index.d.ts.map +1 -0
  161. package/lib/component/days-tab/index.js +129 -0
  162. package/lib/component/days-tab/style.css +43 -0
  163. package/lib/component/days-tab/utils.d.ts +32 -0
  164. package/lib/component/days-tab/utils.d.ts.map +1 -0
  165. package/lib/component/days-tab/utils.js +110 -0
  166. package/lib/component/error-boundary/index.d.ts +2 -0
  167. package/lib/component/error-boundary/index.d.ts.map +1 -0
  168. package/lib/component/error-boundary/index.js +40 -0
  169. package/lib/component/it-notice-modal/columns.d.ts +11 -0
  170. package/lib/component/it-notice-modal/columns.d.ts.map +1 -0
  171. package/lib/component/it-notice-modal/columns.js +116 -0
  172. package/lib/component/it-notice-modal/double-tab.d.ts +6 -0
  173. package/lib/component/it-notice-modal/double-tab.d.ts.map +1 -0
  174. package/lib/component/it-notice-modal/double-tab.js +104 -0
  175. package/lib/component/it-notice-modal/index.d.ts +6 -0
  176. package/lib/component/it-notice-modal/index.d.ts.map +1 -0
  177. package/lib/component/it-notice-modal/index.js +499 -0
  178. package/lib/component/it-notice-modal/server.d.ts +8 -0
  179. package/lib/component/it-notice-modal/server.d.ts.map +1 -0
  180. package/lib/component/it-notice-modal/server.js +55 -0
  181. package/lib/component/it-notice-modal/single-tab.d.ts +6 -0
  182. package/lib/component/it-notice-modal/single-tab.d.ts.map +1 -0
  183. package/lib/component/it-notice-modal/single-tab.js +92 -0
  184. package/lib/component/it-notice-modal/style.css +301 -0
  185. package/lib/component/it-notice-modal/utils.d.ts +2 -0
  186. package/lib/component/it-notice-modal/utils.d.ts.map +1 -0
  187. package/lib/component/it-notice-modal/utils.js +15 -0
  188. package/lib/component/it-notice-tab/index.d.ts +6 -0
  189. package/lib/component/it-notice-tab/index.d.ts.map +1 -0
  190. package/lib/component/it-notice-tab/index.js +216 -0
  191. package/lib/component/it-notice-tab/server.d.ts +3 -0
  192. package/lib/component/it-notice-tab/server.d.ts.map +1 -0
  193. package/lib/component/it-notice-tab/server.js +20 -0
  194. package/lib/component/it-notice-tab/style.css +103 -0
  195. package/lib/component/mail-list-modal/index.d.ts +2 -0
  196. package/lib/component/mail-list-modal/index.d.ts.map +1 -0
  197. package/lib/component/mail-list-modal/index.js +316 -0
  198. package/lib/component/mail-list-modal/server.d.ts +7 -0
  199. package/lib/component/mail-list-modal/server.d.ts.map +1 -0
  200. package/lib/component/mail-list-modal/server.js +50 -0
  201. package/lib/component/mail-list-modal/style.css +132 -0
  202. package/lib/component/myself-chat-card/index.d.ts +15 -0
  203. package/lib/component/myself-chat-card/index.d.ts.map +1 -0
  204. package/lib/component/myself-chat-card/index.js +35 -0
  205. package/lib/component/myself-chat-card/style.css +22 -0
  206. package/lib/component/need-answer/index.d.ts +15 -0
  207. package/lib/component/need-answer/index.d.ts.map +1 -0
  208. package/lib/component/need-answer/index.js +70 -0
  209. package/lib/component/need-answer/style.css +19 -0
  210. package/lib/component/opppsition-chat-card/index.d.ts +11 -0
  211. package/lib/component/opppsition-chat-card/index.d.ts.map +1 -0
  212. package/lib/component/opppsition-chat-card/index.js +35 -0
  213. package/lib/component/opppsition-chat-card/style.css +23 -0
  214. package/lib/component/question-library/index.d.ts +10 -0
  215. package/lib/component/question-library/index.d.ts.map +1 -0
  216. package/lib/component/question-library/index.js +301 -0
  217. package/lib/component/question-library/server.d.ts +4 -0
  218. package/lib/component/question-library/server.d.ts.map +1 -0
  219. package/lib/component/question-library/server.js +27 -0
  220. package/lib/component/question-library/style.css +75 -0
  221. package/lib/component/question-tag/index.d.ts +11 -0
  222. package/lib/component/question-tag/index.d.ts.map +1 -0
  223. package/lib/component/question-tag/index.js +33 -0
  224. package/lib/component/question-tag/style.css +12 -0
  225. package/lib/component/recommend-questions-card/index.d.ts +10 -0
  226. package/lib/component/recommend-questions-card/index.d.ts.map +1 -0
  227. package/lib/component/recommend-questions-card/index.js +114 -0
  228. package/lib/component/recommend-questions-card/style.css +54 -0
  229. package/lib/component/scroll-view/index.d.ts +3 -0
  230. package/lib/component/scroll-view/index.d.ts.map +1 -0
  231. package/lib/component/scroll-view/index.js +10 -0
  232. package/lib/component/scroll-view/scroll-view.d.ts +18 -0
  233. package/lib/component/scroll-view/scroll-view.d.ts.map +1 -0
  234. package/lib/component/scroll-view/scroll-view.js +76 -0
  235. package/lib/component/scroll-view/style.css +34 -0
  236. package/lib/component/tab/index.d.ts +2 -0
  237. package/lib/component/tab/index.d.ts.map +1 -0
  238. package/lib/component/tab/index.js +28 -0
  239. package/lib/component/tab/style.css +26 -0
  240. package/lib/component/tips-answer/index.d.ts +15 -0
  241. package/lib/component/tips-answer/index.d.ts.map +1 -0
  242. package/lib/component/tips-answer/index.js +38 -0
  243. package/lib/component/tips-answer/style.css +10 -0
  244. package/lib/images/expire-robot.svg +16 -0
  245. package/lib/images/pc-invalid.svg +11 -0
  246. package/lib/images/screenshot-5.png +0 -0
  247. package/lib/index.d.ts +92 -0
  248. package/lib/index.d.ts.map +1 -0
  249. package/lib/index.js +516 -0
  250. package/lib/js/const.d.ts +41 -0
  251. package/lib/js/const.d.ts.map +1 -0
  252. package/lib/js/const.js +55 -0
  253. package/lib/js/gen-render-promise.d.ts +9 -0
  254. package/lib/js/gen-render-promise.d.ts.map +1 -0
  255. package/lib/js/gen-render-promise.js +37 -0
  256. package/lib/js/get-time.d.ts +15 -0
  257. package/lib/js/get-time.d.ts.map +1 -0
  258. package/lib/js/get-time.js +43 -0
  259. package/lib/js/hfc-space.d.ts +16 -0
  260. package/lib/js/hfc-space.d.ts.map +1 -0
  261. package/lib/js/hfc-space.js +91 -0
  262. package/lib/js/render-special.d.ts +16 -0
  263. package/lib/js/render-special.d.ts.map +1 -0
  264. package/lib/js/render-special.js +61 -0
  265. package/lib/js/request/fetch.d.ts +10 -0
  266. package/lib/js/request/fetch.d.ts.map +1 -0
  267. package/lib/js/request/fetch.js +88 -0
  268. package/lib/js/request/request.d.ts +3 -0
  269. package/lib/js/request/request.d.ts.map +1 -0
  270. package/lib/js/request/request.js +71 -0
  271. package/lib/js/showMessage.d.ts +15 -0
  272. package/lib/js/showMessage.d.ts.map +1 -0
  273. package/lib/js/showMessage.js +83 -0
  274. package/lib/js/state-immer.d.ts +3 -0
  275. package/lib/js/state-immer.d.ts.map +1 -0
  276. package/lib/js/state-immer.js +27 -0
  277. package/lib/js/timer-executor.d.ts +3 -0
  278. package/lib/js/timer-executor.d.ts.map +1 -0
  279. package/lib/js/timer-executor.js +91 -0
  280. package/lib/js/to-hfc.d.ts +2 -0
  281. package/lib/js/to-hfc.d.ts.map +1 -0
  282. package/lib/js/to-hfc.js +14 -0
  283. package/lib/js/utils.d.ts +3 -0
  284. package/lib/js/utils.d.ts.map +1 -0
  285. package/lib/js/utils.js +19 -0
  286. package/lib/jsx/chat-modal.d.ts +16 -0
  287. package/lib/jsx/chat-modal.d.ts.map +1 -0
  288. package/lib/jsx/chat-modal.js +278 -0
  289. package/lib/server.d.ts +8 -0
  290. package/lib/server.d.ts.map +1 -0
  291. package/lib/server.js +58 -0
  292. package/lib/style.css +174 -0
  293. package/package.json +57 -0
  294. package/rct.config.js +8 -0
  295. package/src/component/answer-itme/index.jsx +64 -0
  296. package/src/component/answer-itme/style.less +37 -0
  297. package/src/component/data-container/index.jsx +45 -0
  298. package/src/component/data-container/style.less +27 -0
  299. package/src/component/days-tab/index.jsx +114 -0
  300. package/src/component/days-tab/style.less +55 -0
  301. package/src/component/days-tab/utils.js +87 -0
  302. package/src/component/error-boundary/index.jsx +39 -0
  303. package/src/component/it-notice-modal/columns.js +102 -0
  304. package/src/component/it-notice-modal/double-tab.jsx +83 -0
  305. package/src/component/it-notice-modal/index.jsx +404 -0
  306. package/src/component/it-notice-modal/server.js +43 -0
  307. package/src/component/it-notice-modal/single-tab.jsx +70 -0
  308. package/src/component/it-notice-modal/style.less +367 -0
  309. package/src/component/it-notice-modal/utils.js +8 -0
  310. package/src/component/it-notice-tab/index.jsx +196 -0
  311. package/src/component/it-notice-tab/server.js +14 -0
  312. package/src/component/it-notice-tab/style.less +120 -0
  313. package/src/component/mail-list-modal/index.jsx +270 -0
  314. package/src/component/mail-list-modal/server.js +38 -0
  315. package/src/component/mail-list-modal/style.less +154 -0
  316. package/src/component/myself-chat-card/index.jsx +27 -0
  317. package/src/component/myself-chat-card/style.less +30 -0
  318. package/src/component/need-answer/index.jsx +56 -0
  319. package/src/component/need-answer/style.less +21 -0
  320. package/src/component/opppsition-chat-card/index.jsx +25 -0
  321. package/src/component/opppsition-chat-card/style.less +33 -0
  322. package/src/component/question-library/index.jsx +316 -0
  323. package/src/component/question-library/server.js +19 -0
  324. package/src/component/question-library/style.less +102 -0
  325. package/src/component/question-tag/index.jsx +27 -0
  326. package/src/component/question-tag/style.less +15 -0
  327. package/src/component/recommend-questions-card/index.jsx +111 -0
  328. package/src/component/recommend-questions-card/style.less +66 -0
  329. package/src/component/scroll-view/index.js +3 -0
  330. package/src/component/scroll-view/scroll-view.jsx +74 -0
  331. package/src/component/scroll-view/style.less +37 -0
  332. package/src/component/tab/index.jsx +17 -0
  333. package/src/component/tab/style.less +26 -0
  334. package/src/component/tips-answer/index.jsx +38 -0
  335. package/src/component/tips-answer/style.less +11 -0
  336. package/src/images/expire-robot.svg +16 -0
  337. package/src/images/pc-invalid.svg +11 -0
  338. package/src/images/screenshot-5.png +0 -0
  339. package/src/index.jsx +554 -0
  340. package/src/js/const.js +48 -0
  341. package/src/js/gen-render-promise.js +32 -0
  342. package/src/js/get-time.js +35 -0
  343. package/src/js/hfc-space.js +91 -0
  344. package/src/js/render-special.js +64 -0
  345. package/src/js/request/fetch.js +87 -0
  346. package/src/js/request/request.js +74 -0
  347. package/src/js/showMessage.js +81 -0
  348. package/src/js/state-immer.js +12 -0
  349. package/src/js/timer-executor.js +37 -0
  350. package/src/js/to-hfc.js +9 -0
  351. package/src/js/utils.js +13 -0
  352. package/src/jsx/chat-modal.jsx +254 -0
  353. package/src/main.js +1 -0
  354. package/src/server.js +45 -0
  355. package/src/style.less +229 -0
  356. package/test/cases/case-01.assert.js +6 -0
  357. package/test/cases/case-01.source.jsx +17 -0
  358. package/test/cases/case-02.assert.js +6 -0
  359. package/test/cases/case-02.source.jsx +25 -0
  360. package/test/cases/case-02.style.less +15 -0
  361. package/test/cases/case-03.source.jsx +69 -0
  362. package/test/cases/case-03.style.less +3 -0
  363. package/tsconfig.json +48 -0
  364. package/typings.d.ts +5 -0
  365. package/umd/b415d90208c277ba3703.png +0 -0
  366. package/umd/index.css +1753 -0
  367. package/umd/index.js +36258 -0
  368. package/umd/index.min.css +1 -0
  369. package/umd/index.min.js +657 -0
@@ -0,0 +1,21 @@
1
+ .needAnswerContent {
2
+ font-weight: 400;
3
+ color: #35383D;
4
+ }
5
+
6
+ .needLink {
7
+ color: var(--primary-color,#1890ff) ;
8
+ font-weight: 400;
9
+
10
+ cursor: pointer;
11
+ }
12
+
13
+ .onSeekHlep {
14
+ color: var(--primary-color,#1890ff);
15
+ cursor: pointer;
16
+ }
17
+
18
+ .onDisabled {
19
+ color: #A5ACB8;
20
+ cursor: not-allowed;
21
+ }
@@ -0,0 +1,25 @@
1
+ import React, { memo } from 'react'
2
+ import classNames from 'classnames'
3
+ import Proptypes from 'prop-types'
4
+ import styles from './style.less'
5
+
6
+ const OppositionChatCard = memo((props) => {
7
+ const { children, noBorderRadius, isRecommendQuestions } = props
8
+ return (
9
+ <div className={styles.oppositionChatCardwrapper}>
10
+ <div className={classNames(styles.oppositionContentWrapper,
11
+ !noBorderRadius && styles.otherRadius, isRecommendQuestions && styles.isRecommendQuestions)}
12
+ >
13
+ {children}
14
+ </div>
15
+ </div>
16
+ )
17
+ })
18
+
19
+
20
+ OppositionChatCard.propTypes = {
21
+ children: Proptypes.element,
22
+ noBorderRadius: Proptypes.bool,
23
+ }
24
+
25
+ export default OppositionChatCard
@@ -0,0 +1,33 @@
1
+ .oppositionChatCardwrapper {
2
+
3
+
4
+ display: flex;
5
+ flex-direction: row;
6
+ overflow: hidden;
7
+
8
+ }
9
+
10
+ .oppositionContentWrapper {
11
+ max-width: 416px;
12
+
13
+ margin-top: 12px;
14
+
15
+ background-color: #fff;
16
+
17
+ padding: 10px 12px;
18
+ border: 1px solid #E0E4F3;
19
+
20
+ display: flex;
21
+ flex-direction: column;
22
+ }
23
+
24
+ .otherRadius {
25
+ border-radius: 0px 8px 8px 8px;
26
+ }
27
+
28
+ .isRecommendQuestions {
29
+ padding: 10px 12px 0;
30
+ box-shadow: 0px 1px 2px 0px rgba(25, 122, 250, 0.15);
31
+ border-radius: 8px;
32
+ width: 100%;
33
+ }
@@ -0,0 +1,316 @@
1
+ import React, { createRef, PureComponent } from 'react'
2
+ import { Button, Spin } from 'shineout'
3
+ import { Scrollbars } from 'react-custom-scrollbars'
4
+ import Icon from '@shein-components/Icon'
5
+ import getNow from '../../js/get-time'
6
+ import { debounce, getRandomID } from '../../js/utils'
7
+ import { toHfc } from '../../js/to-hfc'
8
+ import { contentType, TIPS } from '../../js/const'
9
+ import AnswerItme from '../answer-itme'
10
+ import OppositionChatCard from '../opppsition-chat-card'
11
+ import RecommendQuestionsCard from '../recommend-questions-card'
12
+ import MyselfChatCard from '../myself-chat-card'
13
+ import TipsAnswer from '../tips-answer'
14
+ import NeedAnswer from '../need-answer'
15
+ import * as Server from './server'
16
+ import styles from './style.less'
17
+
18
+ class QuestionLibrary extends PureComponent {
19
+ constructor(props) {
20
+ super(props)
21
+ this.state = {
22
+ conversationRecordList: [],
23
+ value: '',
24
+ // hotList: [],
25
+ refreshLoading: false,
26
+
27
+ pageNo: 1,
28
+ pageSize: 20,
29
+ }
30
+ this.scrollRef = createRef()
31
+
32
+ this.setChatMsg = this.setChatMsg.bind(this)
33
+ this.getMoreChatRecords = debounce(this.getMoreChatRecords.bind(this), 300)
34
+ }
35
+
36
+ componentDidMount() {
37
+ this.getChatRecords()
38
+ }
39
+
40
+
41
+ getChatRecords() {
42
+ const { t } = this.props
43
+ const { pageNo, pageSize } = this.state
44
+ Server.queryConversationRecord({
45
+ pageNo,
46
+ pageSize,
47
+ })
48
+ .then((res) => {
49
+ if (res) {
50
+ // 确认查看接口
51
+ Server.confirmView()
52
+ const list = (res.info && res.info.conversationRecordList
53
+ && res.info.conversationRecordList.map(vo => ({
54
+ ...vo,
55
+ key: getRandomID(),
56
+ }))) || []
57
+
58
+ // eslint-disable-next-line no-unused-expressions
59
+ Object.keys(TIPS) && Object.keys(TIPS).forEach((key) => {
60
+ if (res.info && res.info[key] > 0) {
61
+ list.push({
62
+ key: getRandomID(),
63
+ contentType: contentType.TIPS,
64
+ content: t('帮助中心{0}有更新了,', t(TIPS[key].content)),
65
+ link: TIPS[key].link,
66
+ })
67
+ }
68
+ })
69
+
70
+ const problemNeedHelpList = (res.info
71
+ && res.info.problemHelpList
72
+ && res.info.problemHelpList.map(vo => ({
73
+ ...vo,
74
+ key: getRandomID(),
75
+ contentType: contentType.NEEDANSWER,
76
+ }))) || []
77
+ const newList = [...list, ...problemNeedHelpList]
78
+ this.setState({
79
+ conversationRecordList: newList,
80
+ }, () => {
81
+ this.scrollToEnd()
82
+ })
83
+ }
84
+ })
85
+ }
86
+
87
+ async getMoreChatRecords() {
88
+ const { refreshLoading } = this.state
89
+ if (refreshLoading) return
90
+ this.setState({
91
+ refreshLoading: true,
92
+ })
93
+ const { pageNo, pageSize } = this.state
94
+ const newPageNo = pageNo + 1
95
+ const res = await Server.queryConversationRecord({
96
+ pageNo: newPageNo,
97
+ pageSize,
98
+ })
99
+
100
+ const list = (res.info && res.info.conversationRecordList
101
+ && res.info.conversationRecordList.map(vo => ({
102
+ ...vo,
103
+ key: getRandomID(),
104
+ }))) || []
105
+
106
+ const { conversationRecordList } = this.state
107
+ this.setState({
108
+ refreshLoading: false,
109
+ })
110
+ if (list.length > 0) {
111
+ // 记录增加数据之前的高度
112
+ const originScrollHeight = this.scrollRef.current.getScrollHeight()
113
+ this.setState({
114
+ conversationRecordList: [...list, ...conversationRecordList],
115
+ pageNo: newPageNo,
116
+ }, () => {
117
+ const scrollTop = this.scrollRef.current.getScrollHeight() - originScrollHeight - 10
118
+ this.scrollRef.current.scrollTop(scrollTop)
119
+ })
120
+ }
121
+ }
122
+
123
+ setChatMsg(val) {
124
+ const { conversationRecordList } = this.state
125
+ if (val) {
126
+ const vo = {
127
+ contentType: contentType.MYSELF,
128
+ problem: val,
129
+ questionTime: getNow(), // 获取此刻的时间
130
+ key: getRandomID(),
131
+ }
132
+ const newArr = [...conversationRecordList, vo]
133
+ this.setState({
134
+ conversationRecordList: newArr,
135
+ value: '',
136
+ })
137
+ this.scrollToEnd()
138
+ this.queryAnswer(val)
139
+ }
140
+ }
141
+
142
+
143
+ scrollToEnd() {
144
+ if (this.scrollRef && this.scrollRef.current && this.scrollRef.current.scrollToBottom) {
145
+ setTimeout(() => {
146
+ this.scrollRef.current.scrollToBottom({
147
+ behavior: 'smooth',
148
+ })
149
+ }, 0)
150
+ }
151
+ }
152
+
153
+ queryAnswer(val) {
154
+ Server.queryAnswer({
155
+ problem: val,
156
+ }).then((res) => {
157
+ const { conversationRecordList } = this.state
158
+
159
+ if (res) {
160
+ const newVo = {
161
+ ...(res.info || {}),
162
+ key: getRandomID(),
163
+ }
164
+ this.setState({
165
+ conversationRecordList: [...conversationRecordList, newVo],
166
+ })
167
+ this.scrollToEnd()
168
+ }
169
+ })
170
+ }
171
+
172
+
173
+ handlenScroll() {
174
+ // 到达顶部的时候
175
+ if (this.scrollRef && this.scrollRef.current && this.scrollRef.current.getScrollTop() === 0) {
176
+ this.getMoreChatRecords()
177
+ }
178
+ }
179
+
180
+ render() {
181
+ const { zIndex, t } = this.props
182
+ const {
183
+ value, conversationRecordList, refreshLoading,
184
+ } = this.state
185
+ return (
186
+ <>
187
+ <div className={styles.tipsWrapper}>
188
+ <RecommendQuestionsCard
189
+ {...this.props}
190
+ />
191
+ </div>
192
+
193
+ <div className={styles.scrollCon}>
194
+ <Scrollbars
195
+ style={{
196
+ paddingRight: '20px',
197
+ flex: 1,
198
+ backgroundColor: '#F7F9FC',
199
+ }}
200
+ ref={this.scrollRef}
201
+ onScroll={(e) => {
202
+ this.handlenScroll(e)
203
+ }}
204
+ >
205
+ {
206
+ refreshLoading
207
+ ? (
208
+ <Spin
209
+ size={18}
210
+ tips={t('加载中')}
211
+ />
212
+ )
213
+ : null
214
+ }
215
+
216
+ <div className={styles.scrollWrapper}>
217
+
218
+ {
219
+ conversationRecordList.map((item) => {
220
+ // 自己提问的问题
221
+ if (item.contentType === contentType.MYSELF) {
222
+ return (
223
+ <MyselfChatCard
224
+ key={item.key}
225
+ item={item}
226
+ />
227
+ )
228
+ }
229
+ // 回答类型
230
+ if (item.contentType === contentType.OPPOSITION) {
231
+ return (
232
+ <OppositionChatCard
233
+ key={item.key}
234
+ >
235
+ <AnswerItme
236
+ item={item}
237
+ zIndex={zIndex}
238
+ t={t}
239
+ />
240
+ </OppositionChatCard>
241
+ )
242
+ }
243
+ // 帮助中心类型
244
+ if (item.contentType === contentType.TIPS) {
245
+ return (
246
+ <TipsAnswer
247
+ item={item}
248
+ key={item.key}
249
+ t={t}
250
+ />
251
+ )
252
+ }
253
+ // 需要回答的类型
254
+ return (
255
+ <NeedAnswer
256
+ item={item}
257
+ key={item.key}
258
+ t={t}
259
+ />
260
+ )
261
+ })
262
+ }
263
+ </div>
264
+ </Scrollbars>
265
+ </div>
266
+
267
+ <div className={styles.bottomLink}>
268
+ <div
269
+ className={styles.toLink}
270
+ onClick={() => {
271
+ toHfc('')
272
+ }}
273
+ >
274
+ <span>{t('进入帮助中心')}</span>
275
+ <Icon name="arrow-right" />
276
+ </div>
277
+ </div>
278
+ <div
279
+ className={styles.bottomWrapper}
280
+ >
281
+ <div className={styles.textAreaWrapper}>
282
+ <textarea
283
+ placeholder={t('请输入问题关键词,如:如何发货')}
284
+ className={styles.textArea}
285
+ value={value}
286
+ onChange={(e) => {
287
+ this.setState({
288
+ value: e.target.value,
289
+ })
290
+ }}
291
+ onKeyDown={(event) => {
292
+ if (event.keyCode === 13) {
293
+ this.setChatMsg(value)
294
+ event.preventDefault()
295
+ }
296
+ }}
297
+ />
298
+ <Button
299
+ type="primary"
300
+ disabled={!value}
301
+ className={styles.btn}
302
+ onClick={() => {
303
+ this.setChatMsg(value)
304
+ }}
305
+ >
306
+ {t('发送')}
307
+ </Button>
308
+ </div>
309
+ </div>
310
+ </>
311
+ )
312
+ }
313
+ }
314
+
315
+
316
+ export default QuestionLibrary
@@ -0,0 +1,19 @@
1
+ import postRequest from '../../js/request/request'
2
+
3
+ // 查询聊天记录
4
+ // https://soapi.sheincorp.cn/application/3768/routes/102471
5
+ export function queryConversationRecord(argument) {
6
+ return postRequest('/front/mesAssistant/queryConversationRecord', argument)
7
+ }
8
+
9
+ // 确认查看
10
+ // https://soapi.sheincorp.cn/application/3876/routes/post_mesAssistant_confirmView
11
+ export function confirmView(argument) {
12
+ return postRequest('/front/mesAssistant/confirmView', argument)
13
+ }
14
+
15
+ // 查询回答
16
+ // https://soapi.sheincorp.cn/application/3876/routes/post_mesAssistant_queryAnswer
17
+ export function queryAnswer(argument) {
18
+ return postRequest('/front/mesAssistant/queryAnswer', argument)
19
+ }
@@ -0,0 +1,102 @@
1
+ .tipsWrapper {
2
+ padding: 20px;
3
+ background-color: #F7F9FC;
4
+ }
5
+
6
+ .scrollWrapper {
7
+ padding: 20px;
8
+ }
9
+
10
+ .scrollCon {
11
+ display: flex;
12
+ flex: 1;
13
+
14
+ & > div:nth-child(1) > div:nth-child(1) {
15
+ margin-right: 0 !important;
16
+ margin-bottom: 0 !important;
17
+ }
18
+
19
+ * {
20
+ &::-webkit-scrollbar{
21
+ width: 0;
22
+ height: 0;
23
+ }
24
+ }
25
+ }
26
+
27
+ .bottomLink {
28
+ display: flex;
29
+ justify-content: flex-end;
30
+ font-size: 14px;
31
+ color: #7E848F;
32
+ background-color: #F7F9FC;
33
+ padding-bottom: 12px;
34
+ padding-right: 12px;
35
+
36
+ .toLink {
37
+ font-weight: 400;
38
+ cursor: pointer;
39
+
40
+ &>span {
41
+ margin-right: 4px;
42
+ }
43
+
44
+ :global {
45
+ .so-icon {
46
+ font-size: 12px;
47
+ }
48
+ }
49
+ }
50
+ }
51
+
52
+ .textAreaWrapper {
53
+ display: flex;
54
+ width: 100%;
55
+ // padding: 12px;
56
+ display: flex;
57
+ // background-color: #F4F5F8;
58
+ align-items: flex-end;
59
+ }
60
+
61
+ .bottomWrapper {
62
+ background: #ffffff;
63
+ box-shadow: inset 0px 1px 0px 0px #e6eaf0;
64
+ padding: 20px;
65
+
66
+ .textArea {
67
+ border-width: 0;
68
+ height: 56px;
69
+ // background-color: #F4F5F8;
70
+ width: 100%;
71
+ resize: none !important;
72
+ ;
73
+ outline: none;
74
+ }
75
+
76
+ .findByWechat {
77
+ margin-top: 9px;
78
+ cursor: pointer;
79
+
80
+ span {
81
+ color: var(--primary-color, #1890ff);
82
+ }
83
+ }
84
+
85
+ :global {
86
+ .so-input {
87
+ border: 0px solid #fff;
88
+
89
+ &:hover {
90
+ border: 0px solid #fff;
91
+ }
92
+ }
93
+
94
+ textarea {
95
+ padding: 0;
96
+ }
97
+ }
98
+
99
+ .btn {
100
+ height: 32px;
101
+ }
102
+ }
@@ -0,0 +1,27 @@
1
+ import React, { memo } from 'react'
2
+ import Proptypes from 'prop-types'
3
+ import Ellipsis from '@shein-components/Ellipsis'
4
+
5
+ import styles from './style.less'
6
+
7
+ const QuestionTag = memo((props) => {
8
+ const { title, onSendMsg } = props
9
+ return (
10
+ <div
11
+ className={styles.tagWraper}
12
+ onClick={onSendMsg}
13
+ >
14
+ <Ellipsis
15
+ rows={1}
16
+ value={title}
17
+ />
18
+ </div>
19
+ )
20
+ })
21
+
22
+
23
+ QuestionTag.propTypes = {
24
+ title: Proptypes.string,
25
+ onSendMsg: Proptypes.func,
26
+ }
27
+ export default QuestionTag
@@ -0,0 +1,15 @@
1
+ .tagWraper {
2
+ height: 32px;
3
+ background: #E6EAF0;
4
+ border-radius: 16px;
5
+ justify-content: center;
6
+ align-items: center;
7
+ display: flex;
8
+
9
+ max-width:160px ;
10
+ padding: 0 12px;
11
+
12
+ margin-right: 8px;
13
+
14
+ cursor: pointer;
15
+ }
@@ -0,0 +1,111 @@
1
+ import React, {
2
+ memo, useEffect, useCallback, useMemo,
3
+ } from 'react'
4
+ import Icon from '@shein-components/Icon'
5
+ import { Spin } from 'shineout'
6
+ import Proptypes from 'prop-types'
7
+ import OppositionChatCard from '../opppsition-chat-card'
8
+ import styles from './style.less'
9
+ import useStateByImmer from '../../js/state-immer'
10
+ import { queryProblem } from '../../server'
11
+ import { toHfc } from '../../js/to-hfc'
12
+
13
+ const defaultState = {
14
+ loading: false,
15
+ list: [],
16
+ pageNo: 1,
17
+ pageSize: 3,
18
+ totalCount: 0,
19
+ }
20
+
21
+ const RecommendQuestionsCard = memo((props) => {
22
+ const { menusTitle, t } = props
23
+ const [state, setState] = useStateByImmer(defaultState)
24
+ const getList = useCallback(() => {
25
+ setState({
26
+ loading: true,
27
+ list: [],
28
+ })
29
+ if (!menusTitle) return
30
+ queryProblem({
31
+ problem: menusTitle,
32
+ }).then((res) => {
33
+ setState({
34
+ loading: false,
35
+ })
36
+ if (res) {
37
+ setState({
38
+ list: res.info || [],
39
+ totalCount: (res.info && res.info.length) || 0,
40
+ })
41
+ }
42
+ })
43
+ }, [menusTitle])
44
+ useEffect(() => {
45
+ getList()
46
+ }, [getList])
47
+
48
+ const arr = useMemo(() => {
49
+ const news = state.list?.slice((state.pageNo - 1) * 3,
50
+ (state.pageNo * 3) < state.list?.length ? state.pageNo * 3 : state.list?.length)
51
+ return news
52
+ }, [state])
53
+ if (!arr || arr.length === 0) return null
54
+ return (
55
+ <OppositionChatCard
56
+ data-if={arr?.length}
57
+ noBorderRadius
58
+ isRecommendQuestions
59
+ >
60
+ <div
61
+ className={styles.top}
62
+ >
63
+ <span>{t('猜你想看')}</span>
64
+ <span
65
+ onClick={() => {
66
+ const maxPageNo = Math.ceil(((state.list?.length) || 0) / 3)
67
+ setState({
68
+ pageNo: (state.pageNo === maxPageNo) ? 1 : state.pageNo + 1,
69
+ })
70
+ }}
71
+ >
72
+ <Icon name="refresh1" className={styles.changeIcon} />
73
+ {t('换一批')}
74
+ </span>
75
+ </div>
76
+
77
+ <div
78
+ className={styles.recommendContent}
79
+ >
80
+ {
81
+ state.loading
82
+ ? <Spin />
83
+ : null
84
+ }
85
+
86
+ {
87
+ arr && arr.map((vo, idx) => (
88
+ <div
89
+ key={vo.problemId}
90
+ onClick={() => {
91
+ toHfc(`/question/answer/${vo.problemId}`)
92
+ }}
93
+ className={styles.problemLine}
94
+ >
95
+ <span className={styles.problemNum}>{`${idx + 1}.`}</span>
96
+ <span className={styles.problemTitle}>{vo.problemTitle}</span>
97
+ <Icon name="arrow-right" />
98
+ </div>
99
+ ))
100
+ }
101
+ </div>
102
+ </OppositionChatCard>
103
+ )
104
+ })
105
+
106
+ RecommendQuestionsCard.propTypes = {
107
+ menusTitle: Proptypes.string,
108
+ }
109
+
110
+
111
+ export default RecommendQuestionsCard