productDesc.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <view class="product-intro" v-if="productData.description">
  3. <common-wrapper :config="dataConfig">
  4. <view class="title" v-if="titleShow" :style="[titleStyle]">{{
  5. $t(`产品介绍`)
  6. }}</view>
  7. <view class="conter">
  8. <!-- #ifndef APP-PLUS -->
  9. <parser
  10. :html="productData.description"
  11. ref="article"
  12. :tag-style="tagStyle"
  13. ></parser>
  14. <!-- #endif -->
  15. <!-- #ifdef APP-PLUS -->
  16. <view class="description" v-html="productData.description"></view>
  17. <!-- #endif -->
  18. </view>
  19. </common-wrapper>
  20. </view>
  21. </template>
  22. <script>
  23. import commonWrapper from "./commonWrapper.vue";
  24. import parser from "@/components/jyf-parser/jyf-parser";
  25. export default {
  26. name: "productDesc",
  27. components: {
  28. parser,
  29. commonWrapper
  30. },
  31. props: {
  32. productData: {
  33. type: Object,
  34. default: () => ({}),
  35. },
  36. dataConfig: {
  37. type: Object,
  38. default: () => ({}),
  39. },
  40. },
  41. computed: {
  42. titleShow() {
  43. return this.dataConfig.isShow?.tabVal == 0;
  44. },
  45. titleStyle() {
  46. return {
  47. color: this.dataConfig.textColor?.color?.[0]?.item || "#333",
  48. fontSize: (this.dataConfig.fontSize?.val || 16) * 2 + "rpx",
  49. textAlign: this.dataConfig.textPosition?.val || "left",
  50. };
  51. },
  52. },
  53. data() {
  54. return {
  55. tagStyle: {
  56. img: "width:100%;display:block;",
  57. table: "width:100%",
  58. video: "width:100%",
  59. },
  60. };
  61. },
  62. };
  63. </script>
  64. <style lang="scss" scoped>
  65. .product-intro {
  66. .title {
  67. height: 90rpx;
  68. line-height: 90rpx;
  69. font-size: 30rpx;
  70. color: #282828;
  71. text-align: center;
  72. }
  73. .conter {
  74. font-size: 30rpx;
  75. color: #333;
  76. line-height: 50rpx;
  77. }
  78. }
  79. </style>