picTxt.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view class="txtPic">
  3. <view class="ueditor acea-row row-center-wrapper" v-if="isIframe && !description">
  4. <text class="iconfont icon-icon_im_keyboard"></text>
  5. </view>
  6. <jyf-parser :html="description" ref="article" :tag-style="tagStyle" v-if="description && isShow && !isIframe"></jyf-parser>
  7. <jyf-parser :html="description" ref="article" :tag-style="tagStyle" v-if="description && isIframe"></jyf-parser>
  8. </view>
  9. </template>
  10. <script>
  11. let app = getApp();
  12. import parser from "@/components/jyf-parser/jyf-parser";
  13. import { goPage } from '@/libs/order.js';
  14. export default {
  15. name: 'picTxt',
  16. props: {
  17. dataConfig: {
  18. type: Object,
  19. default: () => {}
  20. }
  21. },
  22. components: {
  23. "jyf-parser": parser
  24. },
  25. watch: {
  26. dataConfig: {
  27. immediate: true,
  28. handler(nVal, oVal) {
  29. if(nVal){
  30. this.description = nVal.richText.val;
  31. this.isShow = nVal.isShow.val;
  32. }
  33. }
  34. }
  35. },
  36. data() {
  37. return {
  38. description: '',
  39. name:this.$options.name,
  40. isIframe:app.globalData.isIframe,
  41. isShow:true,
  42. tagStyle: {
  43. img: 'width:100%;display:block',
  44. video: 'width: 100% !important;'
  45. }
  46. };
  47. },
  48. created() {
  49. },
  50. mounted() {},
  51. methods: {
  52. }
  53. }
  54. </script>
  55. <style scoped lang="scss">
  56. .txtPic{
  57. .ueditor{
  58. width: 690rpx;
  59. height: 300rpx;
  60. border-radius: 14rpx;
  61. margin: 26rpx auto 0 auto;
  62. background-color: $uni-bg-color;
  63. text-align: center;
  64. line-height: 300rpx;
  65. .iconfont{
  66. font-size: 50rpx;
  67. }
  68. }
  69. }
  70. </style>