detail-content-card.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <!-- 产品详情:描述卡片 -->
  2. <template>
  3. <view class="detail-content-card bg-white ss-m-x-20 ss-p-t-20">
  4. <view class="card-header ss-flex ss-col-center ss-m-b-30 ss-m-l-20">
  5. <view class="line"></view>
  6. <view class="title ss-m-l-20 ss-m-r-20">详情</view>
  7. </view>
  8. <view class="card-content">
  9. <template v-if="goodsInfo.userHtml">
  10. <rich-text style="padding: 10px;" :nodes="goodsInfo.userHtml" :preview-img="true" :selectable="true"
  11. :use-anchor="true"></rich-text>
  12. </template>
  13. <template v-else>
  14. <view style="padding: 10px;" v-html="content"></view>
  15. </template>
  16. </view>
  17. </view>
  18. </template>
  19. <script setup>
  20. import sheep from '@/sheep';
  21. const { safeAreaInsets } = sheep.$platform.device;
  22. const props = defineProps({
  23. content: {
  24. type: String,
  25. default: '',
  26. },
  27. goodsInfo: {
  28. type: Object,
  29. default: {},
  30. },
  31. });
  32. const htmlContent = `
  33. <div class="article">
  34. <h2>焰小厨餐厅介绍</h2>
  35. <p>位于苏州平江路...</p>
  36. <img src="https://example.com/logo.png" alt="餐厅Logo">
  37. </div>
  38. `
  39. </script>
  40. <style lang="scss" scoped>
  41. .detail-content-card {
  42. .card-header {
  43. .line {
  44. width: 6rpx;
  45. height: 30rpx;
  46. background: linear-gradient(180deg, var(--ui-BG-Main) 0%, var(--ui-BG-Main-gradient) 100%);
  47. border-radius: 3rpx;
  48. }
  49. .title {
  50. font-size: 30rpx;
  51. font-weight: bold;
  52. }
  53. .des {
  54. font-size: 24rpx;
  55. color: $dark-9;
  56. }
  57. .more-btn {
  58. font-size: 24rpx;
  59. color: var(--ui-BG-Main);
  60. }
  61. }
  62. }
  63. </style>