picTxt.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. table: 'width:100%',
  45. video: 'width: 100% !important;'
  46. }
  47. };
  48. },
  49. created() {
  50. },
  51. mounted() {},
  52. methods: {
  53. }
  54. }
  55. </script>
  56. <style scoped lang="scss">
  57. .txtPic{
  58. .ueditor{
  59. width: 690rpx;
  60. height: 300rpx;
  61. border-radius: 14rpx;
  62. margin: 26rpx auto 0 auto;
  63. background-color: $uni-bg-color;
  64. text-align: center;
  65. line-height: 300rpx;
  66. .iconfont{
  67. font-size: 50rpx;
  68. }
  69. }
  70. }
  71. </style>