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.
 
 
 

525 lines
11 KiB

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