cm-service.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template name="cm-service">
  2. <!-- 服务项目 -->
  3. <view class="cm-service">
  4. <view class="cm-service-text" v-show="product.orderInfo">
  5. <view class="cm-service-title">订购方案</view>
  6. <view class="cm-service-p">
  7. <mp-html :content="orderInfoHtml" :tag-style="tagStyle" />
  8. </view>
  9. </view>
  10. <view class="cm-service-text" v-show="product.serviceInfo">
  11. <view class="cm-service-title">服务详情</view>
  12. <view class="cm-service-p">
  13. <mp-html :content="serviceInfoHtml" :tag-style="tagStyle" />
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default{
  20. name:'cm-service',
  21. props:{
  22. product:{
  23. type:Object,
  24. }
  25. },
  26. data() {
  27. return{
  28. orderInfoHtml:'',
  29. serviceInfoHtml:''
  30. }
  31. },
  32. created() {
  33. this.adaptOrderInfoHtml(this.product)
  34. this.adaptServiceInfoHtml(this.product)
  35. },
  36. methods:{
  37. adaptOrderInfoHtml(product){
  38. let defaulHtml = '<div style="text-align: center;color:#333333;">暂无内容</div>'
  39. this.orderInfoHtml = product.orderInfo ? this.$api.adaptRichTextImg(product.orderInfo) : defaulHtml
  40. },
  41. adaptServiceInfoHtml(product){
  42. let defaulHtml = '<div style="text-align: center;color:#333333;">暂无内容</div>'
  43. this.serviceInfoHtml = product.serviceInfo ? this.$api.adaptRichTextImg(product.serviceInfo) : defaulHtml
  44. }
  45. },
  46. }
  47. </script>
  48. <style lang="scss">
  49. .cm-service{
  50. width: 702rpx;
  51. height: auto;
  52. background: #FFF;
  53. margin: 0 auto;
  54. padding: 24rpx 0;
  55. .cm-service-text{
  56. width: 100%;
  57. height: auto;
  58. margin-bottom: 24rpx;
  59. .cm-service-title{
  60. font-size: $font-size-28;
  61. color: #333;
  62. text-align: left;
  63. line-height: 44rpx;
  64. margin-bottom: 8rpx;
  65. }
  66. .cm-service-p{
  67. font-size: $font-size-28;
  68. color: #999;
  69. text-align: justify;
  70. line-height: 44rpx;
  71. }
  72. }
  73. }
  74. </style>