notify-dialog.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <tm-poup v-model="isShow" width="80vw" height="800rpx" position="center" :round="6" @change="fnOnChange">
  3. <view class="fulled pa-4">
  4. <view class="mt-24 fulled text-weight-b text-size-sm text-align-center text-overflow-2 pb-24">{{ title }}</view>
  5. <view class="fulled mt-2">
  6. <scroll-view class="fulled" scroll-y :style="{
  7. height: url? '600rpx': '680rpx'
  8. }">
  9. <mp-html class="evan-markdown" lazy-load :domain="markdownConfig.domain"
  10. :loading-img="markdownConfig.loadingGif" :scroll-table="true" :selectable="true"
  11. :tag-style="markdownConfig.tagStyle" :container-style="markdownConfig.containStyle"
  12. :content="content" :markdown="true" :showLineNumber="true" :showLanguageName="true"
  13. :copyByLongPress="true"/>
  14. </scroll-view>
  15. </view>
  16. <view v-if="url" class="fulled mt-12 flex flex-center">
  17. <tm-button theme="bg-gradient-light-blue-accent" size="m" @click="fnToWebview()">
  18. 点击跳转内容链接
  19. </tm-button>
  20. </view>
  21. </view>
  22. </tm-poup>
  23. </template>
  24. <script>
  25. import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
  26. import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
  27. import mpHtml from '@/components/mp-html/components/mp-html/mp-html.vue';
  28. import MarkdownConfig from '@/common/markdown/markdown.config.js';
  29. export default {
  30. name: 'notify-dialog',
  31. components: {
  32. tmPoup,
  33. tmButton,
  34. mpHtml
  35. },
  36. props: {
  37. show: {
  38. type: Boolean,
  39. default: false
  40. },
  41. title: {
  42. type: String,
  43. default: ''
  44. },
  45. content: {
  46. type: String,
  47. default: ''
  48. },
  49. url: {
  50. type: String,
  51. default: ''
  52. }
  53. },
  54. data() {
  55. return {
  56. isShow: false,
  57. markdownConfig: MarkdownConfig,
  58. };
  59. },
  60. created() {
  61. this.isShow = this.show;
  62. },
  63. methods: {
  64. fnToWebview() {
  65. if (this.$utils.checkIsUrl(this.url)) {
  66. uni.navigateTo({
  67. url: '/pagesC/website/website?data=' +
  68. JSON.stringify({
  69. title: this.title,
  70. url: encodeURIComponent(this.url)
  71. }),
  72. success: () => {
  73. this.fnOnChange(false)
  74. }
  75. });
  76. }
  77. },
  78. fnOnChange(e) {
  79. this.isShow = false;
  80. this.$emit('on-change', e);
  81. }
  82. }
  83. }
  84. </script>
  85. <style scoped lang="scss">
  86. </style>