AI销管
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

656 regels
12 KiB

  1. <template>
  2. <view class="main">
  3. <view class="tit">{{ messageObj.title }}</view>
  4. <u-parse class="ql-editor" :content="messageObj.content" @preview="preview" @navigate="navigate" />
  5. <web-view v-if="webviewShow" :webview-styles="webviewStyles" :src="webviewUrl"></web-view>
  6. <!-- <view v-html="content"></view> -->
  7. <!-- <rich-text :nodes="content"></rich-text> -->
  8. </view>
  9. </template>
  10. <script>
  11. var util = require("../../utils/util.js");
  12. var config = require("../../config");
  13. import uParse from '@/components/gaoyia-parse/parse.vue'
  14. export default {
  15. data() {
  16. return {
  17. webviewShow: false,
  18. webviewUrl: "",
  19. webviewStyles: {
  20. progress: {
  21. color: '#FF3333'
  22. }
  23. }
  24. };
  25. },
  26. components: {
  27. uParse
  28. },
  29. computed: {
  30. messageObj() {
  31. return this.$store.state.messageObj
  32. }
  33. },
  34. onLoad(e) {
  35. console.log(this.messageObj, 'this.messageObj')
  36. this.read()
  37. },
  38. methods: {
  39. navigate(href, e) {
  40. if (href != undefined && href != "") {
  41. this.webviewShow = true;
  42. this.webviewUrl = href
  43. }
  44. console.log(href, 111)
  45. //比如点击a标签,打开某个传输url
  46. uni.navigateTo({
  47. url: href,
  48. })
  49. },
  50. read() {
  51. uni.request({
  52. url: config.service.updateRead,
  53. method: "GET",
  54. data: {
  55. id: this.messageObj.id,
  56. accountId: uni.getStorageSync('weapp_session_userInfo_data').accountId,
  57. projectId: uni.getStorageSync('buildingID').id,
  58. },
  59. header: {
  60. 'content-type': 'application/json',
  61. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  62. },
  63. success: (res) => {
  64. console.log(res)
  65. }
  66. })
  67. }
  68. }
  69. }
  70. </script>
  71. <style lang="scss">
  72. @import '../../static/css/quill/quill.core.css';
  73. @import '../../static/css/quill/quill.snow.css';
  74. @import '../../static/css/quill/quill.bubble.css';
  75. .main {
  76. padding: 20rpx;
  77. word-wrap: break-word;
  78. .tit {
  79. font-size: 46rpx;
  80. font-weight: 800;
  81. text-align: center;
  82. margin-bottom: 16rpx;
  83. }
  84. }
  85. .ql-editor {
  86. font-size: 32rpx;
  87. .strong {
  88. font-weight: bold;
  89. }
  90. .ol {
  91. padding-left: 16rpx;
  92. .li {
  93. font-size: 34rpx;
  94. &::before {
  95. content: "·";
  96. font-size: 34rpx;
  97. }
  98. }
  99. }
  100. .ql-indent-1 {
  101. text-indent: 10px;
  102. }
  103. .h1 {
  104. font-size: 5em;
  105. }
  106. .h2 {
  107. font-size: 4em;
  108. }
  109. .h3 {
  110. font-size: 3em;
  111. }
  112. .h4 {
  113. font-size: 2em;
  114. }
  115. .h4 {
  116. font-size: 1em;
  117. }
  118. .em {
  119. font-style: italic
  120. }
  121. .u {
  122. text-decoration: underline
  123. }
  124. .blockquote {
  125. text-decoration: line-through;
  126. }
  127. }
  128. .ql-container {
  129. box-sizing: border-box;
  130. font-family: Helvetica, Arial, sans-serif;
  131. font-size: 13px;
  132. height: 100%;
  133. margin: 0px;
  134. position: relative;
  135. }
  136. .ql-editor h1 {
  137. font-size: 2em;
  138. }
  139. .ql-container.ql-disabled .ql-tooltip {
  140. visibility: hidden;
  141. }
  142. .ql-container.ql-disabled .ql-editor ul[data-checked]>li::before {
  143. pointer-events: none;
  144. }
  145. .ql-clipboard {
  146. left: -100000px;
  147. height: 1px;
  148. overflow-y: hidden;
  149. position: absolute;
  150. top: 50%;
  151. }
  152. .ql-clipboard p {
  153. margin: 0;
  154. padding: 0;
  155. }
  156. .ql-editor {
  157. box-sizing: border-box;
  158. line-height: 1.42;
  159. height: 100%;
  160. outline: none;
  161. overflow-y: auto;
  162. padding: 12px 15px;
  163. tab-size: 4;
  164. -moz-tab-size: 4;
  165. text-align: left;
  166. white-space: pre-wrap;
  167. word-wrap: break-word;
  168. }
  169. .ql-editor>* {
  170. cursor: text;
  171. }
  172. .ql-editor p,
  173. .ql-editor ol,
  174. .ql-editor ul,
  175. .ql-editor pre,
  176. .ql-editor blockquote,
  177. .ql-editor h1,
  178. .ql-editor h2,
  179. .ql-editor h3,
  180. .ql-editor h4,
  181. .ql-editor h5,
  182. .ql-editor h6 {
  183. margin: 0;
  184. padding: 0;
  185. counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
  186. }
  187. .ql-editor ol,
  188. .ql-editor ul {
  189. padding-left: 1.5em;
  190. }
  191. .ql-editor ol>li,
  192. .ql-editor ul>li {
  193. list-style-type: none;
  194. }
  195. .ql-editor ul>li::before {
  196. content: '\2022';
  197. }
  198. .ql-editor ul[data-checked=true],
  199. .ql-editor ul[data-checked=false] {
  200. pointer-events: none;
  201. }
  202. .ql-editor ul[data-checked=true]>li *,
  203. .ql-editor ul[data-checked=false]>li * {
  204. pointer-events: all;
  205. }
  206. .ql-editor ul[data-checked=true]>li::before,
  207. .ql-editor ul[data-checked=false]>li::before {
  208. color: #777;
  209. cursor: pointer;
  210. pointer-events: all;
  211. }
  212. .ql-editor ul[data-checked=true]>li::before {
  213. content: '\2611';
  214. }
  215. .ql-editor ul[data-checked=false]>li::before {
  216. content: '\2610';
  217. }
  218. .ql-editor li::before {
  219. display: inline-block;
  220. white-space: nowrap;
  221. width: 1.2em;
  222. }
  223. .ql-editor li:not(.ql-direction-rtl)::before {
  224. margin-left: -1.5em;
  225. margin-right: 0.3em;
  226. text-align: right;
  227. }
  228. .ql-editor li.ql-direction-rtl::before {
  229. margin-left: 0.3em;
  230. margin-right: -1.5em;
  231. }
  232. .ql-editor ol li:not(.ql-direction-rtl),
  233. .ql-editor ul li:not(.ql-direction-rtl) {
  234. padding-left: 1.5em;
  235. }
  236. .ql-editor ol li.ql-direction-rtl,
  237. .ql-editor ul li.ql-direction-rtl {
  238. padding-right: 1.5em;
  239. }
  240. .ql-editor ol li {
  241. counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
  242. counter-increment: list-0;
  243. }
  244. .ql-editor ol li:before {
  245. content: counter(list-0, decimal) '. ';
  246. }
  247. .ql-editor ol li.ql-indent-1 {
  248. counter-increment: list-1;
  249. }
  250. .ql-editor ol li.ql-indent-1:before {
  251. content: counter(list-1, lower-alpha) '. ';
  252. }
  253. .ql-editor ol li.ql-indent-1 {
  254. counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
  255. }
  256. .ql-editor ol li.ql-indent-2 {
  257. counter-increment: list-2;
  258. }
  259. .ql-editor ol li.ql-indent-2:before {
  260. content: counter(list-2, lower-roman) '. ';
  261. }
  262. .ql-editor ol li.ql-indent-2 {
  263. counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9;
  264. }
  265. .ql-editor ol li.ql-indent-3 {
  266. counter-increment: list-3;
  267. }
  268. .ql-editor ol li.ql-indent-3:before {
  269. content: counter(list-3, decimal) '. ';
  270. }
  271. .ql-editor ol li.ql-indent-3 {
  272. counter-reset: list-4 list-5 list-6 list-7 list-8 list-9;
  273. }
  274. .ql-editor ol li.ql-indent-4 {
  275. counter-increment: list-4;
  276. }
  277. .ql-editor ol li.ql-indent-4:before {
  278. content: counter(list-4, lower-alpha) '. ';
  279. }
  280. .ql-editor ol li.ql-indent-4 {
  281. counter-reset: list-5 list-6 list-7 list-8 list-9;
  282. }
  283. .ql-editor ol li.ql-indent-5 {
  284. counter-increment: list-5;
  285. }
  286. .ql-editor ol li.ql-indent-5:before {
  287. content: counter(list-5, lower-roman) '. ';
  288. }
  289. .ql-editor ol li.ql-indent-5 {
  290. counter-reset: list-6 list-7 list-8 list-9;
  291. }
  292. .ql-editor ol li.ql-indent-6 {
  293. counter-increment: list-6;
  294. }
  295. .ql-editor ol li.ql-indent-6:before {
  296. content: counter(list-6, decimal) '. ';
  297. }
  298. .ql-editor ol li.ql-indent-6 {
  299. counter-reset: list-7 list-8 list-9;
  300. }
  301. .ql-editor ol li.ql-indent-7 {
  302. counter-increment: list-7;
  303. }
  304. .ql-editor ol li.ql-indent-7:before {
  305. content: counter(list-7, lower-alpha) '. ';
  306. }
  307. .ql-editor ol li.ql-indent-7 {
  308. counter-reset: list-8 list-9;
  309. }
  310. .ql-editor ol li.ql-indent-8 {
  311. counter-increment: list-8;
  312. }
  313. .ql-editor ol li.ql-indent-8:before {
  314. content: counter(list-8, lower-roman) '. ';
  315. }
  316. .ql-editor ol li.ql-indent-8 {
  317. counter-reset: list-9;
  318. }
  319. .ql-editor ol li.ql-indent-9 {
  320. counter-increment: list-9;
  321. }
  322. .ql-editor ol li.ql-indent-9:before {
  323. content: counter(list-9, decimal) '. ';
  324. }
  325. .ql-editor .ql-indent-1:not(.ql-direction-rtl) {
  326. padding-left: 3em;
  327. }
  328. .ql-editor li.ql-indent-1:not(.ql-direction-rtl) {
  329. padding-left: 4.5em;
  330. }
  331. .ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right {
  332. padding-right: 3em;
  333. }
  334. .ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right {
  335. padding-right: 4.5em;
  336. }
  337. .ql-editor .ql-indent-2:not(.ql-direction-rtl) {
  338. padding-left: 6em;
  339. }
  340. .ql-editor li.ql-indent-2:not(.ql-direction-rtl) {
  341. padding-left: 7.5em;
  342. }
  343. .ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right {
  344. padding-right: 6em;
  345. }
  346. .ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right {
  347. padding-right: 7.5em;
  348. }
  349. .ql-editor .ql-indent-3:not(.ql-direction-rtl) {
  350. padding-left: 9em;
  351. }
  352. .ql-editor li.ql-indent-3:not(.ql-direction-rtl) {
  353. padding-left: 10.5em;
  354. }
  355. .ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right {
  356. padding-right: 9em;
  357. }
  358. .ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right {
  359. padding-right: 10.5em;
  360. }
  361. .ql-editor .ql-indent-4:not(.ql-direction-rtl) {
  362. padding-left: 12em;
  363. }
  364. .ql-editor li.ql-indent-4:not(.ql-direction-rtl) {
  365. padding-left: 13.5em;
  366. }
  367. .ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right {
  368. padding-right: 12em;
  369. }
  370. .ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right {
  371. padding-right: 13.5em;
  372. }
  373. .ql-editor .ql-indent-5:not(.ql-direction-rtl) {
  374. padding-left: 15em;
  375. }
  376. .ql-editor li.ql-indent-5:not(.ql-direction-rtl) {
  377. padding-left: 16.5em;
  378. }
  379. .ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right {
  380. padding-right: 15em;
  381. }
  382. .ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right {
  383. padding-right: 16.5em;
  384. }
  385. .ql-editor .ql-indent-6:not(.ql-direction-rtl) {
  386. padding-left: 18em;
  387. }
  388. .ql-editor li.ql-indent-6:not(.ql-direction-rtl) {
  389. padding-left: 19.5em;
  390. }
  391. .ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right {
  392. padding-right: 18em;
  393. }
  394. .ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right {
  395. padding-right: 19.5em;
  396. }
  397. .ql-editor .ql-indent-7:not(.ql-direction-rtl) {
  398. padding-left: 21em;
  399. }
  400. .ql-editor li.ql-indent-7:not(.ql-direction-rtl) {
  401. padding-left: 22.5em;
  402. }
  403. .ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right {
  404. padding-right: 21em;
  405. }
  406. .ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right {
  407. padding-right: 22.5em;
  408. }
  409. .ql-editor .ql-indent-8:not(.ql-direction-rtl) {
  410. padding-left: 24em;
  411. }
  412. .ql-editor li.ql-indent-8:not(.ql-direction-rtl) {
  413. padding-left: 25.5em;
  414. }
  415. .ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right {
  416. padding-right: 24em;
  417. }
  418. .ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right {
  419. padding-right: 25.5em;
  420. }
  421. .ql-editor .ql-indent-9:not(.ql-direction-rtl) {
  422. padding-left: 27em;
  423. }
  424. .ql-editor li.ql-indent-9:not(.ql-direction-rtl) {
  425. padding-left: 28.5em;
  426. }
  427. .ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right {
  428. padding-right: 27em;
  429. }
  430. .ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right {
  431. padding-right: 28.5em;
  432. }
  433. .ql-editor .ql-video {
  434. display: block;
  435. max-width: 100%;
  436. }
  437. .ql-editor .ql-video.ql-align-center {
  438. margin: 0 auto;
  439. }
  440. .ql-editor .ql-video.ql-align-right {
  441. margin: 0 0 0 auto;
  442. }
  443. .ql-editor .ql-bg-black {
  444. background-color: #000;
  445. }
  446. .ql-editor .ql-bg-red {
  447. background-color: #e60000;
  448. }
  449. .ql-editor .ql-bg-orange {
  450. background-color: #f90;
  451. }
  452. .ql-editor .ql-bg-yellow {
  453. background-color: #ff0;
  454. }
  455. .ql-editor .ql-bg-green {
  456. background-color: #008a00;
  457. }
  458. .ql-editor .ql-bg-blue {
  459. background-color: #06c;
  460. }
  461. .ql-editor .ql-bg-purple {
  462. background-color: #93f;
  463. }
  464. .ql-editor .ql-color-white {
  465. color: #fff;
  466. }
  467. .ql-editor .ql-color-red {
  468. color: #e60000;
  469. }
  470. .ql-editor .ql-color-orange {
  471. color: #f90;
  472. }
  473. .ql-editor .ql-color-yellow {
  474. color: #ff0;
  475. }
  476. .ql-editor .ql-color-green {
  477. color: #008a00;
  478. }
  479. .ql-editor .ql-color-blue {
  480. color: #06c;
  481. }
  482. .ql-editor .ql-color-purple {
  483. color: #93f;
  484. }
  485. .ql-editor .ql-font-serif {
  486. font-family: Georgia, Times New Roman, serif;
  487. }
  488. .ql-editor .ql-font-monospace {
  489. font-family: Monaco, Courier New, monospace;
  490. }
  491. .ql-editor .ql-size-small {
  492. font-size: 0.75em;
  493. }
  494. .ql-editor .ql-size-large {
  495. font-size: 1.5em;
  496. }
  497. .ql-editor .ql-size-huge {
  498. font-size: 2.5em;
  499. }
  500. .ql-editor .ql-direction-rtl {
  501. direction: rtl;
  502. text-align: inherit;
  503. }
  504. .ql-editor .ql-align-center {
  505. text-align: center;
  506. }
  507. .ql-editor .ql-align-justify {
  508. text-align: justify;
  509. }
  510. .ql-editor .ql-align-right {
  511. text-align: right;
  512. }
  513. .ql-editor.ql-blank::before {
  514. color: rgba(0, 0, 0, 0.6);
  515. content: attr(data-placeholder);
  516. font-style: italic;
  517. left: 15px;
  518. pointer-events: none;
  519. position: absolute;
  520. right: 15px;
  521. }
  522. </style>