bd-detail.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view class="bd-detail">
  3. <view class="detail" v-if="newDetail">
  4. <view class="detail-title dir-left-nowrap main-center">
  5. <view class="dir-left-nowrap cross-center">
  6. <view class="border"></view>
  7. <view class="text">商品详情</view>
  8. <view class="border"></view>
  9. </view>
  10. </view>
  11. <app-rich-text
  12. :content="newDetail"
  13. class-name="rich-text"
  14. ></app-rich-text>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. import appRichText from "../../basic-component/app-rich/parse";
  20. export default {
  21. name: "bd-detail",
  22. components: {
  23. 'app-rich-text': appRichText,
  24. },
  25. props: {
  26. detail: {
  27. type: String,
  28. default() {
  29. return '';
  30. }
  31. },
  32. },
  33. created() {
  34. this.$store.dispatch('gConfig/setImageWidth', 48);
  35. },
  36. computed: {
  37. newDetail() {
  38. let detail = '正在加载数据,模拟网络延迟2秒😝';
  39. if (this.detail) {
  40. detail = this.detail;
  41. }
  42. return detail;
  43. },
  44. }
  45. }
  46. </script>
  47. <style scoped lang="scss">
  48. .bd-detail {
  49. width: 100%;
  50. margin-top: 16upx;
  51. image {
  52. width: 100%;
  53. height: #{80rpx};
  54. display: block;
  55. }
  56. .detail-title {
  57. margin: #{40rpx} 0 #{32rpx} 0;
  58. font-size: $uni-font-size-weak-one;
  59. color: $uni-general-color-two;
  60. .text {
  61. color: #333;
  62. font-size: #{30rpx};
  63. }
  64. .border {
  65. border-top: 2px solid #E56283;
  66. height: 0;
  67. width: #{40rpx};
  68. margin: 0 #{45rpx};
  69. }
  70. image {
  71. width: #{24rpx};
  72. height: #{24rpx};
  73. display: block;
  74. margin-right: #{12rpx};
  75. }
  76. }
  77. }
  78. </style>