Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

481 linhas
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-container {
  83. box-sizing: border-box;
  84. font-family: Helvetica, Arial, sans-serif;
  85. font-size: 13px;
  86. height: 100%;
  87. margin: 0px;
  88. position: relative;
  89. }
  90. .ql-editor h1 {
  91. font-size: 2em;
  92. }
  93. .ql-container.ql-disabled .ql-tooltip {
  94. visibility: hidden;
  95. }
  96. .ql-container.ql-disabled .ql-editor ul[data-checked] > li::before {
  97. pointer-events: none;
  98. }
  99. .ql-clipboard {
  100. left: -100000px;
  101. height: 1px;
  102. overflow-y: hidden;
  103. position: absolute;
  104. top: 50%;
  105. }
  106. .ql-clipboard p {
  107. margin: 0;
  108. padding: 0;
  109. }
  110. .ql-editor {
  111. box-sizing: border-box;
  112. line-height: 1.42;
  113. height: 100%;
  114. outline: none;
  115. overflow-y: auto;
  116. padding: 12px 15px;
  117. tab-size: 4;
  118. -moz-tab-size: 4;
  119. text-align: left;
  120. white-space: pre-wrap;
  121. word-wrap: break-word;
  122. }
  123. .ql-editor > * {
  124. cursor: text;
  125. }
  126. .ql-editor p,
  127. .ql-editor ol,
  128. .ql-editor ul,
  129. .ql-editor pre,
  130. .ql-editor blockquote,
  131. .ql-editor h1,
  132. .ql-editor h2,
  133. .ql-editor h3,
  134. .ql-editor h4,
  135. .ql-editor h5,
  136. .ql-editor h6 {
  137. margin: 0;
  138. padding: 0;
  139. counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
  140. }
  141. .ql-editor ol,
  142. .ql-editor ul {
  143. padding-left: 1.5em;
  144. }
  145. .ql-editor ol > li,
  146. .ql-editor ul > li {
  147. list-style-type: none;
  148. }
  149. .ql-editor ul > li::before {
  150. content: '\2022';
  151. }
  152. .ql-editor ul[data-checked=true],
  153. .ql-editor ul[data-checked=false] {
  154. pointer-events: none;
  155. }
  156. .ql-editor ul[data-checked=true] > li *,
  157. .ql-editor ul[data-checked=false] > li * {
  158. pointer-events: all;
  159. }
  160. .ql-editor ul[data-checked=true] > li::before,
  161. .ql-editor ul[data-checked=false] > li::before {
  162. color: #777;
  163. cursor: pointer;
  164. pointer-events: all;
  165. }
  166. .ql-editor ul[data-checked=true] > li::before {
  167. content: '\2611';
  168. }
  169. .ql-editor ul[data-checked=false] > li::before {
  170. content: '\2610';
  171. }
  172. .ql-editor li::before {
  173. display: inline-block;
  174. white-space: nowrap;
  175. width: 1.2em;
  176. }
  177. .ql-editor li:not(.ql-direction-rtl)::before {
  178. margin-left: -1.5em;
  179. margin-right: 0.3em;
  180. text-align: right;
  181. }
  182. .ql-editor li.ql-direction-rtl::before {
  183. margin-left: 0.3em;
  184. margin-right: -1.5em;
  185. }
  186. .ql-editor ol li:not(.ql-direction-rtl),
  187. .ql-editor ul li:not(.ql-direction-rtl) {
  188. padding-left: 1.5em;
  189. }
  190. .ql-editor ol li.ql-direction-rtl,
  191. .ql-editor ul li.ql-direction-rtl {
  192. padding-right: 1.5em;
  193. }
  194. .ql-editor ol li {
  195. counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
  196. counter-increment: list-0;
  197. }
  198. .ql-editor ol li:before {
  199. content: counter(list-0, decimal) '. ';
  200. }
  201. .ql-editor ol li.ql-indent-1 {
  202. counter-increment: list-1;
  203. }
  204. .ql-editor ol li.ql-indent-1:before {
  205. content: counter(list-1, lower-alpha) '. ';
  206. }
  207. .ql-editor ol li.ql-indent-1 {
  208. counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
  209. }
  210. .ql-editor ol li.ql-indent-2 {
  211. counter-increment: list-2;
  212. }
  213. .ql-editor ol li.ql-indent-2:before {
  214. content: counter(list-2, lower-roman) '. ';
  215. }
  216. .ql-editor ol li.ql-indent-2 {
  217. counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9;
  218. }
  219. .ql-editor ol li.ql-indent-3 {
  220. counter-increment: list-3;
  221. }
  222. .ql-editor ol li.ql-indent-3:before {
  223. content: counter(list-3, decimal) '. ';
  224. }
  225. .ql-editor ol li.ql-indent-3 {
  226. counter-reset: list-4 list-5 list-6 list-7 list-8 list-9;
  227. }
  228. .ql-editor ol li.ql-indent-4 {
  229. counter-increment: list-4;
  230. }
  231. .ql-editor ol li.ql-indent-4:before {
  232. content: counter(list-4, lower-alpha) '. ';
  233. }
  234. .ql-editor ol li.ql-indent-4 {
  235. counter-reset: list-5 list-6 list-7 list-8 list-9;
  236. }
  237. .ql-editor ol li.ql-indent-5 {
  238. counter-increment: list-5;
  239. }
  240. .ql-editor ol li.ql-indent-5:before {
  241. content: counter(list-5, lower-roman) '. ';
  242. }
  243. .ql-editor ol li.ql-indent-5 {
  244. counter-reset: list-6 list-7 list-8 list-9;
  245. }
  246. .ql-editor ol li.ql-indent-6 {
  247. counter-increment: list-6;
  248. }
  249. .ql-editor ol li.ql-indent-6:before {
  250. content: counter(list-6, decimal) '. ';
  251. }
  252. .ql-editor ol li.ql-indent-6 {
  253. counter-reset: list-7 list-8 list-9;
  254. }
  255. .ql-editor ol li.ql-indent-7 {
  256. counter-increment: list-7;
  257. }
  258. .ql-editor ol li.ql-indent-7:before {
  259. content: counter(list-7, lower-alpha) '. ';
  260. }
  261. .ql-editor ol li.ql-indent-7 {
  262. counter-reset: list-8 list-9;
  263. }
  264. .ql-editor ol li.ql-indent-8 {
  265. counter-increment: list-8;
  266. }
  267. .ql-editor ol li.ql-indent-8:before {
  268. content: counter(list-8, lower-roman) '. ';
  269. }
  270. .ql-editor ol li.ql-indent-8 {
  271. counter-reset: list-9;
  272. }
  273. .ql-editor ol li.ql-indent-9 {
  274. counter-increment: list-9;
  275. }
  276. .ql-editor ol li.ql-indent-9:before {
  277. content: counter(list-9, decimal) '. ';
  278. }
  279. .ql-editor .ql-indent-1:not(.ql-direction-rtl) {
  280. padding-left: 3em;
  281. }
  282. .ql-editor li.ql-indent-1:not(.ql-direction-rtl) {
  283. padding-left: 4.5em;
  284. }
  285. .ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right {
  286. padding-right: 3em;
  287. }
  288. .ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right {
  289. padding-right: 4.5em;
  290. }
  291. .ql-editor .ql-indent-2:not(.ql-direction-rtl) {
  292. padding-left: 6em;
  293. }
  294. .ql-editor li.ql-indent-2:not(.ql-direction-rtl) {
  295. padding-left: 7.5em;
  296. }
  297. .ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right {
  298. padding-right: 6em;
  299. }
  300. .ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right {
  301. padding-right: 7.5em;
  302. }
  303. .ql-editor .ql-indent-3:not(.ql-direction-rtl) {
  304. padding-left: 9em;
  305. }
  306. .ql-editor li.ql-indent-3:not(.ql-direction-rtl) {
  307. padding-left: 10.5em;
  308. }
  309. .ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right {
  310. padding-right: 9em;
  311. }
  312. .ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right {
  313. padding-right: 10.5em;
  314. }
  315. .ql-editor .ql-indent-4:not(.ql-direction-rtl) {
  316. padding-left: 12em;
  317. }
  318. .ql-editor li.ql-indent-4:not(.ql-direction-rtl) {
  319. padding-left: 13.5em;
  320. }
  321. .ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right {
  322. padding-right: 12em;
  323. }
  324. .ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right {
  325. padding-right: 13.5em;
  326. }
  327. .ql-editor .ql-indent-5:not(.ql-direction-rtl) {
  328. padding-left: 15em;
  329. }
  330. .ql-editor li.ql-indent-5:not(.ql-direction-rtl) {
  331. padding-left: 16.5em;
  332. }
  333. .ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right {
  334. padding-right: 15em;
  335. }
  336. .ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right {
  337. padding-right: 16.5em;
  338. }
  339. .ql-editor .ql-indent-6:not(.ql-direction-rtl) {
  340. padding-left: 18em;
  341. }
  342. .ql-editor li.ql-indent-6:not(.ql-direction-rtl) {
  343. padding-left: 19.5em;
  344. }
  345. .ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right {
  346. padding-right: 18em;
  347. }
  348. .ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right {
  349. padding-right: 19.5em;
  350. }
  351. .ql-editor .ql-indent-7:not(.ql-direction-rtl) {
  352. padding-left: 21em;
  353. }
  354. .ql-editor li.ql-indent-7:not(.ql-direction-rtl) {
  355. padding-left: 22.5em;
  356. }
  357. .ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right {
  358. padding-right: 21em;
  359. }
  360. .ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right {
  361. padding-right: 22.5em;
  362. }
  363. .ql-editor .ql-indent-8:not(.ql-direction-rtl) {
  364. padding-left: 24em;
  365. }
  366. .ql-editor li.ql-indent-8:not(.ql-direction-rtl) {
  367. padding-left: 25.5em;
  368. }
  369. .ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right {
  370. padding-right: 24em;
  371. }
  372. .ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right {
  373. padding-right: 25.5em;
  374. }
  375. .ql-editor .ql-indent-9:not(.ql-direction-rtl) {
  376. padding-left: 27em;
  377. }
  378. .ql-editor li.ql-indent-9:not(.ql-direction-rtl) {
  379. padding-left: 28.5em;
  380. }
  381. .ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right {
  382. padding-right: 27em;
  383. }
  384. .ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right {
  385. padding-right: 28.5em;
  386. }
  387. .ql-editor .ql-video {
  388. display: block;
  389. max-width: 100%;
  390. }
  391. .ql-editor .ql-video.ql-align-center {
  392. margin: 0 auto;
  393. }
  394. .ql-editor .ql-video.ql-align-right {
  395. margin: 0 0 0 auto;
  396. }
  397. .ql-editor .ql-bg-black {
  398. background-color: #000;
  399. }
  400. .ql-editor .ql-bg-red {
  401. background-color: #e60000;
  402. }
  403. .ql-editor .ql-bg-orange {
  404. background-color: #f90;
  405. }
  406. .ql-editor .ql-bg-yellow {
  407. background-color: #ff0;
  408. }
  409. .ql-editor .ql-bg-green {
  410. background-color: #008a00;
  411. }
  412. .ql-editor .ql-bg-blue {
  413. background-color: #06c;
  414. }
  415. .ql-editor .ql-bg-purple {
  416. background-color: #93f;
  417. }
  418. .ql-editor .ql-color-white {
  419. color: #fff;
  420. }
  421. .ql-editor .ql-color-red {
  422. color: #e60000;
  423. }
  424. .ql-editor .ql-color-orange {
  425. color: #f90;
  426. }
  427. .ql-editor .ql-color-yellow {
  428. color: #ff0;
  429. }
  430. .ql-editor .ql-color-green {
  431. color: #008a00;
  432. }
  433. .ql-editor .ql-color-blue {
  434. color: #06c;
  435. }
  436. .ql-editor .ql-color-purple {
  437. color: #93f;
  438. }
  439. .ql-editor .ql-font-serif {
  440. font-family: Georgia, Times New Roman, serif;
  441. }
  442. .ql-editor .ql-font-monospace {
  443. font-family: Monaco, Courier New, monospace;
  444. }
  445. .ql-editor .ql-size-small {
  446. font-size: 0.75em;
  447. }
  448. .ql-editor .ql-size-large {
  449. font-size: 1.5em;
  450. }
  451. .ql-editor .ql-size-huge {
  452. font-size: 2.5em;
  453. }
  454. .ql-editor .ql-direction-rtl {
  455. direction: rtl;
  456. text-align: inherit;
  457. }
  458. .ql-editor .ql-align-center {
  459. text-align: center;
  460. }
  461. .ql-editor .ql-align-justify {
  462. text-align: justify;
  463. }
  464. .ql-editor .ql-align-right {
  465. text-align: right;
  466. }
  467. .ql-editor.ql-blank::before {
  468. color: rgba(0,0,0,0.6);
  469. content: attr(data-placeholder);
  470. font-style: italic;
  471. left: 15px;
  472. pointer-events: none;
  473. position: absolute;
  474. right: 15px;
  475. }
  476. </style>